Merge pull request #5353 from jonpryor/jonp-mono-api-html-ignore-class-removal
authorAlexis Christoforides <alexis@thenull.net>
Fri, 11 Aug 2017 20:02:11 +0000 (16:02 -0400)
committerGitHub <noreply@github.com>
Fri, 11 Aug 2017 20:02:11 +0000 (16:02 -0400)
[mono-api-html] Allow `-r` to ignore class removals

1270 files changed:
CODEOWNERS
CONTRIBUTING.md
Makefile.am
acceptance-tests/profiler-stress.mk
acceptance-tests/profiler-stress/runner.cs
autogen.sh
configure.ac
eglib/.gitignore [deleted file]
eglib/AUTHORS [deleted file]
eglib/COPYING [deleted file]
eglib/Makefile.am [deleted file]
eglib/NEWS [deleted file]
eglib/README [deleted file]
eglib/TODO [deleted file]
eglib/acinclude.m4 [deleted file]
eglib/autogen.sh [deleted file]
eglib/config.rpath [deleted file]
eglib/configure.ac [deleted file]
eglib/m4/.gitignore [deleted file]
eglib/m4/Makefile.am [deleted file]
eglib/m4/iconv.m4 [deleted file]
eglib/m4/lib-ld.m4 [deleted file]
eglib/m4/lib-link.m4 [deleted file]
eglib/m4/lib-prefix.m4 [deleted file]
eglib/src/.gitignore [deleted file]
eglib/src/Makefile.am [deleted file]
eglib/src/eglib-config.h.in [deleted file]
eglib/src/eglib-config.hw [deleted file]
eglib/src/eglib-remap.h [deleted file]
eglib/src/garray.c [deleted file]
eglib/src/gbytearray.c [deleted file]
eglib/src/gdate-unix.c [deleted file]
eglib/src/gdate-win32.c [deleted file]
eglib/src/gdir-unix.c [deleted file]
eglib/src/gdir-win32.c [deleted file]
eglib/src/gerror.c [deleted file]
eglib/src/gfile-posix.c [deleted file]
eglib/src/gfile-unix.c [deleted file]
eglib/src/gfile-win32.c [deleted file]
eglib/src/gfile.c [deleted file]
eglib/src/ghashtable.c [deleted file]
eglib/src/giconv.c [deleted file]
eglib/src/glib.h [deleted file]
eglib/src/glist.c [deleted file]
eglib/src/gmarkup.c [deleted file]
eglib/src/gmem.c [deleted file]
eglib/src/gmisc-unix.c [deleted file]
eglib/src/gmisc-win32-uwp.c [deleted file]
eglib/src/gmisc-win32.c [deleted file]
eglib/src/gmodule-unix.c [deleted file]
eglib/src/gmodule-win32-internals.h [deleted file]
eglib/src/gmodule-win32-uwp.c [deleted file]
eglib/src/gmodule-win32.c [deleted file]
eglib/src/gmodule.h [deleted file]
eglib/src/goutput.c [deleted file]
eglib/src/gpath.c [deleted file]
eglib/src/gpattern.c [deleted file]
eglib/src/gptrarray.c [deleted file]
eglib/src/gqsort.c [deleted file]
eglib/src/gqueue.c [deleted file]
eglib/src/gshell.c [deleted file]
eglib/src/gslist.c [deleted file]
eglib/src/gspawn.c [deleted file]
eglib/src/gstr.c [deleted file]
eglib/src/gstring.c [deleted file]
eglib/src/gtimer-unix.c [deleted file]
eglib/src/gtimer-win32.c [deleted file]
eglib/src/gunicode-win32-uwp.c [deleted file]
eglib/src/gunicode-win32.c [deleted file]
eglib/src/gunicode.c [deleted file]
eglib/src/gutf8.c [deleted file]
eglib/src/sort.frag.h [deleted file]
eglib/src/unicode-data.h [deleted file]
eglib/test/.gitignore [deleted file]
eglib/test/Makefile.am [deleted file]
eglib/test/README [deleted file]
eglib/test/UTF-16BE.txt [deleted file]
eglib/test/UTF-16LE.txt [deleted file]
eglib/test/UTF-32BE.txt [deleted file]
eglib/test/UTF-32LE.txt [deleted file]
eglib/test/UTF-8.txt [deleted file]
eglib/test/array.c [deleted file]
eglib/test/dir.c [deleted file]
eglib/test/driver.c [deleted file]
eglib/test/endian.c [deleted file]
eglib/test/fake.c [deleted file]
eglib/test/file.c [deleted file]
eglib/test/hashtable.c [deleted file]
eglib/test/list.c [deleted file]
eglib/test/markup.c [deleted file]
eglib/test/memory.c [deleted file]
eglib/test/module.c [deleted file]
eglib/test/path.c [deleted file]
eglib/test/pattern.c [deleted file]
eglib/test/ptrarray.c [deleted file]
eglib/test/queue.c [deleted file]
eglib/test/shell.c [deleted file]
eglib/test/sizes.c [deleted file]
eglib/test/slist.c [deleted file]
eglib/test/spawn.c [deleted file]
eglib/test/string-util.c [deleted file]
eglib/test/string.c [deleted file]
eglib/test/test-both [deleted file]
eglib/test/test.c [deleted file]
eglib/test/test.h [deleted file]
eglib/test/tests.h [deleted file]
eglib/test/timer.c [deleted file]
eglib/test/unicode.c [deleted file]
eglib/test/utf8.c [deleted file]
eglib/test/whats-implemented [deleted file]
eglib/winconfig.h [deleted file]
external/api-snapshot
external/bockbuild
external/cecil
external/corefx
external/ikdasm
external/linker
external/roslyn-binaries
libgc/include/gc.h
man/mprof-report.1
mcs/build/common/basic-profile-check.cs
mcs/build/executable.make
mcs/build/library.make
mcs/build/profiles/basic.make
mcs/build/tests.make
mcs/class/Accessibility/Accessibility-net_4_x.csproj
mcs/class/Accessibility/Assembly/AssemblyInfo.cs
mcs/class/Accessibility/Makefile
mcs/class/Commons.Xml.Relaxng/Assembly/AssemblyInfo.cs
mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_4_x.csproj
mcs/class/Commons.Xml.Relaxng/Makefile
mcs/class/Compat.ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib/AssemblyInfo.cs
mcs/class/Compat.ICSharpCode.SharpZipLib/Makefile
mcs/class/Cscompmgd/Assembly/AssemblyInfo.cs
mcs/class/Cscompmgd/Cscompmgd-net_4_x.csproj
mcs/class/Cscompmgd/Makefile
mcs/class/CustomMarshalers/Assembly/AssemblyInfo.cs
mcs/class/CustomMarshalers/CustomMarshalers-net_4_x.csproj
mcs/class/CustomMarshalers/Makefile
mcs/class/Facades/Microsoft.Win32.Primitives/Facades_Microsoft.Win32.Primitives-net_4_x.csproj
mcs/class/Facades/Microsoft.Win32.Primitives/Makefile
mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Facades_Microsoft.Win32.Registry.AccessControl-net_4_x.csproj
mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Makefile
mcs/class/Facades/Microsoft.Win32.Registry/Facades_Microsoft.Win32.Registry-net_4_x.csproj
mcs/class/Facades/Microsoft.Win32.Registry/Makefile
mcs/class/Facades/System.AppContext/Facades_System.AppContext-net_4_x.csproj
mcs/class/Facades/System.AppContext/Makefile
mcs/class/Facades/System.Collections.Concurrent/Facades_System.Collections.Concurrent-net_4_x.csproj
mcs/class/Facades/System.Collections.Concurrent/Makefile
mcs/class/Facades/System.Collections.Concurrent/_Makefile [deleted file]
mcs/class/Facades/System.Collections.NonGeneric/Facades_System.Collections.NonGeneric-net_4_x.csproj
mcs/class/Facades/System.Collections.NonGeneric/Makefile
mcs/class/Facades/System.Collections.Specialized/Facades_System.Collections.Specialized-net_4_x.csproj
mcs/class/Facades/System.Collections.Specialized/Makefile
mcs/class/Facades/System.Collections/Facades_System.Collections-net_4_x.csproj
mcs/class/Facades/System.Collections/Makefile
mcs/class/Facades/System.ComponentModel.Annotations/Facades_System.ComponentModel.Annotations-net_4_x.csproj
mcs/class/Facades/System.ComponentModel.Annotations/Makefile
mcs/class/Facades/System.ComponentModel.EventBasedAsync/Facades_System.ComponentModel.EventBasedAsync-net_4_x.csproj
mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile
mcs/class/Facades/System.ComponentModel.Primitives/Facades_System.ComponentModel.Primitives-net_4_x.csproj
mcs/class/Facades/System.ComponentModel.Primitives/Makefile
mcs/class/Facades/System.ComponentModel.TypeConverter/Facades_System.ComponentModel.TypeConverter-net_4_x.csproj
mcs/class/Facades/System.ComponentModel.TypeConverter/Makefile
mcs/class/Facades/System.ComponentModel/Facades_System.ComponentModel-net_4_x.csproj
mcs/class/Facades/System.ComponentModel/Makefile
mcs/class/Facades/System.Console/Facades_System.Console-net_4_x.csproj
mcs/class/Facades/System.Console/Makefile
mcs/class/Facades/System.Data.Common/Facades_System.Data.Common-net_4_x.csproj
mcs/class/Facades/System.Data.Common/Makefile
mcs/class/Facades/System.Data.SqlClient/Facades_System.Data.SqlClient-net_4_x.csproj
mcs/class/Facades/System.Data.SqlClient/Makefile
mcs/class/Facades/System.Diagnostics.Contracts/Facades_System.Diagnostics.Contracts-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Contracts/Makefile
mcs/class/Facades/System.Diagnostics.Debug/Facades_System.Diagnostics.Debug-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Debug/Makefile
mcs/class/Facades/System.Diagnostics.FileVersionInfo/Facades_System.Diagnostics.FileVersionInfo-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.FileVersionInfo/Makefile
mcs/class/Facades/System.Diagnostics.Process/Facades_System.Diagnostics.Process-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Process/Makefile
mcs/class/Facades/System.Diagnostics.StackTrace/Facades_System.Diagnostics.StackTrace-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.StackTrace/Makefile
mcs/class/Facades/System.Diagnostics.TextWriterTraceListener/Facades_System.Diagnostics.TextWriterTraceListener-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.TextWriterTraceListener/Makefile
mcs/class/Facades/System.Diagnostics.Tools/Facades_System.Diagnostics.Tools-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Tools/Makefile
mcs/class/Facades/System.Diagnostics.TraceEvent/Facades_System.Diagnostics.TraceEvent-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.TraceEvent/Makefile
mcs/class/Facades/System.Diagnostics.TraceSource/Facades_System.Diagnostics.TraceSource-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.TraceSource/Makefile
mcs/class/Facades/System.Diagnostics.Tracing/Facades_System.Diagnostics.Tracing-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Tracing/Makefile
mcs/class/Facades/System.Drawing.Primitives/Facades_System.Drawing.Primitives-net_4_x.csproj
mcs/class/Facades/System.Drawing.Primitives/Makefile
mcs/class/Facades/System.Dynamic.Runtime/Facades_System.Dynamic.Runtime-net_4_x.csproj
mcs/class/Facades/System.Dynamic.Runtime/Makefile
mcs/class/Facades/System.Globalization.Calendars/Facades_System.Globalization.Calendars-net_4_x.csproj
mcs/class/Facades/System.Globalization.Calendars/Makefile
mcs/class/Facades/System.Globalization.Extensions/Facades_System.Globalization.Extensions-net_4_x.csproj
mcs/class/Facades/System.Globalization.Extensions/Makefile
mcs/class/Facades/System.Globalization/Facades_System.Globalization-net_4_x.csproj
mcs/class/Facades/System.Globalization/Makefile
mcs/class/Facades/System.IO.Compression.ZipFile/Facades_System.IO.Compression.ZipFile-net_4_x.csproj
mcs/class/Facades/System.IO.Compression.ZipFile/Makefile
mcs/class/Facades/System.IO.FileSystem.AccessControl/Facades_System.IO.FileSystem.AccessControl-net_4_x.csproj
mcs/class/Facades/System.IO.FileSystem.AccessControl/Makefile
mcs/class/Facades/System.IO.FileSystem.DriveInfo/Facades_System.IO.FileSystem.DriveInfo-net_4_x.csproj
mcs/class/Facades/System.IO.FileSystem.DriveInfo/Makefile
mcs/class/Facades/System.IO.FileSystem.Primitives/Facades_System.IO.FileSystem.Primitives-net_4_x.csproj
mcs/class/Facades/System.IO.FileSystem.Primitives/Makefile
mcs/class/Facades/System.IO.FileSystem.Watcher/Facades_System.IO.FileSystem.Watcher-net_4_x.csproj
mcs/class/Facades/System.IO.FileSystem.Watcher/Makefile
mcs/class/Facades/System.IO.FileSystem/Facades_System.IO.FileSystem-net_4_x.csproj
mcs/class/Facades/System.IO.FileSystem/Makefile
mcs/class/Facades/System.IO.IsolatedStorage/Facades_System.IO.IsolatedStorage-net_4_x.csproj
mcs/class/Facades/System.IO.IsolatedStorage/Makefile
mcs/class/Facades/System.IO.MemoryMappedFiles/Facades_System.IO.MemoryMappedFiles-net_4_x.csproj
mcs/class/Facades/System.IO.MemoryMappedFiles/Makefile
mcs/class/Facades/System.IO.Pipes/Facades_System.IO.Pipes-net_4_x.csproj
mcs/class/Facades/System.IO.Pipes/Makefile
mcs/class/Facades/System.IO.UnmanagedMemoryStream/Facades_System.IO.UnmanagedMemoryStream-net_4_x.csproj
mcs/class/Facades/System.IO.UnmanagedMemoryStream/Makefile
mcs/class/Facades/System.IO/Facades_System.IO-net_4_x.csproj
mcs/class/Facades/System.IO/Makefile
mcs/class/Facades/System.Linq.Expressions/Facades_System.Linq.Expressions-net_4_x.csproj
mcs/class/Facades/System.Linq.Expressions/Makefile
mcs/class/Facades/System.Linq.Parallel/Facades_System.Linq.Parallel-net_4_x.csproj
mcs/class/Facades/System.Linq.Parallel/Makefile
mcs/class/Facades/System.Linq.Queryable/Facades_System.Linq.Queryable-net_4_x.csproj
mcs/class/Facades/System.Linq.Queryable/Makefile
mcs/class/Facades/System.Linq/Facades_System.Linq-net_4_x.csproj
mcs/class/Facades/System.Linq/Makefile
mcs/class/Facades/System.Net.AuthenticationManager/Facades_System.Net.AuthenticationManager-net_4_x.csproj
mcs/class/Facades/System.Net.AuthenticationManager/Makefile
mcs/class/Facades/System.Net.Cache/Facades_System.Net.Cache-net_4_x.csproj
mcs/class/Facades/System.Net.Cache/Makefile
mcs/class/Facades/System.Net.HttpListener/Facades_System.Net.HttpListener-net_4_x.csproj
mcs/class/Facades/System.Net.HttpListener/Makefile
mcs/class/Facades/System.Net.Mail/Facades_System.Net.Mail-net_4_x.csproj
mcs/class/Facades/System.Net.Mail/Makefile
mcs/class/Facades/System.Net.NameResolution/Facades_System.Net.NameResolution-net_4_x.csproj
mcs/class/Facades/System.Net.NameResolution/Makefile
mcs/class/Facades/System.Net.NetworkInformation/Facades_System.Net.NetworkInformation-net_4_x.csproj
mcs/class/Facades/System.Net.NetworkInformation/Makefile
mcs/class/Facades/System.Net.Ping/Makefile
mcs/class/Facades/System.Net.Primitives/Facades_System.Net.Primitives-net_4_x.csproj
mcs/class/Facades/System.Net.Primitives/Makefile
mcs/class/Facades/System.Net.Requests/Facades_System.Net.Requests-net_4_x.csproj
mcs/class/Facades/System.Net.Requests/Makefile
mcs/class/Facades/System.Net.Security/Facades_System.Net.Security-net_4_x.csproj
mcs/class/Facades/System.Net.Security/Makefile
mcs/class/Facades/System.Net.ServicePoint/Facades_System.Net.ServicePoint-net_4_x.csproj
mcs/class/Facades/System.Net.ServicePoint/Makefile
mcs/class/Facades/System.Net.Sockets/Facades_System.Net.Sockets-net_4_x.csproj
mcs/class/Facades/System.Net.Sockets/Makefile
mcs/class/Facades/System.Net.Utilities/Facades_System.Net.Utilities-net_4_x.csproj
mcs/class/Facades/System.Net.Utilities/Makefile
mcs/class/Facades/System.Net.WebHeaderCollection/Facades_System.Net.WebHeaderCollection-net_4_x.csproj
mcs/class/Facades/System.Net.WebHeaderCollection/Makefile
mcs/class/Facades/System.Net.WebSockets.Client/Facades_System.Net.WebSockets.Client-net_4_x.csproj
mcs/class/Facades/System.Net.WebSockets.Client/Makefile
mcs/class/Facades/System.Net.WebSockets/Facades_System.Net.WebSockets-net_4_x.csproj
mcs/class/Facades/System.Net.WebSockets/Makefile
mcs/class/Facades/System.ObjectModel/Facades_System.ObjectModel-net_4_x.csproj
mcs/class/Facades/System.ObjectModel/Makefile
mcs/class/Facades/System.Reflection.DispatchProxy/Makefile
mcs/class/Facades/System.Reflection.Emit.ILGeneration/Facades_System.Reflection.Emit.ILGeneration-net_4_x.csproj
mcs/class/Facades/System.Reflection.Emit.ILGeneration/Makefile
mcs/class/Facades/System.Reflection.Emit.Lightweight/Facades_System.Reflection.Emit.Lightweight-net_4_x.csproj
mcs/class/Facades/System.Reflection.Emit.Lightweight/Makefile
mcs/class/Facades/System.Reflection.Emit/Facades_System.Reflection.Emit-net_4_x.csproj
mcs/class/Facades/System.Reflection.Emit/Makefile
mcs/class/Facades/System.Reflection.Extensions/Facades_System.Reflection.Extensions-net_4_x.csproj
mcs/class/Facades/System.Reflection.Extensions/Makefile
mcs/class/Facades/System.Reflection.Primitives/Facades_System.Reflection.Primitives-net_4_x.csproj
mcs/class/Facades/System.Reflection.Primitives/Makefile
mcs/class/Facades/System.Reflection.TypeExtensions/Facades_System.Reflection.TypeExtensions-net_4_x.csproj
mcs/class/Facades/System.Reflection.TypeExtensions/Makefile
mcs/class/Facades/System.Reflection/Facades_System.Reflection-net_4_x.csproj
mcs/class/Facades/System.Reflection/Makefile
mcs/class/Facades/System.Resources.ReaderWriter/Facades_System.Resources.ReaderWriter-net_4_x.csproj
mcs/class/Facades/System.Resources.ReaderWriter/Makefile
mcs/class/Facades/System.Resources.ResourceManager/Facades_System.Resources.ResourceManager-net_4_x.csproj
mcs/class/Facades/System.Resources.ResourceManager/Makefile
mcs/class/Facades/System.Runtime.CompilerServices.VisualC/Facades_System.Runtime.CompilerServices.VisualC-net_4_x.csproj
mcs/class/Facades/System.Runtime.CompilerServices.VisualC/Makefile
mcs/class/Facades/System.Runtime.Extensions/Facades_System.Runtime.Extensions-net_4_x.csproj
mcs/class/Facades/System.Runtime.Extensions/Makefile
mcs/class/Facades/System.Runtime.Handles/Facades_System.Runtime.Handles-net_4_x.csproj
mcs/class/Facades/System.Runtime.Handles/Makefile
mcs/class/Facades/System.Runtime.InteropServices.RuntimeInformation/Facades_System.Runtime.InteropServices.RuntimeInformation-net_4_x.csproj
mcs/class/Facades/System.Runtime.InteropServices.RuntimeInformation/Makefile
mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Facades_System.Runtime.InteropServices.WindowsRuntime-net_4_x.csproj
mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Makefile
mcs/class/Facades/System.Runtime.InteropServices/Facades_System.Runtime.InteropServices-net_4_x.csproj
mcs/class/Facades/System.Runtime.InteropServices/Makefile
mcs/class/Facades/System.Runtime.Loader/Makefile
mcs/class/Facades/System.Runtime.Numerics/Facades_System.Runtime.Numerics-net_4_x.csproj
mcs/class/Facades/System.Runtime.Numerics/Makefile
mcs/class/Facades/System.Runtime.Serialization.Formatters/Makefile
mcs/class/Facades/System.Runtime.Serialization.Json/Facades_System.Runtime.Serialization.Json-net_4_x.csproj
mcs/class/Facades/System.Runtime.Serialization.Json/Makefile
mcs/class/Facades/System.Runtime.Serialization.Primitives/Facades_System.Runtime.Serialization.Primitives-net_4_x.csproj
mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile
mcs/class/Facades/System.Runtime.Serialization.Xml/Facades_System.Runtime.Serialization.Xml-net_4_x.csproj
mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile
mcs/class/Facades/System.Runtime/Facades_System.Runtime-net_4_x.csproj
mcs/class/Facades/System.Runtime/Makefile
mcs/class/Facades/System.Security.AccessControl/Facades_System.Security.AccessControl-net_4_x.csproj
mcs/class/Facades/System.Security.AccessControl/Makefile
mcs/class/Facades/System.Security.Claims/Facades_System.Security.Claims-net_4_x.csproj
mcs/class/Facades/System.Security.Claims/Makefile
mcs/class/Facades/System.Security.Cryptography.Algorithms/Facades_System.Security.Cryptography.Algorithms-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Algorithms/Makefile
mcs/class/Facades/System.Security.Cryptography.Cng/Makefile
mcs/class/Facades/System.Security.Cryptography.Csp/Makefile
mcs/class/Facades/System.Security.Cryptography.DeriveBytes/Facades_System.Security.Cryptography.DeriveBytes-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.DeriveBytes/Makefile
mcs/class/Facades/System.Security.Cryptography.Encoding/Facades_System.Security.Cryptography.Encoding-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Encoding/Makefile
mcs/class/Facades/System.Security.Cryptography.Encryption.Aes/Facades_System.Security.Cryptography.Encryption.Aes-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Encryption.Aes/Makefile
mcs/class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman/Facades_System.Security.Cryptography.Encryption.ECDiffieHellman-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman/Makefile
mcs/class/Facades/System.Security.Cryptography.Encryption.ECDsa/Facades_System.Security.Cryptography.Encryption.ECDsa-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Encryption.ECDsa/Makefile
mcs/class/Facades/System.Security.Cryptography.Encryption/Facades_System.Security.Cryptography.Encryption-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Encryption/Makefile
mcs/class/Facades/System.Security.Cryptography.Hashing.Algorithms/Facades_System.Security.Cryptography.Hashing.Algorithms-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Hashing.Algorithms/Makefile
mcs/class/Facades/System.Security.Cryptography.Hashing/Facades_System.Security.Cryptography.Hashing-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Hashing/Makefile
mcs/class/Facades/System.Security.Cryptography.OpenSsl/Makefile
mcs/class/Facades/System.Security.Cryptography.Pkcs/Makefile
mcs/class/Facades/System.Security.Cryptography.Primitives/Facades_System.Security.Cryptography.Primitives-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Primitives/Makefile
mcs/class/Facades/System.Security.Cryptography.ProtectedData/Facades_System.Security.Cryptography.ProtectedData-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.ProtectedData/Makefile
mcs/class/Facades/System.Security.Cryptography.RSA/Facades_System.Security.Cryptography.RSA-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.RSA/Makefile
mcs/class/Facades/System.Security.Cryptography.RandomNumberGenerator/Facades_System.Security.Cryptography.RandomNumberGenerator-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.RandomNumberGenerator/Makefile
mcs/class/Facades/System.Security.Cryptography.X509Certificates/Facades_System.Security.Cryptography.X509Certificates-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile
mcs/class/Facades/System.Security.Principal.Windows/Facades_System.Security.Principal.Windows-net_4_x.csproj
mcs/class/Facades/System.Security.Principal.Windows/Makefile
mcs/class/Facades/System.Security.Principal/Facades_System.Security.Principal-net_4_x.csproj
mcs/class/Facades/System.Security.Principal/Makefile
mcs/class/Facades/System.Security.SecureString/Facades_System.Security.SecureString-net_4_x.csproj
mcs/class/Facades/System.Security.SecureString/Makefile
mcs/class/Facades/System.ServiceModel.Duplex/Facades_System.ServiceModel.Duplex-net_4_x.csproj
mcs/class/Facades/System.ServiceModel.Duplex/Makefile
mcs/class/Facades/System.ServiceModel.Http/Facades_System.ServiceModel.Http-net_4_x.csproj
mcs/class/Facades/System.ServiceModel.Http/Makefile
mcs/class/Facades/System.ServiceModel.NetTcp/Facades_System.ServiceModel.NetTcp-net_4_x.csproj
mcs/class/Facades/System.ServiceModel.NetTcp/Makefile
mcs/class/Facades/System.ServiceModel.Primitives/Facades_System.ServiceModel.Primitives-net_4_x.csproj
mcs/class/Facades/System.ServiceModel.Primitives/Makefile
mcs/class/Facades/System.ServiceModel.Security/Facades_System.ServiceModel.Security-net_4_x.csproj
mcs/class/Facades/System.ServiceModel.Security/Makefile
mcs/class/Facades/System.ServiceProcess.ServiceController/Facades_System.ServiceProcess.ServiceController-net_4_x.csproj
mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile
mcs/class/Facades/System.Text.Encoding.CodePages/Facades_System.Text.Encoding.CodePages-net_4_x.csproj
mcs/class/Facades/System.Text.Encoding.CodePages/Makefile
mcs/class/Facades/System.Text.Encoding.Extensions/Facades_System.Text.Encoding.Extensions-net_4_x.csproj
mcs/class/Facades/System.Text.Encoding.Extensions/Makefile
mcs/class/Facades/System.Text.Encoding/Facades_System.Text.Encoding-net_4_x.csproj
mcs/class/Facades/System.Text.Encoding/Makefile
mcs/class/Facades/System.Text.RegularExpressions/Facades_System.Text.RegularExpressions-net_4_x.csproj
mcs/class/Facades/System.Text.RegularExpressions/Makefile
mcs/class/Facades/System.Threading.AccessControl/Facades_System.Threading.AccessControl-net_4_x.csproj
mcs/class/Facades/System.Threading.AccessControl/Makefile
mcs/class/Facades/System.Threading.Overlapped/Facades_System.Threading.Overlapped-net_4_x.csproj
mcs/class/Facades/System.Threading.Overlapped/Makefile
mcs/class/Facades/System.Threading.Tasks.Parallel/Facades_System.Threading.Tasks.Parallel-net_4_x.csproj
mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile
mcs/class/Facades/System.Threading.Tasks/Facades_System.Threading.Tasks-net_4_x.csproj
mcs/class/Facades/System.Threading.Tasks/Makefile
mcs/class/Facades/System.Threading.Thread/Facades_System.Threading.Thread-net_4_x.csproj
mcs/class/Facades/System.Threading.Thread/Makefile
mcs/class/Facades/System.Threading.ThreadPool/Facades_System.Threading.ThreadPool-net_4_x.csproj
mcs/class/Facades/System.Threading.ThreadPool/Makefile
mcs/class/Facades/System.Threading.Timer/Facades_System.Threading.Timer-net_4_x.csproj
mcs/class/Facades/System.Threading.Timer/Makefile
mcs/class/Facades/System.Threading/Facades_System.Threading-net_4_x.csproj
mcs/class/Facades/System.Threading/Makefile
mcs/class/Facades/System.ValueTuple/Facades_System.ValueTuple-net_4_x.csproj
mcs/class/Facades/System.ValueTuple/Makefile
mcs/class/Facades/System.Xml.ReaderWriter/Facades_System.Xml.ReaderWriter-net_4_x.csproj
mcs/class/Facades/System.Xml.ReaderWriter/Makefile
mcs/class/Facades/System.Xml.XDocument/Facades_System.Xml.XDocument-net_4_x.csproj
mcs/class/Facades/System.Xml.XDocument/Makefile
mcs/class/Facades/System.Xml.XPath.XDocument/Facades_System.Xml.XPath.XDocument-net_4_x.csproj
mcs/class/Facades/System.Xml.XPath.XDocument/Makefile
mcs/class/Facades/System.Xml.XPath.XmlDocument/Makefile
mcs/class/Facades/System.Xml.XPath/Facades_System.Xml.XPath-net_4_x.csproj
mcs/class/Facades/System.Xml.XPath/Makefile
mcs/class/Facades/System.Xml.XmlDocument/Facades_System.Xml.XmlDocument-net_4_x.csproj
mcs/class/Facades/System.Xml.XmlDocument/Makefile
mcs/class/Facades/System.Xml.XmlSerializer/Facades_System.Xml.XmlSerializer-net_4_x.csproj
mcs/class/Facades/System.Xml.XmlSerializer/Makefile
mcs/class/Facades/System.Xml.Xsl.Primitives/Facades_System.Xml.Xsl.Primitives-net_4_x.csproj
mcs/class/Facades/System.Xml.Xsl.Primitives/Makefile
mcs/class/Facades/netstandard/Facades_netstandard-net_4_x.csproj
mcs/class/Facades/netstandard/Makefile
mcs/class/I18N/Assembly/AssemblyInfo.cs
mcs/class/I18N/CJK/I18N.CJK-net_4_x.csproj
mcs/class/I18N/CJK/Makefile
mcs/class/I18N/Common/I18N-net_4_x.csproj
mcs/class/I18N/Common/Makefile
mcs/class/I18N/MidEast/I18N.MidEast-net_4_x.csproj
mcs/class/I18N/MidEast/Makefile
mcs/class/I18N/Other/I18N.Other-net_4_x.csproj
mcs/class/I18N/Other/Makefile
mcs/class/I18N/Rare/I18N.Rare-net_4_x.csproj
mcs/class/I18N/Rare/Makefile
mcs/class/I18N/West/I18N.West-net_4_x.csproj
mcs/class/I18N/West/Makefile
mcs/class/IBM.Data.DB2/Assembly/AssemblyInfo.cs
mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_4_x.csproj
mcs/class/IBM.Data.DB2/Makefile
mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_4_x.csproj
mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib/AssemblyInfo.cs
mcs/class/ICSharpCode.SharpZipLib/Makefile
mcs/class/Microsoft.Build.Engine/Assembly/AssemblyInfo.cs
mcs/class/Microsoft.Build.Engine/Makefile
mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_4_x.csproj
mcs/class/Microsoft.Build.Framework/Assembly/AssemblyInfo.cs
mcs/class/Microsoft.Build.Framework/Makefile
mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_4_x.csproj
mcs/class/Microsoft.Build.Tasks/Assembly/AssemblyInfo.cs
mcs/class/Microsoft.Build.Tasks/Makefile
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_x.csproj
mcs/class/Microsoft.Build.Utilities/Assembly/AssemblyInfo.cs
mcs/class/Microsoft.Build.Utilities/Makefile
mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_4_x.csproj
mcs/class/Microsoft.Build/Assembly/AssemblyInfo.cs
mcs/class/Microsoft.Build/Makefile
mcs/class/Microsoft.Build/Microsoft.Build-net_4_x.csproj
mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildSubmissionTest.cs
mcs/class/Microsoft.CSharp/Assembly/AssemblyInfo.cs
mcs/class/Microsoft.CSharp/Makefile
mcs/class/Microsoft.CSharp/Microsoft.CSharp-net_4_x.csproj
mcs/class/Microsoft.CSharp/Microsoft.CSharp.dll.sources
mcs/class/Microsoft.CSharp/corefx/SR.cs
mcs/class/Microsoft.VisualC/Assembly/AssemblyInfo.cs
mcs/class/Microsoft.VisualC/Makefile
mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_4_x.csproj
mcs/class/Microsoft.Web.Infrastructure/Assembly/AssemblyInfo.cs
mcs/class/Microsoft.Web.Infrastructure/Makefile
mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure-net_4_x.csproj
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface-net_4_x.csproj
mcs/class/Mono.C5/C5/AssemblyInfo.cs
mcs/class/Mono.C5/Makefile
mcs/class/Mono.C5/Mono.C5-net_4_x.csproj
mcs/class/Mono.CSharp/Assembly/AssemblyInfo.cs
mcs/class/Mono.CSharp/Makefile
mcs/class/Mono.CSharp/Mono.CSharp-net_4_x.csproj
mcs/class/Mono.CSharp/Mono.CSharp.csproj
mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs
mcs/class/Mono.Cairo/Assembly/AssemblyInfo.cs
mcs/class/Mono.Cairo/Makefile
mcs/class/Mono.Cairo/Mono.Cairo-net_4_x.csproj
mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_x.csproj
mcs/class/Mono.Cecil/Mono.Cecil-net_4_x.csproj
mcs/class/Mono.CodeContracts/Assembly/AssemblyInfo.cs
mcs/class/Mono.CodeContracts/Makefile
mcs/class/Mono.CodeContracts/Mono.CodeContracts-net_4_x.csproj
mcs/class/Mono.CompilerServices.SymbolWriter/Assembly/AssemblyInfo.cs
mcs/class/Mono.CompilerServices.SymbolWriter/Makefile
mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_4_x.csproj
mcs/class/Mono.Data.Sqlite/Assembly/AssemblyInfo.cs
mcs/class/Mono.Data.Sqlite/Makefile
mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_4_x.csproj
mcs/class/Mono.Data.Tds/Assembly/AssemblyInfo.cs
mcs/class/Mono.Data.Tds/Makefile
mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_4_x.csproj
mcs/class/Mono.Debugger.Soft/Makefile
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_4_x.csproj
mcs/class/Mono.Http/Assembly/AssemblyInfo.cs
mcs/class/Mono.Http/Makefile
mcs/class/Mono.Http/Mono.Http-net_4_x.csproj
mcs/class/Mono.Management/Assembly/AssemblyInfo.cs
mcs/class/Mono.Management/Makefile
mcs/class/Mono.Management/Mono.Management-net_4_x.csproj
mcs/class/Mono.Messaging.RabbitMQ/Assembly/AssemblyInfo.cs
mcs/class/Mono.Messaging.RabbitMQ/Makefile
mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_4_x.csproj
mcs/class/Mono.Messaging/Assembly/AssemblyInfo.cs
mcs/class/Mono.Messaging/Makefile
mcs/class/Mono.Messaging/Mono.Messaging-net_4_x.csproj
mcs/class/Mono.Options/Assembly/AssemblyInfo.cs
mcs/class/Mono.Options/Makefile
mcs/class/Mono.Options/Mono.Options-net_4_x.csproj
mcs/class/Mono.Parallel/Assembly/AssemblyInfo.cs
mcs/class/Mono.Parallel/Makefile
mcs/class/Mono.Parallel/Mono.Parallel-net_4_x.csproj
mcs/class/Mono.Posix/Assembly/AssemblyInfo.cs
mcs/class/Mono.Posix/Makefile
mcs/class/Mono.Posix/Mono.Posix-net_4_x.csproj
mcs/class/Mono.Profiler.Log/Makefile
mcs/class/Mono.Profiler.Log/Mono.Profiler.Log-net_4_x.csproj
mcs/class/Mono.Profiler.Log/Mono.Profiler.Log.dll.sources
mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEnums.cs
mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEventVisitor.cs
mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEvents.cs
mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogProcessor.cs
mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogProfiler.cs [new file with mode: 0644]
mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogRuntimeProfiler.cs [deleted file]
mcs/class/Mono.Reactive.Testing/Makefile
mcs/class/Mono.Reactive.Testing/more_build_args [deleted file]
mcs/class/Mono.Security.Win32/Assembly/AssemblyInfo.cs
mcs/class/Mono.Security.Win32/Makefile
mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_4_x.csproj
mcs/class/Mono.Security/Assembly/AssemblyInfo.cs
mcs/class/Mono.Security/Makefile
mcs/class/Mono.Security/Mono.Security-net_4_x.csproj
mcs/class/Mono.ServiceModel.IdentitySelectors/Assembly/AssemblyInfo.cs
mcs/class/Mono.ServiceModel.IdentitySelectors/Makefile
mcs/class/Mono.Simd/Assembly/AssemblyInfo.cs
mcs/class/Mono.Simd/Makefile
mcs/class/Mono.Simd/Mono.Simd-net_4_x.csproj
mcs/class/Mono.Tasklets/Assembly/AssemblyInfo.cs
mcs/class/Mono.Tasklets/Makefile
mcs/class/Mono.Tasklets/Mono.Tasklets-net_4_x.csproj
mcs/class/Mono.WebBrowser/Assembly/AssemblyInfo.cs
mcs/class/Mono.WebBrowser/Makefile
mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_4_x.csproj
mcs/class/Mono.XBuild.Tasks/Assembly/AssemblyInfo.cs
mcs/class/Mono.XBuild.Tasks/Makefile
mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_4_x.csproj
mcs/class/Mono.Xml.Ext/Assembly/AssemblyInfo.cs
mcs/class/Mono.Xml.Ext/Makefile
mcs/class/Novell.Directory.Ldap/Makefile
mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_4_x.csproj
mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/AssemblyInfo.cs
mcs/class/PEAPI/Assembly/AssemblyInfo.cs
mcs/class/PEAPI/Makefile
mcs/class/PEAPI/PEAPI-net_4_x.csproj
mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_4_x.csproj
mcs/class/RabbitMQ.Client/src/client/AssemblyInfo.cs
mcs/class/RabbitMQ.Client/src/client/Makefile
mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_4_x.csproj
mcs/class/SMDiagnostics/SMDiagnostics-net_4_x.csproj
mcs/class/System.ComponentModel.Composition.4.5/Makefile
mcs/class/System.ComponentModel.Composition.4.5/System.ComponentModel.Composition-net_4_x.csproj
mcs/class/System.ComponentModel.Composition.4.5/src/Assembly/AssemblyInfo.cs
mcs/class/System.ComponentModel.DataAnnotations/Assembly/AssemblyInfo.cs
mcs/class/System.ComponentModel.DataAnnotations/Makefile
mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_4_x.csproj
mcs/class/System.Configuration.Install/Assembly/AssemblyInfo.cs
mcs/class/System.Configuration.Install/Makefile
mcs/class/System.Configuration.Install/System.Configuration.Install-net_4_x.csproj
mcs/class/System.Configuration/Assembly/AssemblyInfo.cs
mcs/class/System.Configuration/Makefile
mcs/class/System.Configuration/System.Configuration-net_4_x.csproj
mcs/class/System.Core/Makefile
mcs/class/System.Core/System.Core-net_4_x.csproj
mcs/class/System.Core/System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs
mcs/class/System.Data.DataSetExtensions/Assembly/AssemblyInfo.cs
mcs/class/System.Data.DataSetExtensions/Makefile
mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_4_x.csproj
mcs/class/System.Data.Entity/Assembly/AssemblyInfo.cs
mcs/class/System.Data.Entity/Makefile
mcs/class/System.Data.Entity/System.Data.Entity-net_4_x.csproj
mcs/class/System.Data.Linq/Makefile
mcs/class/System.Data.Linq/System.Data.Linq-net_4_x.csproj
mcs/class/System.Data.Linq/src/DbLinq/System.Data.Linq/Assembly/AssemblyInfo.cs
mcs/class/System.Data.Linq/src/DbLinq/System.Data.Linq/Makefile
mcs/class/System.Data.OracleClient/Assembly/AssemblyInfo.cs
mcs/class/System.Data.OracleClient/Makefile
mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_4_x.csproj
mcs/class/System.Data.Services.Client/Assembly/AssemblyInfo.cs
mcs/class/System.Data.Services.Client/Makefile
mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_4_x.csproj
mcs/class/System.Data.Services/Assembly/AssemblyInfo.cs
mcs/class/System.Data.Services/Makefile
mcs/class/System.Data.Services/System.Data.Services-net_4_x.csproj
mcs/class/System.Data/Assembly/AssemblyInfo.cs
mcs/class/System.Data/Makefile
mcs/class/System.Data/System.Data-net_4_x.csproj
mcs/class/System.Deployment/System.Deployment-net_4_x.csproj
mcs/class/System.Design/Assembly/AssemblyInfo.cs
mcs/class/System.Design/Makefile
mcs/class/System.Design/System.Design-net_4_x.csproj
mcs/class/System.Design/System.Design-plaindesign-net_4_x.csproj
mcs/class/System.DirectoryServices.Protocols/Assembly/AssemblyInfo.cs
mcs/class/System.DirectoryServices.Protocols/Makefile
mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_4_x.csproj
mcs/class/System.DirectoryServices/Assembly/AssemblyInfo.cs
mcs/class/System.DirectoryServices/Makefile
mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_x.csproj
mcs/class/System.DirectoryServices/Test/System.DirectoryServices/DirectoryServicesDirectoryEntryTest.cs
mcs/class/System.DirectoryServices/Test/System.DirectoryServices/DirectoryServicesDirectorySearcherTest.cs
mcs/class/System.DirectoryServices/Test/System.DirectoryServices/DirectoryServicesSearchResultTest.cs
mcs/class/System.Drawing.Design/Assembly/AssemblyInfo.cs
mcs/class/System.Drawing.Design/Makefile
mcs/class/System.Drawing.Design/System.Drawing.Design-net_4_x.csproj
mcs/class/System.Drawing/Assembly/AssemblyInfo.cs
mcs/class/System.Drawing/Makefile
mcs/class/System.Drawing/System.Drawing-net_4_x.csproj
mcs/class/System.Drawing/System.Drawing.dll.sources
mcs/class/System.Dynamic/Assembly/AssemblyInfo.cs
mcs/class/System.Dynamic/Makefile
mcs/class/System.Dynamic/System.Dynamic-net_4_x.csproj
mcs/class/System.EnterpriseServices/Assembly/AssemblyInfo.cs
mcs/class/System.EnterpriseServices/Makefile
mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_4_x.csproj
mcs/class/System.IO.Compression.FileSystem/AssemblyInfo.cs
mcs/class/System.IO.Compression.FileSystem/Makefile
mcs/class/System.IO.Compression.FileSystem/System.IO.Compression.FileSystem-net_4_x.csproj
mcs/class/System.IO.Compression/AssemblyInfo.cs
mcs/class/System.IO.Compression/Makefile
mcs/class/System.IO.Compression/System.IO.Compression-net_4_x.csproj
mcs/class/System.IdentityModel.Selectors/Assembly/AssemblyInfo.cs
mcs/class/System.IdentityModel.Selectors/Makefile
mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_4_x.csproj
mcs/class/System.IdentityModel/Assembly/AssemblyInfo.cs
mcs/class/System.IdentityModel/Makefile
mcs/class/System.IdentityModel/System.IdentityModel-net_4_x.csproj
mcs/class/System.Interactive.Async/Makefile
mcs/class/System.Interactive.Async/more_build_args [deleted file]
mcs/class/System.Interactive.Providers/Makefile
mcs/class/System.Interactive.Providers/more_build_args [deleted file]
mcs/class/System.Interactive/Makefile
mcs/class/System.Interactive/more_build_args [deleted file]
mcs/class/System.Json.Microsoft/System.Json.Microsoft-net_4_x.csproj
mcs/class/System.Json/Assembly/AssemblyInfo.cs
mcs/class/System.Json/Makefile
mcs/class/System.Json/System.Json-net_4_x.csproj
mcs/class/System.Management/Assembly/AssemblyInfo.cs
mcs/class/System.Management/Makefile
mcs/class/System.Management/System.Management-net_4_x.csproj
mcs/class/System.Messaging/Assembly/AssemblyInfo.cs
mcs/class/System.Messaging/Makefile
mcs/class/System.Messaging/System.Messaging-net_4_x.csproj
mcs/class/System.Net.Http.Formatting/System.Net.Http.Formatting-net_4_x.csproj
mcs/class/System.Net.Http.WebRequest/Assembly/AssemblyInfo.cs
mcs/class/System.Net.Http.WebRequest/Makefile
mcs/class/System.Net.Http.WebRequest/System.Net.Http.WebRequest-net_4_x.csproj
mcs/class/System.Net.Http.WinHttpHandler/Assembly/AssemblyInfo.cs
mcs/class/System.Net.Http.WinHttpHandler/Makefile
mcs/class/System.Net.Http/Assembly/AssemblyInfo.cs
mcs/class/System.Net.Http/Makefile
mcs/class/System.Net.Http/System.Net.Http-net_4_x.csproj
mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs
mcs/class/System.Net/System.Net-net_4_x.csproj
mcs/class/System.Numerics.Vectors/Assembly/AssemblyInfo.cs
mcs/class/System.Numerics.Vectors/Makefile
mcs/class/System.Numerics.Vectors/System.Numerics.Vectors-net_4_x.csproj
mcs/class/System.Numerics/Assembly/AssemblyInfo.cs
mcs/class/System.Numerics/Makefile
mcs/class/System.Numerics/System.Numerics-net_4_x.csproj
mcs/class/System.Numerics/System.Numerics.dll.sources
mcs/class/System.Numerics/System.Numerics_xtest.dll.sources
mcs/class/System.Reactive.Core/Makefile
mcs/class/System.Reactive.Core/System.Reactive.Core-net_4_x.csproj
mcs/class/System.Reactive.Core/more_build_args [deleted file]
mcs/class/System.Reactive.Debugger/Makefile
mcs/class/System.Reactive.Debugger/System.Reactive.Debugger-net_4_x.csproj
mcs/class/System.Reactive.Debugger/more_build_args [deleted file]
mcs/class/System.Reactive.Experimental/Makefile
mcs/class/System.Reactive.Experimental/System.Reactive.Experimental-net_4_x.csproj
mcs/class/System.Reactive.Experimental/more_build_args [deleted file]
mcs/class/System.Reactive.Interfaces/Makefile
mcs/class/System.Reactive.Interfaces/System.Reactive.Interfaces-net_4_x.csproj
mcs/class/System.Reactive.Interfaces/more_build_args [deleted file]
mcs/class/System.Reactive.Linq/Makefile
mcs/class/System.Reactive.Linq/System.Reactive.Linq-net_4_x.csproj
mcs/class/System.Reactive.Linq/more_build_args [deleted file]
mcs/class/System.Reactive.Observable.Aliases/Makefile
mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases-net_4_x.csproj
mcs/class/System.Reactive.Observable.Aliases/more_build_args [deleted file]
mcs/class/System.Reactive.PlatformServices/Makefile
mcs/class/System.Reactive.PlatformServices/System.Reactive.PlatformServices-net_4_x.csproj
mcs/class/System.Reactive.PlatformServices/more_build_args [deleted file]
mcs/class/System.Reactive.Providers/Makefile
mcs/class/System.Reactive.Providers/System.Reactive.Providers-net_4_x.csproj
mcs/class/System.Reactive.Providers/more_build_args [deleted file]
mcs/class/System.Reactive.Runtime.Remoting/Makefile
mcs/class/System.Reactive.Runtime.Remoting/System.Reactive.Runtime.Remoting-net_4_x.csproj
mcs/class/System.Reactive.Runtime.Remoting/more_build_args [deleted file]
mcs/class/System.Reactive.Windows.Forms/Makefile
mcs/class/System.Reactive.Windows.Forms/System.Reactive.Windows.Forms-net_4_x.csproj
mcs/class/System.Reactive.Windows.Forms/more_build_args [deleted file]
mcs/class/System.Reactive.Windows.Threading/Makefile
mcs/class/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading-net_4_x.csproj
mcs/class/System.Reactive.Windows.Threading/more_build_args [deleted file]
mcs/class/System.Reflection.Context/Assembly/AssemblyInfo.cs
mcs/class/System.Reflection.Context/Makefile
mcs/class/System.Reflection.Context/System.Reflection.Context-net_4_x.csproj
mcs/class/System.Runtime.Caching/Assembly/AssemblyInfo.cs
mcs/class/System.Runtime.Caching/Makefile
mcs/class/System.Runtime.Caching/System.Runtime.Caching-net_4_x.csproj
mcs/class/System.Runtime.DurableInstancing/Assembly/AssemblyInfo.cs
mcs/class/System.Runtime.DurableInstancing/Makefile
mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-net_4_x.csproj
mcs/class/System.Runtime.Remoting/Assembly/AssemblyInfo.cs
mcs/class/System.Runtime.Remoting/Makefile
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_4_x.csproj
mcs/class/System.Runtime.Remoting/Test/IpcChannelTest.cs
mcs/class/System.Runtime.Serialization.Formatters.Soap/Assembly/AssemblyInfo.cs
mcs/class/System.Runtime.Serialization.Formatters.Soap/Makefile
mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_4_x.csproj
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_4_x.csproj
mcs/class/System.Security/Assembly/AssemblyInfo.cs
mcs/class/System.Security/Makefile
mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs [deleted file]
mcs/class/System.Security/System.Security-net_4_x.csproj
mcs/class/System.Security/System.Security.Cryptography.Xml/EncryptedReference.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/Reference.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/Transform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/TransformChain.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDecryptionTransform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigBase64Transform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigC14NTransform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigC14NWithCommentsTransform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigEnvelopedSignatureTransform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigExcC14NTransform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigExcC14NWithCommentsTransform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigNodeList.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXPathTransform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXsltTransform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlLicenseTransform.cs [deleted file]
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlSignature.cs
mcs/class/System.Security/System.Security.Cryptography.Xml/XmlSignatureStreamReader.cs [deleted file]
mcs/class/System.Security/System.Security.dll.sources
mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ReferenceTest.cs
mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs
mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs
mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigExcC14NTransformTest.cs
mcs/class/System.Security/corefx/SR.cs
mcs/class/System.ServiceModel.Activation/Assembly/AssemblyInfo.cs
mcs/class/System.ServiceModel.Activation/Makefile
mcs/class/System.ServiceModel.Activation/System.ServiceModel.Activation-net_4_x.csproj
mcs/class/System.ServiceModel.Discovery/Assembly/AssemblyInfo.cs
mcs/class/System.ServiceModel.Discovery/Makefile
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-net_4_x.csproj
mcs/class/System.ServiceModel.Internals/System.ServiceModel.Internals-net_4_x.csproj
mcs/class/System.ServiceModel.Routing/Assembly/AssemblyInfo.cs
mcs/class/System.ServiceModel.Routing/Makefile
mcs/class/System.ServiceModel.Routing/System.ServiceModel.Routing-net_4_x.csproj
mcs/class/System.ServiceModel.Web/Assembly/AssemblyInfo.cs
mcs/class/System.ServiceModel.Web/Makefile
mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_4_x.csproj
mcs/class/System.ServiceModel/System.ServiceModel-net_4_x.csproj
mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_4_x.csproj
mcs/class/System.ServiceModel/System.ServiceModel.Description/ServiceEndpoint.cs
mcs/class/System.ServiceProcess/Assembly/AssemblyInfo.cs
mcs/class/System.ServiceProcess/Makefile
mcs/class/System.ServiceProcess/System.ServiceProcess-net_4_x.csproj
mcs/class/System.Threading.Tasks.Dataflow/Assembly/AssemblyInfo.cs
mcs/class/System.Threading.Tasks.Dataflow/Makefile
mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow-net_4_x.csproj
mcs/class/System.Transactions/Assembly/AssemblyInfo.cs
mcs/class/System.Transactions/Makefile
mcs/class/System.Transactions/System.Transactions-net_4_x.csproj
mcs/class/System.Web.Abstractions/Assembly/AssemblyInfo.cs
mcs/class/System.Web.Abstractions/Makefile
mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_4_x.csproj
mcs/class/System.Web.ApplicationServices/Assembly/AssemblyInfo.cs
mcs/class/System.Web.ApplicationServices/Makefile
mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_4_x.csproj
mcs/class/System.Web.DynamicData/Assembly/AssemblyInfo.cs
mcs/class/System.Web.DynamicData/Makefile
mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_4_x.csproj
mcs/class/System.Web.DynamicData/Test/Assembly/AssemblyInfo.cs
mcs/class/System.Web.Extensions.Design/Assembly/AssemblyInfo.cs
mcs/class/System.Web.Extensions.Design/Makefile
mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_4_x.csproj
mcs/class/System.Web.Extensions/Assembly/AssemblyInfo.cs
mcs/class/System.Web.Extensions/Makefile
mcs/class/System.Web.Extensions/System.Web.Extensions-net_4_x.csproj
mcs/class/System.Web.Http.SelfHost/System.Web.Http.SelfHost-net_4_x.csproj
mcs/class/System.Web.Http.WebHost/System.Web.Http.WebHost-net_4_x.csproj
mcs/class/System.Web.Http/Makefile
mcs/class/System.Web.Http/System.Web.Http-net_4_x.csproj
mcs/class/System.Web.Mobile/System.Web.Mobile-net_4_x.csproj
mcs/class/System.Web.Mvc3/Makefile
mcs/class/System.Web.Mvc3/System.Web.Mvc3-net_4_x.csproj
mcs/class/System.Web.Razor/Makefile
mcs/class/System.Web.Razor/System.Web.Razor-net_4_x.csproj
mcs/class/System.Web.RegularExpressions/System.Web.RegularExpressions-net_4_x.csproj
mcs/class/System.Web.Routing/Assembly/AssemblyInfo.cs
mcs/class/System.Web.Routing/Makefile
mcs/class/System.Web.Routing/System.Web.Routing-net_4_x.csproj
mcs/class/System.Web.Services/Assembly/AssemblyInfo.cs
mcs/class/System.Web.Services/Makefile
mcs/class/System.Web.Services/System.Web.Services-net_4_x.csproj
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHttpClientProtocol.cs
mcs/class/System.Web.Services/Test/System.Web.Services.Discovery/DiscoveryClientProtocolTest.cs
mcs/class/System.Web.WebPages.Deployment/Makefile
mcs/class/System.Web.WebPages.Deployment/System.Web.WebPages.Deployment-net_4_x.csproj
mcs/class/System.Web.WebPages.Razor/Makefile
mcs/class/System.Web.WebPages.Razor/System.Web.WebPages.Razor-net_4_x.csproj
mcs/class/System.Web.WebPages/Makefile
mcs/class/System.Web.WebPages/System.Web.WebPages-net_4_x.csproj
mcs/class/System.Web/Assembly/AssemblyInfo.cs
mcs/class/System.Web/Makefile
mcs/class/System.Web/System.Web-net_4_x.csproj
mcs/class/System.Web/System.Web-plainweb-net_4_x.csproj
mcs/class/System.Web/Test/standalone/ApplicationPreStartMethods/test_01/Makefile
mcs/class/System.Web/Test/standalone/ApplicationPreStartMethods/test_02/Makefile
mcs/class/System.Web/Test/standalone/ApplicationPreStartMethods/test_03/Makefile
mcs/class/System.Web/Test/standalone/ApplicationPreStartMethods/test_04/Makefile
mcs/class/System.Web/Test/standalone/ApplicationPreStartMethods/test_05/Makefile
mcs/class/System.Web/Test/standalone/ApplicationPreStartMethods/test_06/Makefile
mcs/class/System.Web/Test/standalone/ApplicationPreStartMethods/test_07/Makefile
mcs/class/System.Web/Test/standalone/ApplicationPreStartMethods/test_08/Makefile
mcs/class/System.Web/Test/standalone/EnableFormsAuthentication/Test_01/Makefile
mcs/class/System.Web/Test/standalone/EnableFormsAuthentication/Test_02/Makefile
mcs/class/System.Web/Test/standalone/EnableFormsAuthentication/Test_03/Makefile
mcs/class/System.Web/Test/standalone/EnableFormsAuthentication/Test_04/Makefile
mcs/class/System.Web/Test/standalone/EnableFormsAuthentication/Test_05/Makefile
mcs/class/System.Web/Test/standalone/EnableFormsAuthentication/Test_06/Makefile
mcs/class/System.Web/Test/standalone/EnableFormsAuthentication/Test_07/Makefile
mcs/class/System.Web/Test/standalone/EnableFormsAuthentication/Test_08/Makefile
mcs/class/System.Web/Test/standalone/EnableFormsAuthentication/Test_09/Makefile
mcs/class/System.Web/Test/standalone/PageParserDefaultTypeProperties/Makefile
mcs/class/System.Web/Test/standalone/RegisterBuildProvider/Makefile
mcs/class/System.Windows.Forms.DataVisualization/Assembly/AssemblyInfo.cs
mcs/class/System.Windows.Forms.DataVisualization/Makefile
mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization-net_4_x.csproj
mcs/class/System.Windows.Forms/Assembly/AssemblyInfo.cs
mcs/class/System.Windows.Forms/Makefile
mcs/class/System.Windows.Forms/System.Windows.Forms-net_4_x.csproj
mcs/class/System.Windows/AssemblyInfo.cs
mcs/class/System.Windows/Makefile
mcs/class/System.Windows/System.Windows-net_4_x.csproj
mcs/class/System.Workflow.Activities/System.Workflow.Activities-net_4_x.csproj
mcs/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel-net_4_x.csproj
mcs/class/System.Workflow.Runtime/System.Workflow.Runtime-net_4_x.csproj
mcs/class/System.XML/System.Xml-bare-net_4_x.csproj
mcs/class/System.XML/System.Xml-net_4_x.csproj
mcs/class/System.Xaml/System.Xaml-net_4_x.csproj
mcs/class/System.Xml.Linq/System.Xml.Linq-net_4_x.csproj
mcs/class/System.Xml.Serialization/AssemblyInfo.cs
mcs/class/System.Xml.Serialization/Makefile
mcs/class/System.Xml.Serialization/System.Xml.Serialization-net_4_x.csproj
mcs/class/System/Mono.AppleTls/AppleTlsContext.cs
mcs/class/System/Mono.Btls/X509CertificateImplBtls.cs
mcs/class/System/Mono.Net.Security/MonoTlsStream.cs
mcs/class/System/ReferenceSources/Win32Exception.cs
mcs/class/System/System-bare-net_4_x.csproj
mcs/class/System/System-net_4_x.csproj
mcs/class/System/System-secxml-net_4_x.csproj
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/System.Net/AuthenticationManager.cs
mcs/class/System/System.Net/Dns.cs
mcs/class/System/System.Net/EndPointManager.cs
mcs/class/System/System.Net/FtpWebRequest.cs
mcs/class/System/System.Net/HttpWebRequest.cs
mcs/class/System/Test/System.Net.Sockets/NetworkStreamCas.cs
mcs/class/System/Test/System.Net.Sockets/SocketCas.cs
mcs/class/System/Test/System.Net.Sockets/SocketTest.cs
mcs/class/System/Test/System.Net.Sockets/TcpClientCas.cs
mcs/class/System/Test/System.Net/HttpWebRequestTest.cs
mcs/class/System/Test/System.Net/ServicePointManagerTest.cs
mcs/class/System/Test/System.Net/ServicePointTest.cs
mcs/class/System/Test/System.Net/WebClientTest.cs
mcs/class/System/Test/System.Net/WebClientTestAsync.cs
mcs/class/System/Test/System.Security.Cryptography.X509Certificates/X509ChainTest.cs
mcs/class/SystemWebTestShim/Assembly/AssemblyInfo.cs
mcs/class/SystemWebTestShim/Makefile
mcs/class/SystemWebTestShim/SystemWebTestShim-net_4_x.csproj
mcs/class/WebMatrix.Data/Assembly/AssemblyInfo.cs
mcs/class/WebMatrix.Data/Makefile
mcs/class/WebMatrix.Data/WebMatrix.Data-net_4_x.csproj
mcs/class/WindowsBase/Assembly/AssemblyInfo.cs
mcs/class/WindowsBase/Makefile
mcs/class/WindowsBase/System.Windows.Converters/SizeValueSerializer.cs
mcs/class/WindowsBase/System.Windows.Media.Converters/MatrixValueSerializer.cs
mcs/class/WindowsBase/System.Windows.Media/Matrix.cs
mcs/class/WindowsBase/System.Windows.Media/MatrixConverter.cs
mcs/class/WindowsBase/System.Windows/Size.cs
mcs/class/WindowsBase/Test/System.Windows.Media/MatrixConverterTest.cs [new file with mode: 0644]
mcs/class/WindowsBase/Test/System.Windows.Media/MatrixTest.cs
mcs/class/WindowsBase/Test/System.Windows.Media/MatrixValueSerializerTest.cs [new file with mode: 0644]
mcs/class/WindowsBase/Test/System.Windows/SizeConverterTest.cs
mcs/class/WindowsBase/Test/System.Windows/SizeTest.cs
mcs/class/WindowsBase/Test/System.Windows/SizeValueSerializerTest.cs [new file with mode: 0644]
mcs/class/WindowsBase/WindowsBase-net_4_x.csproj
mcs/class/WindowsBase/WindowsBase_test.dll.sources
mcs/class/corlib/LinkerDescriptor/mscorlib.xml
mcs/class/corlib/Makefile
mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
mcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs
mcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs
mcs/class/corlib/System.Reflection.Emit/GenericTypeParameterBuilder.cs
mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
mcs/class/corlib/System/Delegate.cs
mcs/class/corlib/Test/System.Reflection.Emit/ConstructorBuilderTest.cs
mcs/class/corlib/Test/System.Reflection.Emit/EnumBuilderTest.cs
mcs/class/corlib/Test/System.Reflection.Emit/GenericTypeParameterBuilderTest.cs
mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs [new file with mode: 0644]
mcs/class/corlib/Test/System.Reflection.Emit/TypeBuilderTest.cs
mcs/class/corlib/Test/System/TypeTest.cs
mcs/class/corlib/corlib-net_4_x.csproj
mcs/class/corlib/corlib.dll.sources
mcs/class/corlib/corlib_test.dll.sources
mcs/class/corlib/corlib_xtest.dll.sources [new file with mode: 0644]
mcs/class/corlib/testing_aot_full_corlib_test.dll.exclude.sources
mcs/class/legacy/Mono.Cecil/legacy_Mono.Cecil-net_4_x.csproj
mcs/class/monodoc/Assembly/AssemblyInfo.cs
mcs/class/monodoc/Makefile
mcs/class/monodoc/monodoc-net_4_x.csproj
mcs/class/referencesource/mscorlib/system/collections/generic/list.cs
mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs
mcs/class/test-helpers/NetworkHelpers.cs
mcs/class/test-helpers/NunitHelpers.cs
mcs/errors/Makefile
mcs/errors/cs1525-23.cs
mcs/errors/cs1621-2.cs [new file with mode: 0644]
mcs/errors/cs1703-2.cs
mcs/errors/cs1703.cs [deleted file]
mcs/errors/dlls/first/CS1703-lib.cs [deleted file]
mcs/errors/dlls/second/CS1703-lib.cs [deleted file]
mcs/ilasm/ilasm-net_4_x.csproj
mcs/mcs/anonymous.cs
mcs/mcs/argument.cs
mcs/mcs/convert.cs
mcs/mcs/cs-parser.jay
mcs/mcs/ecore.cs
mcs/mcs/enum.cs
mcs/mcs/expression.cs
mcs/mcs/ikvm.cs
mcs/mcs/iterators.cs
mcs/mcs/mcs-net_4_x.csproj
mcs/mcs/pending.cs
mcs/nunit24/ClientUtilities/util/nunit.util-net_4_x.csproj
mcs/nunit24/ConsoleRunner/nunit-console-exe/nunit-console-net_4_x.csproj
mcs/nunit24/ConsoleRunner/nunit-console/nunit-console-runner-net_4_x.csproj
mcs/nunit24/NUnitCore/core/nunit.core-net_4_x.csproj
mcs/nunit24/NUnitCore/interfaces/nunit.core.interfaces-net_4_x.csproj
mcs/nunit24/NUnitExtensions/core/nunit.core.extensions-net_4_x.csproj
mcs/nunit24/NUnitExtensions/framework/nunit.framework.extensions-net_4_x.csproj
mcs/nunit24/NUnitFramework/framework/NUnit.Framework-net_4_x.csproj
mcs/nunit24/NUnitMocks/mocks/nunit.mocks-net_4_x.csproj
mcs/tests/test-947.cs [new file with mode: 0644]
mcs/tests/test-decl-expr-05.cs [new file with mode: 0644]
mcs/tests/test-expression-bodied-04.cs [new file with mode: 0644]
mcs/tests/test-pattern-08.cs [new file with mode: 0644]
mcs/tests/test-pattern-09.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_x.xml
mcs/tools/Makefile
mcs/tools/al/al-net_4_x.csproj
mcs/tools/browsercaps-updater/browsercaps-updater-net_4_x.csproj
mcs/tools/cccheck/cccheck-net_4_x.csproj
mcs/tools/ccrewrite/ccrewrite-net_4_x.csproj
mcs/tools/cil-strip/mono-cil-strip-net_4_x.csproj
mcs/tools/compiler-tester/compiler-tester-net_4_x.csproj
mcs/tools/corcompare/mono-api-info-net_4_x.csproj
mcs/tools/csharp/csharp-net_4_x.csproj
mcs/tools/csharp/csharp.csproj
mcs/tools/culevel/culevel-net_4_x.csproj
mcs/tools/disco/disco-net_4_x.csproj
mcs/tools/dtd2rng/dtd2rng-net_4_x.csproj
mcs/tools/dtd2xsd/dtd2xsd-net_4_x.csproj
mcs/tools/gacutil/gacutil-net_4_x.csproj
mcs/tools/genxs/genxs-net_4_x.csproj
mcs/tools/ictool/ictool-net_4_x.csproj
mcs/tools/ikdasm/ikdasm-net_4_x.csproj
mcs/tools/installutil/installutil-net_4_x.csproj
mcs/tools/installvst/installvst-net_4_x.csproj
mcs/tools/lc/lc-net_4_x.csproj
mcs/tools/linker-analyzer/linkeranalyzer-net_4_x.csproj
mcs/tools/linker/monolinker-net_4_x.csproj
mcs/tools/macpack/macpack-net_4_x.csproj
mcs/tools/mconfig/mconfig-net_4_x.csproj
mcs/tools/mdb2ppdb/mdb2ppdb-net_4_x.csproj
mcs/tools/mdbrebase/mdbrebase-net_4_x.csproj
mcs/tools/mdoc/Makefile
mcs/tools/mdoc/mdoc-net_4_x.csproj
mcs/tools/mkbundle/mkbundle-net_4_x.csproj
mcs/tools/mod/mod-net_4_x.csproj
mcs/tools/mono-api-html/MemberComparer.cs
mcs/tools/mono-api-html/mono-api-html-net_4_x.csproj
mcs/tools/mono-configuration-crypto/cli/mono-configuration-crypto-net_4_x.csproj
mcs/tools/mono-configuration-crypto/lib/Mono.Configuration.Crypto-net_4_x.csproj
mcs/tools/mono-service/mono-service-net_4_x.csproj
mcs/tools/mono-shlib-cop/mono-shlib-cop-net_4_x.csproj
mcs/tools/mono-symbolicate/Makefile
mcs/tools/mono-symbolicate/mono-symbolicate-net_4_x.csproj
mcs/tools/mono-xmltool/mono-xmltool-net_4_x.csproj
mcs/tools/mono-xsd/xsd-net_4_x.csproj
mcs/tools/monop/monop-net_4_x.csproj
mcs/tools/nunitreport/nunitreport-net_4_x.csproj
mcs/tools/pdb2mdb/pdb2mdb-net_4_x.csproj
mcs/tools/resgen/resgen-net_4_x.csproj
mcs/tools/sgen/sgen-net_4_x.csproj
mcs/tools/soapsuds/soapsuds-net_4_x.csproj
mcs/tools/sqlmetal/sqlmetal-net_4_x.csproj
mcs/tools/sqlsharp/sqlsharp-net_4_x.csproj
mcs/tools/svcutil/svcutil-net_4_x.csproj
mcs/tools/wsdl/wsdl-net_4_x.csproj
mcs/tools/xbuild/Makefile
mcs/tools/xbuild/xbuild_test.make
mono/Makefile.am
mono/btls/CMakeLists.txt
mono/btls/Makefile.am
mono/btls/create-object-library.sh [deleted file]
mono/dis/get.c
mono/eglib/.gitignore [new file with mode: 0644]
mono/eglib/Makefile.am [new file with mode: 0644]
mono/eglib/eglib-config.h.in [new file with mode: 0644]
mono/eglib/eglib-config.hw [new file with mode: 0644]
mono/eglib/eglib-remap.h [new file with mode: 0644]
mono/eglib/garray.c [new file with mode: 0644]
mono/eglib/gbytearray.c [new file with mode: 0644]
mono/eglib/gdate-unix.c [new file with mode: 0644]
mono/eglib/gdate-win32.c [new file with mode: 0644]
mono/eglib/gdir-unix.c [new file with mode: 0644]
mono/eglib/gdir-win32.c [new file with mode: 0644]
mono/eglib/gerror.c [new file with mode: 0644]
mono/eglib/gfile-posix.c [new file with mode: 0644]
mono/eglib/gfile-unix.c [new file with mode: 0644]
mono/eglib/gfile-win32.c [new file with mode: 0644]
mono/eglib/gfile.c [new file with mode: 0644]
mono/eglib/ghashtable.c [new file with mode: 0644]
mono/eglib/giconv.c [new file with mode: 0644]
mono/eglib/glib.h [new file with mode: 0644]
mono/eglib/glist.c [new file with mode: 0644]
mono/eglib/gmarkup.c [new file with mode: 0644]
mono/eglib/gmem.c [new file with mode: 0644]
mono/eglib/gmisc-unix.c [new file with mode: 0644]
mono/eglib/gmisc-win32-uwp.c [new file with mode: 0644]
mono/eglib/gmisc-win32.c [new file with mode: 0644]
mono/eglib/gmodule-unix.c [new file with mode: 0644]
mono/eglib/gmodule-win32-internals.h [new file with mode: 0644]
mono/eglib/gmodule-win32-uwp.c [new file with mode: 0644]
mono/eglib/gmodule-win32.c [new file with mode: 0644]
mono/eglib/gmodule.h [new file with mode: 0644]
mono/eglib/goutput.c [new file with mode: 0644]
mono/eglib/gpath.c [new file with mode: 0644]
mono/eglib/gpattern.c [new file with mode: 0644]
mono/eglib/gptrarray.c [new file with mode: 0644]
mono/eglib/gqsort.c [new file with mode: 0644]
mono/eglib/gqueue.c [new file with mode: 0644]
mono/eglib/gshell.c [new file with mode: 0644]
mono/eglib/gslist.c [new file with mode: 0644]
mono/eglib/gspawn.c [new file with mode: 0644]
mono/eglib/gstr.c [new file with mode: 0644]
mono/eglib/gstring.c [new file with mode: 0644]
mono/eglib/gtimer-unix.c [new file with mode: 0644]
mono/eglib/gtimer-win32.c [new file with mode: 0644]
mono/eglib/gunicode-win32-uwp.c [new file with mode: 0644]
mono/eglib/gunicode-win32.c [new file with mode: 0644]
mono/eglib/gunicode.c [new file with mode: 0644]
mono/eglib/gutf8.c [new file with mode: 0644]
mono/eglib/sort.frag.h [new file with mode: 0644]
mono/eglib/test/.gitignore [new file with mode: 0644]
mono/eglib/test/Makefile.am [new file with mode: 0644]
mono/eglib/test/README [new file with mode: 0644]
mono/eglib/test/UTF-16BE.txt [new file with mode: 0644]
mono/eglib/test/UTF-16LE.txt [new file with mode: 0644]
mono/eglib/test/UTF-32BE.txt [new file with mode: 0644]
mono/eglib/test/UTF-32LE.txt [new file with mode: 0644]
mono/eglib/test/UTF-8.txt [new file with mode: 0644]
mono/eglib/test/array.c [new file with mode: 0644]
mono/eglib/test/dir.c [new file with mode: 0644]
mono/eglib/test/driver.c [new file with mode: 0644]
mono/eglib/test/endian.c [new file with mode: 0644]
mono/eglib/test/fake.c [new file with mode: 0644]
mono/eglib/test/file.c [new file with mode: 0644]
mono/eglib/test/hashtable.c [new file with mode: 0644]
mono/eglib/test/list.c [new file with mode: 0644]
mono/eglib/test/markup.c [new file with mode: 0644]
mono/eglib/test/memory.c [new file with mode: 0644]
mono/eglib/test/module.c [new file with mode: 0644]
mono/eglib/test/path.c [new file with mode: 0644]
mono/eglib/test/pattern.c [new file with mode: 0644]
mono/eglib/test/ptrarray.c [new file with mode: 0644]
mono/eglib/test/queue.c [new file with mode: 0644]
mono/eglib/test/shell.c [new file with mode: 0644]
mono/eglib/test/sizes.c [new file with mode: 0644]
mono/eglib/test/slist.c [new file with mode: 0644]
mono/eglib/test/spawn.c [new file with mode: 0644]
mono/eglib/test/string-util.c [new file with mode: 0644]
mono/eglib/test/string.c [new file with mode: 0644]
mono/eglib/test/test-both [new file with mode: 0755]
mono/eglib/test/test.c [new file with mode: 0644]
mono/eglib/test/test.h [new file with mode: 0644]
mono/eglib/test/tests.h [new file with mode: 0644]
mono/eglib/test/timer.c [new file with mode: 0644]
mono/eglib/test/unicode.c [new file with mode: 0644]
mono/eglib/test/utf8.c [new file with mode: 0644]
mono/eglib/test/whats-implemented [new file with mode: 0755]
mono/eglib/unicode-data.h [new file with mode: 0644]
mono/metadata/Makefile.am
mono/metadata/appdomain.c
mono/metadata/assembly.c
mono/metadata/boehm-gc.c
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/cominterop.c
mono/metadata/cominterop.h
mono/metadata/custom-attrs.c
mono/metadata/domain.c
mono/metadata/dynamic-image-internals.h
mono/metadata/dynamic-image.c
mono/metadata/fdhandle.c [new file with mode: 0644]
mono/metadata/fdhandle.h [new file with mode: 0644]
mono/metadata/icall-def.h
mono/metadata/loader.c
mono/metadata/marshal.c
mono/metadata/mempool.c
mono/metadata/metadata-cross-helpers.c
mono/metadata/metadata.c
mono/metadata/mono-mlist.c
mono/metadata/object-internals.h
mono/metadata/object-offsets.h
mono/metadata/object.c
mono/metadata/profiler-events.h
mono/metadata/profiler-private.h
mono/metadata/profiler.c
mono/metadata/profiler.h
mono/metadata/reflection-cache.h
mono/metadata/reflection.c
mono/metadata/sgen-client-mono.h
mono/metadata/sre-encode.c
mono/metadata/sre-save.c
mono/metadata/sre.c
mono/metadata/threads-types.h
mono/metadata/threads.c
mono/metadata/w32error.h
mono/metadata/w32file-unix.c
mono/metadata/w32file.c
mono/metadata/w32handle.c
mono/metadata/w32handle.h
mono/metadata/w32process-unix.c
mono/metadata/w32socket-internals.h
mono/metadata/w32socket-unix.c
mono/metadata/w32socket-win32.c
mono/metadata/w32socket.c
mono/metadata/w32socket.h
mono/mini/Makefile.am.in
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/aot-tests.cs
mono/mini/builtin-types.cs [new file with mode: 0644]
mono/mini/cpu-amd64.md
mono/mini/cpu-arm.md
mono/mini/cpu-arm64.md
mono/mini/cpu-x86.md
mono/mini/debug-mini.c
mono/mini/debugger-agent.c
mono/mini/driver.c
mono/mini/iltests.il
mono/mini/image-writer.c
mono/mini/image-writer.h
mono/mini/interp/interp-internals.h
mono/mini/interp/interp.c
mono/mini/interp/mintops.def
mono/mini/interp/transform.c
mono/mini/jit.h
mono/mini/method-to-ir.c
mono/mini/mini-amd64.c
mono/mini/mini-amd64.h
mono/mini/mini-arm.c
mono/mini/mini-arm.h
mono/mini/mini-arm64.c
mono/mini/mini-arm64.h
mono/mini/mini-exceptions.c
mono/mini/mini-llvm-loaded.c
mono/mini/mini-llvm.c
mono/mini/mini-llvm.h
mono/mini/mini-mips.c
mono/mini/mini-native-types.c
mono/mini/mini-ops.h
mono/mini/mini-posix.c
mono/mini/mini-ppc.c
mono/mini/mini-ppc.h
mono/mini/mini-profiler.c [new file with mode: 0644]
mono/mini/mini-runtime.c
mono/mini/mini-s390x.c
mono/mini/mini-s390x.h
mono/mini/mini-sparc.c
mono/mini/mini-trampolines.c
mono/mini/mini-x86.c
mono/mini/mini-x86.h
mono/mini/mini.c
mono/mini/mini.h
mono/mini/simd-intrinsics.c
mono/mini/tramp-amd64.c
mono/mini/tramp-arm.c
mono/mini/tramp-arm64.c
mono/mini/tramp-s390x.c
mono/mini/tramp-x86.c
mono/mini/xdebug.c
mono/profiler/aot.c
mono/profiler/iomap.c
mono/profiler/log-args.c
mono/profiler/log.c
mono/profiler/log.h
mono/profiler/mprof-report.c
mono/profiler/ptestrunner.pl
mono/profiler/vtune.c
mono/sgen/sgen-array-list.c
mono/sgen/sgen-array-list.h
mono/sgen/sgen-gc.c
mono/sgen/sgen-gc.h
mono/sgen/sgen-marksweep.c
mono/sgen/sgen-protocol-def.h
mono/sgen/sgen-thread-pool.c
mono/sgen/sgen-thread-pool.h
mono/sgen/sgen-workers.c
mono/sgen/sgen-workers.h
mono/tests/Makefile.am
mono/tests/cominterop.cs
mono/tests/internalsvisibleto-2048.snk [new file with mode: 0644]
mono/tests/internalsvisibleto-compilertest.cs
mono/tests/internalsvisibleto-library.cs
mono/tests/internalsvisibleto-runtimetest.cs
mono/tests/libtest.c
mono/utils/Makefile.am
mono/utils/mono-compiler.h
mono/utils/mono-logger-internals.h
mono/utils/mono-proclib.h
mono/utils/mono-threads-linux.c
mono/utils/mono-threads-posix.c
mono/utils/unlocked.h [new file with mode: 0644]
msvc/eglib-common.targets
msvc/eglib-common.targets.filters
msvc/eglib-posix.targets
msvc/eglib-posix.targets.filters
msvc/eglib-win32.targets
msvc/eglib-win32.targets.filters
msvc/eglib.vcxproj
msvc/libmono-static.vcxproj
msvc/libmono-static.vcxproj.filters
msvc/libmonoruntime.vcxproj
msvc/libmonoruntime.vcxproj.filters
msvc/libmonoutils.vcxproj
msvc/libmonoutils.vcxproj.filters
msvc/mono-nunit-test.props
msvc/mono-profiler-vtune.def
msvc/mono.def
msvc/mono.props
msvc/monosgen.def
msvc/profiler-vtune.vcxproj
msvc/profiler-vtune.vcxproj.filters
msvc/scripts/csproj.tmpl
msvc/scripts/genproj.cs
msvc/test_eglib.vcxproj
msvc/test_eglib.vcxproj.filters
msvc/winsetup.bat
net_4_x.sln
packaging/MacSDK/fsharp.py
packaging/MacSDK/mono-llvm.py
packaging/MacSDK/mono.py
packaging/MacSDK/msbuild.py
packaging/MacSDK/patches/fsharp-Fix-mono-gac-location.patch [deleted file]
packaging/MacSDK/patches/fsharp-enable-jit-tracking-for-portable-pdb.patch [deleted file]
packaging/MacSDK/patches/fsharp-fix-xbuild-check.patch [deleted file]
packaging/MacSDK/sqlite.py
runtime/Makefile.am
samples/profiler/sample.c
samples/size/size.c
scripts/ci/clang-thread-sanitizer-blacklist [new file with mode: 0644]
scripts/ci/run-jenkins.sh
scripts/ci/run-test-default.sh
tools/nuget-hash-extractor/nuget-hash-extractor.cs
tools/offsets-tool/MonoAotOffsetsDumper.cs
tools/pedump/pedump.c
winconfig.h

index 827f2d9f7b2645189efa2616f847ddee285b1782..29241f71f455c9c081cb0360d0a64c0da4f9afff 100644 (file)
 # https://github.com/blog/2392-introducing-code-owners
 # https://help.github.com/articles/about-codeowners
 
-acceptance-tests/profiler-stress @alexrp
+acceptance-tests/* @akoeplinger
+acceptance-tests/profiler-stress* @alexrp
 docs/sources/mono-api-profiler.html @alexrp
+man @marek-safar @miguel
 man/mprof-report.1 @alexrp
+mcs/build @marek-safar
+mcs/class @marek-safar
+mcs/class/corlib/System.Reflection*/ @vargaz @lambdageek
+mcs/class/Mono.Btls.Interface @baulig
+mcs/class/Mono.Data.Tds @egorbo
+mcs/class/Mono.Debugger.Soft @vargaz
+mcs/class/Mono.Options @jonpryor
 mcs/class/Mono.Profiler.Log @alexrp
-mono/metadata/profiler* @alexrp
+mcs/class/Mono.Security/Mono.Security/Interface @baulig
+mcs/class/System/Mono.AppleTls @baulig
+mcs/class/System/Mono.Btls @baulig
+mcs/class/System/Mono.Net.Security @baulig
+mcs/class/System/Mono.Security.Interface @baulig
+mcs/class/System.Data @egorbo
+mcs/errors @marek-safar
+mcs/mcs @marek-safar
+mcs/tests @marek-safar
+mono/eglib @kumpera
+mono/metadata @vargaz
+mono/metadata/*profiler* @alexrp
+mono/metadata/monitor* @brzvlad
+mono/metadata/sgen* @brzvlad
+mono/metadata/threads* @luhenry @kumpera
+mono/metadata/threadpool* @luhenry
+mono/metadata/w32* @luhenry
+mono/mini @vargaz
+mono/mini/*cfgdump* @lewurm
+mono/mini/*exceptions* @lewurm
+mono/mini/*ppc* @lewurm
+mono/mini/*type-check* @lewurm
+mono/mini/interp/* @lewurm
+mono/mini/*profiler* @alexrp
 mono/profiler @alexrp
+mono/sgen @brzvlad
+mono/utils @kumpera
 mono/utils/atomic* @alexrp
 mono/utils/mono-hwcap* @alexrp
 mono/utils/mono-mem* @alexrp
+mono/utils/mono-threads* @luhenry @kumpera
 msvc/*profiler* @alexrp
+msvc/scripts @akoeplinger
+packaging/Windows @akoeplinger
 samples/profiler @alexrp
 samples/size @alexrp
+scripts @akoeplinger
+scripts/ci @akoeplinger
 scripts/ci/run-test-profiler-stress-tests.sh @alexrp
index ed8d6fe7cc5ac74d975dfc69afdd0d3de2abf69b..b767c969fb6c0c6bee4a89a3c422073624a62095 100644 (file)
@@ -23,7 +23,7 @@ License
 
 The Mono runtime, compilers, and tools and most of the class libraries
 are licensed under the MIT license. But include some bits of code
-licensed under different licenses. The exact list is [available here] (https://github.com/mono/mono/blob/master/LICENSE).
+licensed under different licenses. The exact list is [available here](https://github.com/mono/mono/blob/master/LICENSE).
 
 Different parts of Mono use different licenses.  The actual details of
 which licenses are used for which parts are detailed on the LICENSE
@@ -32,7 +32,7 @@ file in this directory.
 CLA
 =======
 
-Contributions are now taken under the [.NET Foundation CLA] (https://cla2.dotnetfoundation.org/). 
+Contributions are now taken under the [.NET Foundation CLA](https://cla2.dotnetfoundation.org/).
 
 Testing
 =======
index 031ef3a11684161955ad17c3367c1e7e7b676989..8cb099618a19551ee5e4f95c45d0f55e43db84ff 100644 (file)
@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4
 
 AM_CFLAGS = $(WERROR_CFLAGS)
 
-MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src mono
+MONOTOUCH_SUBDIRS = $(libgc_dir) mono
 
 # Some tools might not build when cross-compiling
 if CROSS_COMPILING
@@ -11,9 +11,9 @@ else
 tools_dir = tools
 endif
 
-SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) msvc $(docs_dir) acceptance-tests llvm
+SUBDIRS = po $(libgc_dir) mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) msvc $(docs_dir) acceptance-tests llvm
 # Keep in sync with SUBDIRS
-DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests llvm
+DIST_SUBDIRS = m4 po $(libgc_dir) mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests llvm
 
 all: update_submodules
 
index ff67772a1d47d4ca21296d27cbb66dfcd8162743..dd819d397cc5ef207667118474949f31e7498cbc 100644 (file)
@@ -9,5 +9,5 @@ SYS_REFS = \
 
 check-profiler-stress:
        @$(MAKE) validate-benchmarker RESET_VERSIONS=1
-       cd profiler-stress && $(MCS) -target:exe $(addprefix -r:, $(SYS_REFS)) -out:runner.exe @runner.exe.sources
+       cd profiler-stress && $(MCS) -debug -define:ARCH_$(arch_target) -target:exe $(addprefix -r:, $(SYS_REFS)) -out:runner.exe @runner.exe.sources
        cd profiler-stress && $(RUNTIME) runner.exe
index 302e43e639228c097c5a13eb74053c25662646b6..e5d44e68b4ac391c7ebd8a40d494e2ec202f56a1 100644 (file)
@@ -38,38 +38,65 @@ namespace Mono.Profiling.Tests.Stress {
                public ProcessStartInfo StartInfo { get; set; }
                public Stopwatch Stopwatch { get; set; } = new Stopwatch ();
                public int? ExitCode { get; set; }
-               public StringBuilder StandardOutput { get; set; } = new StringBuilder ();
-               public StringBuilder StandardError { get; set; } = new StringBuilder ();
+               public string StandardOutput { get; set; }
+               public string StandardError { get; set; }
        }
 
        static class Program {
 
                static readonly string[] _options = new [] {
-                       "domain",
-                       "assembly",
-                       "module",
-                       "class",
-                       "jit",
                        "exception",
-                       "gcalloc",
-                       "gc",
-                       "thread",
-                       // "calls", // Way too heavy.
                        "monitor",
+                       "gc",
+                       "gcalloc",
                        "gcmove",
                        "gcroot",
-                       "context",
+                       "gchandle",
                        "finalization",
                        "counter",
-                       "gchandle",
+                       "jit",
                };
 
-               static readonly TimeSpan _timeout = TimeSpan.FromHours (6);
+               static readonly TimeSpan _timeout = TimeSpan.FromHours (8);
+
+               static readonly Dictionary<string, Predicate<Benchmark>> _filters = new Dictionary<string, Predicate<Benchmark>> {
+                       { "ironjs-v8", FilterArmArchitecture },
+               };
+
+               static readonly Dictionary<string, Action<TestResult>> _processors = new Dictionary<string, Action<TestResult>> {
+                       { "msbiology", Process32BitOutOfMemory },
+               };
 
                static string FilterInvalidXmlChars (string text) {
                        return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
                }
 
+               static bool FilterArmArchitecture (Benchmark benchmark)
+               {
+#if ARCH_arm || ARCH_arm64
+                       return false;
+#else
+                       return true;
+#endif
+               }
+
+               static void Process32BitOutOfMemory (TestResult result)
+               {
+                       if (Environment.Is64BitProcess)
+                               return;
+
+                       if (result.ExitCode == null || result.ExitCode == 0)
+                               return;
+
+                       if (result.StandardError.Contains ("OutOfMemoryException"))
+                               result.ExitCode = 0;
+               }
+
+               static bool IsSupported (Benchmark benchmark)
+               {
+                       return _filters.TryGetValue (benchmark.Name, out var filter) ? filter (benchmark) : true;
+               }
+
                static int Main ()
                {
                        var depDir = Path.Combine ("..", "external", "benchmarker");
@@ -78,7 +105,7 @@ namespace Mono.Profiling.Tests.Stress {
 
                        var benchmarks = Directory.EnumerateFiles (benchDir, "*.benchmark")
                                         .Select (Benchmark.Load)
-                                        .Where (b => !b.OnlyExplicit && b.ClientCommandLine == null)
+                                        .Where (b => !b.OnlyExplicit && b.ClientCommandLine == null && IsSupported (b))
                                         .OrderBy (b => b.Name)
                                         .ToArray ();
 
@@ -96,7 +123,7 @@ namespace Mono.Profiling.Tests.Stress {
                                var bench = benchmarks [i];
 
                                var sampleFreq = rand.Next (-1000, 1001);
-                               var sampleMode = rand.Next (0, 2) == 1 ? "real" : "process";
+                               var sampleMode = rand.Next (0, 2) == 1 ? "-real" : string.Empty;
                                var maxSamples = rand.Next (0, cpus * 2000 + 1);
                                var heapShotFreq = rand.Next (-10, 11);
                                var maxFrames = rand.Next (0, 33);
@@ -107,7 +134,7 @@ namespace Mono.Profiling.Tests.Stress {
                                var profOptions = $"maxframes={maxFrames},{string.Join (",", options)},output=/dev/null";
 
                                if (sampleFreq > 0)
-                                       profOptions += $",sample={sampleFreq},sampling-{sampleMode},maxsamples={maxSamples}";
+                                       profOptions += $",sample{sampleMode}={sampleFreq},maxsamples={maxSamples}";
 
                                if (heapShotFreq > 0)
                                        profOptions += $",heapshot={heapShotFreq}gc";
@@ -138,14 +165,19 @@ namespace Mono.Profiling.Tests.Stress {
                                using (var proc = new Process ()) {
                                        proc.StartInfo = info;
 
+                                       var stdout = new StringBuilder ();
+                                       var stderr = new StringBuilder ();
+
                                        proc.OutputDataReceived += (sender, args) => {
                                                if (args.Data != null)
-                                                       result.StandardOutput.AppendLine (args.Data);
+                                                       lock (result)
+                                                               stdout.AppendLine (args.Data);
                                        };
 
                                        proc.ErrorDataReceived += (sender, args) => {
                                                if (args.Data != null)
-                                                       result.StandardError.AppendLine (args.Data);
+                                                       lock (result)
+                                                               stderr.AppendLine (args.Data);
                                        };
 
                                        result.Stopwatch.Start ();
@@ -168,6 +200,11 @@ namespace Mono.Profiling.Tests.Stress {
                                                result.ExitCode = proc.ExitCode;
 
                                        result.Stopwatch.Stop ();
+
+                                       lock (result) {
+                                               result.StandardOutput = stdout.ToString ();
+                                               result.StandardError = stderr.ToString ();
+                                       }
                                }
 
                                var resultStr = result.ExitCode == null ? "timed out" : $"exited with code: {result.ExitCode}";
@@ -181,15 +218,18 @@ namespace Mono.Profiling.Tests.Stress {
                                        Console.WriteLine ("===== stdout =====");
                                        Console.ResetColor ();
 
-                                       Console.WriteLine (result.StandardOutput.ToString ());
+                                       Console.WriteLine (result.StandardOutput);
 
                                        Console.ForegroundColor = ConsoleColor.Red;
                                        Console.WriteLine ("===== stderr =====");
                                        Console.ResetColor ();
 
-                                       Console.WriteLine (result.StandardError.ToString ());
+                                       Console.WriteLine (result.StandardError);
                                }
 
+                               if (_processors.TryGetValue (bench.Name, out var processor))
+                                       processor (result);
+
                                results.Add (result);
                        }
 
@@ -267,11 +307,11 @@ namespace Mono.Profiling.Tests.Stress {
                                                writer.WriteStartElement ("failure");
 
                                                writer.WriteStartElement ("message");
-                                               writer.WriteCData (FilterInvalidXmlChars (result.StandardOutput.ToString ()));
+                                               writer.WriteCData (FilterInvalidXmlChars (result.StandardOutput));
                                                writer.WriteEndElement ();
 
                                                writer.WriteStartElement ("stack-trace");
-                                               writer.WriteCData (FilterInvalidXmlChars (result.StandardError.ToString ()));
+                                               writer.WriteCData (FilterInvalidXmlChars (result.StandardError));
                                                writer.WriteEndElement ();
 
                                                writer.WriteEndElement ();
index 2fe9281e8dd4029b883d0512759afa962128e57b..7c58e0921502807146c2c3614fe797756a68b352 100755 (executable)
@@ -154,12 +154,6 @@ if test -d $srcdir/libgc; then
   echo Done running libgc/autogen.sh ...
 fi
 
-if test -d $srcdir/eglib; then
-  echo Running eglib/autogen.sh ...
-  (cd $srcdir/eglib ; NOCONFIGURE=1 ./autogen.sh "$@")
-  echo Done running eglib/autogen.sh ...
-fi
-
 if test x$MONO_EXTRA_CONFIGURE_FLAGS != x; then
        echo "MONO_EXTRA_CONFIGURE_FLAGS is $MONO_EXTRA_CONFIGURE_FLAGS"
 fi
index b14ee03463ca4ae4dee7aba63fe7d58846d91a2c..0abf9ebb4695b9b1866e7d92408c193b547d1518 100644 (file)
@@ -1,7 +1,7 @@
 # Process this file with autoconf to produce a configure script.
 #AC_PREREQ([2.62])
 
-AC_INIT(mono, [5.5.0],
+AC_INIT(mono, [5.7.0],
         [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
 
 AC_CONFIG_SRCDIR([README.md])
@@ -40,7 +40,7 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
 # This can be reset to 0 when Mono's version number is bumped
 # since it's part of the corlib version (the prefix '1' in the full
 # version number is to ensure the number isn't treated as octal in C)
-MONO_CORLIB_COUNTER=2
+MONO_CORLIB_COUNTER=0
 MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR $MONO_VERSION_BUILD $MONO_CORLIB_COUNTER`
 
 AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
@@ -67,8 +67,6 @@ libgc_configure_args=
 # libgc should inherit the original CFLAGS/CPPFLAGS passed to configure, i.e. -O0
 CPPFLAGS_FOR_LIBGC=$CPPFLAGS
 CFLAGS_FOR_LIBGC=$CFLAGS
-CPPFLAGS_FOR_EGLIB=$CPPFLAGS
-CFLAGS_FOR_EGLIB=$CFLAGS
 CPPFLAGS_FOR_BTLS=$CPPFLAGS
 CFLAGS_FOR_BTLS=$CFLAGS
 
@@ -323,8 +321,6 @@ case "$host" in
                                CCASFLAGS="$CCASFLAGS $BROKEN_DARWIN_FLAGS"
                                CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC $BROKEN_DARWIN_CPPFLAGS"
                                CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
-                               CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_CPPFLAGS"
-                               CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
                                with_sgen_default_concurrent=yes
                                ;;
                        x*64-*-darwin*)
@@ -571,7 +567,6 @@ if test x"$GCC" = xyes; then
                if test x"$disable_visibility_hidden" = xno; then
                   # Don't export any symbols by default
                   SHARED_CFLAGS="-fvisibility=hidden"
-                  CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB -fvisibility=hidden"
                   CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
                fi
 
@@ -691,6 +686,9 @@ AC_ARG_WITH(crosspkgdir, [  --with-crosspkgdir=/path/to/pkg-config/dir      Chan
        fi
 )
 
+AC_CHECK_PROG(ninja, ninja, yes, no)
+AM_CONDITIONAL(NINJA, test x$ninja != xno)
+
 AC_ARG_ENABLE(werror, [  --enable-werror Pass -Werror to the C compiler], werror_flag=$enableval, werror_flag=no)
 if test x$werror_flag = xyes; then
        WERROR_CFLAGS="-Werror"
@@ -698,11 +696,8 @@ fi
 AC_SUBST([WERROR_CFLAGS])
 AC_SUBST([SHARED_CFLAGS])
 
-ac_configure_args="$ac_configure_args \"CPPFLAGS_FOR_EGLIB=$EGLIB_CPPFLAGS\" \"CFLAGS_FOR_EGLIB=$CFLAGS_FOR_EGLIB\""
-AC_CONFIG_SUBDIRS(eglib)
-
-GLIB_CFLAGS='-I$(top_srcdir)/eglib/src -I$(top_builddir)/eglib/src'
-GLIB_LIBS='-L$(top_builddir)/eglib/src -leglib -lm'
+GLIB_CFLAGS='-I$(top_srcdir)/mono/eglib -I$(top_builddir)/mono/eglib'
+GLIB_LIBS='$(top_builddir)/mono/eglib/libeglib.la -lm'
   
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
@@ -791,7 +786,10 @@ if test $csc_compiler = default; then
    if test $endian = big; then
       csc_compiler=mcs
    elif test $endian = little; then
-      csc_compiler=roslyn
+      case "$host" in
+        powerpc*) csc_compiler=mcs ;;
+        *) csc_compiler=roslyn ;;
+      esac
    else
       csc_compiler=mcs
    fi
@@ -816,7 +814,7 @@ AC_ARG_WITH(orbis,               [  --with-orbis=yes,no                 If you w
 AC_ARG_WITH(unreal,              [  --with-unreal=yes,no                If you want to build the Unreal assemblies (defaults to no)], [], [with_unreal=default])
 
 
-AC_ARG_WITH(runtime_preset, [  --with-runtime_preset=net_4_x,all,aot,hybridaot,fullaot,bitcode   Which default profile to build (defaults to net_4_x)],  [], [with_runtime_preset=net_4_x])
+AC_ARG_WITH(runtime_preset, [  --with-runtime_preset=net_4_x,all,aot,hybridaot,fullaot,bitcode,unreal   Which default profile to build (defaults to net_4_x)],  [], [with_runtime_preset=net_4_x])
 
 dnl
 dnl Profile defaults
@@ -928,11 +926,11 @@ elif test x$with_runtime_preset = xorbis; then
 elif test x$with_runtime_preset = xunreal; then
    DISABLE_MCS_DOCS_default=yes
    with_unreal_default=yes
-   TEST_PROFILE=ounreal
+   TEST_PROFILE=unreal
 
    mono_feature_disable_com='yes'
    mono_feature_disable_remoting='yes'
-   mono_feature_disable_appdomains='yes'
+   mono_feature_disable_appdomains='no'
 
    AOT_BUILD_FLAGS="--runtime=mobile --aot=hybrid,$INVARIANT_AOT_OPTIONS"
    AOT_RUN_FLAGS="--runtime=mobile --hybrid-aot"
@@ -3517,6 +3515,7 @@ if test "x$target_mach" = "xyes"; then
           CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
           CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS"
           BTLS_SUPPORTED=no
+                 target_ios=yes
        ])
        fi
    AC_DEFINE(TARGET_MACH,1,[The JIT/AOT targets Apple platforms])
@@ -3532,6 +3531,8 @@ else
    AC_DEFINE(SIZEOF_REGISTER,SIZEOF_VOID_P,[size of machine integer registers])
 fi
 
+AC_SUBST(SIZEOF_VOID_P,[$ac_cv_sizeof_void_p])
+
 if test "x$target_byte_order" = "xG_BIG_ENDIAN"; then
    AC_DEFINE(TARGET_BYTE_ORDER,G_BIG_ENDIAN,[byte order of target])
 elif test "x$target_byte_order" = "xG_LITTLE_ENDIAN"; then
@@ -3639,9 +3640,182 @@ case "$host" in
        ;;
 esac
 
-
 AC_SUBST(libsuffix)
 
+######################################
+# EGLIB CHECKS
+######################################
+
+GNUC_PRETTY=
+GNUC_UNUSED=
+BREAKPOINT="G_STMT_START { raise (SIGTRAP); } G_STMT_END"
+if test x$GCC = xyes; then
+   GNUC_UNUSED='__attribute__((__unused__))'
+   GNUC_NORETURN='__attribute__((__noreturn__))'
+   case $host_cpu in
+     i*86|x86_64) BREAKPOINT="G_STMT_START { __asm__ (\"int \$03\"); } G_STMT_END" ;;
+   esac
+fi
+AC_SUBST(GNUC_PRETTY)
+AC_SUBST(GNUC_UNUSED)
+AC_SUBST(GNUC_NORETURN)
+AC_SUBST(BREAKPOINT)
+
+AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
+
+case $host in
+*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
+    PATHSEP='\\'
+    SEARCHSEP=';'
+    OS="WIN32"
+    PIDTYPE='void *'
+    ;;
+*)
+    PATHSEP='/'
+    SEARCHSEP=':'
+    OS="UNIX"
+    PIDTYPE='int'
+    ;;
+esac
+
+case $host in
+       *-*-solaris*)
+       CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
+       ;;
+esac
+
+case $target in
+arm*-darwin*|aarch64*-*)
+    CFLAGS="$CFLAGS -U_FORTIFY_SOURCE"
+    ;;
+i*86-*-darwin*)
+    ORDER=G_LITTLE_ENDIAN
+    ;;
+*-*-haiku*)
+    LDFLAGS="$LDFLAGS -ltextencoding"
+    ;;
+*-*-openbsd*)
+    CFLAGS="$CFLAGS -pthread"
+    LDFLAGS="$LDFLAGS -pthread"
+    ;;
+esac
+
+AC_SUBST(ORDER)
+AC_SUBST(CFLAGS)
+AC_SUBST(PATHSEP)
+AC_SUBST(SEARCHSEP)
+AC_SUBST(OS)
+AC_SUBST(PIDTYPE)
+
+# Defined for all targets/platforms using classic Windows API support.
+AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
+AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
+
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf strerror_r)
+AC_CHECK_FUNCS(getrlimit)
+AC_CHECK_FUNCS(fork execv execve)
+
+AC_ARG_WITH([overridable-allocators], [  --with-overridable-allocators allow g_*alloc/g_free to call custom allocators set via g_mem_set_vtable])
+
+if test x$with_overridable_allocators = xyes; then
+       AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
+  AC_MSG_NOTICE([Overridable allocator support enabled])
+else
+  AC_MSG_NOTICE([Overridable allocator support disabled])
+fi
+
+#
+# Mono currently supports 10.6, but strndup is not available prior to 10.7; avoiding
+# the detection of strndup on OS X so Mono built on 10.7+ still runs on 10.6. This can be
+# removed once support for 10.6 is dropped.
+#
+# iOS detection of strndup and getpwuid_r is faulty for some reason so let's simply avoid it
+#
+if test x$target_osx = xyes; then
+AC_CHECK_FUNCS(getpwuid_r)
+elif test x$target_ios = xno; then
+AC_CHECK_FUNCS(strndup getpwuid_r)
+fi
+
+AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
+AM_ICONV()
+AC_SEARCH_LIBS(sqrtf, m)
+
+# nanosleep may not be part of libc, also search it in other libraries
+AC_SEARCH_LIBS(nanosleep, rt)
+
+AC_SEARCH_LIBS(dlopen, dl)
+old_ldflags="${LDFLAGS}"
+LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
+AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
+if test $found_export_dynamic = no; then
+       LDFLAGS="${old_ldflags}"
+fi
+
+AC_MSG_CHECKING(for varargs macros)
+AC_TRY_COMPILE([],[
+int foo (int i, int j);
+#define bar(...) foo (1, __VA_ARGS__)
+void main () {
+        bar (2);
+}
+],have_iso_varargs=yes,have_iso_varargs=no)
+AC_MSG_RESULT($have_iso_varargs)
+G_HAVE_ISO_VARARGS=0
+if test "x$have_iso_varargs" = "xyes"; then
+   G_HAVE_ISO_VARARGS=1
+fi
+AC_SUBST(G_HAVE_ISO_VARARGS)
+
+AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h iconv.h localcharset.h sys/types.h sys/resource.h)
+AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+="-liconv -lcharset"])])
+AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
+AC_SUBST(HAVE_ALLOCA_H)
+
+if test $ac_cv_sizeof_void_p = $ac_cv_sizeof_int; then
+   GPOINTER_TO_INT="((gint) (ptr))"
+   GPOINTER_TO_UINT="((guint) (ptr))"
+   GINT_TO_POINTER="((gpointer) (v))"
+   GUINT_TO_POINTER="((gpointer) (v))"
+   GSIZE="int"
+   GSIZE_FORMAT='"u"'
+elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long; then
+   GPOINTER_TO_INT="((gint)(long) (ptr))"
+   GPOINTER_TO_UINT="((guint)(long) (ptr))"
+   GINT_TO_POINTER="((gpointer)(glong) (v))"
+   GUINT_TO_POINTER="((gpointer)(gulong) (v))"
+   GSIZE="long"
+   GSIZE_FORMAT='"lu"'
+elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long_long; then
+   GPOINTER_TO_INT="((gint)(long long) (ptr))"
+   GPOINTER_TO_UINT="((guint)(unsigned long long) (ptr))"
+   GINT_TO_POINTER="((gpointer)(long long) (v))"
+   GUINT_TO_POINTER="((gpointer)(unsigned long long) (v))"
+   GSIZE="long long"
+   GSIZE_FORMAT='"I64u"'
+else
+   AC_MSG_ERROR([unsupported pointer size])
+fi
+
+AC_SUBST(GPOINTER_TO_INT)
+AC_SUBST(GPOINTER_TO_UINT)
+AC_SUBST(GINT_TO_POINTER)
+AC_SUBST(GUINT_TO_POINTER)
+AC_SUBST(GSIZE)
+AC_SUBST(GSIZE_FORMAT)
+AC_SUBST(G_GUINT64_FORMAT)
+AC_SUBST(G_GINT64_FORMAT)
+AC_SUBST(G_GUINT32_FORMAT)
+AC_SUBST(G_GINT32_FORMAT)
+
+#
+# END OF EGLIB CHECKS
+#
+
 AC_ARG_WITH([libgdiplus],
        [  --with-libgdiplus=installed|sibling|<path>   Override the libgdiplus used for System.Drawing tests (defaults to installed)],
        [], [with_libgdiplus=installed])
@@ -4156,7 +4330,7 @@ AC_SUBST(mono_build_root)
 mono_runtime=mono/mini/mono
 AC_SUBST(mono_runtime)
 
-CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.0/tools/csc.exe
+CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.1/tools/csc.exe
 
 if test $csc_compiler = mcs; then
   CSC=$mcs_topdir/class/lib/build/mcs.exe
@@ -4373,6 +4547,8 @@ mono/unit-tests/Makefile
 mono/benchmark/Makefile
 mono/mini/Makefile
 mono/profiler/Makefile
+mono/eglib/Makefile
+mono/eglib/eglib-config.h
 m4/Makefile
 ikvm-native/Makefile
 scripts/Makefile
diff --git a/eglib/.gitignore b/eglib/.gitignore
deleted file mode 100644 (file)
index 61e1af8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/
-/depcomp
-/config.guess
-/config.sub
-/ltmain.sh
-/eglib-*.tar.gz
-/missing
-/install-sh
-/compile
-/Makefile
-/Makefile.in
-/stamp-h1
-/config.h.in
-/libtool
-/autom4te.cache
-/aclocal.m4
-/config.log
-/configure
-/config.h
-/config.status
-/INSTALL
-dolt*
diff --git a/eglib/AUTHORS b/eglib/AUTHORS
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/eglib/COPYING b/eglib/COPYING
deleted file mode 100644 (file)
index 1bb5a44..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
diff --git a/eglib/Makefile.am b/eglib/Makefile.am
deleted file mode 100644 (file)
index c112172..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-ACLOCAL_AMFLAGS = -I m4
-
-AM_CFLAGS = $(WERROR_CFLAGS)
-
-if HOST_WIN32
-SUBDIRS = m4 src
-else
-if PLATFORM_DARWIN
-SUBDIRS = m4 src
-else
-if CROSS_COMPILING
-SUBDIRS = m4 src
-else
-SUBDIRS = m4 src test
-endif
-endif
-endif
-
-EXTRA_DIST = autogen.sh README NEWS AUTHORS winconfig.h
diff --git a/eglib/NEWS b/eglib/NEWS
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/eglib/README b/eglib/README
deleted file mode 100644 (file)
index eea89f5..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-
-The purpose of eglib is to be an X11-licensed subset of glib that can
-be used with Mono when the Mono runtime is explicitly relicensed under
-a different license by Novell.
-
-The implementation is done from the public documentation available here:
-
-    http://developer.gnome.org/doc/API/2.0/glib/
-
-Currently this is only being built standalone, use:
-
-         ./autogen.sh --prefix=/tmp/test
-
-Currently all the definitions go into a single file: glib.h, there are 
-no separate files, please try to follow the convetions in the source code
-
-* Tests
-       
-       Please read the README in tests/
-
-* Features
-
-       The source code is designed to allow for different operating
-       system builds of the eglib code.
-
-       Files in src that:
-
-         * Have a plain name: are cross platform, and should work on
-           every operating system.
-
-         * That end in -unix.c: These files contain Unix specific code.
-
-         * That end in -win32.c: These files contain Win32 specific code.
-
-         * That end in -posix.c: Will work on both Windows and Unix,
-            but should not be included for other operating systems. 
-
-* Plans: short and long term.
-
-       The short term plans for eglib is to allow Mono to optionally
-       build with it instead of using glib, gmodule and gthread, but
-       the default build will continue to be done against glib 2.0.
-
-       In the long-term we are considering dropping glib as a
-       dependency, considering that Mono requires a modern Unix
-       system to run anyways (for its thread support) it would allow
-       us to fix some of the glib API limitations we have to live
-       with (explicit thread support for example), rework the API to
-       use types from stdint.h and we would be able to drop three
-       external shared libraries.
-
-       This would reduce memory usage for the handful of routines
-       that we use from glib, dynamic linker overhead for those and
-       would allow us to tune the implementation to Mono's needs. 
diff --git a/eglib/TODO b/eglib/TODO
deleted file mode 100644 (file)
index bbbb49b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-* Missing code
-
-       * Process launching
-             3 g_shell_quote
-             1 g_shell_unquote
-
----------------------------------------------------------------------- 
-
-* Should implement, for better performance:
-Macros:
-      6 G_UNLIKELY
-      4 G_LIKELY
-
-* Unimplemented, not supported currently:
-
-       (none as yet.)
-
-* Dead Code
-
-       The GMainLoop code was no longer in use in Mono.
-
-* Windows implementations needed
-
-  Directory, File manipulation:
-
-       g_dir_open, g_dir_close, g_dir_read_name
-
-  We're missing a native windows implementation. The unix one is in place.
-
-     * Information retrieval
-      1 g_win32_getlocale
-       
diff --git a/eglib/acinclude.m4 b/eglib/acinclude.m4
deleted file mode 100644 (file)
index bbc2781..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-dnl dolt, a replacement for libtool
-dnl Copyright © 2007-2008 Josh Triplett <josh@freedesktop.org>
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-dnl
-dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
-dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
-dnl installed when running autoconf on your project.
-
-AC_DEFUN([DOLT], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-# dolt, a replacement for libtool
-# Josh Triplett <josh@freedesktop.org>
-AC_PATH_PROG(DOLT_BASH, bash)
-AC_MSG_CHECKING([if dolt supports this host])
-dolt_supported=yes
-if test x$DOLT_BASH = x; then
-    dolt_supported=no
-fi
-if test x$GCC != xyes; then
-    dolt_supported=no
-fi
-case $host in
-i?86-*-linux*|i?86-apple-darwin*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-linux* \
-|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*|x86_64-apple-darwin*|aarch64*)
-    pic_options='-fPIC'
-    ;;
-?86-pc-cygwin*|i?86-pc-cygwin*|i?86-pc-mingw32*)
-    pic_options='-DDLL_EXPORT'
-    ;;
-i?86-apple-darwin*|arm-apple-darwin*)
-    pic_options='-fno-common'
-    ;;
-*)
-    dolt_supported=no
-    ;;
-esac
-if test x$dolt_supported = xno ; then
-    AC_MSG_RESULT([no, falling back to libtool])
-    LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
-    LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
-else
-    AC_MSG_RESULT([yes, replacing libtool])
-
-dnl Start writing out doltcompile.
-    cat <<__DOLTCOMPILE__EOF__ >doltcompile
-#!$DOLT_BASH
-__DOLTCOMPILE__EOF__
-    cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-args=("$[]@")
-for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
-    if test x"${args@<:@$arg@:>@}" = x-o ; then
-        objarg=$((arg+1))
-        break
-    fi
-done
-if test x$objarg = x ; then
-    echo 'Error: no -o on compiler command line' 1>&2
-    exit 1
-fi
-lo="${args@<:@$objarg@:>@}"
-obj="${lo%.lo}"
-if test x"$lo" = x"$obj" ; then
-    echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
-    exit 1
-fi
-objbase="${obj##*/}"
-__DOLTCOMPILE__EOF__
-
-dnl Write out shared compilation code.
-    if test x$enable_shared = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-libobjdir="${obj%$objbase}.libs"
-if test ! -d "$libobjdir" ; then
-    mkdir_out="$(mkdir "$libobjdir" 2>&1)"
-    mkdir_ret=$?
-    if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
-       echo "$mkdir_out" 1>&2
-        exit $mkdir_ret
-    fi
-fi
-pic_object="$libobjdir/$objbase.o"
-args@<:@$objarg@:>@="$pic_object"
-__DOLTCOMPILE__EOF__
-    cat <<__DOLTCOMPILE__EOF__ >>doltcompile
-"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
-__DOLTCOMPILE__EOF__
-    fi
-
-dnl Write out static compilation code.
-dnl Avoid duplicate compiler output if also building shared objects.
-    if test x$enable_static = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-non_pic_object="$obj.o"
-args@<:@$objarg@:>@="$non_pic_object"
-__DOLTCOMPILE__EOF__
-        if test x$enable_shared = xyes; then
-            cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
-__DOLTCOMPILE__EOF__
-        else
-            cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-"${args@<:@@@:>@}" || exit $?
-__DOLTCOMPILE__EOF__
-        fi
-    fi
-
-dnl Write out the code to write the .lo file.
-dnl The second line of the .lo file must match "^# Generated by .*libtool"
-    cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-{
-echo "# $lo - a libtool object file"
-echo "# Generated by doltcompile, not libtool"
-__DOLTCOMPILE__EOF__
-
-    if test x$enable_shared = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo "pic_object='.libs/${objbase}.o'"
-__DOLTCOMPILE__EOF__
-    else
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo pic_object=none
-__DOLTCOMPILE__EOF__
-    fi
-
-    if test x$enable_static = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo "non_pic_object='${objbase}.o'"
-__DOLTCOMPILE__EOF__
-    else
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo non_pic_object=none
-__DOLTCOMPILE__EOF__
-    fi
-
-    cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-} > "$lo"
-__DOLTCOMPILE__EOF__
-
-dnl Done writing out doltcompile; substitute it for libtool compilation.
-    chmod +x doltcompile
-    LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
-    LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
-
-dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
-dnl a target, so write out a libtool wrapper to handle that case.
-dnl Note that doltlibtool does not handle inferred tags or option arguments
-dnl without '=', because automake does not use them.
-    cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
-#!$DOLT_BASH
-__DOLTLIBTOOL__EOF__
-    cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
-top_builddir_slash="${0%%doltlibtool}"
-: ${top_builddir_slash:=./}
-args=()
-modeok=false
-tagok=false
-for arg in "$[]@"; do
-    case "$arg" in
-        --silent) ;;
-        --mode=compile) modeok=true ;;
-        --tag=CC|--tag=CXX) tagok=true ;;
-        --quiet) ;;
-        *) args@<:@${#args[@]}@:>@="$arg" ;;
-    esac
-done
-if $modeok && $tagok ; then
-    . ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
-else
-    exec ${top_builddir_slash}libtool "$[]@"
-fi
-__DOLTLIBTOOL__EOF__
-
-dnl Done writing out doltlibtool; substitute it for libtool.
-    chmod +x doltlibtool
-    LIBTOOL='$(top_builddir)/doltlibtool'
-fi
-AC_SUBST(LTCOMPILE)
-AC_SUBST(LTCXXCOMPILE)
-# end dolt
-])
diff --git a/eglib/autogen.sh b/eglib/autogen.sh
deleted file mode 100755 (executable)
index 01c2aca..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-# Ripped off from GNOME macros version
-
-DIE=0
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-if [ -n "$MONO_PATH" ]; then
-       # from -> /mono/lib:/another/mono/lib
-       # to -> /mono /another/mono
-       for i in `echo ${MONO_PATH} | tr ":" " "`; do
-               i=`dirname ${i}`
-               if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
-                       ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
-               fi
-               if [ -n "{i}" -a -d "${i}/bin" ]; then
-                       PATH="${i}/bin:$PATH"
-               fi
-       done
-       export PATH
-fi
-
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
-  echo
-  echo "**Error**: You must have \`autoconf' installed to compile Mono."
-  echo "Download the appropriate package for your distribution,"
-  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
-  DIE=1
-}
-
-if [ -z "$LIBTOOLIZE" ]; then
-  LIBTOOLIZE=`which glibtoolize 2>/dev/null`
-  if [ ! -x "$LIBTOOLIZE" ]; then
-    LIBTOOLIZE=`which libtoolize`
-  fi
-fi
-
-(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
-  ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
-    echo
-    echo "**Error**: You must have \`libtoolize' installed to compile Mono."
-    echo "Get ftp://ftp.gnu.org/gnu/libtool/libtool-1.2.tar.gz"
-    echo "(or a newer version if it is available)"
-    DIE=1
-  }
-}
-
-grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && {
-  grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
-  (gettext --version) < /dev/null > /dev/null 2>&1 || {
-    echo
-    echo "**Error**: You must have \`gettext' installed to compile Mono."
-    echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
-    echo "(or a newer version if it is available)"
-    DIE=1
-  }
-}
-
-(automake --version) < /dev/null > /dev/null 2>&1 || {
-  echo
-  echo "**Error**: You must have \`automake' installed to compile Mono."
-  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
-  echo "(or a newer version if it is available)"
-  DIE=1
-  NO_AUTOMAKE=yes
-}
-
-
-# if no automake, don't bother testing for aclocal
-test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
-  echo
-  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
-  echo "installed doesn't appear recent enough."
-  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
-  echo "(or a newer version if it is available)"
-  DIE=1
-}
-
-if test "$DIE" -eq 1; then
-  exit 1
-fi
-
-if test x$NOCONFIGURE = x && test -z "$*"; then
-  echo "**Warning**: I am going to run \`configure' with no arguments."
-  echo "If you wish to pass any to it, please specify them on the"
-  echo \`$0\'" command line."
-  echo
-fi
-
-case $CC in
-xlc )
-  am_opt=--include-deps;;
-esac
-
-
-if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
-  if test -z "$NO_LIBTOOLIZE" ; then 
-    echo "Running libtoolize..."
-    $LIBTOOLIZE --force --copy
-  fi
-fi
-
-echo "Running aclocal -I m4 $ACLOCAL_FLAGS ..."
-aclocal -I m4 $ACLOCAL_FLAGS || {
-  echo
-  echo "**Error**: aclocal failed. This may mean that you have not"
-  echo "installed all of the packages you need, or you may need to"
-  echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
-  echo "for the prefix where you installed the packages whose"
-  echo "macros were not found"
-  exit 1
-}
-
-if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
-  echo "Running autoheader..."
-  autoheader || { echo "**Error**: autoheader failed."; exit 1; }
-fi
-
-echo "Running automake --gnu $am_opt ..."
-automake --add-missing --gnu $am_opt ||
-  { echo "**Error**: automake failed."; exit 1; }
-echo "Running autoconf ..."
-autoconf || { echo "**Error**: autoconf failed."; exit 1; }
-
-
-conf_flags="--enable-maintainer-mode" #--enable-compile-warnings --enable-iso-c
-
-if test x$NOCONFIGURE = x; then
-  echo Running $srcdir/configure $conf_flags "$@" ...
-  $srcdir/configure $conf_flags "$@" \
-  && echo Now type \`make\' to compile $PKG_NAME || exit 1
-else
-  echo Skipping configure process.
-fi
diff --git a/eglib/config.rpath b/eglib/config.rpath
deleted file mode 100755 (executable)
index 17298f2..0000000
+++ /dev/null
@@ -1,672 +0,0 @@
-#! /bin/sh
-# Output a system dependent set of variables, describing how to set the
-# run time search path of shared libraries in an executable.
-#
-#   Copyright 1996-2010 Free Software Foundation, Inc.
-#   Taken from GNU libtool, 2001
-#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-#   This file is free software; the Free Software Foundation gives
-#   unlimited permission to copy and/or distribute it, with or without
-#   modifications, as long as this notice is preserved.
-#
-# The first argument passed to this file is the canonical host specification,
-#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or
-#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
-# should be set by the caller.
-#
-# The set of defined variables is at the end of this script.
-
-# Known limitations:
-# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
-#   than 256 bytes, otherwise the compiler driver will dump core. The only
-#   known workaround is to choose shorter directory names for the build
-#   directory and/or the installation directory.
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-shrext=.so
-
-host="$1"
-host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-# Code taken from libtool.m4's _LT_CC_BASENAME.
-
-for cc_temp in $CC""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
-
-# Code taken from libtool.m4's _LT_COMPILER_PIC.
-
-wl=
-if test "$GCC" = yes; then
-  wl='-Wl,'
-else
-  case "$host_os" in
-    aix*)
-      wl='-Wl,'
-      ;;
-    darwin*)
-      case $cc_basename in
-        xlc*)
-          wl='-Wl,'
-          ;;
-      esac
-      ;;
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      ;;
-    hpux9* | hpux10* | hpux11*)
-      wl='-Wl,'
-      ;;
-    irix5* | irix6* | nonstopux*)
-      wl='-Wl,'
-      ;;
-    newsos6)
-      ;;
-    linux* | k*bsd*-gnu)
-      case $cc_basename in
-        ecc*)
-          wl='-Wl,'
-          ;;
-        icc* | ifort*)
-          wl='-Wl,'
-          ;;
-        lf95*)
-          wl='-Wl,'
-          ;;
-        pgcc | pgf77 | pgf90)
-          wl='-Wl,'
-          ;;
-        ccc*)
-          wl='-Wl,'
-          ;;
-        como)
-          wl='-lopt='
-          ;;
-        *)
-          case `$CC -V 2>&1 | sed 5q` in
-            *Sun\ C*)
-              wl='-Wl,'
-              ;;
-          esac
-          ;;
-      esac
-      ;;
-    osf3* | osf4* | osf5*)
-      wl='-Wl,'
-      ;;
-    rdos*)
-      ;;
-    solaris*)
-      wl='-Wl,'
-      ;;
-    sunos4*)
-      wl='-Qoption ld '
-      ;;
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      wl='-Wl,'
-      ;;
-    sysv4*MP*)
-      ;;
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      wl='-Wl,'
-      ;;
-    unicos*)
-      wl='-Wl,'
-      ;;
-    uts4*)
-      ;;
-  esac
-fi
-
-# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
-
-hardcode_libdir_flag_spec=
-hardcode_libdir_separator=
-hardcode_direct=no
-hardcode_minus_L=no
-
-case "$host_os" in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-esac
-
-ld_shlibs=yes
-if test "$with_gnu_ld" = yes; then
-  # Set some defaults for GNU ld with shared library support. These
-  # are reset later if shared libraries are not supported. Putting them
-  # here allows them to be overridden if necessary.
-  # Unlike libtool, we use -rpath here, not --rpath, since the documented
-  # option of GNU ld is called -rpath, not --rpath.
-  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-  case "$host_os" in
-    aix[3-9]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-        ld_shlibs=no
-      fi
-      ;;
-    amigaos*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we cannot use
-      # them.
-      ld_shlibs=no
-      ;;
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        :
-      else
-        ld_shlibs=no
-      fi
-      ;;
-    cygwin* | mingw* | pw32* | cegcc*)
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec='-L$libdir'
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        :
-      else
-        ld_shlibs=no
-      fi
-      ;;
-    interix[3-9]*)
-      hardcode_direct=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      ;;
-    gnu* | linux* | k*bsd*-gnu)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        :
-      else
-        ld_shlibs=no
-      fi
-      ;;
-    netbsd*)
-      ;;
-    solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-        ld_shlibs=no
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        :
-      else
-        ld_shlibs=no
-      fi
-      ;;
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-          ld_shlibs=no
-          ;;
-        *)
-          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-          else
-            ld_shlibs=no
-          fi
-          ;;
-      esac
-      ;;
-    sunos4*)
-      hardcode_direct=yes
-      ;;
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        :
-      else
-        ld_shlibs=no
-      fi
-      ;;
-  esac
-  if test "$ld_shlibs" = no; then
-    hardcode_libdir_flag_spec=
-  fi
-else
-  case "$host_os" in
-    aix3*)
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L=yes
-      if test "$GCC" = yes; then
-        # Neither direct hardcoding nor static linking is supported with a
-        # broken collect2.
-        hardcode_direct=unsupported
-      fi
-      ;;
-    aix[4-9]*)
-      if test "$host_cpu" = ia64; then
-        # On IA64, the linker does run time linking by default, so we don't
-        # have to do anything special.
-        aix_use_runtimelinking=no
-      else
-        aix_use_runtimelinking=no
-        # Test if we are trying to use run time linking or normal
-        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-        # need to do runtime linking.
-        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-          for ld_flag in $LDFLAGS; do
-            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-              aix_use_runtimelinking=yes
-              break
-            fi
-          done
-          ;;
-        esac
-      fi
-      hardcode_direct=yes
-      hardcode_libdir_separator=':'
-      if test "$GCC" = yes; then
-        case $host_os in aix4.[012]|aix4.[012].*)
-          collect2name=`${CC} -print-prog-name=collect2`
-          if test -f "$collect2name" && \
-            strings "$collect2name" | grep resolve_lib_name >/dev/null
-          then
-            # We have reworked collect2
-            :
-          else
-            # We have old collect2
-            hardcode_direct=unsupported
-            hardcode_minus_L=yes
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_libdir_separator=
-          fi
-          ;;
-        esac
-      fi
-      # Begin _LT_AC_SYS_LIBPATH_AIX.
-      echo 'int main () { return 0; }' > conftest.c
-      ${CC} ${LDFLAGS} conftest.c -o conftest
-      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-      if test -z "$aix_libpath"; then
-        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-      fi
-      if test -z "$aix_libpath"; then
-        aix_libpath="/usr/lib:/lib"
-      fi
-      rm -f conftest.c conftest
-      # End _LT_AC_SYS_LIBPATH_AIX.
-      if test "$aix_use_runtimelinking" = yes; then
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-      else
-        if test "$host_cpu" = ia64; then
-          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-        else
-          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        fi
-      fi
-      ;;
-    amigaos*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs=no
-      ;;
-    bsdi[45]*)
-      ;;
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec=' '
-      libext=lib
-      ;;
-    darwin* | rhapsody*)
-      hardcode_direct=no
-      if test "$GCC" = yes ; then
-        :
-      else
-        case $cc_basename in
-          xlc*)
-            ;;
-          *)
-            ld_shlibs=no
-            ;;
-        esac
-      fi
-      ;;
-    dgux*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      ;;
-    freebsd1*)
-      ld_shlibs=no
-      ;;
-    freebsd2.2*)
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      ;;
-    freebsd2*)
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      ;;
-    freebsd* | dragonfly*)
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      ;;
-    hpux9*)
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_direct=yes
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L=yes
-      ;;
-    hpux10*)
-      if test "$with_gnu_ld" = no; then
-        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-        hardcode_libdir_separator=:
-        hardcode_direct=yes
-        # hardcode_minus_L: Not really in the search PATH,
-        # but as the default location of the library.
-        hardcode_minus_L=yes
-      fi
-      ;;
-    hpux11*)
-      if test "$with_gnu_ld" = no; then
-        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-        hardcode_libdir_separator=:
-        case $host_cpu in
-          hppa*64*|ia64*)
-            hardcode_direct=no
-            ;;
-          *)
-            hardcode_direct=yes
-            # hardcode_minus_L: Not really in the search PATH,
-            # but as the default location of the library.
-            hardcode_minus_L=yes
-            ;;
-        esac
-      fi
-      ;;
-    irix5* | irix6* | nonstopux*)
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
-    netbsd*)
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      ;;
-    newsos6)
-      hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-        hardcode_direct=yes
-        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-        else
-          case "$host_os" in
-            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-              hardcode_libdir_flag_spec='-R$libdir'
-              ;;
-            *)
-              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-              ;;
-          esac
-        fi
-      else
-        ld_shlibs=no
-      fi
-      ;;
-    os2*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      ;;
-    osf3*)
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
-    osf4* | osf5*)
-      if test "$GCC" = yes; then
-        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      else
-        # Both cc and cxx compiler support -rpath directly
-        hardcode_libdir_flag_spec='-rpath $libdir'
-      fi
-      hardcode_libdir_separator=:
-      ;;
-    solaris*)
-      hardcode_libdir_flag_spec='-R$libdir'
-      ;;
-    sunos4*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      ;;
-    sysv4)
-      case $host_vendor in
-        sni)
-          hardcode_direct=yes # is this really true???
-          ;;
-        siemens)
-          hardcode_direct=no
-          ;;
-        motorola)
-          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-          ;;
-      esac
-      ;;
-    sysv4.3*)
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-        ld_shlibs=yes
-      fi
-      ;;
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      ;;
-    sysv5* | sco3.2v5* | sco5v6*)
-      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      hardcode_libdir_separator=':'
-      ;;
-    uts4*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      ;;
-    *)
-      ld_shlibs=no
-      ;;
-  esac
-fi
-
-# Check dynamic linker characteristics
-# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
-# Unlike libtool.m4, here we don't care about _all_ names of the library, but
-# only about the one the linker finds when passed -lNAME. This is the last
-# element of library_names_spec in libtool.m4, or possibly two of them if the
-# linker has special search rules.
-library_names_spec=      # the last element of library_names_spec in libtool.m4
-libname_spec='lib$name'
-case "$host_os" in
-  aix3*)
-    library_names_spec='$libname.a'
-    ;;
-  aix[4-9]*)
-    library_names_spec='$libname$shrext'
-    ;;
-  amigaos*)
-    library_names_spec='$libname.a'
-    ;;
-  beos*)
-    library_names_spec='$libname$shrext'
-    ;;
-  bsdi[45]*)
-    library_names_spec='$libname$shrext'
-    ;;
-  cygwin* | mingw* | pw32* | cegcc*)
-    shrext=.dll
-    library_names_spec='$libname.dll.a $libname.lib'
-    ;;
-  darwin* | rhapsody*)
-    shrext=.dylib
-    library_names_spec='$libname$shrext'
-    ;;
-  dgux*)
-    library_names_spec='$libname$shrext'
-    ;;
-  freebsd1*)
-    ;;
-  freebsd* | dragonfly*)
-    case "$host_os" in
-      freebsd[123]*)
-        library_names_spec='$libname$shrext$versuffix' ;;
-      *)
-        library_names_spec='$libname$shrext' ;;
-    esac
-    ;;
-  gnu*)
-    library_names_spec='$libname$shrext'
-    ;;
-  hpux9* | hpux10* | hpux11*)
-    case $host_cpu in
-      ia64*)
-        shrext=.so
-        ;;
-      hppa*64*)
-        shrext=.sl
-        ;;
-      *)
-        shrext=.sl
-        ;;
-    esac
-    library_names_spec='$libname$shrext'
-    ;;
-  interix[3-9]*)
-    library_names_spec='$libname$shrext'
-    ;;
-  irix5* | irix6* | nonstopux*)
-    library_names_spec='$libname$shrext'
-    case "$host_os" in
-      irix5* | nonstopux*)
-        libsuff= shlibsuff=
-        ;;
-      *)
-        case $LD in
-          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
-          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
-          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
-          *) libsuff= shlibsuff= ;;
-        esac
-        ;;
-    esac
-    ;;
-  linux*oldld* | linux*aout* | linux*coff*)
-    ;;
-  linux* | k*bsd*-gnu)
-    library_names_spec='$libname$shrext'
-    ;;
-  knetbsd*-gnu)
-    library_names_spec='$libname$shrext'
-    ;;
-  netbsd*)
-    library_names_spec='$libname$shrext'
-    ;;
-  newsos6)
-    library_names_spec='$libname$shrext'
-    ;;
-  nto-qnx*)
-    library_names_spec='$libname$shrext'
-    ;;
-  openbsd*)
-    library_names_spec='$libname$shrext$versuffix'
-    ;;
-  os2*)
-    libname_spec='$name'
-    shrext=.dll
-    library_names_spec='$libname.a'
-    ;;
-  osf3* | osf4* | osf5*)
-    library_names_spec='$libname$shrext'
-    ;;
-  rdos*)
-    ;;
-  solaris*)
-    library_names_spec='$libname$shrext'
-    ;;
-  sunos4*)
-    library_names_spec='$libname$shrext$versuffix'
-    ;;
-  sysv4 | sysv4.3*)
-    library_names_spec='$libname$shrext'
-    ;;
-  sysv4*MP*)
-    library_names_spec='$libname$shrext'
-    ;;
-  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-    library_names_spec='$libname$shrext'
-    ;;
-  uts4*)
-    library_names_spec='$libname$shrext'
-    ;;
-esac
-
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
-shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
-escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-
-LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
-
-# How to pass a linker flag through the compiler.
-wl="$escaped_wl"
-
-# Static library suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally "so").
-shlibext="$shlibext"
-
-# Format of library name prefix.
-libname_spec="$escaped_libname_spec"
-
-# Library names that the linker finds when passed -lNAME.
-library_names_spec="$escaped_library_names_spec"
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator="$hardcode_libdir_separator"
-
-# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct="$hardcode_direct"
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L="$hardcode_minus_L"
-
-EOF
diff --git a/eglib/configure.ac b/eglib/configure.ac
deleted file mode 100644 (file)
index b043298..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-#
-# Copyright 2012 Xamarin Inc
-#
-AC_INIT(eglib, [0.3],
-        [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
-
-AC_CONFIG_SRCDIR([README])
-AC_CONFIG_MACRO_DIR([m4])
-AC_CANONICAL_SYSTEM
-AC_CANONICAL_HOST
-
-AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip foreign])
-AC_CONFIG_HEADERS([config.h])
-AM_MAINTAINER_MODE
-
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
-AC_PROG_CC
-AM_PROG_LIBTOOL
-# Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
-DOLT
-GNUC_PRETTY=
-GNUC_UNUSED=
-BREAKPOINT="G_STMT_START { raise (SIGTRAP); } G_STMT_END"
-if test x$GCC = xyes; then
-   GNUC_UNUSED='__attribute__((__unused__))'
-   GNUC_NORETURN='__attribute__((__noreturn__))'
-   case $host_cpu in
-     i*86|x86_64) BREAKPOINT="G_STMT_START { __asm__ (\"int \$03\"); } G_STMT_END" ;;
-   esac
-fi
-AC_SUBST(GNUC_PRETTY)
-AC_SUBST(GNUC_UNUSED)
-AC_SUBST(GNUC_NORETURN)
-AC_SUBST(BREAKPOINT)
-
-# We use a separate variable to pass down CPPFLAGS and CFLAGS from the main mono 
-# configure, because of autoconf brokeness
-if test "x$CPPFLAGS_FOR_EGLIB" != "x"; then
-   CPPFLAGS=$CPPFLAGS_FOR_EGLIB
-fi
-if test "x$CFLAGS_FOR_EGLIB" != "x"; then
-   CFLAGS=$CFLAGS_FOR_EGLIB
-fi
-
-CFLAGS="$CFLAGS -g -D_GNU_SOURCE"
-
-AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
-AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
-
-platform_darwin=no
-platform_android=no
-
-case $host in
-*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
-    PATHSEP='\\'
-    SEARCHSEP=';'
-    OS="WIN32"
-    PIDTYPE='void *'
-    ;;
-*-*darwin*)
-    platform_darwin=yes
-    PATHSEP='/'
-    SEARCHSEP=':'
-    OS="UNIX"
-    PIDTYPE='int'
-    ;;
-*-*-linux-android*)
-    platform_android=yes
-       AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
-    PATHSEP='/'
-    SEARCHSEP=':'
-    OS="UNIX"
-    PIDTYPE='int'
-    ;;
-*)
-    PATHSEP='/'
-    SEARCHSEP=':'
-    OS="UNIX"
-    PIDTYPE='int'
-    ;;
-esac
-
-case $host in
-       *-*-solaris*)
-       CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
-       ;;
-esac
-
-case $target in
-arm*-darwin*|aarch64*-*)
-    CFLAGS="$CFLAGS -U_FORTIFY_SOURCE"
-    ;;
-i*86-*-darwin*)
-    ORDER=G_LITTLE_ENDIAN
-    ;;
-*-*-haiku*)
-    LDFLAGS="$LDFLAGS -ltextencoding"
-    ;;
-*-*-openbsd*)
-    CFLAGS="$CFLAGS -pthread"
-    LDFLAGS="$LDFLAGS -pthread"
-    ;;
-esac
-
-target_osx=no
-target_ios=no
-
-if test "x$platform_darwin" = "xyes"; then
-       AC_TRY_COMPILE([#include "TargetConditionals.h"],[
-       #if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
-       #error fail this for ios
-       #endif
-       return 0;
-       ], [
-               AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX])
-               target_osx=yes
-       ], [
-               AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
-               target_ios=yes
-       ])
-   AC_DEFINE(TARGET_MACH,1,[The JIT/AOT targets Apple platforms])
-fi
-
-AC_SUBST(ORDER)
-AC_SUBST(CFLAGS)
-AC_SUBST(PATHSEP)
-AC_SUBST(SEARCHSEP)
-AC_SUBST(OS)
-AC_SUBST(PIDTYPE)
-AM_CONDITIONAL(HOST_WIN32, test x$OS = xWIN32)
-AM_CONDITIONAL(TARGET_WIN32, test x$OS = xWIN32)
-AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
-AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
-
-# Defined for all targets/platforms using classic Windows API support.
-AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
-AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
-
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(void *)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf strerror_r)
-AC_CHECK_FUNCS(getrlimit)
-AC_CHECK_FUNCS(fork execv execve)
-
-AC_ARG_WITH([overridable-allocators], [  --with-overridable-allocators allow g_*alloc/g_free to call custom allocators set via g_mem_set_vtable])
-
-if test x$with_overridable_allocators = xyes; then
-       AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
-  AC_MSG_NOTICE([Overridable allocator support enabled])
-else
-  AC_MSG_NOTICE([Overridable allocator support disabled])
-fi
-
-#
-# Mono currently supports 10.6, but strndup is not available prior to 10.7; avoiding
-# the detection of strndup on OS X so Mono built on 10.7+ still runs on 10.6. This can be
-# removed once support for 10.6 is dropped.
-#
-# iOS detection of strndup and getpwuid_r is faulty for some reason so let's simply avoid it
-#
-if test x$target_osx = xyes; then
-AC_CHECK_FUNCS(getpwuid_r)
-elif test x$target_ios = xno; then
-AC_CHECK_FUNCS(strndup getpwuid_r)
-fi
-
-AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
-AM_ICONV()
-AC_SEARCH_LIBS(sqrtf, m)
-
-# nanosleep may not be part of libc, also search it in other libraries
-AC_SEARCH_LIBS(nanosleep, rt)
-
-AC_SEARCH_LIBS(dlopen, dl)
-old_ldflags="${LDFLAGS}"
-LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
-AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
-if test $found_export_dynamic = no; then
-       LDFLAGS="${old_ldflags}"
-fi
-
-AC_MSG_CHECKING(for varargs macros)
-AC_TRY_COMPILE([],[
-int foo (int i, int j);
-#define bar(...) foo (1, __VA_ARGS__)
-void main () {
-        bar (2);
-}
-],have_iso_varargs=yes,have_iso_varargs=no)
-AC_MSG_RESULT($have_iso_varargs)
-G_HAVE_ISO_VARARGS=0
-if test "x$have_iso_varargs" = "xyes"; then
-   G_HAVE_ISO_VARARGS=1
-fi
-AC_SUBST(G_HAVE_ISO_VARARGS)
-
-AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h iconv.h localcharset.h sys/types.h sys/resource.h)
-AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+="-liconv -lcharset"])])
-AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
-AC_SUBST(HAVE_ALLOCA_H)
-
-if test $ac_cv_sizeof_void_p = $ac_cv_sizeof_int; then
-   GPOINTER_TO_INT="((gint) (ptr))"
-   GPOINTER_TO_UINT="((guint) (ptr))"
-   GINT_TO_POINTER="((gpointer) (v))"
-   GUINT_TO_POINTER="((gpointer) (v))"
-   GSIZE="int"
-   GSIZE_FORMAT='"u"'
-elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long; then
-   GPOINTER_TO_INT="((gint)(long) (ptr))"
-   GPOINTER_TO_UINT="((guint)(long) (ptr))"
-   GINT_TO_POINTER="((gpointer)(glong) (v))"
-   GUINT_TO_POINTER="((gpointer)(gulong) (v))"
-   GSIZE="long"
-   GSIZE_FORMAT='"lu"'
-elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long_long; then
-   GPOINTER_TO_INT="((gint)(long long) (ptr))"
-   GPOINTER_TO_UINT="((guint)(unsigned long long) (ptr))"
-   GINT_TO_POINTER="((gpointer)(long long) (v))"
-   GUINT_TO_POINTER="((gpointer)(unsigned long long) (v))"
-   GSIZE="long long"
-   GSIZE_FORMAT='"I64u"'
-else
-   AC_MSG_ERROR([unsupported pointer size])
-fi
-
-AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-
-pkg_config_path=
-AC_ARG_WITH(crosspkgdir, [  --with-crosspkgdir=/path/to/pkg-config/dir      Change pkg-config dir to custom dir],
-       if test x$with_crosspkgdir = "x"; then
-               if test -s $PKG_CONFIG_PATH; then
-                       pkg_config_path=$PKG_CONFIG_PATH
-               fi
-       else
-               pkg_config_path=$with_crosspkgdir
-               PKG_CONFIG_PATH=$pkg_config_path
-               export PKG_CONFIG_PATH
-       fi
-)
-
-AC_ARG_ENABLE(werror, [  --enable-werror Pass -Werror to the C compiler], werror_flag=$enableval, werror_flag=no)
-if test x$werror_flag = xyes; then
-       WERROR_CFLAGS="-Werror"
-fi
-AC_SUBST([WERROR_CFLAGS])
-
-AC_SUBST(GPOINTER_TO_INT)
-AC_SUBST(GPOINTER_TO_UINT)
-AC_SUBST(GINT_TO_POINTER)
-AC_SUBST(GUINT_TO_POINTER)
-AC_SUBST(GSIZE)
-AC_SUBST(GSIZE_FORMAT)
-AC_SUBST(G_GUINT64_FORMAT)
-AC_SUBST(G_GINT64_FORMAT)
-AC_SUBST(G_GUINT32_FORMAT)
-AC_SUBST(G_GINT32_FORMAT)
-
-AC_OUTPUT([
-Makefile
-m4/Makefile
-src/Makefile
-src/eglib-config.h
-test/Makefile
-])
diff --git a/eglib/m4/.gitignore b/eglib/m4/.gitignore
deleted file mode 100644 (file)
index 7a0b214..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.in
-libtool.m4
-ltoptions.m4
-ltsugar.m4
-ltversion.m4
-lt~obsolete.m4
diff --git a/eglib/m4/Makefile.am b/eglib/m4/Makefile.am
deleted file mode 100644 (file)
index af864e3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST = $(wildcard *.m4)
diff --git a/eglib/m4/iconv.m4 b/eglib/m4/iconv.m4
deleted file mode 100644 (file)
index e2041b9..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-# iconv.m4 serial 11 (gettext-0.18.1)
-dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
-[
-  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  AC_REQUIRE([AC_LIB_RPATH])
-
-  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
-  dnl accordingly.
-  AC_LIB_LINKFLAGS_BODY([iconv])
-])
-
-AC_DEFUN([AM_ICONV_LINK],
-[
-  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
-  dnl those with the standalone portable GNU libiconv installed).
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-
-  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
-  dnl accordingly.
-  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
-
-  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
-  dnl because if the user has installed libiconv and not disabled its use
-  dnl via --without-libiconv-prefix, he wants to use it. The first
-  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
-  am_save_CPPFLAGS="$CPPFLAGS"
-  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
-
-  AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
-    am_cv_func_iconv="no, consider installing GNU libiconv"
-    am_cv_lib_iconv=no
-    AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-      [iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);],
-      [am_cv_func_iconv=yes])
-    if test "$am_cv_func_iconv" != yes; then
-      am_save_LIBS="$LIBS"
-      LIBS="$LIBS $LIBICONV"
-      AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-        [iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);],
-        [am_cv_lib_iconv=yes]
-        [am_cv_func_iconv=yes])
-      LIBS="$am_save_LIBS"
-    fi
-  ])
-  if test "$am_cv_func_iconv" = yes; then
-    AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
-      dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
-      am_save_LIBS="$LIBS"
-      if test $am_cv_lib_iconv = yes; then
-        LIBS="$LIBS $LIBICONV"
-      fi
-      AC_TRY_RUN([
-#include <iconv.h>
-#include <string.h>
-int main ()
-{
-  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
-     returns.  */
-  {
-    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
-    if (cd_utf8_to_88591 != (iconv_t)(-1))
-      {
-        static const char input[] = "\342\202\254"; /* EURO SIGN */
-        char buf[10];
-        const char *inptr = input;
-        size_t inbytesleft = strlen (input);
-        char *outptr = buf;
-        size_t outbytesleft = sizeof (buf);
-        size_t res = iconv (cd_utf8_to_88591,
-                            (char **) &inptr, &inbytesleft,
-                            &outptr, &outbytesleft);
-        if (res == 0)
-          return 1;
-      }
-  }
-  /* Test against Solaris 10 bug: Failures are not distinguishable from
-     successful returns.  */
-  {
-    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
-    if (cd_ascii_to_88591 != (iconv_t)(-1))
-      {
-        static const char input[] = "\263";
-        char buf[10];
-        const char *inptr = input;
-        size_t inbytesleft = strlen (input);
-        char *outptr = buf;
-        size_t outbytesleft = sizeof (buf);
-        size_t res = iconv (cd_ascii_to_88591,
-                            (char **) &inptr, &inbytesleft,
-                            &outptr, &outbytesleft);
-        if (res == 0)
-          return 1;
-      }
-  }
-#if 0 /* This bug could be worked around by the caller.  */
-  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
-  {
-    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
-    if (cd_88591_to_utf8 != (iconv_t)(-1))
-      {
-        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
-        char buf[50];
-        const char *inptr = input;
-        size_t inbytesleft = strlen (input);
-        char *outptr = buf;
-        size_t outbytesleft = sizeof (buf);
-        size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
-                            &outptr, &outbytesleft);
-        if ((int)res > 0)
-          return 1;
-      }
-  }
-#endif
-  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
-     provided.  */
-  if (/* Try standardized names.  */
-      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
-      /* Try IRIX, OSF/1 names.  */
-      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
-      /* Try AIX names.  */
-      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
-      /* Try HP-UX names.  */
-      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
-    return 1;
-  return 0;
-}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
-        [case "$host_os" in
-           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
-           *)            am_cv_func_iconv_works="guessing yes" ;;
-         esac])
-      LIBS="$am_save_LIBS"
-    ])
-    case "$am_cv_func_iconv_works" in
-      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
-      *)   am_func_iconv=yes ;;
-    esac
-  else
-    am_func_iconv=no am_cv_lib_iconv=no
-  fi
-  if test "$am_func_iconv" = yes; then
-    AC_DEFINE([HAVE_ICONV], [1],
-      [Define if you have the iconv() function and it works.])
-  fi
-  if test "$am_cv_lib_iconv" = yes; then
-    AC_MSG_CHECKING([how to link with libiconv])
-    AC_MSG_RESULT([$LIBICONV])
-  else
-    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
-    dnl either.
-    CPPFLAGS="$am_save_CPPFLAGS"
-    LIBICONV=
-    LTLIBICONV=
-  fi
-  AC_SUBST([LIBICONV])
-  AC_SUBST([LTLIBICONV])
-])
-
-dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
-dnl avoid warnings like
-dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
-dnl This is tricky because of the way 'aclocal' is implemented:
-dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
-dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
-dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
-dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
-dnl   warnings.
-m4_define([gl_iconv_AC_DEFUN],
-  m4_version_prereq([2.64],
-    [[AC_DEFUN_ONCE(
-        [$1], [$2])]],
-    [[AC_DEFUN(
-        [$1], [$2])]]))
-gl_iconv_AC_DEFUN([AM_ICONV],
-[
-  AM_ICONV_LINK
-  if test "$am_cv_func_iconv" = yes; then
-    AC_MSG_CHECKING([for iconv declaration])
-    AC_CACHE_VAL([am_cv_proto_iconv], [
-      AC_TRY_COMPILE([
-#include <stdlib.h>
-#include <iconv.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-#if defined(__STDC__) || defined(__cplusplus)
-size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-#else
-size_t iconv();
-#endif
-], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
-      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
-    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
-    AC_MSG_RESULT([
-         $am_cv_proto_iconv])
-    AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
-      [Define as const if the declaration of iconv() needs const.])
-  fi
-])
diff --git a/eglib/m4/lib-ld.m4 b/eglib/m4/lib-ld.m4
deleted file mode 100644 (file)
index ebb3052..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-# lib-ld.m4 serial 4 (gettext-0.18)
-dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Subroutines of libtool.m4,
-dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
-dnl with libtool.m4.
-
-dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
-AC_DEFUN([AC_LIB_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  acl_cv_prog_gnu_ld=yes ;;
-*)
-  acl_cv_prog_gnu_ld=no ;;
-esac])
-with_gnu_ld=$acl_cv_prog_gnu_ld
-])
-
-dnl From libtool-1.4. Sets the variable LD.
-AC_DEFUN([AC_LIB_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
-[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by GCC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]* | [A-Za-z]:[\\/]*)]
-      [re_direlt='/[^/][^/]*/\.\./']
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL([acl_cv_path_LD],
-[if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
-      *GNU* | *'with BFD'*)
-        test "$with_gnu_ld" != no && break ;;
-      *)
-        test "$with_gnu_ld" != yes && break ;;
-      esac
-    fi
-  done
-  IFS="$ac_save_ifs"
-else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT([$LD])
-else
-  AC_MSG_RESULT([no])
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_LIB_PROG_LD_GNU
-])
diff --git a/eglib/m4/lib-link.m4 b/eglib/m4/lib-link.m4
deleted file mode 100644 (file)
index c73bd8e..0000000
+++ /dev/null
@@ -1,774 +0,0 @@
-# lib-link.m4 serial 21 (gettext-0.18)
-dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-AC_PREREQ([2.54])
-
-dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
-dnl the libraries corresponding to explicit and implicit dependencies.
-dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
-dnl augments the CPPFLAGS variable.
-dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
-dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
-AC_DEFUN([AC_LIB_LINKFLAGS],
-[
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  AC_REQUIRE([AC_LIB_RPATH])
-  pushdef([Name],[translit([$1],[./-], [___])])
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
-    AC_LIB_LINKFLAGS_BODY([$1], [$2])
-    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
-    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
-    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
-    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
-  ])
-  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
-  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
-  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
-  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
-  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
-  AC_SUBST([LIB]NAME)
-  AC_SUBST([LTLIB]NAME)
-  AC_SUBST([LIB]NAME[_PREFIX])
-  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
-  dnl results of this search when this library appears as a dependency.
-  HAVE_LIB[]NAME=yes
-  popdef([NAME])
-  popdef([Name])
-])
-
-dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
-dnl searches for libname and the libraries corresponding to explicit and
-dnl implicit dependencies, together with the specified include files and
-dnl the ability to compile and link the specified testcode. The missing-message
-dnl defaults to 'no' and may contain additional hints for the user.
-dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
-dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
-dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
-dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
-dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
-dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
-AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
-[
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  AC_REQUIRE([AC_LIB_RPATH])
-  pushdef([Name],[translit([$1],[./-], [___])])
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-
-  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
-  dnl accordingly.
-  AC_LIB_LINKFLAGS_BODY([$1], [$2])
-
-  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
-  dnl because if the user has installed lib[]Name and not disabled its use
-  dnl via --without-lib[]Name-prefix, he wants to use it.
-  ac_save_CPPFLAGS="$CPPFLAGS"
-  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
-
-  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
-    ac_save_LIBS="$LIBS"
-    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
-    dnl because these -l options might require -L options that are present in
-    dnl LIBS. -l options benefit only from the -L options listed before it.
-    dnl Otherwise, add it to the front of LIBS, because it may be a static
-    dnl library that depends on another static library that is present in LIBS.
-    dnl Static libraries benefit only from the static libraries listed after
-    dnl it.
-    case " $LIB[]NAME" in
-      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
-      *)       LIBS="$LIB[]NAME $LIBS" ;;
-    esac
-    AC_TRY_LINK([$3], [$4],
-      [ac_cv_lib[]Name=yes],
-      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
-    LIBS="$ac_save_LIBS"
-  ])
-  if test "$ac_cv_lib[]Name" = yes; then
-    HAVE_LIB[]NAME=yes
-    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
-    AC_MSG_CHECKING([how to link with lib[]$1])
-    AC_MSG_RESULT([$LIB[]NAME])
-  else
-    HAVE_LIB[]NAME=no
-    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
-    dnl $INC[]NAME either.
-    CPPFLAGS="$ac_save_CPPFLAGS"
-    LIB[]NAME=
-    LTLIB[]NAME=
-    LIB[]NAME[]_PREFIX=
-  fi
-  AC_SUBST([HAVE_LIB]NAME)
-  AC_SUBST([LIB]NAME)
-  AC_SUBST([LTLIB]NAME)
-  AC_SUBST([LIB]NAME[_PREFIX])
-  popdef([NAME])
-  popdef([Name])
-])
-
-dnl Determine the platform dependent parameters needed to use rpath:
-dnl   acl_libext,
-dnl   acl_shlibext,
-dnl   acl_hardcode_libdir_flag_spec,
-dnl   acl_hardcode_libdir_separator,
-dnl   acl_hardcode_direct,
-dnl   acl_hardcode_minus_L.
-AC_DEFUN([AC_LIB_RPATH],
-[
-  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
-  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
-  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
-  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
-  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
-  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
-  AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
-    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
-    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-    . ./conftest.sh
-    rm -f ./conftest.sh
-    acl_cv_rpath=done
-  ])
-  wl="$acl_cv_wl"
-  acl_libext="$acl_cv_libext"
-  acl_shlibext="$acl_cv_shlibext"
-  acl_libname_spec="$acl_cv_libname_spec"
-  acl_library_names_spec="$acl_cv_library_names_spec"
-  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-  acl_hardcode_direct="$acl_cv_hardcode_direct"
-  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
-  dnl Determine whether the user wants rpath handling at all.
-  AC_ARG_ENABLE([rpath],
-    [  --disable-rpath         do not hardcode runtime library paths],
-    :, enable_rpath=yes)
-])
-
-dnl AC_LIB_FROMPACKAGE(name, package)
-dnl declares that libname comes from the given package. The configure file
-dnl will then not have a --with-libname-prefix option but a
-dnl --with-package-prefix option. Several libraries can come from the same
-dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
-dnl macro call that searches for libname.
-AC_DEFUN([AC_LIB_FROMPACKAGE],
-[
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-  define([acl_frompackage_]NAME, [$2])
-  popdef([NAME])
-  pushdef([PACK],[$2])
-  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
-                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-  define([acl_libsinpackage_]PACKUP,
-    m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
-  popdef([PACKUP])
-  popdef([PACK])
-])
-
-dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
-dnl the libraries corresponding to explicit and implicit dependencies.
-dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
-dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
-dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
-AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
-[
-  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
-  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
-                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
-  dnl Autoconf >= 2.61 supports dots in --with options.
-  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
-  dnl By default, look in $includedir and $libdir.
-  use_additional=yes
-  AC_LIB_WITH_FINAL_PREFIX([
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
-  ])
-  AC_ARG_WITH(P_A_C_K[-prefix],
-[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
-  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
-[
-    if test "X$withval" = "Xno"; then
-      use_additional=no
-    else
-      if test "X$withval" = "X"; then
-        AC_LIB_WITH_FINAL_PREFIX([
-          eval additional_includedir=\"$includedir\"
-          eval additional_libdir=\"$libdir\"
-        ])
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/$acl_libdirstem"
-        if test "$acl_libdirstem2" != "$acl_libdirstem" \
-           && ! test -d "$withval/$acl_libdirstem"; then
-          additional_libdir="$withval/$acl_libdirstem2"
-        fi
-      fi
-    fi
-])
-  dnl Search the library and its dependencies in $additional_libdir and
-  dnl $LDFLAGS. Using breadth-first-seach.
-  LIB[]NAME=
-  LTLIB[]NAME=
-  INC[]NAME=
-  LIB[]NAME[]_PREFIX=
-  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
-  dnl computed. So it has to be reset here.
-  HAVE_LIB[]NAME=
-  rpathdirs=
-  ltrpathdirs=
-  names_already_handled=
-  names_next_round='$1 $2'
-  while test -n "$names_next_round"; do
-    names_this_round="$names_next_round"
-    names_next_round=
-    for name in $names_this_round; do
-      already_handled=
-      for n in $names_already_handled; do
-        if test "$n" = "$name"; then
-          already_handled=yes
-          break
-        fi
-      done
-      if test -z "$already_handled"; then
-        names_already_handled="$names_already_handled $name"
-        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
-        dnl or AC_LIB_HAVE_LINKFLAGS call.
-        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
-        eval value=\"\$HAVE_LIB$uppername\"
-        if test -n "$value"; then
-          if test "$value" = yes; then
-            eval value=\"\$LIB$uppername\"
-            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
-            eval value=\"\$LTLIB$uppername\"
-            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
-          else
-            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
-            dnl that this library doesn't exist. So just drop it.
-            :
-          fi
-        else
-          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
-          dnl and the already constructed $LIBNAME/$LTLIBNAME.
-          found_dir=
-          found_la=
-          found_so=
-          found_a=
-          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
-          if test -n "$acl_shlibext"; then
-            shrext=".$acl_shlibext"             # typically: shrext=.so
-          else
-            shrext=
-          fi
-          if test $use_additional = yes; then
-            dir="$additional_libdir"
-            dnl The same code as in the loop below:
-            dnl First look for a shared library.
-            if test -n "$acl_shlibext"; then
-              if test -f "$dir/$libname$shrext"; then
-                found_dir="$dir"
-                found_so="$dir/$libname$shrext"
-              else
-                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                  ver=`(cd "$dir" && \
-                        for f in "$libname$shrext".*; do echo "$f"; done \
-                        | sed -e "s,^$libname$shrext\\\\.,," \
-                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                        | sed 1q ) 2>/dev/null`
-                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                    found_dir="$dir"
-                    found_so="$dir/$libname$shrext.$ver"
-                  fi
-                else
-                  eval library_names=\"$acl_library_names_spec\"
-                  for f in $library_names; do
-                    if test -f "$dir/$f"; then
-                      found_dir="$dir"
-                      found_so="$dir/$f"
-                      break
-                    fi
-                  done
-                fi
-              fi
-            fi
-            dnl Then look for a static library.
-            if test "X$found_dir" = "X"; then
-              if test -f "$dir/$libname.$acl_libext"; then
-                found_dir="$dir"
-                found_a="$dir/$libname.$acl_libext"
-              fi
-            fi
-            if test "X$found_dir" != "X"; then
-              if test -f "$dir/$libname.la"; then
-                found_la="$dir/$libname.la"
-              fi
-            fi
-          fi
-          if test "X$found_dir" = "X"; then
-            for x in $LDFLAGS $LTLIB[]NAME; do
-              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-              case "$x" in
-                -L*)
-                  dir=`echo "X$x" | sed -e 's/^X-L//'`
-                  dnl First look for a shared library.
-                  if test -n "$acl_shlibext"; then
-                    if test -f "$dir/$libname$shrext"; then
-                      found_dir="$dir"
-                      found_so="$dir/$libname$shrext"
-                    else
-                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                        ver=`(cd "$dir" && \
-                              for f in "$libname$shrext".*; do echo "$f"; done \
-                              | sed -e "s,^$libname$shrext\\\\.,," \
-                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                              | sed 1q ) 2>/dev/null`
-                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                          found_dir="$dir"
-                          found_so="$dir/$libname$shrext.$ver"
-                        fi
-                      else
-                        eval library_names=\"$acl_library_names_spec\"
-                        for f in $library_names; do
-                          if test -f "$dir/$f"; then
-                            found_dir="$dir"
-                            found_so="$dir/$f"
-                            break
-                          fi
-                        done
-                      fi
-                    fi
-                  fi
-                  dnl Then look for a static library.
-                  if test "X$found_dir" = "X"; then
-                    if test -f "$dir/$libname.$acl_libext"; then
-                      found_dir="$dir"
-                      found_a="$dir/$libname.$acl_libext"
-                    fi
-                  fi
-                  if test "X$found_dir" != "X"; then
-                    if test -f "$dir/$libname.la"; then
-                      found_la="$dir/$libname.la"
-                    fi
-                  fi
-                  ;;
-              esac
-              if test "X$found_dir" != "X"; then
-                break
-              fi
-            done
-          fi
-          if test "X$found_dir" != "X"; then
-            dnl Found the library.
-            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
-            if test "X$found_so" != "X"; then
-              dnl Linking with a shared library. We attempt to hardcode its
-              dnl directory into the executable's runpath, unless it's the
-              dnl standard /usr/lib.
-              if test "$enable_rpath" = no \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
-                dnl No hardcoding is needed.
-                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-              else
-                dnl Use an explicit option to hardcode DIR into the resulting
-                dnl binary.
-                dnl Potentially add DIR to ltrpathdirs.
-                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
-                haveit=
-                for x in $ltrpathdirs; do
-                  if test "X$x" = "X$found_dir"; then
-                    haveit=yes
-                    break
-                  fi
-                done
-                if test -z "$haveit"; then
-                  ltrpathdirs="$ltrpathdirs $found_dir"
-                fi
-                dnl The hardcoding into $LIBNAME is system dependent.
-                if test "$acl_hardcode_direct" = yes; then
-                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
-                  dnl resulting binary.
-                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                else
-                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
-                    dnl Use an explicit option to hardcode DIR into the resulting
-                    dnl binary.
-                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                    dnl Potentially add DIR to rpathdirs.
-                    dnl The rpathdirs will be appended to $LIBNAME at the end.
-                    haveit=
-                    for x in $rpathdirs; do
-                      if test "X$x" = "X$found_dir"; then
-                        haveit=yes
-                        break
-                      fi
-                    done
-                    if test -z "$haveit"; then
-                      rpathdirs="$rpathdirs $found_dir"
-                    fi
-                  else
-                    dnl Rely on "-L$found_dir".
-                    dnl But don't add it if it's already contained in the LDFLAGS
-                    dnl or the already constructed $LIBNAME
-                    haveit=
-                    for x in $LDFLAGS $LIB[]NAME; do
-                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                      if test "X$x" = "X-L$found_dir"; then
-                        haveit=yes
-                        break
-                      fi
-                    done
-                    if test -z "$haveit"; then
-                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
-                    fi
-                    if test "$acl_hardcode_minus_L" != no; then
-                      dnl FIXME: Not sure whether we should use
-                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-                      dnl here.
-                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                    else
-                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
-                      dnl here, because this doesn't fit in flags passed to the
-                      dnl compiler. So give up. No hardcoding. This affects only
-                      dnl very old systems.
-                      dnl FIXME: Not sure whether we should use
-                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-                      dnl here.
-                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
-                    fi
-                  fi
-                fi
-              fi
-            else
-              if test "X$found_a" != "X"; then
-                dnl Linking with a static library.
-                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
-              else
-                dnl We shouldn't come here, but anyway it's good to have a
-                dnl fallback.
-                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
-              fi
-            fi
-            dnl Assume the include files are nearby.
-            additional_includedir=
-            case "$found_dir" in
-              */$acl_libdirstem | */$acl_libdirstem/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
-                if test "$name" = '$1'; then
-                  LIB[]NAME[]_PREFIX="$basedir"
-                fi
-                additional_includedir="$basedir/include"
-                ;;
-              */$acl_libdirstem2 | */$acl_libdirstem2/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
-                if test "$name" = '$1'; then
-                  LIB[]NAME[]_PREFIX="$basedir"
-                fi
-                additional_includedir="$basedir/include"
-                ;;
-            esac
-            if test "X$additional_includedir" != "X"; then
-              dnl Potentially add $additional_includedir to $INCNAME.
-              dnl But don't add it
-              dnl   1. if it's the standard /usr/include,
-              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
-              dnl   3. if it's already present in $CPPFLAGS or the already
-              dnl      constructed $INCNAME,
-              dnl   4. if it doesn't exist as a directory.
-              if test "X$additional_includedir" != "X/usr/include"; then
-                haveit=
-                if test "X$additional_includedir" = "X/usr/local/include"; then
-                  if test -n "$GCC"; then
-                    case $host_os in
-                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
-                    esac
-                  fi
-                fi
-                if test -z "$haveit"; then
-                  for x in $CPPFLAGS $INC[]NAME; do
-                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                    if test "X$x" = "X-I$additional_includedir"; then
-                      haveit=yes
-                      break
-                    fi
-                  done
-                  if test -z "$haveit"; then
-                    if test -d "$additional_includedir"; then
-                      dnl Really add $additional_includedir to $INCNAME.
-                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
-                    fi
-                  fi
-                fi
-              fi
-            fi
-            dnl Look for dependencies.
-            if test -n "$found_la"; then
-              dnl Read the .la file. It defines the variables
-              dnl dlname, library_names, old_library, dependency_libs, current,
-              dnl age, revision, installed, dlopen, dlpreopen, libdir.
-              save_libdir="$libdir"
-              case "$found_la" in
-                */* | *\\*) . "$found_la" ;;
-                *) . "./$found_la" ;;
-              esac
-              libdir="$save_libdir"
-              dnl We use only dependency_libs.
-              for dep in $dependency_libs; do
-                case "$dep" in
-                  -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
-                    dnl But don't add it
-                    dnl   1. if it's the standard /usr/lib,
-                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
-                    dnl   3. if it's already present in $LDFLAGS or the already
-                    dnl      constructed $LIBNAME,
-                    dnl   4. if it doesn't exist as a directory.
-                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
-                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
-                      haveit=
-                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
-                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
-                        if test -n "$GCC"; then
-                          case $host_os in
-                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
-                          esac
-                        fi
-                      fi
-                      if test -z "$haveit"; then
-                        haveit=
-                        for x in $LDFLAGS $LIB[]NAME; do
-                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
-                            haveit=yes
-                            break
-                          fi
-                        done
-                        if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LIBNAME.
-                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
-                          fi
-                        fi
-                        haveit=
-                        for x in $LDFLAGS $LTLIB[]NAME; do
-                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
-                            haveit=yes
-                            break
-                          fi
-                        done
-                        if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LTLIBNAME.
-                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
-                          fi
-                        fi
-                      fi
-                    fi
-                    ;;
-                  -R*)
-                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
-                    if test "$enable_rpath" != no; then
-                      dnl Potentially add DIR to rpathdirs.
-                      dnl The rpathdirs will be appended to $LIBNAME at the end.
-                      haveit=
-                      for x in $rpathdirs; do
-                        if test "X$x" = "X$dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        rpathdirs="$rpathdirs $dir"
-                      fi
-                      dnl Potentially add DIR to ltrpathdirs.
-                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
-                      haveit=
-                      for x in $ltrpathdirs; do
-                        if test "X$x" = "X$dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        ltrpathdirs="$ltrpathdirs $dir"
-                      fi
-                    fi
-                    ;;
-                  -l*)
-                    dnl Handle this in the next round.
-                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
-                    ;;
-                  *.la)
-                    dnl Handle this in the next round. Throw away the .la's
-                    dnl directory; it is already contained in a preceding -L
-                    dnl option.
-                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
-                    ;;
-                  *)
-                    dnl Most likely an immediate library name.
-                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
-                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
-                    ;;
-                esac
-              done
-            fi
-          else
-            dnl Didn't find the library; assume it is in the system directories
-            dnl known to the linker and runtime loader. (All the system
-            dnl directories known to the linker should also be known to the
-            dnl runtime loader, otherwise the system is severely misconfigured.)
-            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
-            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
-          fi
-        fi
-      fi
-    done
-  done
-  if test "X$rpathdirs" != "X"; then
-    if test -n "$acl_hardcode_libdir_separator"; then
-      dnl Weird platform: only the last -rpath option counts, the user must
-      dnl pass all path elements in one option. We can arrange that for a
-      dnl single library, but not when more than one $LIBNAMEs are used.
-      alldirs=
-      for found_dir in $rpathdirs; do
-        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
-      done
-      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
-      acl_save_libdir="$libdir"
-      libdir="$alldirs"
-      eval flag=\"$acl_hardcode_libdir_flag_spec\"
-      libdir="$acl_save_libdir"
-      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
-    else
-      dnl The -rpath options are cumulative.
-      for found_dir in $rpathdirs; do
-        acl_save_libdir="$libdir"
-        libdir="$found_dir"
-        eval flag=\"$acl_hardcode_libdir_flag_spec\"
-        libdir="$acl_save_libdir"
-        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
-      done
-    fi
-  fi
-  if test "X$ltrpathdirs" != "X"; then
-    dnl When using libtool, the option that works for both libraries and
-    dnl executables is -R. The -R options are cumulative.
-    for found_dir in $ltrpathdirs; do
-      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
-    done
-  fi
-  popdef([P_A_C_K])
-  popdef([PACKLIBS])
-  popdef([PACKUP])
-  popdef([PACK])
-  popdef([NAME])
-])
-
-dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
-dnl unless already present in VAR.
-dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
-dnl contains two or three consecutive elements that belong together.
-AC_DEFUN([AC_LIB_APPENDTOVAR],
-[
-  for element in [$2]; do
-    haveit=
-    for x in $[$1]; do
-      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-      if test "X$x" = "X$element"; then
-        haveit=yes
-        break
-      fi
-    done
-    if test -z "$haveit"; then
-      [$1]="${[$1]}${[$1]:+ }$element"
-    fi
-  done
-])
-
-dnl For those cases where a variable contains several -L and -l options
-dnl referring to unknown libraries and directories, this macro determines the
-dnl necessary additional linker options for the runtime path.
-dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
-dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
-dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
-dnl otherwise linking without libtool is assumed.
-AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
-[
-  AC_REQUIRE([AC_LIB_RPATH])
-  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
-  $1=
-  if test "$enable_rpath" != no; then
-    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
-      dnl Use an explicit option to hardcode directories into the resulting
-      dnl binary.
-      rpathdirs=
-      next=
-      for opt in $2; do
-        if test -n "$next"; then
-          dir="$next"
-          dnl No need to hardcode the standard /usr/lib.
-          if test "X$dir" != "X/usr/$acl_libdirstem" \
-             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
-            rpathdirs="$rpathdirs $dir"
-          fi
-          next=
-        else
-          case $opt in
-            -L) next=yes ;;
-            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
-                 dnl No need to hardcode the standard /usr/lib.
-                 if test "X$dir" != "X/usr/$acl_libdirstem" \
-                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
-                   rpathdirs="$rpathdirs $dir"
-                 fi
-                 next= ;;
-            *) next= ;;
-          esac
-        fi
-      done
-      if test "X$rpathdirs" != "X"; then
-        if test -n ""$3""; then
-          dnl libtool is used for linking. Use -R options.
-          for dir in $rpathdirs; do
-            $1="${$1}${$1:+ }-R$dir"
-          done
-        else
-          dnl The linker is used for linking directly.
-          if test -n "$acl_hardcode_libdir_separator"; then
-            dnl Weird platform: only the last -rpath option counts, the user
-            dnl must pass all path elements in one option.
-            alldirs=
-            for dir in $rpathdirs; do
-              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
-            done
-            acl_save_libdir="$libdir"
-            libdir="$alldirs"
-            eval flag=\"$acl_hardcode_libdir_flag_spec\"
-            libdir="$acl_save_libdir"
-            $1="$flag"
-          else
-            dnl The -rpath options are cumulative.
-            for dir in $rpathdirs; do
-              acl_save_libdir="$libdir"
-              libdir="$dir"
-              eval flag=\"$acl_hardcode_libdir_flag_spec\"
-              libdir="$acl_save_libdir"
-              $1="${$1}${$1:+ }$flag"
-            done
-          fi
-        fi
-      fi
-    fi
-  fi
-  AC_SUBST([$1])
-])
diff --git a/eglib/m4/lib-prefix.m4 b/eglib/m4/lib-prefix.m4
deleted file mode 100644 (file)
index 1601cea..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-# lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
-dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
-dnl require excessive bracketing.
-ifdef([AC_HELP_STRING],
-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
-[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
-
-dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
-dnl to access previously installed libraries. The basic assumption is that
-dnl a user will want packages to use other packages he previously installed
-dnl with the same --prefix option.
-dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
-dnl libraries, but is otherwise very convenient.
-AC_DEFUN([AC_LIB_PREFIX],
-[
-  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
-  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-  dnl By default, look in $includedir and $libdir.
-  use_additional=yes
-  AC_LIB_WITH_FINAL_PREFIX([
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
-  ])
-  AC_LIB_ARG_WITH([lib-prefix],
-[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
-  --without-lib-prefix    don't search for libraries in includedir and libdir],
-[
-    if test "X$withval" = "Xno"; then
-      use_additional=no
-    else
-      if test "X$withval" = "X"; then
-        AC_LIB_WITH_FINAL_PREFIX([
-          eval additional_includedir=\"$includedir\"
-          eval additional_libdir=\"$libdir\"
-        ])
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/$acl_libdirstem"
-      fi
-    fi
-])
-  if test $use_additional = yes; then
-    dnl Potentially add $additional_includedir to $CPPFLAGS.
-    dnl But don't add it
-    dnl   1. if it's the standard /usr/include,
-    dnl   2. if it's already present in $CPPFLAGS,
-    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
-    dnl   4. if it doesn't exist as a directory.
-    if test "X$additional_includedir" != "X/usr/include"; then
-      haveit=
-      for x in $CPPFLAGS; do
-        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-        if test "X$x" = "X-I$additional_includedir"; then
-          haveit=yes
-          break
-        fi
-      done
-      if test -z "$haveit"; then
-        if test "X$additional_includedir" = "X/usr/local/include"; then
-          if test -n "$GCC"; then
-            case $host_os in
-              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
-            esac
-          fi
-        fi
-        if test -z "$haveit"; then
-          if test -d "$additional_includedir"; then
-            dnl Really add $additional_includedir to $CPPFLAGS.
-            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
-          fi
-        fi
-      fi
-    fi
-    dnl Potentially add $additional_libdir to $LDFLAGS.
-    dnl But don't add it
-    dnl   1. if it's the standard /usr/lib,
-    dnl   2. if it's already present in $LDFLAGS,
-    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
-    dnl   4. if it doesn't exist as a directory.
-    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
-      haveit=
-      for x in $LDFLAGS; do
-        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-        if test "X$x" = "X-L$additional_libdir"; then
-          haveit=yes
-          break
-        fi
-      done
-      if test -z "$haveit"; then
-        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
-          if test -n "$GCC"; then
-            case $host_os in
-              linux*) haveit=yes;;
-            esac
-          fi
-        fi
-        if test -z "$haveit"; then
-          if test -d "$additional_libdir"; then
-            dnl Really add $additional_libdir to $LDFLAGS.
-            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
-          fi
-        fi
-      fi
-    fi
-  fi
-])
-
-dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
-dnl acl_final_exec_prefix, containing the values to which $prefix and
-dnl $exec_prefix will expand at the end of the configure script.
-AC_DEFUN([AC_LIB_PREPARE_PREFIX],
-[
-  dnl Unfortunately, prefix and exec_prefix get only finally determined
-  dnl at the end of configure.
-  if test "X$prefix" = "XNONE"; then
-    acl_final_prefix="$ac_default_prefix"
-  else
-    acl_final_prefix="$prefix"
-  fi
-  if test "X$exec_prefix" = "XNONE"; then
-    acl_final_exec_prefix='${prefix}'
-  else
-    acl_final_exec_prefix="$exec_prefix"
-  fi
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
-  prefix="$acl_save_prefix"
-])
-
-dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
-dnl variables prefix and exec_prefix bound to the values they will have
-dnl at the end of the configure script.
-AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
-[
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  $1
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
-])
-
-dnl AC_LIB_PREPARE_MULTILIB creates
-dnl - a variable acl_libdirstem, containing the basename of the libdir, either
-dnl   "lib" or "lib64" or "lib/64",
-dnl - a variable acl_libdirstem2, as a secondary possible value for
-dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
-dnl   "lib/amd64".
-AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
-[
-  dnl There is no formal standard regarding lib and lib64.
-  dnl On glibc systems, the current practice is that on a system supporting
-  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
-  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
-  dnl the compiler's default mode by looking at the compiler's library search
-  dnl path. If at least one of its elements ends in /lib64 or points to a
-  dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
-  dnl Otherwise we use the default, namely "lib".
-  dnl On Solaris systems, the current practice is that on a system supporting
-  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
-  dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
-  dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
-  AC_REQUIRE([AC_CANONICAL_HOST])
-  acl_libdirstem=lib
-  acl_libdirstem2=
-  case "$host_os" in
-    solaris*)
-      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
-      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
-      dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
-      dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
-      dnl symlink is missing, so we set acl_libdirstem2 too.
-      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
-        [AC_EGREP_CPP([sixtyfour bits], [
-#ifdef _LP64
-sixtyfour bits
-#endif
-           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
-        ])
-      if test $gl_cv_solaris_64bit = yes; then
-        acl_libdirstem=lib/64
-        case "$host_cpu" in
-          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
-          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
-        esac
-      fi
-      ;;
-    *)
-      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
-      if test -n "$searchpath"; then
-        acl_save_IFS="${IFS=   }"; IFS=":"
-        for searchdir in $searchpath; do
-          if test -d "$searchdir"; then
-            case "$searchdir" in
-              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
-              */../ | */.. )
-                # Better ignore directories of this form. They are misleading.
-                ;;
-              *) searchdir=`cd "$searchdir" && pwd`
-                 case "$searchdir" in
-                   */lib64 ) acl_libdirstem=lib64 ;;
-                 esac ;;
-            esac
-          fi
-        done
-        IFS="$acl_save_IFS"
-      fi
-      ;;
-  esac
-  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
-])
diff --git a/eglib/src/.gitignore b/eglib/src/.gitignore
deleted file mode 100644 (file)
index 6635df1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/Makefile
-/Makefile.in
-/.libs
-/.deps
-/*.lo
-/*.la
-/*.o
-/semantic.cache
-/.project
-/.cproject
-/eglib-config.h
diff --git a/eglib/src/Makefile.am b/eglib/src/Makefile.am
deleted file mode 100644 (file)
index d7e6a94..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-noinst_LTLIBRARIES = libeglib.la
-
-AM_CFLAGS = $(WERROR_CFLAGS)
-
-win_files  = \
-       eglib-config.hw \
-       gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
-       gmodule-win32.c gmodule-win32-internals.h gtimer-win32.c gunicode-win32.c
-
-unix_files = \
-       gdate-unix.c  gdir-unix.c  gfile-unix.c  gmisc-unix.c   \
-       gmodule-unix.c gtimer-unix.c
-
-if HOST_WIN32
-os_files = $(win_files)
-else
-os_files = $(unix_files)
-endif
-
-libeglib_la_SOURCES = \
-       eglib-remap.h   \
-       sort.frag.h     \
-       glib.h          \
-       garray.c        \
-       gbytearray.c    \
-       gerror.c        \
-       ghashtable.c    \
-       giconv.c        \
-       gmem.c          \
-       gmodule.h       \
-       goutput.c       \
-       gqsort.c        \
-       gstr.c          \
-       gslist.c        \
-       gstring.c       \
-       gptrarray.c     \
-       glist.c         \
-       gqueue.c        \
-       gpath.c         \
-       gshell.c        \
-       gspawn.c        \
-       gfile.c         \
-       gfile-posix.c   \
-       gpattern.c      \
-       gmarkup.c       \
-       gutf8.c         \
-       gunicode.c      \
-       unicode-data.h  \
-       $(os_files)
-
-libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2
-
-AM_CPPFLAGS = -I$(srcdir)
-
-if HOST_WIN32
-libeglib_la_LIBADD = -lm $(LIBICONV) -lpsapi
-else
-if PLATFORM_ANDROID
-libeglib_la_LIBADD = -llog
-endif
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
-
-EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files)
diff --git a/eglib/src/eglib-config.h.in b/eglib/src/eglib-config.h.in
deleted file mode 100644 (file)
index 7179757..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef __EGLIB_CONFIG_H
-#define __EGLIB_CONFIG_H
-
-/*
- * System-dependent settings
- */
-#define G_GNUC_PRETTY_FUNCTION   @GNUC_PRETTY@
-#define G_GNUC_UNUSED            @GNUC_UNUSED@
-#define G_BYTE_ORDER             @ORDER@
-#define G_GNUC_NORETURN          @GNUC_NORETURN@
-#define G_SEARCHPATH_SEPARATOR_S "@SEARCHSEP@"
-#define G_SEARCHPATH_SEPARATOR   '@SEARCHSEP@'
-#define G_DIR_SEPARATOR          '@PATHSEP@'
-#define G_DIR_SEPARATOR_S        "@PATHSEP@"
-#define G_BREAKPOINT()           @BREAKPOINT@
-#define G_OS_@OS@
-#define GPOINTER_TO_INT(ptr)   @GPOINTER_TO_INT@
-#define GPOINTER_TO_UINT(ptr)  @GPOINTER_TO_UINT@
-#define GINT_TO_POINTER(v)     @GINT_TO_POINTER@
-#define GUINT_TO_POINTER(v)    @GUINT_TO_POINTER@
-
-#if @HAVE_ALLOCA_H@ == 1
-#define G_HAVE_ALLOCA_H
-#endif
-
-typedef unsigned @GSIZE@ gsize;
-typedef signed   @GSIZE@ gssize;
-
-#define G_GSIZE_FORMAT   @GSIZE_FORMAT@
-
-#if @G_HAVE_ISO_VARARGS@ == 1
-#define G_HAVE_ISO_VARARGS
-#endif
-
-#if defined (HOST_WATCHOS)
-#undef G_BREAKPOINT
-#define G_BREAKPOINT()
-#endif
-
-typedef @PIDTYPE@ GPid;
-
-#endif
diff --git a/eglib/src/eglib-config.hw b/eglib/src/eglib-config.hw
deleted file mode 100644 (file)
index cc7bd44..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef __EGLIB_CONFIG_H
-#define __EGLIB_CONFIG_H
-
-/*
- * System-dependent settings
- */
-#define G_OS_WIN32 1
-
-#ifdef _MSC_VER
-
-#include <io.h>
-
-#define G_GNUC_PRETTY_FUNCTION   __FUNCTION__
-#define G_GNUC_UNUSED            
-#define G_BYTE_ORDER             1234
-#define G_GNUC_NORETURN          
-#define G_BREAKPOINT()           __debugbreak()
-#define MAXPATHLEN 242
-
-typedef uintptr_t gsize;
-typedef intptr_t gssize;
-typedef int pid_t;
-
-#define G_DIR_SEPARATOR          '\\'
-#define G_DIR_SEPARATOR_S        "\\"
-#define G_SEARCHPATH_SEPARATOR_S ";"
-#define G_SEARCHPATH_SEPARATOR   ';'
-#define G_GSIZE_FORMAT   "d"
-#define GPOINTER_TO_INT(ptr)   ((gint)(intptr_t) (ptr))
-#define GPOINTER_TO_UINT(ptr)  ((guint)(intptr_t) (ptr))
-#define GINT_TO_POINTER(v)     ((gpointer)(intptr_t) (v))
-#define GUINT_TO_POINTER(v)    ((gpointer)(intptr_t) (v))
-
-#define STDOUT_FILENO (int)(intptr_t)stdout
-#define STDERR_FILENO (int)(intptr_t)stderr
-
-/* FIXME: what should this be ?*/
-#define X_OK 4 /* This is really read */
-#define WNOHANG 1
-#define F_SETFD 1
-#define FD_CLOEXEC 1
-
-#undef inline
-#define inline __inline
-
-#define strtok_r strtok_s
-
-#undef G_HAVE_UNISTD_H
-#undef G_HAVE_SYS_TIME_H
-#undef G_HAVE_SYS_WAIT_H
-#undef G_HAVE_PWD_H
-#undef G_HAVE_STRNDUP
-#define G_HAVE_GETOPT_H 1
-
-/* disable the following warnings 
- * C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored. 
- * C4127: conditional expression is constant
-*/
-#pragma warning(disable:4100 4127)
-#endif
-
-typedef void * GPid;
-#endif
diff --git a/eglib/src/eglib-remap.h b/eglib/src/eglib-remap.h
deleted file mode 100644 (file)
index 311c06a..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-#define g_array_append monoeg_g_array_append
-#define g_array_append_vals monoeg_g_array_append_vals
-#define g_array_free monoeg_g_array_free
-#define g_array_insert_vals monoeg_g_array_insert_vals
-#define g_array_new monoeg_g_array_new
-#define g_array_remove_index monoeg_g_array_remove_index
-#define g_array_remove_index_fast monoeg_g_array_remove_index_fast
-#define g_array_set_size monoeg_g_array_set_size
-#define g_array_sized_new monoeg_g_array_sized_new
-#define g_ascii_strdown monoeg_g_ascii_strdown
-#define g_ascii_strncasecmp monoeg_g_ascii_strncasecmp
-#define g_ascii_tolower monoeg_g_ascii_tolower
-#define g_ascii_xdigit_value monoeg_g_ascii_xdigit_value
-#define g_build_path monoeg_g_build_path
-#define g_byte_array_append monoeg_g_byte_array_append
-#define g_byte_array_free monoeg_g_byte_array_free
-#define g_byte_array_new monoeg_g_byte_array_new
-#define g_byte_array_set_size monoeg_g_byte_array_set_size
-#define g_calloc monoeg_g_calloc
-#define g_clear_error monoeg_g_clear_error
-#define g_convert monoeg_g_convert
-#define g_convert_error_quark monoeg_g_convert_error_quark
-#define g_dir_close monoeg_g_dir_close
-#define g_dir_open monoeg_g_dir_open
-#define g_dir_read_name monoeg_g_dir_read_name
-#define g_dir_rewind monoeg_g_dir_rewind
-#define g_mkdir_with_parents monoeg_g_mkdir_with_parents
-#define g_direct_equal monoeg_g_direct_equal
-#define g_direct_hash monoeg_g_direct_hash
-#define g_ensure_directory_exists monoeg_g_ensure_directory_exists
-#define g_error_free monoeg_g_error_free
-#define g_error_new monoeg_g_error_new
-#define g_error_vnew monoeg_g_error_vnew
-#define g_file_error_quark monoeg_g_file_error_quark
-#define g_file_error_from_errno monoeg_g_file_error_from_errno
-#define g_file_get_contents monoeg_g_file_get_contents
-#define g_file_set_contents monoeg_g_file_set_contents
-#define g_file_open_tmp monoeg_g_file_open_tmp
-#define g_file_test monoeg_g_file_test
-#define g_filename_from_uri monoeg_g_filename_from_uri
-#define g_filename_from_utf8 monoeg_g_filename_from_utf8
-#define g_filename_to_uri monoeg_g_filename_to_uri
-#define g_find_program_in_path monoeg_g_find_program_in_path
-#define g_fprintf monoeg_g_fprintf
-#define g_free monoeg_g_free
-#define g_get_charset monoeg_g_get_charset
-#define g_get_current_dir monoeg_g_get_current_dir
-#define g_get_current_time monoeg_g_get_current_time
-#define g_get_home_dir monoeg_g_get_home_dir
-#define g_get_prgname monoeg_g_get_prgname
-#define g_get_tmp_dir monoeg_g_get_tmp_dir
-#define g_get_user_name monoeg_g_get_user_name
-#define g_getenv monoeg_g_getenv
-#define g_hasenv monoeg_g_hasenv
-#define g_hash_table_destroy monoeg_g_hash_table_destroy
-#define g_hash_table_find monoeg_g_hash_table_find
-#define g_hash_table_foreach monoeg_g_hash_table_foreach
-#define g_hash_table_foreach_remove monoeg_g_hash_table_foreach_remove
-#define g_hash_table_foreach_steal monoeg_g_hash_table_foreach_steal
-#define g_hash_table_get_keys monoeg_g_hash_table_get_keys
-#define g_hash_table_get_values monoeg_g_hash_table_get_values
-#define g_hash_table_insert_replace monoeg_g_hash_table_insert_replace
-#define g_hash_table_lookup monoeg_g_hash_table_lookup
-#define g_hash_table_lookup_extended monoeg_g_hash_table_lookup_extended
-#define g_hash_table_new monoeg_g_hash_table_new
-#define g_hash_table_new_full monoeg_g_hash_table_new_full
-#define g_hash_table_remove monoeg_g_hash_table_remove
-#define g_hash_table_steal monoeg_g_hash_table_steal
-#define g_hash_table_size monoeg_g_hash_table_size
-#define g_hash_table_print_stats monoeg_g_hash_table_print_stats
-#define g_hash_table_remove_all monoeg_g_hash_table_remove_all
-#define g_hash_table_iter_init monoeg_g_hash_table_iter_init
-#define g_hash_table_iter_next monoeg_g_hash_table_iter_next
-#define g_iconv monoeg_g_iconv
-#define g_iconv_close monoeg_g_iconv_close
-#define g_iconv_open monoeg_g_iconv_open
-#define g_int_equal monoeg_g_int_equal
-#define g_int_hash monoeg_g_int_hash
-#define g_list_alloc monoeg_g_list_alloc
-#define g_list_append monoeg_g_list_append
-#define g_list_concat monoeg_g_list_concat
-#define g_list_copy monoeg_g_list_copy
-#define g_list_delete_link monoeg_g_list_delete_link
-#define g_list_find monoeg_g_list_find
-#define g_list_find_custom monoeg_g_list_find_custom
-#define g_list_first monoeg_g_list_first
-#define g_list_foreach monoeg_g_list_foreach
-#define g_list_free monoeg_g_list_free
-#define g_list_free_1 monoeg_g_list_free_1
-#define g_list_index monoeg_g_list_index
-#define g_list_insert_before monoeg_g_list_insert_before
-#define g_list_insert_sorted monoeg_g_list_insert_sorted
-#define g_list_last monoeg_g_list_last
-#define g_list_length monoeg_g_list_length
-#define g_list_nth monoeg_g_list_nth
-#define g_list_nth_data monoeg_g_list_nth_data
-#define g_list_prepend monoeg_g_list_prepend
-#define g_list_remove monoeg_g_list_remove
-#define g_list_remove_all monoeg_g_list_remove_all
-#define g_list_remove_link monoeg_g_list_remove_link
-#define g_list_reverse monoeg_g_list_reverse
-#define g_list_sort monoeg_g_list_sort
-#define g_locale_from_utf8 monoeg_g_locale_from_utf8
-#define g_locale_to_utf8 monoeg_g_locale_to_utf8
-#define g_log monoeg_g_log
-#define g_log_set_always_fatal monoeg_g_log_set_always_fatal
-#define g_log_set_fatal_mask monoeg_g_log_set_fatal_mask
-#define g_logv monoeg_g_logv
-#define g_markup_parse_context_end_parse monoeg_g_markup_parse_context_end_parse
-#define g_markup_parse_context_free monoeg_g_markup_parse_context_free
-#define g_markup_parse_context_new monoeg_g_markup_parse_context_new
-#define g_markup_parse_context_parse monoeg_g_markup_parse_context_parse
-#define g_memdup monoeg_g_memdup
-#define g_mem_set_vtable monoeg_g_mem_set_vtable
-#define g_mkdtemp monoeg_g_mkdtemp
-#define g_module_build_path monoeg_g_module_build_path
-#define g_module_close monoeg_g_module_close
-#define g_module_error monoeg_g_module_error
-#define g_module_open monoeg_g_module_open
-#define g_module_symbol monoeg_g_module_symbol
-#define g_path_get_basename monoeg_g_path_get_basename
-#define g_path_get_dirname monoeg_g_path_get_dirname
-#define g_path_is_absolute monoeg_g_path_is_absolute
-#define g_pattern_match_string monoeg_g_pattern_match_string
-#define g_pattern_spec_free monoeg_g_pattern_spec_free
-#define g_pattern_spec_new monoeg_g_pattern_spec_new
-#define g_print monoeg_g_print
-#define g_printf monoeg_g_printf
-#define g_printerr monoeg_g_printerr
-#define g_propagate_error monoeg_g_propagate_error
-#define g_ptr_array_add monoeg_g_ptr_array_add
-#define g_ptr_array_foreach monoeg_g_ptr_array_foreach
-#define g_ptr_array_free monoeg_g_ptr_array_free
-#define g_ptr_array_new monoeg_g_ptr_array_new
-#define g_ptr_array_remove monoeg_g_ptr_array_remove
-#define g_ptr_array_remove_fast monoeg_g_ptr_array_remove_fast
-#define g_ptr_array_remove_index monoeg_g_ptr_array_remove_index
-#define g_ptr_array_remove_index_fast monoeg_g_ptr_array_remove_index_fast
-#define g_ptr_array_set_size monoeg_g_ptr_array_set_size
-#define g_ptr_array_sized_new monoeg_g_ptr_array_sized_new
-#define g_ptr_array_sort monoeg_g_ptr_array_sort
-#define g_ptr_array_sort_with_data monoeg_g_ptr_array_sort_with_data
-#define g_qsort_with_data monoeg_g_qsort_with_data
-#define g_queue_free monoeg_g_queue_free
-#define g_queue_is_empty monoeg_g_queue_is_empty
-#define g_queue_foreach monoeg_g_queue_foreach
-#define g_queue_new monoeg_g_queue_new
-#define g_queue_pop_head monoeg_g_queue_pop_head
-#define g_queue_push_head monoeg_g_queue_push_head
-#define g_queue_push_tail monoeg_g_queue_push_tail
-#define g_set_error monoeg_g_set_error
-#define g_set_prgname monoeg_g_set_prgname
-#define g_setenv monoeg_g_setenv
-#define g_shell_parse_argv monoeg_g_shell_parse_argv
-#define g_shell_quote monoeg_g_shell_quote
-#define g_shell_unquote monoeg_g_shell_unquote
-#define g_slist_alloc monoeg_g_slist_alloc
-#define g_slist_append monoeg_g_slist_append
-#define g_slist_concat monoeg_g_slist_concat
-#define g_slist_copy monoeg_g_slist_copy
-#define g_slist_delete_link monoeg_g_slist_delete_link
-#define g_slist_find monoeg_g_slist_find
-#define g_slist_find_custom monoeg_g_slist_find_custom
-#define g_slist_foreach monoeg_g_slist_foreach
-#define g_slist_free monoeg_g_slist_free
-#define g_slist_free_1 monoeg_g_slist_free_1
-#define g_slist_index monoeg_g_slist_index
-#define g_slist_insert_before monoeg_g_slist_insert_before
-#define g_slist_insert_sorted monoeg_g_slist_insert_sorted
-#define g_slist_last monoeg_g_slist_last
-#define g_slist_length monoeg_g_slist_length
-#define g_slist_nth monoeg_g_slist_nth
-#define g_slist_nth_data monoeg_g_slist_nth_data
-#define g_slist_prepend monoeg_g_slist_prepend
-#define g_slist_remove monoeg_g_slist_remove
-#define g_slist_remove_all monoeg_g_slist_remove_all
-#define g_slist_remove_link monoeg_g_slist_remove_link
-#define g_slist_reverse monoeg_g_slist_reverse
-#define g_slist_sort monoeg_g_slist_sort
-#define g_snprintf monoeg_g_snprintf
-#define g_spaced_primes_closest monoeg_g_spaced_primes_closest
-#define g_spawn_async_with_pipes monoeg_g_spawn_async_with_pipes
-#define g_spawn_command_line_sync monoeg_g_spawn_command_line_sync
-#define g_sprintf monoeg_g_sprintf
-#define g_stpcpy monoeg_g_stpcpy
-#define g_str_equal monoeg_g_str_equal
-#define g_str_has_prefix monoeg_g_str_has_prefix
-#define g_str_has_suffix monoeg_g_str_has_suffix
-#define g_str_hash monoeg_g_str_hash
-#define g_strchomp monoeg_g_strchomp
-#define g_strchug monoeg_g_strchug
-#define g_strconcat monoeg_g_strconcat
-#define g_strdelimit monoeg_g_strdelimit
-#define g_strdown monoeg_g_strdown
-#define g_strdup_printf monoeg_g_strdup_printf
-#define g_strdup_vprintf monoeg_g_strdup_vprintf
-#define g_strerror monoeg_g_strerror
-#define g_strescape monoeg_g_strescape
-#define g_strfreev monoeg_g_strfreev
-#define g_strdupv monoeg_g_strdupv
-#define g_string_append monoeg_g_string_append
-#define g_string_append_c monoeg_g_string_append_c
-#define g_string_append_len monoeg_g_string_append_len
-#define g_string_append_unichar monoeg_g_string_append_unichar
-#define g_string_append_printf monoeg_g_string_append_printf
-#define g_string_append_vprintf monoeg_g_string_append_vprintf
-#define g_string_erase monoeg_g_string_erase
-#define g_string_free monoeg_g_string_free
-#define g_string_insert monoeg_g_string_insert
-#define g_string_new monoeg_g_string_new
-#define g_string_new_len monoeg_g_string_new_len
-#define g_string_prepend monoeg_g_string_prepend
-#define g_string_printf monoeg_g_string_printf
-#define g_string_set_size monoeg_g_string_set_size
-#define g_string_sized_new monoeg_g_string_sized_new
-#define g_string_truncate monoeg_g_string_truncate
-#define g_strjoin monoeg_g_strjoin
-#define g_strjoinv monoeg_g_strjoinv
-#define g_strlcpy monoeg_g_strlcpy
-#define g_strndup monoeg_g_strndup
-#define g_strnfill monoeg_g_strnfill
-#define g_strreverse monoeg_g_strreverse
-#define g_strsplit monoeg_g_strsplit
-#define g_strsplit_set monoeg_g_strsplit_set
-#define g_strv_length monoeg_g_strv_length
-#define g_timer_destroy monoeg_g_timer_destroy
-#define g_timer_elapsed monoeg_g_timer_elapsed
-#define g_timer_new monoeg_g_timer_new
-#define g_timer_start monoeg_g_timer_start
-#define g_timer_stop monoeg_g_timer_stop
-#define g_trailingBytesForUTF8 monoeg_g_trailingBytesForUTF8
-#define g_ucs4_to_utf8 monoeg_g_ucs4_to_utf8
-#define g_ucs4_to_utf16 monoeg_g_ucs4_to_utf16
-#define g_unichar_case monoeg_g_unichar_case
-#define g_unichar_isxdigit monoeg_g_unichar_isxdigit
-#define g_unichar_tolower monoeg_g_unichar_tolower
-#define g_unichar_totitle monoeg_g_unichar_totitle
-#define g_unichar_toupper monoeg_g_unichar_toupper
-#define g_unichar_type monoeg_g_unichar_type
-#define g_unichar_xdigit_value monoeg_g_unichar_xdigit_value
-#define g_unsetenv monoeg_g_unsetenv
-#define g_usleep monoeg_g_usleep
-#define g_utf16_to_ucs4 monoeg_g_utf16_to_ucs4
-#define g_utf16_to_utf8 monoeg_g_utf16_to_utf8
-#define g_utf8_get_char monoeg_g_utf8_get_char
-#define g_utf8_offset_to_pointer monoeg_g_utf8_offset_to_pointer
-#define g_utf8_pointer_to_offset monoeg_g_utf8_pointer_to_offset
-#define g_utf8_strdown monoeg_g_utf8_strdown
-#define g_utf8_strlen monoeg_g_utf8_strlen
-#define g_utf8_strup monoeg_g_utf8_strup
-#define g_utf8_to_ucs4_fast monoeg_g_utf8_to_ucs4_fast
-#define g_utf8_to_utf16 monoeg_g_utf8_to_utf16
-#define g_utf8_validate monoeg_g_utf8_validate
-#define g_unichar_to_utf8 monoeg_g_unichar_to_utf8
-#define g_unichar_is_space monoeg_g_unichar_is_space
-#define g_unicode_break_type monoeg_g_unicode_break_type
-#define g_utf8_offset_to_pointer monoeg_g_utf8_offset_to_pointer
-#define g_utf8_pointer_to_offset monoeg_g_utf8_pointer_to_offset
-#define g_utf8_to_ucs4_fast monoeg_g_utf8_to_ucs4_fast
-#define g_vasprintf monoeg_g_vasprintf
-#define g_win32_getlocale monoeg_g_win32_getlocale
-#define g_assertion_message monoeg_assertion_message
-#define g_malloc monoeg_malloc
-#define g_malloc0 monoeg_malloc0
-#define g_ptr_array_grow monoeg_ptr_array_grow
-#define g_realloc monoeg_realloc
-#define g_try_malloc monoeg_try_malloc
-#define g_try_realloc monoeg_try_realloc
-#define g_strdup monoeg_strdup
-#define g_ucs4_to_utf16_len monoeg_ucs4_to_utf16_len
-#define g_utf16_to_ucs4_len monoeg_utf16_to_ucs4_len
-
-#define g_ascii_strcasecmp monoeg_ascii_strcasecmp
-#define g_ascii_strup monoeg_ascii_strup
-#define g_ascii_toupper monoeg_ascii_toupper
-#define g_unichar_break_type monoeg_unichar_break_type
-#define g_unichar_isspace monoeg_unichar_isspace
-#define g_unichar_to_utf16 monoeg_unichar_to_utf16
-#define g_utf8_find_prev_char monoeg_utf8_find_prev_char
-#define g_utf8_get_char_validated monoeg_utf8_get_char_validated
-#define g_utf8_prev_char monoeg_utf8_prev_char
-#define g_utf8_to_ucs4 monoeg_utf8_to_ucs4
-
-
-#define g_log_default_handler monoeg_log_default_handler
-#define g_log_set_default_handler monoeg_log_set_default_handler
-#define g_set_print_handler monoeg_set_print_handler
-#define g_set_printerr_handler monoeg_set_printerr_handler
diff --git a/eglib/src/garray.c b/eglib/src/garray.c
deleted file mode 100644 (file)
index b9844f8..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Arrays
- *
- * Author:
- *   Chris Toshok (toshok@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <glib.h>
-
-#define INITIAL_CAPACITY 16
-
-#define element_offset(p,i) ((p)->array.data + (i) * (p)->element_size)
-#define element_length(p,i) ((i) * (p)->element_size)
-
-typedef struct {
-       GArray array;
-       gboolean clear_;
-       guint element_size;
-       gboolean zero_terminated;
-       guint capacity;
-} GArrayPriv;
-
-static void
-ensure_capacity (GArrayPriv *priv, guint capacity)
-{
-       guint new_capacity;
-       
-       if (capacity <= priv->capacity)
-               return;
-       
-       new_capacity = (capacity + 63) & ~63;
-       
-       priv->array.data = g_realloc (priv->array.data, element_length (priv, new_capacity));
-       
-       if (priv->clear_) {
-               memset (element_offset (priv, priv->capacity),
-                       0,
-                       element_length (priv, new_capacity - priv->capacity));
-       }
-       
-       priv->capacity = new_capacity;
-}
-
-GArray *
-g_array_new (gboolean zero_terminated,
-            gboolean clear_,
-            guint element_size)
-{
-       GArrayPriv *rv = g_new0 (GArrayPriv, 1);
-       rv->zero_terminated = zero_terminated;
-       rv->clear_ = clear_;
-       rv->element_size = element_size;
-
-       ensure_capacity (rv, INITIAL_CAPACITY);
-
-       return (GArray*)rv;
-}
-
-GArray *
-g_array_sized_new (gboolean zero_terminated,
-            gboolean clear_,
-            guint element_size,
-                guint reserved_size)
-{
-       GArrayPriv *rv = g_new0 (GArrayPriv, 1);
-       rv->zero_terminated = zero_terminated;
-       rv->clear_ = clear_;
-       rv->element_size = element_size;
-
-       ensure_capacity (rv, reserved_size);
-
-       return (GArray*)rv;
-}
-
-gchar*
-g_array_free (GArray *array,
-             gboolean free_segment)
-{
-       gchar* rv = NULL;
-
-       g_return_val_if_fail (array != NULL, NULL);
-
-       if (free_segment)
-               g_free (array->data);
-       else
-               rv = array->data;
-
-       g_free (array);
-
-       return rv;
-}
-
-GArray *
-g_array_append_vals (GArray *array,
-                    gconstpointer data,
-                    guint len)
-{
-       GArrayPriv *priv = (GArrayPriv*)array;
-
-       g_return_val_if_fail (array != NULL, NULL);
-
-       ensure_capacity (priv, priv->array.len + len + (priv->zero_terminated ? 1 : 0));
-  
-       memmove (element_offset (priv, priv->array.len),
-                data,
-                element_length (priv, len));
-
-       priv->array.len += len;
-
-       if (priv->zero_terminated) {
-               memset (element_offset (priv, priv->array.len),
-                       0,
-                       priv->element_size);
-       }
-
-       return array;
-}
-
-GArray*
-g_array_insert_vals (GArray *array,
-                    guint index_,
-                    gconstpointer data,
-                    guint len)
-{
-       GArrayPriv *priv = (GArrayPriv*)array;
-       guint extra = (priv->zero_terminated ? 1 : 0);
-
-       g_return_val_if_fail (array != NULL, NULL);
-
-       ensure_capacity (priv, array->len + len + extra);
-  
-       /* first move the existing elements out of the way */
-       memmove (element_offset (priv, index_ + len),
-                element_offset (priv, index_),
-                element_length (priv, array->len - index_));
-
-       /* then copy the new elements into the array */
-       memmove (element_offset (priv, index_),
-                data,
-                element_length (priv, len));
-
-       array->len += len;
-
-       if (priv->zero_terminated) {
-               memset (element_offset (priv, priv->array.len),
-                       0,
-                       priv->element_size);
-       }
-
-       return array;
-}
-
-GArray*
-g_array_remove_index (GArray *array,
-                     guint index_)
-{
-       GArrayPriv *priv = (GArrayPriv*)array;
-
-       g_return_val_if_fail (array != NULL, NULL);
-
-       memmove (element_offset (priv, index_),
-                element_offset (priv, index_ + 1),
-                element_length (priv, array->len - index_));
-
-       array->len --;
-
-       if (priv->zero_terminated) {
-               memset (element_offset (priv, priv->array.len),
-                       0,
-                       priv->element_size);
-       }
-
-       return array;
-}
-
-GArray*
-g_array_remove_index_fast (GArray *array,
-                     guint index_)
-{
-       GArrayPriv *priv = (GArrayPriv*)array;
-
-       g_return_val_if_fail (array != NULL, NULL);
-
-       memmove (element_offset (priv, index_),
-                element_offset (priv, array->len - 1),
-                element_length (priv, 1));
-
-       array->len --;
-
-       if (priv->zero_terminated) {
-               memset (element_offset (priv, priv->array.len),
-                       0,
-                       priv->element_size);
-       }
-
-       return array;
-}
-
-void
-g_array_set_size (GArray *array, gint length)
-{
-       GArrayPriv *priv = (GArrayPriv*)array;
-
-       g_return_if_fail (array != NULL);
-       g_return_if_fail (length >= 0);
-
-       if (length == priv->capacity)
-               return; // nothing to be done
-
-       if (length > priv->capacity) {
-               // grow the array
-               ensure_capacity (priv, length);
-       }
-
-       array->len = length;
-}
diff --git a/eglib/src/gbytearray.c b/eglib/src/gbytearray.c
deleted file mode 100644 (file)
index f8231b4..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Arrays
- *
- * Author:
- *   Geoff Norton  (gnorton@novell.com)
- *
- * (C) 2010 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <glib.h>
-
-GByteArray *
-g_byte_array_new ()
-{
-       return (GByteArray *) g_array_new (FALSE, TRUE, 1);
-}
-
-guint8*
-g_byte_array_free (GByteArray *array,
-             gboolean free_segment)
-{
-       return (guint8*) g_array_free ((GArray *)array, free_segment);
-}
-
-GByteArray *
-g_byte_array_append (GByteArray *array,
-                    const guint8 *data,
-                    guint len)
-{
-       return (GByteArray *)g_array_append_vals ((GArray *)array, data, len);
-}
-
-void
-g_byte_array_set_size (GByteArray *array, gint length)
-{
-       g_array_set_size ((GArray *)array, length);
-}
-
diff --git a/eglib/src/gdate-unix.c b/eglib/src/gdate-unix.c
deleted file mode 100644 (file)
index 5573e0d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * gdate-unix.c: Date and time utility functions.
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <glib.h>
-#include <time.h>
-#include <errno.h>
-#include <sys/time.h>
-
-void
-g_get_current_time (GTimeVal *result)
-{
-       struct timeval tv;
-
-       g_return_if_fail (result != NULL);
-       gettimeofday (&tv, NULL);
-       result->tv_sec = tv.tv_sec;
-       result->tv_usec = tv.tv_usec;
-}
-
-void
-g_usleep (gulong microseconds)
-{
-       struct timespec req, rem;
-
-       req.tv_sec = microseconds / 1000000;
-       req.tv_nsec = (microseconds % 1000000) * 1000;
-       
-       while (nanosleep (&req, &rem) == -1 && errno == EINTR)
-               req = rem;
-}
diff --git a/eglib/src/gdate-win32.c b/eglib/src/gdate-win32.c
deleted file mode 100644 (file)
index b00e9b7..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * gdate-win32.c: Date and time utility functions.
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <glib.h>
-
-#include <winsock2.h>
-
-void
-g_get_current_time (GTimeVal *result)
-{
-       long int l;
-
-       g_return_if_fail (result != NULL);
-       l = GetTickCount();
-
-       result->tv_sec = l / 1000;
-       result->tv_usec = (l % 1000) * 1000;
-}
-
-void
-g_usleep (gulong microseconds)
-{
-       Sleep (microseconds/1000);
-}
diff --git a/eglib/src/gdir-unix.c b/eglib/src/gdir-unix.c
deleted file mode 100644 (file)
index abca22f..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Directory utility functions.
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
-
-struct _GDir {
-       DIR *dir;
-#ifndef HAVE_REWINDDIR
-       char *path;
-#endif
-};
-
-GDir *
-g_dir_open (const gchar *path, guint flags, GError **error)
-{
-       GDir *dir;
-
-       g_return_val_if_fail (path != NULL, NULL);
-       g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
-       (void) flags; /* this is not used */
-       dir = g_new (GDir, 1);
-       dir->dir = opendir (path);
-       if (dir->dir == NULL) {
-               if (error) {
-                       gint err = errno;
-                       *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
-               }
-               g_free (dir);
-               return NULL;
-       }
-#ifndef HAVE_REWINDDIR
-       dir->path = g_strdup (path);
-#endif
-       return dir;
-}
-
-const gchar *
-g_dir_read_name (GDir *dir)
-{
-       struct dirent *entry;
-
-       g_return_val_if_fail (dir != NULL && dir->dir != NULL, NULL);
-       do {
-               entry = readdir (dir->dir);
-               if (entry == NULL)
-                       return NULL;
-       } while ((strcmp (entry->d_name, ".") == 0) || (strcmp (entry->d_name, "..") == 0));
-
-       return entry->d_name;
-}
-
-void
-g_dir_rewind (GDir *dir)
-{
-       g_return_if_fail (dir != NULL && dir->dir != NULL);
-#ifndef HAVE_REWINDDIR
-       closedir (dir->dir);
-       dir->dir = opendir (dir->path);
-#else
-       rewinddir (dir->dir);
-#endif
-}
-
-void
-g_dir_close (GDir *dir)
-{
-       g_return_if_fail (dir != NULL && dir->dir != 0);
-       closedir (dir->dir);
-#ifndef HAVE_REWINDDIR
-       g_free (dir->path);
-#endif
-       dir->dir = NULL;
-       g_free (dir);
-}
-
-int
-g_mkdir_with_parents (const gchar *pathname, int mode)
-{
-       char *path, *d;
-       int rv;
-       
-       if (!pathname || *pathname == '\0') {
-               errno = EINVAL;
-               return -1;
-       }
-       
-       d = path = g_strdup (pathname);
-       if (*d == '/')
-               d++;
-       
-       while (TRUE) {
-               if (*d == '/' || *d == '\0') {
-                 char orig = *d;
-                 *d = '\0';
-                 rv = mkdir (path, mode);
-                 if (rv == -1 && errno != EEXIST) {
-                       g_free (path);
-                       return -1;
-                 }
-
-                 *d++ = orig;
-                 while (orig == '/' && *d == '/')
-                       d++;
-                 if (orig == '\0')
-                       break;
-               } else {
-                       d++;
-               }
-       }
-       
-       g_free (path);
-       
-       return 0;
-}
diff --git a/eglib/src/gdir-win32.c b/eglib/src/gdir-win32.c
deleted file mode 100644 (file)
index 0ae3fd4..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Directory utility functions.
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <io.h>
-
-#include <winsock2.h>
-
-struct _GDir {
-       HANDLE handle;
-       gchar* current;
-       gchar* next;
-};
-
-GDir *
-g_dir_open (const gchar *path, guint flags, GError **error)
-{
-       GDir *dir;
-       gunichar2* path_utf16;
-       gunichar2* path_utf16_search;
-       WIN32_FIND_DATAW find_data;
-
-       g_return_val_if_fail (path != NULL, NULL);
-       g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
-       dir = g_new0 (GDir, 1);
-       path_utf16 = u8to16 (path);
-       path_utf16_search = g_malloc ((wcslen((wchar_t *) path_utf16) + 3)*sizeof(gunichar2));
-       wcscpy (path_utf16_search, path_utf16);
-       wcscat (path_utf16_search, L"\\*");
-
-       dir->handle = FindFirstFileW (path_utf16_search, &find_data);
-       if (dir->handle == INVALID_HANDLE_VALUE) {
-               if (error) {
-                       gint err = errno;
-                       *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
-               }
-               g_free (path_utf16_search);
-               g_free (path_utf16);
-               g_free (dir);
-               return NULL;
-       }
-       g_free (path_utf16_search);
-       g_free (path_utf16);
-
-       while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0)) {
-               if (!FindNextFileW (dir->handle, &find_data)) {
-                       if (error) {
-                               gint err = errno;
-                               *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
-                       }
-                       g_free (dir);
-                       return NULL;
-               }
-       }
-
-       dir->current = NULL;
-       dir->next = u16to8 (find_data.cFileName);
-       return dir;
-}
-
-const gchar *
-g_dir_read_name (GDir *dir)
-{
-       WIN32_FIND_DATAW find_data;
-
-       g_return_val_if_fail (dir != NULL && dir->handle != 0, NULL);
-
-       if (dir->current)
-               g_free (dir->current);
-       dir->current = NULL;
-
-       dir->current = dir->next;
-
-       if (!dir->current)
-               return NULL;
-
-       dir->next = NULL;
-
-       do {
-               if (!FindNextFileW (dir->handle, &find_data)) {
-                       dir->next = NULL;
-                       return dir->current;
-               }
-       } while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0));
-
-       dir->next = u16to8 (find_data.cFileName);
-       return dir->current;
-}
-
-void
-g_dir_rewind (GDir *dir)
-{
-}
-
-void
-g_dir_close (GDir *dir)
-{
-       g_return_if_fail (dir != NULL && dir->handle != 0);
-       
-       if (dir->current)
-               g_free (dir->current);
-       dir->current = NULL;
-       if (dir->next)
-               g_free (dir->next);
-       dir->next = NULL;
-       FindClose (dir->handle);
-       dir->handle = 0;
-       g_free (dir);
-}
-
-
diff --git a/eglib/src/gerror.c b/eglib/src/gerror.c
deleted file mode 100644 (file)
index 43fef97..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * gerror.c: Error support.
- *
- * Author:
- *   Miguel de Icaza (miguel@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <config.h>
-#include <glib.h>
-GError *
-g_error_new (gpointer domain, gint code, const char *format, ...)
-{
-       va_list args;
-       GError *err = g_new (GError, 1);
-       
-       err->domain = domain;
-       err->code = code;
-
-       va_start (args, format);
-       if (g_vasprintf (&err->message, format, args) == -1)
-               err->message = g_strdup_printf ("internal: invalid format string %s", format); 
-       va_end (args);
-
-       return err;
-}
-
-static GError *
-g_error_vnew (gpointer domain, gint code, const char *format, va_list ap)
-{
-       GError *err = g_new (GError, 1);
-       
-       err->domain = domain;
-       err->code = code;
-
-       if (g_vasprintf (&err->message, format, ap) == -1)
-               err->message = g_strdup_printf ("internal: invalid format string %s", format); 
-
-       return err;
-}
-
-void
-g_clear_error (GError **error)
-{
-       if (error && *error) {
-               g_error_free (*error);
-               *error = NULL;
-       }
-}
-
-void
-g_error_free (GError *error)
-{
-       g_return_if_fail (error != NULL);
-       
-       g_free (error->message);
-       g_free (error);
-}
-
-void
-g_set_error (GError **err, gpointer domain, gint code, const gchar *format, ...)
-{
-       va_list args;
-
-       if (err) {
-               va_start (args, format);
-               *err = g_error_vnew (domain, code, format, args);
-               va_end (args);
-       }
-}
-
-void
-g_propagate_error (GError **dest, GError *src)
-{
-       if (dest == NULL){
-               if (src)
-                       g_error_free (src);
-       } else {
-               *dest = src;
-       }
-}
diff --git a/eglib/src/gfile-posix.c b/eglib/src/gfile-posix.c
deleted file mode 100644 (file)
index 48a9192..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * File utility functions.
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <config.h>
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <fcntl.h>
-#include <errno.h>
-
-#ifdef _MSC_VER
-#include <direct.h>
-#endif
-#ifdef G_OS_WIN32
-int mkstemp (char *tmp_template);
-#endif
-
-#ifndef O_LARGEFILE
-#define OPEN_FLAGS (O_RDONLY)
-#else
-#define OPEN_FLAGS (O_RDONLY | O_LARGEFILE)
-#endif
-gboolean
-g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error)
-{
-       gchar *str;
-       int fd;
-       struct stat st;
-       long offset;
-       int nread;
-
-       g_return_val_if_fail (filename != NULL, FALSE);
-       g_return_val_if_fail (contents != NULL, FALSE);
-       g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
-       *contents = NULL;
-       if (length)
-               *length = 0;
-
-       fd = open (filename, OPEN_FLAGS);
-       if (fd == -1) {
-               if (error != NULL) {
-                       int err = errno;
-                       *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error opening file");
-               }
-               return FALSE;
-       }
-
-       if (fstat (fd, &st) != 0) {
-               if (error != NULL) {
-                       int err = errno;
-                       *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in fstat()");
-               }
-               close (fd);
-               return FALSE;
-       }
-
-       str = g_malloc (st.st_size + 1);
-       offset = 0;
-       do {
-               nread = read (fd, str + offset, st.st_size - offset);
-               if (nread > 0) {
-                       offset += nread;
-               }
-       } while ((nread > 0 && offset < st.st_size) || (nread == -1 && errno == EINTR));
-
-       close (fd);
-       str [st.st_size] = '\0';
-       if (length) {
-               *length = st.st_size;
-       }
-       *contents = str;
-       return TRUE;
-}
-
-gint
-g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
-{
-       const static gchar *default_tmpl = ".XXXXXX";
-       gchar *t;
-       gint fd;
-       size_t len;
-
-       g_return_val_if_fail (error == NULL || *error == NULL, -1);
-
-       if (tmpl == NULL)
-               tmpl = default_tmpl;
-
-       if (strchr (tmpl, G_DIR_SEPARATOR) != NULL) {
-               if (error) {
-                       *error = g_error_new (G_LOG_DOMAIN, 24, "Template should not have any " G_DIR_SEPARATOR_S);
-               }
-               return -1;
-       }
-
-       len = strlen (tmpl);
-       if (len < 6 || strcmp (tmpl + len - 6, "XXXXXX")) {
-               if (error) {
-                       *error = g_error_new (G_LOG_DOMAIN, 24, "Template should end with XXXXXX");
-               }
-               return -1;
-       }
-
-       t = g_build_filename (g_get_tmp_dir (), tmpl, NULL);
-
-       fd = mkstemp (t);
-
-       if (fd == -1) {
-               if (error) {
-                       int err = errno;
-                       *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in mkstemp()");
-               }
-               g_free (t);
-               return -1;
-       }
-
-       if (name_used) {
-               *name_used = t;
-       } else {
-               g_free (t);
-       }
-       return fd;
-}
-
-gchar *
-g_get_current_dir (void)
-{
-       int s = 32;
-       char *buffer = NULL, *r;
-       gboolean fail;
-       
-       do {
-               buffer = g_realloc (buffer, s);
-               r = getcwd (buffer, s);
-               fail = (r == NULL && errno == ERANGE);
-               if (fail) {
-                       s <<= 1;
-               }
-       } while (fail);
-
-       /* On amd64 sometimes the bottom 32-bits of r == the bottom 32-bits of buffer
-        * but the top 32-bits of r have overflown to 0xffffffff (seriously wtf getcwd
-        * so we return the buffer here since it has a pointer to the valid string
-        */
-       return buffer;
-}
diff --git a/eglib/src/gfile-unix.c b/eglib/src/gfile-unix.c
deleted file mode 100644 (file)
index ab1fbb4..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * File utility functions.
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <config.h>
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-gboolean
-g_file_test (const gchar *filename, GFileTest test)
-{
-       struct stat st;
-       gboolean have_stat;
-
-       if (filename == NULL || test == 0)
-               return FALSE;
-
-       have_stat = FALSE;
-
-       if ((test & G_FILE_TEST_EXISTS) != 0) {
-               if (access (filename, F_OK) == 0)
-                       return TRUE;
-       }
-
-       if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
-               if (access (filename, X_OK) == 0)
-                       return TRUE;
-       }
-       if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
-               have_stat = (lstat (filename, &st) == 0);
-               if (have_stat && S_ISLNK (st.st_mode))
-                       return TRUE;
-       }
-
-       if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
-               if (!have_stat)
-                       have_stat = (stat (filename, &st) == 0);
-               if (have_stat && S_ISREG (st.st_mode))
-                       return TRUE;
-       }
-       if ((test & G_FILE_TEST_IS_DIR) != 0) {
-               if (!have_stat)
-                       have_stat = (stat (filename, &st) == 0);
-               if (have_stat && S_ISDIR (st.st_mode))
-                       return TRUE;
-       }
-       return FALSE;
-}
-
-gchar *
-g_mkdtemp (char *tmp_template)
-{
-#ifdef HAVE_MKDTEMP
-       char *template_copy = g_strdup (tmp_template);
-
-       return mkdtemp (template_copy);
-#else
-       g_error("Function not supported");
-#endif
-}
diff --git a/eglib/src/gfile-win32.c b/eglib/src/gfile-win32.c
deleted file mode 100644 (file)
index 61e23cb..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * File utility functions.
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <config.h>
-#include <windows.h>
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <direct.h>
-
-#ifdef G_OS_WIN32
-#include <io.h>
-#define open _open
-#ifndef S_ISREG
-#define S_ISREG(x) ((x &  _S_IFMT) == _S_IFREG)
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(x) ((x &  _S_IFMT) == _S_IFDIR)
-#endif
-#endif
-
-int mkstemp (char *tmp_template)
-{
-       int fd;
-       gunichar2* utf16_template;
-
-       utf16_template  = u8to16 (tmp_template);
-
-       fd = -1;
-       utf16_template = _wmktemp( utf16_template);
-       if (utf16_template && *utf16_template) {
-               /* FIXME: _O_TEMPORARY causes file to disappear on close causing a test to fail */
-               fd = _wopen( utf16_template, _O_BINARY | _O_CREAT /*| _O_TEMPORARY*/ | _O_RDWR | _O_EXCL, _S_IREAD | _S_IWRITE);
-       }
-
-       /* FIXME: this will crash if utf16_template == NULL */
-       sprintf (tmp_template + strlen (tmp_template) - 6, "%S", utf16_template + wcslen (utf16_template) - 6);
-
-       g_free (utf16_template);
-       return fd;
-}
-
-gchar *
-g_mkdtemp (char *tmp_template)
-{
-       gunichar2* utf16_template;
-
-       utf16_template  = u8to16 (tmp_template);
-
-       utf16_template = _wmktemp(utf16_template);
-       if (utf16_template && *utf16_template) {
-               if (_wmkdir (utf16_template) == 0){
-                       char *ret = u16to8 (utf16_template);
-                       g_free (utf16_template);
-                       return ret;
-               }
-       }
-
-       g_free (utf16_template);
-       return NULL;
-}
-            
-#ifdef _MSC_VER
-#pragma warning(disable:4701)
-#endif
-
-gboolean
-g_file_test (const gchar *filename, GFileTest test)
-{
-       gunichar2* utf16_filename = NULL;
-       DWORD attr;
-       
-       if (filename == NULL || test == 0)
-               return FALSE;
-
-       utf16_filename = u8to16 (filename);
-       attr = GetFileAttributesW (utf16_filename);
-       g_free (utf16_filename);
-       
-       if (attr == INVALID_FILE_ATTRIBUTES)
-               return FALSE;
-
-       if ((test & G_FILE_TEST_EXISTS) != 0) {
-               return TRUE;
-       }
-
-       if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
-               size_t len = strlen (filename);
-               if (len > 4 && strcmp (filename + len-3, "exe"))
-                   return TRUE;
-                   
-               return FALSE;
-       }
-
-       if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
-               if (attr & (FILE_ATTRIBUTE_DEVICE|FILE_ATTRIBUTE_DIRECTORY))
-                       return FALSE;
-               return TRUE;
-       }
-
-       if ((test & G_FILE_TEST_IS_DIR) != 0) {
-               if (attr & FILE_ATTRIBUTE_DIRECTORY)
-                       return TRUE;
-       }
-
-       /* make this last in case it is OR'd with something else */
-       if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
-               return FALSE;
-       }
-
-       return FALSE;
-}
diff --git a/eglib/src/gfile.c b/eglib/src/gfile.c
deleted file mode 100644 (file)
index 01cfa25..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * File utility functions.
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <errno.h>
-
-static gpointer error_quark = "FileError";
-
-gpointer
-g_file_error_quark (void)
-{
-       return error_quark;
-}
-
-GFileError
-g_file_error_from_errno (gint err_no)
-{
-       switch (err_no) {
-       case EEXIST:
-               return G_FILE_ERROR_EXIST;
-       case EISDIR:
-               return G_FILE_ERROR_ISDIR;
-       case EACCES:
-               return G_FILE_ERROR_ACCES;
-       case ENAMETOOLONG:
-               return G_FILE_ERROR_NAMETOOLONG;
-       case ENOENT:
-               return G_FILE_ERROR_NOENT;
-       case ENOTDIR:
-               return G_FILE_ERROR_NOTDIR;
-       case ENXIO:
-               return G_FILE_ERROR_NXIO;
-       case ENODEV:
-               return G_FILE_ERROR_NODEV;
-       case EROFS:
-               return G_FILE_ERROR_ROFS;
-#ifdef ETXTBSY
-       case ETXTBSY:
-               return G_FILE_ERROR_TXTBSY;
-#endif
-       case EFAULT:
-               return G_FILE_ERROR_FAULT;
-#ifdef ELOOP
-       case ELOOP:
-               return G_FILE_ERROR_LOOP;
-#endif
-       case ENOSPC:
-               return G_FILE_ERROR_NOSPC;
-       case ENOMEM:
-               return G_FILE_ERROR_NOMEM;
-       case EMFILE:
-               return G_FILE_ERROR_MFILE;
-       case ENFILE:
-               return G_FILE_ERROR_NFILE;
-       case EBADF:
-               return G_FILE_ERROR_BADF;
-       case EINVAL:
-               return G_FILE_ERROR_INVAL;
-       case EPIPE:
-               return G_FILE_ERROR_PIPE;
-       case EAGAIN:
-               return G_FILE_ERROR_AGAIN;
-       case EINTR:
-               return G_FILE_ERROR_INTR;
-       case EIO:
-               return G_FILE_ERROR_IO;
-       case EPERM:
-               return G_FILE_ERROR_PERM;
-       case ENOSYS:
-               return G_FILE_ERROR_NOSYS;
-       default:
-               return G_FILE_ERROR_FAILED;
-       }
-}
-
-#ifdef G_OS_WIN32
-#define TMP_FILE_FORMAT "%.*s%s.tmp"
-#else
-#define TMP_FILE_FORMAT "%.*s.%s~"
-#endif
-
-gboolean
-g_file_set_contents (const gchar *filename, const gchar *contents, gssize length, GError **err)
-{
-       const char *name;
-       char *path;
-       FILE *fp;
-       
-       if (!(name = strrchr (filename, G_DIR_SEPARATOR)))
-               name = filename;
-       else
-               name++;
-       
-       path = g_strdup_printf (TMP_FILE_FORMAT, name - filename, filename, name);
-       if (!(fp = fopen (path, "wb"))) {
-               g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (errno), "%s", g_strerror (errno));
-               g_free (path);
-               return FALSE;
-       }
-       
-       if (length < 0)
-               length = strlen (contents);
-       
-       if (fwrite (contents, 1, length, fp) < length) {
-               g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (ferror (fp)), "%s", g_strerror (ferror (fp)));
-               g_unlink (path);
-               g_free (path);
-               fclose (fp);
-               
-               return FALSE;
-       }
-       
-       fclose (fp);
-       
-       if (g_rename (path, filename) != 0) {
-               g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (errno), "%s", g_strerror (errno));
-               g_unlink (path);
-               g_free (path);
-               return FALSE;
-       }
-       
-       g_free (path);
-       
-       return TRUE;
-}
diff --git a/eglib/src/ghashtable.c b/eglib/src/ghashtable.c
deleted file mode 100644 (file)
index 5fac0eb..0000000
+++ /dev/null
@@ -1,671 +0,0 @@
-/*
- * ghashtable.c: Hashtable implementation
- *
- * Author:
- *   Miguel de Icaza (miguel@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <math.h>
-#include <glib.h>
-
-typedef struct _Slot Slot;
-
-struct _Slot {
-       gpointer key;
-       gpointer value;
-       Slot    *next;
-};
-
-static gpointer KEYMARKER_REMOVED = &KEYMARKER_REMOVED;
-
-struct _GHashTable {
-       GHashFunc      hash_func;
-       GEqualFunc     key_equal_func;
-
-       Slot **table;
-       int   table_size;
-       int   in_use;
-       int   threshold;
-       int   last_rehash;
-       GDestroyNotify value_destroy_func, key_destroy_func;
-};
-
-typedef struct {
-       GHashTable *ht;
-       int slot_index;
-       Slot *slot;
-} Iter;
-
-static const guint prime_tbl[] = {
-       11, 19, 37, 73, 109, 163, 251, 367, 557, 823, 1237,
-       1861, 2777, 4177, 6247, 9371, 14057, 21089, 31627,
-       47431, 71143, 106721, 160073, 240101, 360163,
-       540217, 810343, 1215497, 1823231, 2734867, 4102283,
-       6153409, 9230113, 13845163
-};
-
-static gboolean
-test_prime (int x)
-{
-       if ((x & 1) != 0) {
-               int n;
-               for (n = 3; n< (int)sqrt (x); n += 2) {
-                       if ((x % n) == 0)
-                               return FALSE;
-               }
-               return TRUE;
-       }
-       // There is only one even prime - 2.
-       return (x == 2);
-}
-
-static int
-calc_prime (int x)
-{
-       int i;
-       
-       for (i = (x & (~1))-1; i< G_MAXINT32; i += 2) {
-               if (test_prime (i))
-                       return i;
-       }
-       return x;
-}
-
-guint
-g_spaced_primes_closest (guint x)
-{
-       int i;
-       
-       for (i = 0; i < G_N_ELEMENTS (prime_tbl); i++) {
-               if (x <= prime_tbl [i])
-                       return prime_tbl [i];
-       }
-       return calc_prime (x);
-}
-
-GHashTable *
-g_hash_table_new (GHashFunc hash_func, GEqualFunc key_equal_func)
-{
-       GHashTable *hash;
-
-       if (hash_func == NULL)
-               hash_func = g_direct_hash;
-       if (key_equal_func == NULL)
-               key_equal_func = g_direct_equal;
-       hash = g_new0 (GHashTable, 1);
-
-       hash->hash_func = hash_func;
-       hash->key_equal_func = key_equal_func;
-
-       hash->table_size = g_spaced_primes_closest (1);
-       hash->table = g_new0 (Slot *, hash->table_size);
-       hash->last_rehash = hash->table_size;
-       
-       return hash;
-}
-
-GHashTable *
-g_hash_table_new_full (GHashFunc hash_func, GEqualFunc key_equal_func,
-                      GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
-{
-       GHashTable *hash = g_hash_table_new (hash_func, key_equal_func);
-       if (hash == NULL)
-               return NULL;
-       
-       hash->key_destroy_func = key_destroy_func;
-       hash->value_destroy_func = value_destroy_func;
-       
-       return hash;
-}
-
-#if 0
-static void
-dump_hash_table (GHashTable *hash)
-{
-       int i;
-
-       for (i = 0; i < hash->table_size; i++) {
-               Slot *s;
-
-               for (s = hash->table [i]; s != NULL; s = s->next){
-                       guint hashcode = (*hash->hash_func) (s->key);
-                       guint slot = (hashcode) % hash->table_size;
-                       printf ("key %p hash %x on slot %d correct slot %d tb size %d\n", s->key, hashcode, i, slot, hash->table_size);
-               }
-       }
-}
-#endif
-
-#ifdef SANITY_CHECK
-static void
-sanity_check (GHashTable *hash)
-{
-       int i;
-
-       for (i = 0; i < hash->table_size; i++) {
-               Slot *s;
-
-               for (s = hash->table [i]; s != NULL; s = s->next){
-                       guint hashcode = (*hash->hash_func) (s->key);
-                       guint slot = (hashcode) % hash->table_size;
-                       if (slot != i) {
-                               dump_hashcode_func = 1;
-                               hashcode = (*hash->hash_func) (s->key);
-                               dump_hashcode_func = 0;
-                               g_error ("Key %p (bucket %d) on invalid bucket %d (hashcode %x) (tb size %d)", s->key, slot, i, hashcode, hash->table_size);
-                       }
-               }
-       }
-}
-#else
-
-#define sanity_check(HASH) do {}while(0)
-
-#endif
-
-static void
-do_rehash (GHashTable *hash)
-{
-       int current_size, i;
-       Slot **table;
-
-       /* printf ("Resizing diff=%d slots=%d\n", hash->in_use - hash->last_rehash, hash->table_size); */
-       hash->last_rehash = hash->table_size;
-       current_size = hash->table_size;
-       hash->table_size = g_spaced_primes_closest (hash->in_use);
-       /* printf ("New size: %d\n", hash->table_size); */
-       table = hash->table;
-       hash->table = g_new0 (Slot *, hash->table_size);
-       
-       for (i = 0; i < current_size; i++){
-               Slot *s, *next;
-
-               for (s = table [i]; s != NULL; s = next){
-                       guint hashcode = ((*hash->hash_func) (s->key)) % hash->table_size;
-                       next = s->next;
-
-                       s->next = hash->table [hashcode];
-                       hash->table [hashcode] = s;
-               }
-       }
-       g_free (table);
-}
-
-static void
-rehash (GHashTable *hash)
-{
-       int diff = ABS (hash->last_rehash - hash->in_use);
-
-       /* These are the factors to play with to change the rehashing strategy */
-       /* I played with them with a large range, and could not really get */
-       /* something that was too good, maybe the tests are not that great */
-       if (!(diff * 0.75 > hash->table_size * 2))
-               return;
-       do_rehash (hash);
-       sanity_check (hash);
-}
-
-void
-g_hash_table_insert_replace (GHashTable *hash, gpointer key, gpointer value, gboolean replace)
-{
-       guint hashcode;
-       Slot *s;
-       GEqualFunc equal;
-       
-       g_return_if_fail (hash != NULL);
-       sanity_check (hash);
-
-       equal = hash->key_equal_func;
-       if (hash->in_use >= hash->threshold)
-               rehash (hash);
-
-       hashcode = ((*hash->hash_func) (key)) % hash->table_size;
-       for (s = hash->table [hashcode]; s != NULL; s = s->next){
-               if ((*equal) (s->key, key)){
-                       if (replace){
-                               if (hash->key_destroy_func != NULL)
-                                       (*hash->key_destroy_func)(s->key);
-                               s->key = key;
-                       }
-                       if (hash->value_destroy_func != NULL)
-                               (*hash->value_destroy_func) (s->value);
-                       s->value = value;
-                       sanity_check (hash);
-                       return;
-               }
-       }
-       s = g_new (Slot, 1);
-       s->key = key;
-       s->value = value;
-       s->next = hash->table [hashcode];
-       hash->table [hashcode] = s;
-       hash->in_use++;
-       sanity_check (hash);
-}
-
-GList*
-g_hash_table_get_keys (GHashTable *hash)
-{
-       GHashTableIter iter;
-       GList *rv = NULL;
-       gpointer key;
-
-       g_hash_table_iter_init (&iter, hash);
-
-       while (g_hash_table_iter_next (&iter, &key, NULL))
-               rv = g_list_prepend (rv, key);
-
-       return g_list_reverse (rv);
-}
-
-GList*
-g_hash_table_get_values (GHashTable *hash)
-{
-       GHashTableIter iter;
-       GList *rv = NULL;
-       gpointer value;
-
-       g_hash_table_iter_init (&iter, hash);
-
-       while (g_hash_table_iter_next (&iter, NULL, &value))
-               rv = g_list_prepend (rv, value);
-
-       return g_list_reverse (rv);
-}
-
-
-guint
-g_hash_table_size (GHashTable *hash)
-{
-       g_return_val_if_fail (hash != NULL, 0);
-       
-       return hash->in_use;
-}
-
-gpointer
-g_hash_table_lookup (GHashTable *hash, gconstpointer key)
-{
-       gpointer orig_key, value;
-       
-       if (g_hash_table_lookup_extended (hash, key, &orig_key, &value))
-               return value;
-       else
-               return NULL;
-}
-
-gboolean
-g_hash_table_lookup_extended (GHashTable *hash, gconstpointer key, gpointer *orig_key, gpointer *value)
-{
-       GEqualFunc equal;
-       Slot *s;
-       guint hashcode;
-       
-       g_return_val_if_fail (hash != NULL, FALSE);
-       sanity_check (hash);
-       equal = hash->key_equal_func;
-
-       hashcode = ((*hash->hash_func) (key)) % hash->table_size;
-       
-       for (s = hash->table [hashcode]; s != NULL; s = s->next){
-               if ((*equal)(s->key, key)){
-                       if (orig_key)
-                               *orig_key = s->key;
-                       if (value)
-                               *value = s->value;
-                       return TRUE;
-               }
-       }
-       return FALSE;
-}
-
-void
-g_hash_table_foreach (GHashTable *hash, GHFunc func, gpointer user_data)
-{
-       int i;
-       
-       g_return_if_fail (hash != NULL);
-       g_return_if_fail (func != NULL);
-
-       for (i = 0; i < hash->table_size; i++){
-               Slot *s;
-
-               for (s = hash->table [i]; s != NULL; s = s->next)
-                       (*func)(s->key, s->value, user_data);
-       }
-}
-
-gpointer
-g_hash_table_find (GHashTable *hash, GHRFunc predicate, gpointer user_data)
-{
-       int i;
-       
-       g_return_val_if_fail (hash != NULL, NULL);
-       g_return_val_if_fail (predicate != NULL, NULL);
-
-       for (i = 0; i < hash->table_size; i++){
-               Slot *s;
-
-               for (s = hash->table [i]; s != NULL; s = s->next)
-                       if ((*predicate)(s->key, s->value, user_data))
-                               return s->value;
-       }
-       return NULL;
-}
-
-void
-g_hash_table_remove_all (GHashTable *hash)
-{
-       int i;
-       
-       g_return_if_fail (hash != NULL);
-
-       for (i = 0; i < hash->table_size; i++){
-               Slot *s;
-
-               while (hash->table [i]) {
-                       s = hash->table [i];
-                       g_hash_table_remove (hash, s->key);
-               }
-       }
-}
-
-gboolean
-g_hash_table_remove (GHashTable *hash, gconstpointer key)
-{
-       GEqualFunc equal;
-       Slot *s, *last;
-       guint hashcode;
-       
-       g_return_val_if_fail (hash != NULL, FALSE);
-       sanity_check (hash);
-       equal = hash->key_equal_func;
-
-       hashcode = ((*hash->hash_func)(key)) % hash->table_size;
-       last = NULL;
-       for (s = hash->table [hashcode]; s != NULL; s = s->next){
-               if ((*equal)(s->key, key)){
-                       if (hash->key_destroy_func != NULL)
-                               (*hash->key_destroy_func)(s->key);
-                       if (hash->value_destroy_func != NULL)
-                               (*hash->value_destroy_func)(s->value);
-                       if (last == NULL)
-                               hash->table [hashcode] = s->next;
-                       else
-                               last->next = s->next;
-                       g_free (s);
-                       hash->in_use--;
-                       sanity_check (hash);
-                       return TRUE;
-               }
-               last = s;
-       }
-       sanity_check (hash);
-       return FALSE;
-}
-
-guint
-g_hash_table_foreach_remove (GHashTable *hash, GHRFunc func, gpointer user_data)
-{
-       int i;
-       int count = 0;
-       
-       g_return_val_if_fail (hash != NULL, 0);
-       g_return_val_if_fail (func != NULL, 0);
-
-       sanity_check (hash);
-       for (i = 0; i < hash->table_size; i++){
-               Slot *s, *last;
-
-               last = NULL;
-               for (s = hash->table [i]; s != NULL; ){
-                       if ((*func)(s->key, s->value, user_data)){
-                               Slot *n;
-
-                               if (hash->key_destroy_func != NULL)
-                                       (*hash->key_destroy_func)(s->key);
-                               if (hash->value_destroy_func != NULL)
-                                       (*hash->value_destroy_func)(s->value);
-                               if (last == NULL){
-                                       hash->table [i] = s->next;
-                                       n = s->next;
-                               } else  {
-                                       last->next = s->next;
-                                       n = last->next;
-                               }
-                               g_free (s);
-                               hash->in_use--;
-                               count++;
-                               s = n;
-                       } else {
-                               last = s;
-                               s = s->next;
-                       }
-               }
-       }
-       sanity_check (hash);
-       if (count > 0)
-               rehash (hash);
-       return count;
-}
-
-gboolean
-g_hash_table_steal (GHashTable *hash, gconstpointer key)
-{
-       GEqualFunc equal;
-       Slot *s, *last;
-       guint hashcode;
-       
-       g_return_val_if_fail (hash != NULL, FALSE);
-       sanity_check (hash);
-       equal = hash->key_equal_func;
-       
-       hashcode = ((*hash->hash_func)(key)) % hash->table_size;
-       last = NULL;
-       for (s = hash->table [hashcode]; s != NULL; s = s->next){
-               if ((*equal)(s->key, key)) {
-                       if (last == NULL)
-                               hash->table [hashcode] = s->next;
-                       else
-                               last->next = s->next;
-                       g_free (s);
-                       hash->in_use--;
-                       sanity_check (hash);
-                       return TRUE;
-               }
-               last = s;
-       }
-       sanity_check (hash);
-       return FALSE;
-       
-}
-
-guint
-g_hash_table_foreach_steal (GHashTable *hash, GHRFunc func, gpointer user_data)
-{
-       int i;
-       int count = 0;
-       
-       g_return_val_if_fail (hash != NULL, 0);
-       g_return_val_if_fail (func != NULL, 0);
-
-       sanity_check (hash);
-       for (i = 0; i < hash->table_size; i++){
-               Slot *s, *last;
-
-               last = NULL;
-               for (s = hash->table [i]; s != NULL; ){
-                       if ((*func)(s->key, s->value, user_data)){
-                               Slot *n;
-
-                               if (last == NULL){
-                                       hash->table [i] = s->next;
-                                       n = s->next;
-                               } else  {
-                                       last->next = s->next;
-                                       n = last->next;
-                               }
-                               g_free (s);
-                               hash->in_use--;
-                               count++;
-                               s = n;
-                       } else {
-                               last = s;
-                               s = s->next;
-                       }
-               }
-       }
-       sanity_check (hash);
-       if (count > 0)
-               rehash (hash);
-       return count;
-}
-
-void
-g_hash_table_destroy (GHashTable *hash)
-{
-       int i;
-       
-       g_return_if_fail (hash != NULL);
-
-       for (i = 0; i < hash->table_size; i++){
-               Slot *s, *next;
-
-               for (s = hash->table [i]; s != NULL; s = next){
-                       next = s->next;
-                       
-                       if (hash->key_destroy_func != NULL)
-                               (*hash->key_destroy_func)(s->key);
-                       if (hash->value_destroy_func != NULL)
-                               (*hash->value_destroy_func)(s->value);
-                       g_free (s);
-               }
-       }
-       g_free (hash->table);
-       
-       g_free (hash);
-}
-
-void
-g_hash_table_print_stats (GHashTable *table)
-{
-       int i, max_chain_index, chain_size, max_chain_size;
-       Slot *node;
-
-       max_chain_size = 0;
-       max_chain_index = -1;
-       for (i = 0; i < table->table_size; i++) {
-               chain_size = 0;
-               for (node = table->table [i]; node; node = node->next)
-                       chain_size ++;
-               if (chain_size > max_chain_size) {
-                       max_chain_size = chain_size;
-                       max_chain_index = i;
-               }
-       }
-
-       printf ("Size: %d Table Size: %d Max Chain Length: %d at %d\n", table->in_use, table->table_size, max_chain_size, max_chain_index);
-}
-
-void
-g_hash_table_iter_init (GHashTableIter *it, GHashTable *hash_table)
-{
-       Iter *iter = (Iter*)it;
-
-       memset (iter, 0, sizeof (Iter));
-       iter->ht = hash_table;
-       iter->slot_index = -1;
-}
-
-gboolean g_hash_table_iter_next (GHashTableIter *it, gpointer *key, gpointer *value)
-{
-       Iter *iter = (Iter*)it;
-
-       GHashTable *hash = iter->ht;
-
-       g_assert (iter->slot_index != -2);
-       g_assert (sizeof (Iter) <= sizeof (GHashTableIter));
-
-       if (!iter->slot) {
-               while (TRUE) {
-                       iter->slot_index ++;
-                       if (iter->slot_index >= hash->table_size) {
-                               iter->slot_index = -2;
-                               return FALSE;
-                       }
-                       if (hash->table [iter->slot_index])
-                               break;
-               }
-               iter->slot = hash->table [iter->slot_index];
-       }
-
-       if (key)
-               *key = iter->slot->key;
-       if (value)
-               *value = iter->slot->value;
-       iter->slot = iter->slot->next;
-
-       return TRUE;
-}
-
-gboolean
-g_direct_equal (gconstpointer v1, gconstpointer v2)
-{
-       return v1 == v2;
-}
-
-guint
-g_direct_hash (gconstpointer v1)
-{
-       return GPOINTER_TO_UINT (v1);
-}
-
-gboolean
-g_int_equal (gconstpointer v1, gconstpointer v2)
-{
-       return *(gint *)v1 == *(gint *)v2;
-}
-
-guint
-g_int_hash (gconstpointer v1)
-{
-       return *(guint *)v1;
-}
-
-gboolean
-g_str_equal (gconstpointer v1, gconstpointer v2)
-{
-       return strcmp (v1, v2) == 0;
-}
-
-guint
-g_str_hash (gconstpointer v1)
-{
-       guint hash = 0;
-       char *p = (char *) v1;
-
-       while (*p++)
-               hash = (hash << 5) - (hash + *p);
-
-       return hash;
-}
diff --git a/eglib/src/giconv.c b/eglib/src/giconv.c
deleted file mode 100644 (file)
index c7723fe..0000000
+++ /dev/null
@@ -1,1340 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *  Copyright (C) 2011 Jeffrey Stedfast
- *
- *  Permission is hereby granted, free of charge, to any person
- *  obtaining a copy of this software and associated documentation
- *  files (the "Software"), to deal in the Software without
- *  restriction, including without limitation the rights to use, copy,
- *  modify, merge, publish, distribute, sublicense, and/or sell copies
- *  of the Software, and to permit persons to whom the Software is
- *  furnished to do so, subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be
- *  included in all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- *  DEALINGS IN THE SOFTWARE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <string.h>
-#ifdef HAVE_ICONV_H
-#include <iconv.h>
-#endif
-#include <errno.h>
-
-#ifdef _MSC_VER
-#define FORCE_INLINE(RET_TYPE) __forceinline RET_TYPE
-#else
-#define FORCE_INLINE(RET_TYPE) inline RET_TYPE __attribute__((always_inline))
-#endif
-
-
-#define UNROLL_DECODE_UTF8 0
-#define UNROLL_ENCODE_UTF8 0
-
-typedef int (* Decoder) (char *inbuf, size_t inleft, gunichar *outchar);
-typedef int (* Encoder) (gunichar c, char *outbuf, size_t outleft);
-
-struct _GIConv {
-       Decoder decode;
-       Encoder encode;
-       gunichar c;
-#ifdef HAVE_ICONV
-       iconv_t cd;
-#endif
-};
-
-static int decode_utf32be (char *inbuf, size_t inleft, gunichar *outchar);
-static int encode_utf32be (gunichar c, char *outbuf, size_t outleft);
-
-static int decode_utf32le (char *inbuf, size_t inleft, gunichar *outchar);
-static int encode_utf32le (gunichar c, char *outbuf, size_t outleft);
-
-static int decode_utf16be (char *inbuf, size_t inleft, gunichar *outchar);
-static int encode_utf16be (gunichar c, char *outbuf, size_t outleft);
-
-static int decode_utf16le (char *inbuf, size_t inleft, gunichar *outchar);
-static int encode_utf16le (gunichar c, char *outbuf, size_t outleft);
-
-static FORCE_INLINE (int) decode_utf8 (char *inbuf, size_t inleft, gunichar *outchar);
-static int encode_utf8 (gunichar c, char *outbuf, size_t outleft);
-
-static int decode_latin1 (char *inbuf, size_t inleft, gunichar *outchar);
-static int encode_latin1 (gunichar c, char *outbuf, size_t outleft);
-
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define decode_utf32 decode_utf32le
-#define encode_utf32 encode_utf32le
-#define decode_utf16 decode_utf16le
-#define encode_utf16 encode_utf16le
-#else
-#define decode_utf32 decode_utf32be
-#define encode_utf32 encode_utf32be
-#define decode_utf16 decode_utf16be
-#define encode_utf16 encode_utf16be
-#endif
-
-static struct {
-       const char *name;
-       Decoder decoder;
-       Encoder encoder;
-} charsets[] = {
-       { "ISO-8859-1", decode_latin1,  encode_latin1  },
-       { "ISO8859-1",  decode_latin1,  encode_latin1  },
-       { "UTF-32BE",   decode_utf32be, encode_utf32be },
-       { "UTF-32LE",   decode_utf32le, encode_utf32le },
-       { "UTF-16BE",   decode_utf16be, encode_utf16be },
-       { "UTF-16LE",   decode_utf16le, encode_utf16le },
-       { "UTF-32",     decode_utf32,   encode_utf32   },
-       { "UTF-16",     decode_utf16,   encode_utf16   },
-       { "UTF-8",      decode_utf8,    encode_utf8    },
-       { "US-ASCII",   decode_latin1,  encode_latin1  },
-       { "Latin1",     decode_latin1,  encode_latin1  },
-       { "ASCII",      decode_latin1,  encode_latin1  },
-       { "UTF32",      decode_utf32,   encode_utf32   },
-       { "UTF16",      decode_utf16,   encode_utf16   },
-       { "UTF8",       decode_utf8,    encode_utf8    },
-};
-
-
-GIConv
-g_iconv_open (const char *to_charset, const char *from_charset)
-{
-#ifdef HAVE_ICONV
-       iconv_t icd = (iconv_t) -1;
-#endif
-       Decoder decoder = NULL;
-       Encoder encoder = NULL;
-       GIConv cd;
-       guint i;
-       
-       if (!to_charset || !from_charset || !to_charset[0] || !from_charset[0]) {
-               errno = EINVAL;
-               
-               return (GIConv) -1;
-       }
-       
-       for (i = 0; i < G_N_ELEMENTS (charsets); i++) {
-               if (!g_ascii_strcasecmp (charsets[i].name, from_charset))
-                       decoder = charsets[i].decoder;
-               
-               if (!g_ascii_strcasecmp (charsets[i].name, to_charset))
-                       encoder = charsets[i].encoder;
-       }
-       
-       if (!encoder || !decoder) {
-#ifdef HAVE_ICONV
-               if ((icd = iconv_open (to_charset, from_charset)) == (iconv_t) -1)
-                       return (GIConv) -1;
-#else
-               errno = EINVAL;
-               
-               return (GIConv) -1;
-#endif
-       }
-       
-       cd = (GIConv) g_malloc (sizeof (struct _GIConv));
-       cd->decode = decoder;
-       cd->encode = encoder;
-       cd->c = -1;
-       
-#ifdef HAVE_ICONV
-       cd->cd = icd;
-#endif
-       
-       return cd;
-}
-
-int
-g_iconv_close (GIConv cd)
-{
-#ifdef HAVE_ICONV
-       if (cd->cd != (iconv_t) -1)
-               iconv_close (cd->cd);
-#endif
-       
-       g_free (cd);
-       
-       return 0;
-}
-
-gsize
-g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft,
-        gchar **outbytes, gsize *outbytesleft)
-{
-       gsize inleft, outleft;
-       char *inptr, *outptr;
-       gunichar c;
-       int rc = 0;
-       
-#ifdef HAVE_ICONV
-       if (cd->cd != (iconv_t) -1) {
-               /* Note: gsize may have a different size than size_t, so we need to
-                  remap inbytesleft and outbytesleft to size_t's. */
-               size_t *outleftptr, *inleftptr;
-               size_t n_outleft, n_inleft;
-               
-               if (inbytesleft) {
-                       n_inleft = *inbytesleft;
-                       inleftptr = &n_inleft;
-               } else {
-                       inleftptr = NULL;
-               }
-               
-               if (outbytesleft) {
-                       n_outleft = *outbytesleft;
-                       outleftptr = &n_outleft;
-               } else {
-                       outleftptr = NULL;
-               }
-#if defined(__NetBSD__)
-               return iconv (cd->cd, (const gchar **)inbytes, inleftptr, outbytes, outleftptr);
-#else
-               return iconv (cd->cd, inbytes, inleftptr, outbytes, outleftptr);
-#endif
-       }
-#endif
-       
-       if (outbytes == NULL || outbytesleft == NULL) {
-               /* reset converter */
-               cd->c = -1;
-               return 0;
-       }
-       
-       inleft = inbytesleft ? *inbytesleft : 0;
-       inptr = inbytes ? *inbytes : NULL;
-       outleft = *outbytesleft;
-       outptr = *outbytes;
-       
-       if ((c = cd->c) != (gunichar) -1)
-               goto encode;
-       
-       while (inleft > 0) {
-               if ((rc = cd->decode (inptr, inleft, &c)) < 0)
-                       break;
-               
-               inleft -= rc;
-               inptr += rc;
-               
-       encode:
-               if ((rc = cd->encode (c, outptr, outleft)) < 0)
-                       break;
-               
-               c = (gunichar) -1;
-               outleft -= rc;
-               outptr += rc;
-       }
-       
-       if (inbytesleft)
-               *inbytesleft = inleft;
-       
-       if (inbytes)
-               *inbytes = inptr;
-       
-       *outbytesleft = outleft;
-       *outbytes = outptr;
-       cd->c = c;
-       
-       return rc < 0 ? -1 : 0;
-}
-
-/*
- * Unicode encoders and decoders
- */
-
-static int
-decode_utf32be (char *inbuf, size_t inleft, gunichar *outchar)
-{
-       unsigned char *inptr = (unsigned char *) inbuf;
-       gunichar c;
-       
-       if (inleft < 4) {
-               errno = EINVAL;
-               return -1;
-       }
-       
-       c = (inptr[0] << 24) | (inptr[1] << 16) | (inptr[2] << 8) | inptr[3];
-       
-       if (c >= 0xd800 && c < 0xe000) {
-               errno = EILSEQ;
-               return -1;
-       } else if (c >= 0x110000) {
-               errno = EILSEQ;
-               return -1;
-       }
-       
-       *outchar = c;
-       
-       return 4;
-}
-
-static int
-decode_utf32le (char *inbuf, size_t inleft, gunichar *outchar)
-{
-       unsigned char *inptr = (unsigned char *) inbuf;
-       gunichar c;
-       
-       if (inleft < 4) {
-               errno = EINVAL;
-               return -1;
-       }
-       
-       c = (inptr[3] << 24) | (inptr[2] << 16) | (inptr[1] << 8) | inptr[0];
-       
-       if (c >= 0xd800 && c < 0xe000) {
-               errno = EILSEQ;
-               return -1;
-       } else if (c >= 0x110000) {
-               errno = EILSEQ;
-               return -1;
-       }
-       
-       *outchar = c;
-       
-       return 4;
-}
-
-static int
-encode_utf32be (gunichar c, char *outbuf, size_t outleft)
-{
-       unsigned char *outptr = (unsigned char *) outbuf;
-       
-       if (outleft < 4) {
-               errno = E2BIG;
-               return -1;
-       }
-       
-       outptr[0] = (c >> 24) & 0xff;
-       outptr[1] = (c >> 16) & 0xff;
-       outptr[2] = (c >> 8) & 0xff;
-       outptr[3] = c & 0xff;
-       
-       return 4;
-}
-
-static int
-encode_utf32le (gunichar c, char *outbuf, size_t outleft)
-{
-       unsigned char *outptr = (unsigned char *) outbuf;
-       
-       if (outleft < 4) {
-               errno = E2BIG;
-               return -1;
-       }
-       
-       outptr[0] = c & 0xff;
-       outptr[1] = (c >> 8) & 0xff;
-       outptr[2] = (c >> 16) & 0xff;
-       outptr[3] = (c >> 24) & 0xff;
-       
-       return 4;
-}
-
-static int
-decode_utf16be (char *inbuf, size_t inleft, gunichar *outchar)
-{
-       unsigned char *inptr = (unsigned char *) inbuf;
-       gunichar2 c;
-       gunichar u;
-       
-       if (inleft < 2) {
-               errno = EINVAL;
-               return -1;
-       }
-       
-       u = (inptr[0] << 8) | inptr[1];
-       
-       if (u < 0xd800) {
-               /* 0x0000 -> 0xd7ff */
-               *outchar = u;
-               return 2;
-       } else if (u < 0xdc00) {
-               /* 0xd800 -> 0xdbff */
-               if (inleft < 4) {
-                       errno = EINVAL;
-                       return -2;
-               }
-               
-               c = (inptr[2] << 8) | inptr[3];
-               
-               if (c < 0xdc00 || c > 0xdfff) {
-                       errno = EILSEQ;
-                       return -2;
-               }
-               
-               u = ((u - 0xd800) << 10) + (c - 0xdc00) + 0x0010000UL;
-               *outchar = u;
-               
-               return 4;
-       } else if (u < 0xe000) {
-               /* 0xdc00 -> 0xdfff */
-               errno = EILSEQ;
-               return -1;
-       } else {
-               /* 0xe000 -> 0xffff */
-               *outchar = u;
-               return 2;
-       }
-}
-
-static int
-decode_utf16le (char *inbuf, size_t inleft, gunichar *outchar)
-{
-       unsigned char *inptr = (unsigned char *) inbuf;
-       gunichar2 c;
-       gunichar u;
-       
-       if (inleft < 2) {
-               errno = EINVAL;
-               return -1;
-       }
-       
-       u = (inptr[1] << 8) | inptr[0];
-       
-       if (u < 0xd800) {
-               /* 0x0000 -> 0xd7ff */
-               *outchar = u;
-               return 2;
-       } else if (u < 0xdc00) {
-               /* 0xd800 -> 0xdbff */
-               if (inleft < 4) {
-                       errno = EINVAL;
-                       return -2;
-               }
-               
-               c = (inptr[3] << 8) | inptr[2];
-               
-               if (c < 0xdc00 || c > 0xdfff) {
-                       errno = EILSEQ;
-                       return -2;
-               }
-               
-               u = ((u - 0xd800) << 10) + (c - 0xdc00) + 0x0010000UL;
-               *outchar = u;
-               
-               return 4;
-       } else if (u < 0xe000) {
-               /* 0xdc00 -> 0xdfff */
-               errno = EILSEQ;
-               return -1;
-       } else {
-               /* 0xe000 -> 0xffff */
-               *outchar = u;
-               return 2;
-       }
-}
-
-static int
-encode_utf16be (gunichar c, char *outbuf, size_t outleft)
-{
-       unsigned char *outptr = (unsigned char *) outbuf;
-       gunichar2 ch;
-       gunichar c2;
-       
-       if (c < 0x10000) {
-               if (outleft < 2) {
-                       errno = E2BIG;
-                       return -1;
-               }
-               
-               outptr[0] = (c >> 8) & 0xff;
-               outptr[1] = c & 0xff;
-               
-               return 2;
-       } else {
-               if (outleft < 4) {
-                       errno = E2BIG;
-                       return -1;
-               }
-               
-               c2 = c - 0x10000;
-               
-               ch = (gunichar2) ((c2 >> 10) + 0xd800);
-               outptr[0] = (ch >> 8) & 0xff;
-               outptr[1] = ch & 0xff;
-               
-               ch = (gunichar2) ((c2 & 0x3ff) + 0xdc00);
-               outptr[2] = (ch >> 8) & 0xff;
-               outptr[3] = ch & 0xff;
-               
-               return 4;
-       }
-}
-
-static int
-encode_utf16le (gunichar c, char *outbuf, size_t outleft)
-{
-       unsigned char *outptr = (unsigned char *) outbuf;
-       gunichar2 ch;
-       gunichar c2;
-       
-       if (c < 0x10000) {
-               if (outleft < 2) {
-                       errno = E2BIG;
-                       return -1;
-               }
-               
-               outptr[0] = c & 0xff;
-               outptr[1] = (c >> 8) & 0xff;
-               
-               return 2;
-       } else {
-               if (outleft < 4) {
-                       errno = E2BIG;
-                       return -1;
-               }
-               
-               c2 = c - 0x10000;
-               
-               ch = (gunichar2) ((c2 >> 10) + 0xd800);
-               outptr[0] = ch & 0xff;
-               outptr[1] = (ch >> 8) & 0xff;
-               
-               ch = (gunichar2) ((c2 & 0x3ff) + 0xdc00);
-               outptr[2] = ch & 0xff;
-               outptr[3] = (ch >> 8) & 0xff;
-               
-               return 4;
-       }
-}
-
-static FORCE_INLINE (int)
-decode_utf8 (char *inbuf, size_t inleft, gunichar *outchar)
-{
-       unsigned char *inptr = (unsigned char *) inbuf;
-       gunichar u;
-       int n, i;
-       
-       u = *inptr;
-       
-       if (u < 0x80) {
-               /* simple ascii case */
-               *outchar = u;
-               return 1;
-       } else if (u < 0xc2) {
-               errno = EILSEQ;
-               return -1;
-       } else if (u < 0xe0) {
-               u &= 0x1f;
-               n = 2;
-       } else if (u < 0xf0) {
-               u &= 0x0f;
-               n = 3;
-       } else if (u < 0xf8) {
-               u &= 0x07;
-               n = 4;
-       } else if (u < 0xfc) {
-               u &= 0x03;
-               n = 5;
-       } else if (u < 0xfe) {
-               u &= 0x01;
-               n = 6;
-       } else {
-               errno = EILSEQ;
-               return -1;
-       }
-       
-       if (n > inleft) {
-               errno = EINVAL;
-               return -1;
-       }
-       
-#if UNROLL_DECODE_UTF8
-       switch (n) {
-       case 6: u = (u << 6) | (*++inptr ^ 0x80);
-       case 5: u = (u << 6) | (*++inptr ^ 0x80);
-       case 4: u = (u << 6) | (*++inptr ^ 0x80);
-       case 3: u = (u << 6) | (*++inptr ^ 0x80);
-       case 2: u = (u << 6) | (*++inptr ^ 0x80);
-       }
-#else
-       for (i = 1; i < n; i++)
-               u = (u << 6) | (*++inptr ^ 0x80);
-#endif
-       
-       *outchar = u;
-       
-       return n;
-}
-
-static int
-encode_utf8 (gunichar c, char *outbuf, size_t outleft)
-{
-       unsigned char *outptr = (unsigned char *) outbuf;
-       int base, n, i;
-       
-       if (c < 0x80) {
-               outptr[0] = c;
-               return 1;
-       } else if (c < 0x800) {
-               base = 192;
-               n = 2;
-       } else if (c < 0x10000) {
-               base = 224;
-               n = 3;
-       } else if (c < 0x200000) {
-               base = 240;
-               n = 4;
-       } else if (c < 0x4000000) {
-               base = 248;
-               n = 5;
-       } else {
-               base = 252;
-               n = 6;
-       }
-       
-       if (outleft < n) {
-               errno = E2BIG;
-               return -1;
-       }
-       
-#if UNROLL_ENCODE_UTF8
-       switch (n) {
-       case 6: outptr[5] = (c & 0x3f) | 0x80; c >>= 6;
-       case 5: outptr[4] = (c & 0x3f) | 0x80; c >>= 6;
-       case 4: outptr[3] = (c & 0x3f) | 0x80; c >>= 6;
-       case 3: outptr[2] = (c & 0x3f) | 0x80; c >>= 6;
-       case 2: outptr[1] = (c & 0x3f) | 0x80; c >>= 6;
-       case 1: outptr[0] = c | base;
-       }
-#else
-       for (i = n - 1; i > 0; i--) {
-               outptr[i] = (c & 0x3f) | 0x80;
-               c >>= 6;
-       }
-       
-       outptr[0] = c | base;
-#endif
-       
-       return n;
-}
-
-static int
-decode_latin1 (char *inbuf, size_t inleft, gunichar *outchar)
-{
-       *outchar = (unsigned char) *inbuf;
-       return 1;
-}
-
-static int
-encode_latin1 (gunichar c, char *outbuf, size_t outleft)
-{
-       if (outleft < 1) {
-               errno = E2BIG;
-               return -1;
-       }
-       
-       if (c > 0xff) {
-               errno = EILSEQ;
-               return -1;
-       }
-       
-       *outbuf = (char) c;
-       
-       return 1;
-}
-
-
-/*
- * Simple conversion API
- */
-
-static gpointer error_quark = "ConvertError";
-
-gpointer
-g_convert_error_quark (void)
-{
-       return error_quark;
-}
-
-gchar *
-g_convert (const gchar *str, gssize len, const gchar *to_charset, const gchar *from_charset,
-          gsize *bytes_read, gsize *bytes_written, GError **err)
-{
-       gsize outsize, outused, outleft, inleft, grow, rc;
-       char *result, *outbuf, *inbuf;
-       gboolean flush = FALSE;
-       gboolean done = FALSE;
-       GIConv cd;
-       
-       g_return_val_if_fail (str != NULL, NULL);
-       g_return_val_if_fail (to_charset != NULL, NULL);
-       g_return_val_if_fail (from_charset != NULL, NULL);
-       
-       if ((cd = g_iconv_open (to_charset, from_charset)) == (GIConv) -1) {
-               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_CONVERSION,
-                            "Conversion from %s to %s not supported.",
-                            from_charset, to_charset);
-               
-               if (bytes_written)
-                       *bytes_written = 0;
-               
-               if (bytes_read)
-                       *bytes_read = 0;
-               
-               return NULL;
-       }
-       
-       inleft = len < 0 ? strlen (str) : len;
-       inbuf = (char *) str;
-       
-       outleft = outsize = MAX (inleft, 8);
-       outbuf = result = g_malloc (outsize + 4);
-       
-       do {
-               if (!flush)
-                       rc = g_iconv (cd, &inbuf, &inleft, &outbuf, &outleft);
-               else
-                       rc = g_iconv (cd, NULL, NULL, &outbuf, &outleft);
-               
-               if (rc == (gsize) -1) {
-                       switch (errno) {
-                       case E2BIG:
-                               /* grow our result buffer */
-                               grow = MAX (inleft, 8) << 1;
-                               outused = outbuf - result;
-                               outsize += grow;
-                               outleft += grow;
-                               result = g_realloc (result, outsize + 4);
-                               outbuf = result + outused;
-                               break;
-                       case EINVAL:
-                               /* incomplete input, stop converting and terminate here */
-                               if (flush)
-                                       done = TRUE;
-                               else
-                                       flush = TRUE;
-                               break;
-                       case EILSEQ:
-                               /* illegal sequence in the input */
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, "%s", g_strerror (errno));
-                               
-                               if (bytes_read) {
-                                       /* save offset of the illegal input sequence */
-                                       *bytes_read = (inbuf - str);
-                               }
-                               
-                               if (bytes_written)
-                                       *bytes_written = 0;
-                               
-                               g_iconv_close (cd);
-                               g_free (result);
-                               return NULL;
-                       default:
-                               /* unknown errno */
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, "%s", g_strerror (errno));
-                               
-                               if (bytes_written)
-                                       *bytes_written = 0;
-                               
-                               if (bytes_read)
-                                       *bytes_read = 0;
-                               
-                               g_iconv_close (cd);
-                               g_free (result);
-                               return NULL;
-                       }
-               } else if (flush) {
-                       /* input has been converted and output has been flushed */
-                       break;
-               } else {
-                       /* input has been converted, need to flush the output */
-                       flush = TRUE;
-               }
-       } while (!done);
-       
-       g_iconv_close (cd);
-       
-       /* Note: not all charsets can be null-terminated with a single
-           null byte. UCS2, for example, needs 2 null bytes and UCS4
-           needs 4. I hope that 4 null bytes is enough to terminate all
-           multibyte charsets? */
-       
-       /* null-terminate the result */
-       memset (outbuf, 0, 4);
-       
-       if (bytes_written)
-               *bytes_written = outbuf - result;
-       
-       if (bytes_read)
-               *bytes_read = inbuf - str;
-       
-       return result;
-}
-
-
-/*
- * Unicode conversion
- */
-
-/**
- * An explanation of the conversion can be found at:
- * http://home.tiscali.nl/t876506/utf8tbl.html
- *
- **/
-gint
-g_unichar_to_utf8 (gunichar c, gchar *outbuf)
-{
-       int base, n, i;
-       
-       if (c < 0x80) {
-               base = 0;
-               n = 1;
-       } else if (c < 0x800) {
-               base = 192;
-               n = 2;
-       } else if (c < 0x10000) {
-               base = 224;
-               n = 3;
-       } else if (c < 0x200000) {
-               base = 240;
-               n = 4;
-       } else if (c < 0x4000000) {
-               base = 248;
-               n = 5;
-       } else if (c < 0x80000000) {
-               base = 252;
-               n = 6;
-       } else {
-               return -1;
-       }
-       
-       if (outbuf != NULL) {
-               for (i = n - 1; i > 0; i--) {
-                       /* mask off 6 bits worth and add 128 */
-                       outbuf[i] = (c & 0x3f) | 0x80;
-                       c >>= 6;
-               }
-               
-               /* first character has a different base */
-               outbuf[0] = c | base;
-       }
-       
-       return n;
-}
-
-static FORCE_INLINE (int)
-g_unichar_to_utf16 (gunichar c, gunichar2 *outbuf)
-{
-       gunichar c2;
-       
-       if (c < 0xd800) {
-               if (outbuf)
-                       *outbuf = (gunichar2) c;
-               
-               return 1;
-       } else if (c < 0xe000) {
-               return -1;
-       } else if (c < 0x10000) {
-               if (outbuf)
-                       *outbuf = (gunichar2) c;
-               
-               return 1;
-       } else if (c < 0x110000) {
-               if (outbuf) {
-                       c2 = c - 0x10000;
-                       
-                       outbuf[0] = (gunichar2) ((c2 >> 10) + 0xd800);
-                       outbuf[1] = (gunichar2) ((c2 & 0x3ff) + 0xdc00);
-               }
-               
-               return 2;
-       } else {
-               return -1;
-       }
-}
-
-gunichar *
-g_utf8_to_ucs4_fast (const gchar *str, glong len, glong *items_written)
-{
-       gunichar *outbuf, *outptr;
-       char *inptr;
-       glong n, i;
-       
-       g_return_val_if_fail (str != NULL, NULL);
-       
-       n = g_utf8_strlen (str, len);
-       
-       if (items_written)
-               *items_written = n;
-       
-       outptr = outbuf = g_malloc ((n + 1) * sizeof (gunichar));
-       inptr = (char *) str;
-       
-       for (i = 0; i < n; i++) {
-               *outptr++ = g_utf8_get_char (inptr);
-               inptr = g_utf8_next_char (inptr);
-       }
-       
-       *outptr = 0;
-       
-       return outbuf;
-}
-
-static gunichar2 *
-eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong *items_written, gboolean include_nuls, GError **err)
-{
-       gunichar2 *outbuf, *outptr;
-       size_t outlen = 0;
-       size_t inleft;
-       char *inptr;
-       gunichar c;
-       int u, n;
-       
-       g_return_val_if_fail (str != NULL, NULL);
-       
-       if (len < 0) {
-               if (include_nuls) {
-                       g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, "Conversions with embedded nulls must pass the string length");
-                       return NULL;
-               }
-               
-               len = strlen (str);
-       }
-       
-       inptr = (char *) str;
-       inleft = len;
-       
-       while (inleft > 0) {
-               if ((n = decode_utf8 (inptr, inleft, &c)) < 0)
-                       goto error;
-               
-               if (c == 0 && !include_nuls)
-                       break;
-               
-               if ((u = g_unichar_to_utf16 (c, NULL)) < 0) {
-                       errno = EILSEQ;
-                       goto error;
-               }
-               
-               outlen += u;
-               inleft -= n;
-               inptr += n;
-       }
-       
-       if (items_read)
-               *items_read = inptr - str;
-       
-       if (items_written)
-               *items_written = outlen;
-       
-       outptr = outbuf = g_malloc ((outlen + 1) * sizeof (gunichar2));
-       inptr = (char *) str;
-       inleft = len;
-       
-       while (inleft > 0) {
-               if ((n = decode_utf8 (inptr, inleft, &c)) < 0)
-                       break;
-               
-               if (c == 0 && !include_nuls)
-                       break;
-               
-               outptr += g_unichar_to_utf16 (c, outptr);
-               inleft -= n;
-               inptr += n;
-       }
-       
-       *outptr = '\0';
-       
-       return outbuf;
-       
- error:
-       if (errno == EILSEQ) {
-               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-                            "Illegal byte sequence encounted in the input.");
-       } else if (items_read) {
-               /* partial input is ok if we can let our caller know... */
-       } else {
-               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
-                            "Partial byte sequence encountered in the input.");
-       }
-       
-       if (items_read)
-               *items_read = inptr - str;
-       
-       if (items_written)
-               *items_written = 0;
-       
-       return NULL;
-}
-
-gunichar2 *
-g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err)
-{
-       return eg_utf8_to_utf16_general (str, len, items_read, items_written, FALSE, err);
-}
-
-gunichar2 *
-eg_utf8_to_utf16_with_nuls (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err)
-{
-       return eg_utf8_to_utf16_general (str, len, items_read, items_written, TRUE, err);
-}
-
-gunichar *
-g_utf8_to_ucs4 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err)
-{
-       gunichar *outbuf, *outptr;
-       size_t outlen = 0;
-       size_t inleft;
-       char *inptr;
-       gunichar c;
-       int n;
-       
-       g_return_val_if_fail (str != NULL, NULL);
-       
-       if (len < 0)
-               len = strlen (str);
-       
-       inptr = (char *) str;
-       inleft = len;
-       
-       while (inleft > 0) {
-               if ((n = decode_utf8 (inptr, inleft, &c)) < 0) {
-                       if (errno == EILSEQ) {
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-                                            "Illegal byte sequence encounted in the input.");
-                       } else if (items_read) {
-                               /* partial input is ok if we can let our caller know... */
-                               break;
-                       } else {
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
-                                            "Partial byte sequence encountered in the input.");
-                       }
-                       
-                       if (items_read)
-                               *items_read = inptr - str;
-                       
-                       if (items_written)
-                               *items_written = 0;
-                       
-                       return NULL;
-               } else if (c == 0)
-                       break;
-               
-               outlen += 4;
-               inleft -= n;
-               inptr += n;
-       }
-       
-       if (items_written)
-               *items_written = outlen / 4;
-       
-       if (items_read)
-               *items_read = inptr - str;
-       
-       outptr = outbuf = g_malloc (outlen + 4);
-       inptr = (char *) str;
-       inleft = len;
-       
-       while (inleft > 0) {
-               if ((n = decode_utf8 (inptr, inleft, &c)) < 0)
-                       break;
-               else if (c == 0)
-                       break;
-               
-               *outptr++ = c;
-               inleft -= n;
-               inptr += n;
-       }
-       
-       *outptr = 0;
-       
-       return outbuf;
-}
-
-gchar *
-g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **err)
-{
-       char *inptr, *outbuf, *outptr;
-       size_t outlen = 0;
-       size_t inleft;
-       gunichar c;
-       int n;
-       
-       g_return_val_if_fail (str != NULL, NULL);
-       
-       if (len < 0) {
-               len = 0;
-               while (str[len])
-                       len++;
-       }
-       
-       inptr = (char *) str;
-       inleft = len * 2;
-       
-       while (inleft > 0) {
-               if ((n = decode_utf16 (inptr, inleft, &c)) < 0) {
-                       if (n == -2 && inleft > 2) {
-                               /* This means that the first UTF-16 char was read, but second failed */
-                               inleft -= 2;
-                               inptr += 2;
-                       }
-                       
-                       if (errno == EILSEQ) {
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-                                            "Illegal byte sequence encounted in the input.");
-                       } else if (items_read) {
-                               /* partial input is ok if we can let our caller know... */
-                               break;
-                       } else {
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
-                                            "Partial byte sequence encountered in the input.");
-                       }
-                       
-                       if (items_read)
-                               *items_read = (inptr - (char *) str) / 2;
-                       
-                       if (items_written)
-                               *items_written = 0;
-                       
-                       return NULL;
-               } else if (c == 0)
-                       break;
-               
-               outlen += g_unichar_to_utf8 (c, NULL);
-               inleft -= n;
-               inptr += n;
-       }
-       
-       if (items_read)
-               *items_read = (inptr - (char *) str) / 2;
-       
-       if (items_written)
-               *items_written = outlen;
-       
-       outptr = outbuf = g_malloc (outlen + 1);
-       inptr = (char *) str;
-       inleft = len * 2;
-       
-       while (inleft > 0) {
-               if ((n = decode_utf16 (inptr, inleft, &c)) < 0)
-                       break;
-               else if (c == 0)
-                       break;
-               
-               outptr += g_unichar_to_utf8 (c, outptr);
-               inleft -= n;
-               inptr += n;
-       }
-       
-       *outptr = '\0';
-       
-       return outbuf;
-}
-
-gunichar *
-g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **err)
-{
-       gunichar *outbuf, *outptr;
-       size_t outlen = 0;
-       size_t inleft;
-       char *inptr;
-       gunichar c;
-       int n;
-       
-       g_return_val_if_fail (str != NULL, NULL);
-       
-       if (len < 0) {
-               len = 0;
-               while (str[len])
-                       len++;
-       }
-       
-       inptr = (char *) str;
-       inleft = len * 2;
-       
-       while (inleft > 0) {
-               if ((n = decode_utf16 (inptr, inleft, &c)) < 0) {
-                       if (n == -2 && inleft > 2) {
-                               /* This means that the first UTF-16 char was read, but second failed */
-                               inleft -= 2;
-                               inptr += 2;
-                       }
-                       
-                       if (errno == EILSEQ) {
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-                                            "Illegal byte sequence encounted in the input.");
-                       } else if (items_read) {
-                               /* partial input is ok if we can let our caller know... */
-                               break;
-                       } else {
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
-                                            "Partial byte sequence encountered in the input.");
-                       }
-                       
-                       if (items_read)
-                               *items_read = (inptr - (char *) str) / 2;
-                       
-                       if (items_written)
-                               *items_written = 0;
-                       
-                       return NULL;
-               } else if (c == 0)
-                       break;
-               
-               outlen += 4;
-               inleft -= n;
-               inptr += n;
-       }
-       
-       if (items_read)
-               *items_read = (inptr - (char *) str) / 2;
-       
-       if (items_written)
-               *items_written = outlen / 4;
-       
-       outptr = outbuf = g_malloc (outlen + 4);
-       inptr = (char *) str;
-       inleft = len * 2;
-       
-       while (inleft > 0) {
-               if ((n = decode_utf16 (inptr, inleft, &c)) < 0)
-                       break;
-               else if (c == 0)
-                       break;
-               
-               *outptr++ = c;
-               inleft -= n;
-               inptr += n;
-       }
-       
-       *outptr = 0;
-       
-       return outbuf;
-}
-
-gchar *
-g_ucs4_to_utf8 (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **err)
-{
-       char *outbuf, *outptr;
-       size_t outlen = 0;
-       glong i;
-       int n;
-       
-       g_return_val_if_fail (str != NULL, NULL);
-       
-       if (len < 0) {
-               for (i = 0; str[i] != 0; i++) {
-                       if ((n = g_unichar_to_utf8 (str[i], NULL)) < 0) {
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-                                            "Illegal byte sequence encounted in the input.");
-                               
-                               if (items_written)
-                                       *items_written = 0;
-                               
-                               if (items_read)
-                                       *items_read = i;
-                               
-                               return NULL;
-                       }
-                       
-                       outlen += n;
-               }
-       } else {
-               for (i = 0; i < len && str[i] != 0; i++) {
-                       if ((n = g_unichar_to_utf8 (str[i], NULL)) < 0) {
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-                                            "Illegal byte sequence encounted in the input.");
-                               
-                               if (items_written)
-                                       *items_written = 0;
-                               
-                               if (items_read)
-                                       *items_read = i;
-                               
-                               return NULL;
-                       }
-                       
-                       outlen += n;
-               }
-       }
-       
-       len = i;
-       
-       outptr = outbuf = g_malloc (outlen + 1);
-       for (i = 0; i < len; i++)
-               outptr += g_unichar_to_utf8 (str[i], outptr);
-       *outptr = 0;
-       
-       if (items_written)
-               *items_written = outlen;
-       
-       if (items_read)
-               *items_read = i;
-       
-       return outbuf;
-}
-
-gunichar2 *
-g_ucs4_to_utf16 (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **err)
-{
-       gunichar2 *outbuf, *outptr;
-       size_t outlen = 0;
-       glong i;
-       int n;
-       
-       g_return_val_if_fail (str != NULL, NULL);
-       
-       if (len < 0) {
-               for (i = 0; str[i] != 0; i++) {
-                       if ((n = g_unichar_to_utf16 (str[i], NULL)) < 0) {
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-                                            "Illegal byte sequence encounted in the input.");
-                               
-                               if (items_written)
-                                       *items_written = 0;
-                               
-                               if (items_read)
-                                       *items_read = i;
-                               
-                               return NULL;
-                       }
-                       
-                       outlen += n;
-               }
-       } else {
-               for (i = 0; i < len && str[i] != 0; i++) {
-                       if ((n = g_unichar_to_utf16 (str[i], NULL)) < 0) {
-                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-                                            "Illegal byte sequence encounted in the input.");
-                               
-                               if (items_written)
-                                       *items_written = 0;
-                               
-                               if (items_read)
-                                       *items_read = i;
-                               
-                               return NULL;
-                       }
-                       
-                       outlen += n;
-               }
-       }
-       
-       len = i;
-       
-       outptr = outbuf = g_malloc ((outlen + 1) * sizeof (gunichar2));
-       for (i = 0; i < len; i++)
-               outptr += g_unichar_to_utf16 (str[i], outptr);
-       *outptr = 0;
-       
-       if (items_written)
-               *items_written = outlen;
-       
-       if (items_read)
-               *items_read = i;
-       
-       return outbuf;
-}
diff --git a/eglib/src/glib.h b/eglib/src/glib.h
deleted file mode 100644 (file)
index 060b99e..0000000
+++ /dev/null
@@ -1,1079 +0,0 @@
-#ifndef __GLIB_H
-#define __GLIB_H
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <ctype.h>
-#include <limits.h>
-
-
-#ifdef _MSC_VER
-#pragma include_alias(<eglib-config.h>, <eglib-config.hw>)
-#endif
-
-#include <stdint.h>
-#include <inttypes.h>
-
-#include <eglib-config.h>
-#ifndef EGLIB_NO_REMAP
-#include <eglib-remap.h>
-#endif
-
-#ifdef G_HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#ifdef WIN32
-/* For alloca */
-#include <malloc.h>
-#endif
-
-#ifndef offsetof
-#   define offsetof(s_name,n_name) (size_t)(char *)&(((s_name*)0)->m_name)
-#endif
-
-#define __EGLIB_X11 1
-
-#ifdef  __cplusplus
-#define G_BEGIN_DECLS  extern "C" {
-#define G_END_DECLS    }
-#else
-#define G_BEGIN_DECLS
-#define G_END_DECLS
-#endif
-
-G_BEGIN_DECLS
-
-/*
- * Basic data types
- */
-typedef int            gint;
-typedef unsigned int   guint;
-typedef short          gshort;
-typedef unsigned short gushort;
-typedef long           glong;
-typedef unsigned long  gulong;
-typedef void *         gpointer;
-typedef const void *   gconstpointer;
-typedef char           gchar;
-typedef unsigned char  guchar;
-
-/* Types defined in terms of the stdint.h */
-typedef int8_t         gint8;
-typedef uint8_t        guint8;
-typedef int16_t        gint16;
-typedef uint16_t       guint16;
-typedef int32_t        gint32;
-typedef uint32_t       guint32;
-typedef int64_t        gint64;
-typedef uint64_t       guint64;
-typedef float          gfloat;
-typedef double         gdouble;
-typedef int32_t        gboolean;
-
-typedef guint16 gunichar2;
-typedef guint32 gunichar;
-
-/*
- * Macros
- */
-#define G_N_ELEMENTS(s)      (sizeof(s) / sizeof ((s) [0]))
-
-#define FALSE                0
-#define TRUE                 1
-
-#define G_MINSHORT           SHRT_MIN
-#define G_MAXSHORT           SHRT_MAX
-#define G_MAXUSHORT          USHRT_MAX
-#define G_MAXINT             INT_MAX
-#define G_MININT             INT_MIN
-#define G_MAXINT32           INT32_MAX
-#define G_MAXUINT32          UINT32_MAX
-#define G_MININT32           INT32_MIN
-#define G_MININT64           INT64_MIN
-#define G_MAXINT64          INT64_MAX
-#define G_MAXUINT64         UINT64_MAX
-
-#define G_LITTLE_ENDIAN 1234
-#define G_BIG_ENDIAN    4321
-#define G_STMT_START    do 
-#define G_STMT_END      while (0)
-
-#define G_USEC_PER_SEC  1000000
-
-#ifndef ABS
-#define ABS(a)         ((a) > 0 ? (a) : -(a))
-#endif
-
-#define G_STRUCT_OFFSET(p_type,field) offsetof(p_type,field)
-
-#define EGLIB_STRINGIFY(x) #x
-#define EGLIB_TOSTRING(x) EGLIB_STRINGIFY(x)
-#define G_STRLOC __FILE__ ":" EGLIB_TOSTRING(__LINE__) ":"
-
-#define G_CONST_RETURN const
-
-#define G_GUINT64_FORMAT PRIu64
-#define G_GINT64_FORMAT PRIi64
-#define G_GUINT32_FORMAT PRIu32
-#define G_GINT32_FORMAT PRIi32
-
-/*
- * Allocation
- */
-void g_free (void *ptr);
-gpointer g_realloc (gpointer obj, gsize size);
-gpointer g_malloc (gsize x);
-gpointer g_malloc0 (gsize x);
-gpointer g_calloc (gsize n, gsize x);
-gpointer g_try_malloc (gsize x);
-gpointer g_try_realloc (gpointer obj, gsize size);
-
-#define g_new(type,size)        ((type *) g_malloc (sizeof (type) * (size)))
-#define g_new0(type,size)       ((type *) g_malloc0 (sizeof (type)* (size)))
-#define g_newa(type,size)       ((type *) alloca (sizeof (type) * (size)))
-
-#define g_memmove(dest,src,len) memmove (dest, src, len)
-#define g_renew(struct_type, mem, n_structs) g_realloc (mem, sizeof (struct_type) * n_structs)
-#define g_alloca(size)         alloca (size)
-
-gpointer g_memdup (gconstpointer mem, guint byte_size);
-static inline gchar   *g_strdup (const gchar *str) { if (str) { return (gchar*) g_memdup (str, (guint)strlen (str) + 1); } return NULL; }
-gchar **g_strdupv (gchar **str_array);
-
-typedef struct {
-       gpointer (*malloc)      (gsize    n_bytes);
-       gpointer (*realloc)     (gpointer mem, gsize n_bytes);
-       void     (*free)        (gpointer mem);
-       gpointer (*calloc)      (gsize    n_blocks, gsize n_block_bytes);
-} GMemVTable;
-
-void g_mem_set_vtable (GMemVTable* vtable);
-
-struct _GMemChunk {
-       guint alloc_size;
-};
-
-typedef struct _GMemChunk GMemChunk;
-/*
- * Misc.
- */
-
-gboolean         g_hasenv(const gchar *variable);
-gchar *          g_getenv(const gchar *variable);
-gboolean         g_setenv(const gchar *variable, const gchar *value, gboolean overwrite);
-void             g_unsetenv(const gchar *variable);
-
-gchar*           g_win32_getlocale(void);
-
-/*
- * Precondition macros
- */
-#define g_warn_if_fail(x)  G_STMT_START { if (!(x)) { g_warning ("%s:%d: assertion '%s' failed", __FILE__, __LINE__, #x); } } G_STMT_END
-#define g_return_if_fail(x)  G_STMT_START { if (!(x)) { g_critical ("%s:%d: assertion '%s' failed", __FILE__, __LINE__, #x); return; } } G_STMT_END
-#define g_return_val_if_fail(x,e)  G_STMT_START { if (!(x)) { g_critical ("%s:%d: assertion '%s' failed", __FILE__, __LINE__, #x); return (e); } } G_STMT_END
-
-/*
- * Errors
- */
-typedef struct {
-       /* In the real glib, this is a GQuark, but we dont use/need that */
-       gpointer domain;
-       gint     code;
-       gchar   *message;
-} GError;
-
-void    g_clear_error (GError **error);
-void    g_error_free (GError *error);
-GError *g_error_new  (gpointer domain, gint code, const char *format, ...);
-void    g_set_error  (GError **err, gpointer domain, gint code, const gchar *format, ...);
-void    g_propagate_error (GError **dest, GError *src);
-
-/*
- * Strings utility
- */
-gchar       *g_strdup_printf  (const gchar *format, ...);
-gchar       *g_strdup_vprintf (const gchar *format, va_list args);
-gchar       *g_strndup        (const gchar *str, gsize n);
-const gchar *g_strerror       (gint errnum);
-gchar       *g_strndup        (const gchar *str, gsize n);
-void         g_strfreev       (gchar **str_array);
-gchar       *g_strconcat      (const gchar *first, ...);
-gchar      **g_strsplit       (const gchar *string, const gchar *delimiter, gint max_tokens);
-gchar      **g_strsplit_set   (const gchar *string, const gchar *delimiter, gint max_tokens);
-gchar       *g_strreverse     (gchar *str);
-gboolean     g_str_has_prefix (const gchar *str, const gchar *prefix);
-gboolean     g_str_has_suffix (const gchar *str, const gchar *suffix);
-guint        g_strv_length    (gchar **str_array);
-gchar       *g_strjoin        (const gchar *separator, ...);
-gchar       *g_strjoinv       (const gchar *separator, gchar **str_array);
-gchar       *g_strchug        (gchar *str);
-gchar       *g_strchomp       (gchar *str);
-void         g_strdown        (gchar *string);
-gchar       *g_strnfill       (gsize length, gchar fill_char);
-
-gchar       *g_strdelimit     (gchar *string, const gchar *delimiters, gchar new_delimiter);
-gchar       *g_strescape      (const gchar *source, const gchar *exceptions);
-
-gchar       *g_filename_to_uri   (const gchar *filename, const gchar *hostname, GError **error);
-gchar       *g_filename_from_uri (const gchar *uri, gchar **hostname, GError **error);
-
-gint         g_printf          (gchar const *format, ...);
-gint         g_fprintf         (FILE *file, gchar const *format, ...);
-gint         g_sprintf         (gchar *string, gchar const *format, ...);
-gint         g_snprintf        (gchar *string, gulong n, gchar const *format, ...);
-gint         g_vasprintf       (gchar **ret, const gchar *fmt, va_list ap);
-#define g_vprintf vprintf
-#define g_vfprintf vfprintf
-#define g_vsprintf vsprintf
-#define g_vsnprintf vsnprintf
-
-gsize   g_strlcpy            (gchar *dest, const gchar *src, gsize dest_size);
-gchar  *g_stpcpy             (gchar *dest, const char *src);
-
-
-gchar   g_ascii_tolower      (gchar c);
-gchar   g_ascii_toupper      (gchar c);
-gchar  *g_ascii_strdown      (const gchar *str, gssize len);
-gchar  *g_ascii_strup        (const gchar *str, gssize len);
-gint    g_ascii_strncasecmp  (const gchar *s1, const gchar *s2, gsize n);
-gint    g_ascii_strcasecmp   (const gchar *s1, const gchar *s2);
-gint    g_ascii_xdigit_value (gchar c);
-#define g_ascii_isspace(c)   (isspace (c) != 0)
-#define g_ascii_isalpha(c)   (isalpha (c) != 0)
-#define g_ascii_isprint(c)   (isprint (c) != 0)
-#define g_ascii_isxdigit(c)  (isxdigit (c) != 0)
-
-/* FIXME: g_strcasecmp supports utf8 unicode stuff */
-#ifdef _MSC_VER
-#define g_strcasecmp stricmp
-#define g_strncasecmp strnicmp
-#define g_strstrip(a) g_strchug (g_strchomp (a))
-#else
-#define g_strcasecmp strcasecmp
-#define g_ascii_strtoull strtoull
-#define g_strncasecmp strncasecmp
-#define g_strstrip(a) g_strchug (g_strchomp (a))
-#endif
-#define g_ascii_strdup strdup
-
-
-#define        G_STR_DELIMITERS "_-|> <."
-
-/*
- * String type
- */
-typedef struct {
-       char *str;
-       gsize len;
-       gsize allocated_len;
-} GString;
-
-GString     *g_string_new           (const gchar *init);
-GString     *g_string_new_len       (const gchar *init, gssize len);
-GString     *g_string_sized_new     (gsize default_size);
-gchar       *g_string_free          (GString *string, gboolean free_segment);
-GString     *g_string_append        (GString *string, const gchar *val);
-void         g_string_printf        (GString *string, const gchar *format, ...);
-void         g_string_append_printf (GString *string, const gchar *format, ...);
-void         g_string_append_vprintf (GString *string, const gchar *format, va_list args);
-GString     *g_string_append_unichar (GString *string, gunichar c);
-GString     *g_string_append_c      (GString *string, gchar c);
-GString     *g_string_append        (GString *string, const gchar *val);
-GString     *g_string_append_len    (GString *string, const gchar *val, gssize len);
-GString     *g_string_truncate      (GString *string, gsize len);
-GString     *g_string_prepend       (GString *string, const gchar *val);
-GString     *g_string_insert        (GString *string, gssize pos, const gchar *val);
-GString     *g_string_set_size      (GString *string, gsize len);
-GString     *g_string_erase         (GString *string, gssize pos, gssize len);
-
-#define g_string_sprintfa g_string_append_printf
-
-typedef void     (*GFunc)          (gpointer data, gpointer user_data);
-typedef gint     (*GCompareFunc)   (gconstpointer a, gconstpointer b);
-typedef gint     (*GCompareDataFunc) (gconstpointer a, gconstpointer b, gpointer user_data);
-typedef void     (*GHFunc)         (gpointer key, gpointer value, gpointer user_data);
-typedef gboolean (*GHRFunc)        (gpointer key, gpointer value, gpointer user_data);
-typedef void     (*GDestroyNotify) (gpointer data);
-typedef guint    (*GHashFunc)      (gconstpointer key);
-typedef gboolean (*GEqualFunc)     (gconstpointer a, gconstpointer b);
-typedef void     (*GFreeFunc)      (gpointer       data);
-
-/*
- * Lists
- */
-typedef struct _GSList GSList;
-struct _GSList {
-       gpointer data;
-       GSList *next;
-};
-
-GSList *g_slist_alloc         (void);
-GSList *g_slist_append        (GSList        *list,
-                              gpointer       data);
-GSList *g_slist_prepend       (GSList        *list,
-                              gpointer       data);
-void    g_slist_free          (GSList        *list);
-void    g_slist_free_1        (GSList        *list);
-GSList *g_slist_copy          (GSList        *list);
-GSList *g_slist_concat        (GSList        *list1,
-                              GSList        *list2);
-void    g_slist_foreach       (GSList        *list,
-                              GFunc          func,
-                              gpointer       user_data);
-GSList *g_slist_last          (GSList        *list);
-GSList *g_slist_find          (GSList        *list,
-                              gconstpointer  data);
-GSList *g_slist_find_custom   (GSList       *list,
-                              gconstpointer  data,
-                              GCompareFunc   func);
-GSList *g_slist_remove        (GSList        *list,
-                              gconstpointer  data);
-GSList *g_slist_remove_all    (GSList        *list,
-                              gconstpointer  data);
-GSList *g_slist_reverse       (GSList        *list);
-guint   g_slist_length        (GSList        *list);
-GSList *g_slist_remove_link   (GSList        *list,
-                              GSList        *link);
-GSList *g_slist_delete_link   (GSList        *list,
-                              GSList        *link);
-GSList *g_slist_insert_sorted (GSList        *list,
-                              gpointer       data,
-                              GCompareFunc   func);
-GSList *g_slist_insert_before (GSList        *list,
-                              GSList        *sibling,
-                              gpointer       data);
-GSList *g_slist_sort          (GSList        *list,
-                              GCompareFunc   func);
-gint    g_slist_index        (GSList        *list,
-                              gconstpointer  data);
-GSList *g_slist_nth          (GSList        *list,
-                              guint          n);
-gpointer g_slist_nth_data     (GSList       *list,
-                              guint          n);
-
-#define g_slist_next(slist) ((slist) ? (((GSList *) (slist))->next) : NULL)
-
-
-typedef struct _GList GList;
-struct _GList {
-  gpointer data;
-  GList *next;
-  GList *prev;
-};
-
-#define g_list_next(list) ((list) ? (((GList *) (list))->next) : NULL)
-#define g_list_previous(list) ((list) ? (((GList *) (list))->prev) : NULL)
-
-GList *g_list_alloc         (void);
-GList *g_list_append        (GList         *list,
-                            gpointer       data);
-GList *g_list_prepend       (GList         *list,
-                            gpointer       data);
-void   g_list_free          (GList         *list);
-void   g_list_free_1        (GList         *list);
-GList *g_list_copy          (GList         *list);
-guint  g_list_length        (GList         *list);
-gint   g_list_index         (GList         *list,
-                            gconstpointer  data);
-GList *g_list_nth           (GList         *list,
-                            guint          n);
-gpointer g_list_nth_data      (GList         *list,
-                            guint          n);
-GList *g_list_last          (GList         *list);
-GList *g_list_concat        (GList         *list1,
-                            GList         *list2);
-void   g_list_foreach       (GList         *list,
-                            GFunc          func,
-                            gpointer       user_data);
-GList *g_list_first         (GList         *list);
-GList *g_list_find          (GList         *list,
-                            gconstpointer  data);
-GList *g_list_find_custom   (GList        *list,
-                            gconstpointer  data,
-                            GCompareFunc   func);
-GList *g_list_remove        (GList         *list,
-                            gconstpointer  data);
-GList *g_list_remove_all    (GList         *list,
-                            gconstpointer  data);
-GList *g_list_reverse       (GList         *list);
-GList *g_list_remove_link   (GList         *list,
-                            GList         *link);
-GList *g_list_delete_link   (GList         *list,
-                            GList         *link);
-GList *g_list_insert_sorted (GList         *list,
-                            gpointer       data,
-                            GCompareFunc   func);
-GList *g_list_insert_before (GList         *list,
-                            GList         *sibling,
-                            gpointer       data);
-GList *g_list_sort          (GList         *sort,
-                            GCompareFunc   func);
-
-/*
- * Hashtables
- */
-typedef struct _GHashTable GHashTable;
-typedef struct _GHashTableIter GHashTableIter;
-
-/* Private, but needed for stack allocation */
-struct _GHashTableIter
-{
-       gpointer dummy [8];
-};
-
-GHashTable     *g_hash_table_new             (GHashFunc hash_func, GEqualFunc key_equal_func);
-GHashTable     *g_hash_table_new_full        (GHashFunc hash_func, GEqualFunc key_equal_func,
-                                             GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func);
-void            g_hash_table_insert_replace  (GHashTable *hash, gpointer key, gpointer value, gboolean replace);
-guint           g_hash_table_size            (GHashTable *hash);
-GList          *g_hash_table_get_keys        (GHashTable *hash);
-GList          *g_hash_table_get_values      (GHashTable *hash);
-gpointer        g_hash_table_lookup          (GHashTable *hash, gconstpointer key);
-gboolean        g_hash_table_lookup_extended (GHashTable *hash, gconstpointer key, gpointer *orig_key, gpointer *value);
-void            g_hash_table_foreach         (GHashTable *hash, GHFunc func, gpointer user_data);
-gpointer        g_hash_table_find            (GHashTable *hash, GHRFunc predicate, gpointer user_data);
-gboolean        g_hash_table_remove          (GHashTable *hash, gconstpointer key);
-gboolean        g_hash_table_steal           (GHashTable *hash, gconstpointer key);
-void            g_hash_table_remove_all      (GHashTable *hash);
-guint           g_hash_table_foreach_remove  (GHashTable *hash, GHRFunc func, gpointer user_data);
-guint           g_hash_table_foreach_steal   (GHashTable *hash, GHRFunc func, gpointer user_data);
-void            g_hash_table_destroy         (GHashTable *hash);
-void            g_hash_table_print_stats     (GHashTable *table);
-
-void            g_hash_table_iter_init       (GHashTableIter *iter, GHashTable *hash_table);
-gboolean        g_hash_table_iter_next       (GHashTableIter *iter, gpointer *key, gpointer *value);
-
-guint           g_spaced_primes_closest      (guint x);
-
-#define g_hash_table_insert(h,k,v)    g_hash_table_insert_replace ((h),(k),(v),FALSE)
-#define g_hash_table_replace(h,k,v)   g_hash_table_insert_replace ((h),(k),(v),TRUE)
-
-gboolean g_direct_equal (gconstpointer v1, gconstpointer v2);
-guint    g_direct_hash  (gconstpointer v1);
-gboolean g_int_equal    (gconstpointer v1, gconstpointer v2);
-guint    g_int_hash     (gconstpointer v1);
-gboolean g_str_equal    (gconstpointer v1, gconstpointer v2);
-guint    g_str_hash     (gconstpointer v1);
-
-/*
- * ByteArray
- */
-
-typedef struct _GByteArray GByteArray;
-struct _GByteArray {
-       guint8 *data;
-       gint len;
-};
-
-GByteArray *g_byte_array_new    (void);
-GByteArray* g_byte_array_append (GByteArray *array, const guint8 *data, guint len);
-guint8*  g_byte_array_free      (GByteArray *array, gboolean free_segment);
-void     g_byte_array_set_size  (GByteArray *array, gint length);
-
-/*
- * Array
- */
-
-typedef struct _GArray GArray;
-struct _GArray {
-       gchar *data;
-       gint len;
-};
-
-GArray *g_array_new               (gboolean zero_terminated, gboolean clear_, guint element_size);
-GArray *g_array_sized_new         (gboolean zero_terminated, gboolean clear_, guint element_size, guint reserved_size);
-gchar*  g_array_free              (GArray *array, gboolean free_segment);
-GArray *g_array_append_vals       (GArray *array, gconstpointer data, guint len);
-GArray* g_array_insert_vals       (GArray *array, guint index_, gconstpointer data, guint len);
-GArray* g_array_remove_index      (GArray *array, guint index_);
-GArray* g_array_remove_index_fast (GArray *array, guint index_);
-void    g_array_set_size          (GArray *array, gint length);
-
-#define g_array_append_val(a,v)   (g_array_append_vals((a),&(v),1))
-#define g_array_insert_val(a,i,v) (g_array_insert_vals((a),(i),&(v),1))
-#define g_array_index(a,t,i)      *(t*)(((a)->data) + sizeof(t) * (i))
-
-/*
- * QSort
-*/
-
-void g_qsort_with_data (gpointer base, size_t nmemb, size_t size, GCompareDataFunc compare, gpointer user_data);
-
-/*
- * Pointer Array
- */
-
-typedef struct _GPtrArray GPtrArray;
-struct _GPtrArray {
-       gpointer *pdata;
-       guint len;
-};
-
-GPtrArray *g_ptr_array_new                (void);
-GPtrArray *g_ptr_array_sized_new          (guint reserved_size);
-void       g_ptr_array_add                (GPtrArray *array, gpointer data);
-gboolean   g_ptr_array_remove             (GPtrArray *array, gpointer data);
-gpointer   g_ptr_array_remove_index       (GPtrArray *array, guint index);
-gboolean   g_ptr_array_remove_fast        (GPtrArray *array, gpointer data);
-gpointer   g_ptr_array_remove_index_fast  (GPtrArray *array, guint index);
-void       g_ptr_array_sort               (GPtrArray *array, GCompareFunc compare_func);
-void       g_ptr_array_sort_with_data     (GPtrArray *array, GCompareDataFunc compare_func, gpointer user_data);
-void       g_ptr_array_set_size           (GPtrArray *array, gint length);
-gpointer  *g_ptr_array_free               (GPtrArray *array, gboolean free_seg);
-void       g_ptr_array_foreach            (GPtrArray *array, GFunc func, gpointer user_data);
-#define    g_ptr_array_index(array,index) (array)->pdata[(index)]
-
-/*
- * Queues
- */
-typedef struct {
-       GList *head;
-       GList *tail;
-       guint length;
-} GQueue;
-
-gpointer g_queue_pop_head  (GQueue   *queue);
-void     g_queue_push_head (GQueue   *queue,
-                           gpointer  data);
-void     g_queue_push_tail (GQueue   *queue,
-                           gpointer  data);
-gboolean g_queue_is_empty  (GQueue   *queue);
-GQueue  *g_queue_new       (void);
-void     g_queue_free      (GQueue   *queue);
-void     g_queue_foreach   (GQueue   *queue, GFunc func, gpointer user_data);
-
-/*
- * Messages
- */
-#ifndef G_LOG_DOMAIN
-#define G_LOG_DOMAIN ((gchar*) 0)
-#endif
-
-typedef enum {
-       G_LOG_FLAG_RECURSION          = 1 << 0,
-       G_LOG_FLAG_FATAL              = 1 << 1,
-       
-       G_LOG_LEVEL_ERROR             = 1 << 2,
-       G_LOG_LEVEL_CRITICAL          = 1 << 3,
-       G_LOG_LEVEL_WARNING           = 1 << 4,
-       G_LOG_LEVEL_MESSAGE           = 1 << 5,
-       G_LOG_LEVEL_INFO              = 1 << 6,
-       G_LOG_LEVEL_DEBUG             = 1 << 7,
-       
-       G_LOG_LEVEL_MASK              = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL)
-} GLogLevelFlags;
-
-void           g_print                (const gchar *format, ...);
-void           g_printerr             (const gchar *format, ...);
-GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
-GLogLevelFlags g_log_set_fatal_mask   (const gchar *log_domain, GLogLevelFlags fatal_mask);
-void           g_logv                 (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args);
-void           g_log                  (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, ...);
-void           g_assertion_message    (const gchar *format, ...) G_GNUC_NORETURN;
-
-#ifdef HAVE_C99_SUPPORT
-/* The for (;;) tells gc thats g_error () doesn't return, avoiding warnings */
-#define g_error(format, ...)    do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, __VA_ARGS__); for (;;); } while (0)
-#define g_critical(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format, __VA_ARGS__)
-#define g_warning(format, ...)  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, __VA_ARGS__)
-#define g_message(format, ...)  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, __VA_ARGS__)
-#define g_debug(format, ...)    g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, __VA_ARGS__)
-#else   /* HAVE_C99_SUPPORT */
-#define g_error(...)    do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __VA_ARGS__); for (;;); } while (0)
-#define g_critical(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, __VA_ARGS__)
-#define g_warning(...)  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, __VA_ARGS__)
-#define g_message(...)  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, __VA_ARGS__)
-#define g_debug(...)    g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__)
-#endif  /* ndef HAVE_C99_SUPPORT */
-
-typedef void (*GLogFunc) (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data);
-typedef void (*GPrintFunc) (const gchar *string);
-
-void       g_log_default_handler     (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data);
-GLogFunc   g_log_set_default_handler (GLogFunc log_func, gpointer user_data);
-GPrintFunc g_set_print_handler       (GPrintFunc func);
-GPrintFunc g_set_printerr_handler    (GPrintFunc func);
-/*
- * Conversions
- */
-
-gpointer g_convert_error_quark(void);
-
-
-/*
- * Unicode Manipulation: most of this is not used by Mono by default, it is
- * only used if the old collation code is activated, so this is only the
- * bare minimum to build.
- */
-
-typedef enum {
-       G_UNICODE_CONTROL,
-       G_UNICODE_FORMAT,
-       G_UNICODE_UNASSIGNED,
-       G_UNICODE_PRIVATE_USE,
-       G_UNICODE_SURROGATE,
-       G_UNICODE_LOWERCASE_LETTER,
-       G_UNICODE_MODIFIER_LETTER,
-       G_UNICODE_OTHER_LETTER,
-       G_UNICODE_TITLECASE_LETTER,
-       G_UNICODE_UPPERCASE_LETTER,
-       G_UNICODE_COMBINING_MARK,
-       G_UNICODE_ENCLOSING_MARK,
-       G_UNICODE_NON_SPACING_MARK,
-       G_UNICODE_DECIMAL_NUMBER,
-       G_UNICODE_LETTER_NUMBER,
-       G_UNICODE_OTHER_NUMBER,
-       G_UNICODE_CONNECT_PUNCTUATION,
-       G_UNICODE_DASH_PUNCTUATION,
-       G_UNICODE_CLOSE_PUNCTUATION,
-       G_UNICODE_FINAL_PUNCTUATION,
-       G_UNICODE_INITIAL_PUNCTUATION,
-       G_UNICODE_OTHER_PUNCTUATION,
-       G_UNICODE_OPEN_PUNCTUATION,
-       G_UNICODE_CURRENCY_SYMBOL,
-       G_UNICODE_MODIFIER_SYMBOL,
-       G_UNICODE_MATH_SYMBOL,
-       G_UNICODE_OTHER_SYMBOL,
-       G_UNICODE_LINE_SEPARATOR,
-       G_UNICODE_PARAGRAPH_SEPARATOR,
-       G_UNICODE_SPACE_SEPARATOR
-} GUnicodeType;
-
-typedef enum {
-       G_UNICODE_BREAK_MANDATORY,
-       G_UNICODE_BREAK_CARRIAGE_RETURN,
-       G_UNICODE_BREAK_LINE_FEED,
-       G_UNICODE_BREAK_COMBINING_MARK,
-       G_UNICODE_BREAK_SURROGATE,
-       G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
-       G_UNICODE_BREAK_INSEPARABLE,
-       G_UNICODE_BREAK_NON_BREAKING_GLUE,
-       G_UNICODE_BREAK_CONTINGENT,
-       G_UNICODE_BREAK_SPACE,
-       G_UNICODE_BREAK_AFTER,
-       G_UNICODE_BREAK_BEFORE,
-       G_UNICODE_BREAK_BEFORE_AND_AFTER,
-       G_UNICODE_BREAK_HYPHEN,
-       G_UNICODE_BREAK_NON_STARTER,
-       G_UNICODE_BREAK_OPEN_PUNCTUATION,
-       G_UNICODE_BREAK_CLOSE_PUNCTUATION,
-       G_UNICODE_BREAK_QUOTATION,
-       G_UNICODE_BREAK_EXCLAMATION,
-       G_UNICODE_BREAK_IDEOGRAPHIC,
-       G_UNICODE_BREAK_NUMERIC,
-       G_UNICODE_BREAK_INFIX_SEPARATOR,
-       G_UNICODE_BREAK_SYMBOL,
-       G_UNICODE_BREAK_ALPHABETIC,
-       G_UNICODE_BREAK_PREFIX,
-       G_UNICODE_BREAK_POSTFIX,
-       G_UNICODE_BREAK_COMPLEX_CONTEXT,
-       G_UNICODE_BREAK_AMBIGUOUS,
-       G_UNICODE_BREAK_UNKNOWN,
-       G_UNICODE_BREAK_NEXT_LINE,
-       G_UNICODE_BREAK_WORD_JOINER,
-       G_UNICODE_BREAK_HANGUL_L_JAMO,
-       G_UNICODE_BREAK_HANGUL_V_JAMO,
-       G_UNICODE_BREAK_HANGUL_T_JAMO,
-       G_UNICODE_BREAK_HANGUL_LV_SYLLABLE,
-       G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE
-} GUnicodeBreakType;
-
-gunichar       g_unichar_toupper (gunichar c);
-gunichar       g_unichar_tolower (gunichar c);
-gunichar       g_unichar_totitle (gunichar c);
-GUnicodeType   g_unichar_type    (gunichar c);
-gboolean       g_unichar_isspace (gunichar c);
-gboolean       g_unichar_isxdigit (gunichar c);
-gint           g_unichar_xdigit_value (gunichar c);
-GUnicodeBreakType   g_unichar_break_type (gunichar c);
-
-#ifndef MAX
-#define MAX(a,b) (((a)>(b)) ? (a) : (b))
-#endif
-
-#ifndef MIN
-#define MIN(a,b) (((a)<(b)) ? (a) : (b))
-#endif
-
-#ifndef CLAMP
-#define CLAMP(a,low,high) (((a) < (low)) ? (low) : (((a) > (high)) ? (high) : (a)))
-#endif
-
-#if defined(__GNUC__) && (__GNUC__ > 2)
-#define G_LIKELY(expr) (__builtin_expect ((expr) != 0, 1))
-#define G_UNLIKELY(expr) (__builtin_expect ((expr) != 0, 0))
-#else
-#define G_LIKELY(x) (x)
-#define G_UNLIKELY(x) (x)
-#endif
-
-#if defined(_MSC_VER)
-#define  eg_unreachable() __assume(0)
-#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 5)))
-#define  eg_unreachable() __builtin_unreachable()
-#else
-#define  eg_unreachable()
-#endif
-
-#define  g_assert(x)     G_STMT_START { if (G_UNLIKELY (!(x))) g_assertion_message ("* Assertion at %s:%d, condition `%s' not met\n", __FILE__, __LINE__, #x);  } G_STMT_END
-#define  g_assert_not_reached() G_STMT_START { g_assertion_message ("* Assertion: should not be reached at %s:%d\n", __FILE__, __LINE__); eg_unreachable(); } G_STMT_END
-
-/*
- * Unicode conversion
- */
-
-#define G_CONVERT_ERROR g_convert_error_quark()
-
-typedef enum {
-       G_CONVERT_ERROR_NO_CONVERSION,
-       G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-       G_CONVERT_ERROR_FAILED,
-       G_CONVERT_ERROR_PARTIAL_INPUT,
-       G_CONVERT_ERROR_BAD_URI,
-       G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
-} GConvertError;
-
-gchar     *g_utf8_strup (const gchar *str, gssize len);
-gchar     *g_utf8_strdown (const gchar *str, gssize len);
-gint       g_unichar_to_utf8 (gunichar c, gchar *outbuf);
-gunichar  *g_utf8_to_ucs4_fast (const gchar *str, glong len, glong *items_written);
-gunichar  *g_utf8_to_ucs4 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err);
-gunichar2 *g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err);
-gunichar2 *eg_utf8_to_utf16_with_nuls (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err);
-gchar     *g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **err);
-gunichar  *g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **err);
-gchar     *g_ucs4_to_utf8  (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **err);
-gunichar2 *g_ucs4_to_utf16 (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **err);
-
-#define u8to16(str) g_utf8_to_utf16(str, (glong)strlen(str), NULL, NULL, NULL)
-
-#ifdef G_OS_WIN32
-#define u16to8(str) g_utf16_to_utf8((gunichar2 *) (str), (glong)wcslen((wchar_t *) (str)), NULL, NULL, NULL)
-#else
-#define u16to8(str) g_utf16_to_utf8(str, (glong)strlen(str), NULL, NULL, NULL)
-#endif
-
-/*
- * Path
- */
-gchar  *g_build_path           (const gchar *separator, const gchar *first_element, ...);
-#define g_build_filename(x, ...) g_build_path(G_DIR_SEPARATOR_S, x, __VA_ARGS__)
-gchar  *g_path_get_dirname     (const gchar *filename);
-gchar  *g_path_get_basename    (const char *filename);
-gchar  *g_find_program_in_path (const gchar *program);
-gchar  *g_get_current_dir      (void);
-gboolean g_path_is_absolute    (const char *filename);
-
-const gchar *g_get_home_dir    (void);
-const gchar *g_get_tmp_dir     (void);
-const gchar *g_get_user_name   (void);
-gchar *g_get_prgname           (void);
-void  g_set_prgname            (const gchar *prgname);
-
-gboolean g_ensure_directory_exists (const gchar *filename);
-
-/*
- * Shell
- */
-
-gboolean  g_shell_parse_argv (const gchar *command_line, gint *argcp, gchar ***argvp, GError **error);
-gchar    *g_shell_unquote    (const gchar *quoted_string, GError **error);
-gchar    *g_shell_quote      (const gchar *unquoted_string);
-
-/*
- * Spawn
- */
-typedef enum {
-       G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1,
-       G_SPAWN_DO_NOT_REAP_CHILD      = 1 << 1,
-       G_SPAWN_SEARCH_PATH            = 1 << 2,
-       G_SPAWN_STDOUT_TO_DEV_NULL     = 1 << 3,
-       G_SPAWN_STDERR_TO_DEV_NULL     = 1 << 4,
-       G_SPAWN_CHILD_INHERITS_STDIN   = 1 << 5,
-       G_SPAWN_FILE_AND_ARGV_ZERO     = 1 << 6
-} GSpawnFlags;
-
-typedef void (*GSpawnChildSetupFunc) (gpointer user_data);
-
-gboolean g_spawn_command_line_sync (const gchar *command_line, gchar **standard_output, gchar **standard_error, gint *exit_status, GError **error);
-gboolean g_spawn_async_with_pipes  (const gchar *working_directory, gchar **argv, gchar **envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup,
-                               gpointer user_data, GPid *child_pid, gint *standard_input, gint *standard_output, gint *standard_error, GError **error);
-
-int eg_getdtablesize (void);
-
-/*
- * Timer
- */
-typedef struct _GTimer GTimer;
-
-GTimer *g_timer_new (void);
-void g_timer_destroy (GTimer *timer);
-gdouble g_timer_elapsed (GTimer *timer, gulong *microseconds);
-void g_timer_stop (GTimer *timer);
-void g_timer_start (GTimer *timer);
-
-/*
- * Date and time
- */
-typedef struct {
-       glong tv_sec;
-       glong tv_usec;
-} GTimeVal;
-
-void g_get_current_time (GTimeVal *result);
-void g_usleep (gulong microseconds);
-
-/*
- * File
- */
-
-gpointer g_file_error_quark (void);
-
-#define G_FILE_ERROR g_file_error_quark ()
-
-typedef enum {
-       G_FILE_ERROR_EXIST,
-       G_FILE_ERROR_ISDIR,
-       G_FILE_ERROR_ACCES,
-       G_FILE_ERROR_NAMETOOLONG,
-       G_FILE_ERROR_NOENT,
-       G_FILE_ERROR_NOTDIR,
-       G_FILE_ERROR_NXIO,
-       G_FILE_ERROR_NODEV,
-       G_FILE_ERROR_ROFS,
-       G_FILE_ERROR_TXTBSY,
-       G_FILE_ERROR_FAULT,
-       G_FILE_ERROR_LOOP,
-       G_FILE_ERROR_NOSPC,
-       G_FILE_ERROR_NOMEM,
-       G_FILE_ERROR_MFILE,
-       G_FILE_ERROR_NFILE,
-       G_FILE_ERROR_BADF,
-       G_FILE_ERROR_INVAL,
-       G_FILE_ERROR_PIPE,
-       G_FILE_ERROR_AGAIN,
-       G_FILE_ERROR_INTR,
-       G_FILE_ERROR_IO,
-       G_FILE_ERROR_PERM,
-       G_FILE_ERROR_NOSYS,
-       G_FILE_ERROR_FAILED
-} GFileError;
-
-typedef enum {
-       G_FILE_TEST_IS_REGULAR = 1 << 0,
-       G_FILE_TEST_IS_SYMLINK = 1 << 1,
-       G_FILE_TEST_IS_DIR = 1 << 2,
-       G_FILE_TEST_IS_EXECUTABLE = 1 << 3,
-       G_FILE_TEST_EXISTS = 1 << 4
-} GFileTest;
-
-
-gboolean   g_file_set_contents (const gchar *filename, const gchar *contents, gssize length, GError **error);
-gboolean   g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error);
-GFileError g_file_error_from_errno (gint err_no);
-gint       g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error);
-gboolean   g_file_test (const gchar *filename, GFileTest test);
-
-#define g_open open
-#define g_rename rename
-#define g_stat stat
-#define g_unlink unlink
-#define g_fopen fopen
-#define g_lstat lstat
-#define g_rmdir rmdir
-#define g_mkstemp mkstemp
-#define g_ascii_isdigit isdigit
-#define g_ascii_strtod strtod
-#define g_ascii_isalnum isalnum
-
-gchar *g_mkdtemp (gchar *tmpl);
-
-/*
- * Pattern matching
- */
-typedef struct _GPatternSpec GPatternSpec;
-GPatternSpec * g_pattern_spec_new (const gchar *pattern);
-void           g_pattern_spec_free (GPatternSpec *pspec);
-gboolean       g_pattern_match_string (GPatternSpec *pspec, const gchar *string);
-
-/*
- * Directory
- */
-typedef struct _GDir GDir;
-GDir        *g_dir_open (const gchar *path, guint flags, GError **error);
-const gchar *g_dir_read_name (GDir *dir);
-void         g_dir_rewind (GDir *dir);
-void         g_dir_close (GDir *dir);
-
-int          g_mkdir_with_parents (const gchar *pathname, int mode);
-#define g_mkdir mkdir
-
-/*
- * GMarkup
- */
-typedef struct _GMarkupParseContext GMarkupParseContext;
-
-typedef enum
-{
-       G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
-       G_MARKUP_TREAT_CDATA_AS_TEXT              = 1 << 1
-} GMarkupParseFlags;
-
-typedef struct {
-       void (*start_element)  (GMarkupParseContext *context,
-                               const gchar *element_name,
-                               const gchar **attribute_names,
-                               const gchar **attribute_values,
-                               gpointer user_data,
-                               GError **error);
-
-       void (*end_element)    (GMarkupParseContext *context,
-                               const gchar         *element_name,
-                               gpointer             user_data,
-                               GError             **error);
-       
-       void (*text)           (GMarkupParseContext *context,
-                               const gchar         *text,
-                               gsize                text_len,  
-                               gpointer             user_data,
-                               GError             **error);
-       
-       void (*passthrough)    (GMarkupParseContext *context,
-                               const gchar         *passthrough_text,
-                               gsize                text_len,  
-                               gpointer             user_data,
-                               GError             **error);
-       void (*error)          (GMarkupParseContext *context,
-                               GError              *error,
-                               gpointer             user_data);
-} GMarkupParser;
-
-GMarkupParseContext *g_markup_parse_context_new   (const GMarkupParser *parser,
-                                                  GMarkupParseFlags flags,
-                                                  gpointer user_data,
-                                                  GDestroyNotify user_data_dnotify);
-void                 g_markup_parse_context_free  (GMarkupParseContext *context);
-gboolean             g_markup_parse_context_parse (GMarkupParseContext *context,
-                                                  const gchar *text, gssize text_len,
-                                                  GError **error);
-gboolean         g_markup_parse_context_end_parse (GMarkupParseContext *context,
-                                                  GError **error);
-
-/*
- * Character set conversion
- */
-typedef struct _GIConv *GIConv;
-
-gsize g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft, gchar **outbytes, gsize *outbytesleft);
-GIConv g_iconv_open (const gchar *to_charset, const gchar *from_charset);
-int g_iconv_close (GIConv cd);
-
-gboolean  g_get_charset        (G_CONST_RETURN char **charset);
-gchar    *g_locale_to_utf8     (const gchar *opsysstring, gssize len,
-                               gsize *bytes_read, gsize *bytes_written,
-                               GError **error);
-gchar    *g_locale_from_utf8   (const gchar *utf8string, gssize len, gsize *bytes_read,
-                               gsize *bytes_written, GError **error);
-gchar    *g_filename_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read,
-                               gsize *bytes_written, GError **error);
-gchar    *g_convert            (const gchar *str, gssize len,
-                               const gchar *to_codeset, const gchar *from_codeset,
-                               gsize *bytes_read, gsize *bytes_written, GError **error);
-
-/*
- * Unicode manipulation
- */
-extern const guchar g_utf8_jump_table[256];
-
-gboolean  g_utf8_validate      (const gchar *str, gssize max_len, const gchar **end);
-gunichar  g_utf8_get_char_validated (const gchar *str, gssize max_len);
-gchar    *g_utf8_find_prev_char (const char *str, const char *p);
-gchar    *g_utf8_prev_char     (const char *str);
-#define   g_utf8_next_char(p)  ((p) + g_utf8_jump_table[(guchar)(*p)])
-gunichar  g_utf8_get_char      (const gchar *src);
-glong     g_utf8_strlen        (const gchar *str, gssize max);
-gchar    *g_utf8_offset_to_pointer (const gchar *str, glong offset);
-glong     g_utf8_pointer_to_offset (const gchar *str, const gchar *pos);
-
-/*
- * priorities
- */
-#define G_PRIORITY_DEFAULT 0
-#define G_PRIORITY_DEFAULT_IDLE 200
-
-#define GUINT16_SWAP_LE_BE_CONSTANT(x) ((((guint16) x) >> 8) | ((((guint16) x) << 8)))
-
-#define GUINT16_SWAP_LE_BE(x) ((guint16) (((guint16) x) >> 8) | ((((guint16)(x)) & 0xff) << 8))
-#define GUINT32_SWAP_LE_BE(x) ((guint32) \
-                              ( (((guint32) (x)) << 24)| \
-                                ((((guint32) (x)) & 0xff0000) >> 8) | \
-                                ((((guint32) (x)) & 0xff00) << 8) | \
-                                (((guint32) (x)) >> 24)) )
-#define GUINT64_SWAP_LE_BE(x) ((guint64) (((guint64)(GUINT32_SWAP_LE_BE(((guint64)x) & 0xffffffff))) << 32) | \
-                              GUINT32_SWAP_LE_BE(((guint64)x) >> 32))
-
-                                 
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#   define GUINT64_FROM_BE(x) GUINT64_SWAP_LE_BE(x)
-#   define GUINT32_FROM_BE(x) GUINT32_SWAP_LE_BE(x)
-#   define GUINT16_FROM_BE(x) GUINT16_SWAP_LE_BE(x)
-#   define GUINT_FROM_BE(x)   GUINT32_SWAP_LE_BE(x)
-#   define GUINT64_FROM_LE(x) (x)
-#   define GUINT32_FROM_LE(x) (x)
-#   define GUINT16_FROM_LE(x) (x)
-#   define GUINT_FROM_LE(x)   (x)
-#   define GUINT64_TO_BE(x)   GUINT64_SWAP_LE_BE(x)
-#   define GUINT32_TO_BE(x)   GUINT32_SWAP_LE_BE(x)
-#   define GUINT16_TO_BE(x)   GUINT16_SWAP_LE_BE(x)
-#   define GUINT_TO_BE(x)     GUINT32_SWAP_LE_BE(x)
-#   define GUINT64_TO_LE(x)   (x)
-#   define GUINT32_TO_LE(x)   (x)
-#   define GUINT16_TO_LE(x)   (x)
-#   define GUINT_TO_LE(x)     (x)
-#else
-#   define GUINT64_FROM_BE(x) (x)
-#   define GUINT32_FROM_BE(x) (x)
-#   define GUINT16_FROM_BE(x) (x)
-#   define GUINT_FROM_BE(x)   (x)
-#   define GUINT64_FROM_LE(x) GUINT64_SWAP_LE_BE(x)
-#   define GUINT32_FROM_LE(x) GUINT32_SWAP_LE_BE(x)
-#   define GUINT16_FROM_LE(x) GUINT16_SWAP_LE_BE(x)
-#   define GUINT_FROM_LE(x)   GUINT32_SWAP_LE_BE(x)
-#   define GUINT64_TO_BE(x)   (x)
-#   define GUINT32_TO_BE(x)   (x)
-#   define GUINT16_TO_BE(x)   (x)
-#   define GUINT_TO_BE(x)     (x)
-#   define GUINT64_TO_LE(x)   GUINT64_SWAP_LE_BE(x)
-#   define GUINT32_TO_LE(x)   GUINT32_SWAP_LE_BE(x)
-#   define GUINT16_TO_LE(x)   GUINT16_SWAP_LE_BE(x)
-#   define GUINT_TO_LE(x)     GUINT32_SWAP_LE_BE(x)
-#endif
-
-#define GINT64_FROM_BE(x)   (GUINT64_TO_BE (x))
-#define GINT32_FROM_BE(x)   (GUINT32_TO_BE (x))
-#define GINT16_FROM_BE(x)   (GUINT16_TO_BE (x))
-#define GINT64_FROM_LE(x)   (GUINT64_TO_LE (x))
-#define GINT32_FROM_LE(x)   (GUINT32_TO_LE (x))
-#define GINT16_FROM_LE(x)   (GUINT16_TO_LE (x))
-
-#define _EGLIB_MAJOR  2
-#define _EGLIB_MIDDLE 4
-#define _EGLIB_MINOR  0
-#define GLIB_CHECK_VERSION(a,b,c) ((a < _EGLIB_MAJOR) || (a == _EGLIB_MAJOR && (b < _EGLIB_MIDDLE || (b == _EGLIB_MIDDLE && c <= _EGLIB_MINOR))))
-
-#define G_HAVE_API_SUPPORT(x) (x)
-#define G_UNSUPPORTED_API "%s:%d: '%s' not supported.", __FILE__, __LINE__
-#define g_unsupported_api(name) G_STMT_START { g_warning (G_UNSUPPORTED_API, name); } G_STMT_END
-G_END_DECLS
-
-#endif
-
-
-
diff --git a/eglib/src/glist.c b/eglib/src/glist.c
deleted file mode 100644 (file)
index 882fda4..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * glist.c: Doubly-linked list implementation
- *
- * Authors:
- *   Duncan Mak (duncan@novell.com)
- *   Raja R Harinath (rharinath@novell.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * (C) 2006 Novell, Inc.
- */
-#include <stdio.h>
-#include <glib.h>
-
-GList*
-g_list_alloc ()
-{
-       return g_new0 (GList, 1);
-}
-
-static inline GList*
-new_node (GList *prev, gpointer data, GList *next)
-{
-       GList *node = g_list_alloc ();
-       node->data = data;
-       node->prev = prev;
-       node->next = next;
-       if (prev)
-               prev->next = node;
-       if (next)
-               next->prev = node;
-       return node;
-}
-
-static inline GList*
-disconnect_node (GList *node)
-{
-       if (node->next)
-               node->next->prev = node->prev;
-       if (node->prev)
-               node->prev->next = node->next;
-       return node;
-}
-
-GList *
-g_list_prepend (GList *list, gpointer data)
-{
-       return new_node (list ? list->prev : NULL, data, list);
-}
-
-void
-g_list_free_1 (GList *list)
-{
-       g_free (list);
-}
-
-void
-g_list_free (GList *list)
-{
-       while (list){
-               GList *next = list->next;
-               g_list_free_1 (list);
-               list = next;
-       }
-}
-
-GList*
-g_list_append (GList *list, gpointer data)
-{
-       GList *node = new_node (g_list_last (list), data, NULL);
-       return list ? list : node;
-}
-
-GList *
-g_list_concat (GList *list1, GList *list2)
-{
-       if (list1 && list2) {
-               list2->prev = g_list_last (list1);
-               list2->prev->next = list2;
-       }
-       return list1 ? list1 : list2;
-}
-
-guint
-g_list_length (GList *list)
-{
-       guint length = 0;
-
-       while (list) {
-               length ++;
-               list = list->next;
-       }
-
-       return length;
-}
-
-GList*
-g_list_remove (GList *list, gconstpointer data)
-{
-       GList *current = g_list_find (list, data);
-       if (!current)
-               return list;
-
-       if (current == list)
-               list = list->next;
-       g_list_free_1 (disconnect_node (current));
-
-       return list;
-}
-
-GList*
-g_list_remove_all (GList *list, gconstpointer data)
-{
-       GList *current = g_list_find (list, data);
-
-       if (!current)
-               return list;
-
-       while (current) {
-               if (current == list)
-                       list = list->next;
-               g_list_free_1 (disconnect_node (current));
-
-               current = g_list_find (list, data);
-       }
-
-       return list;
-}
-
-GList*
-g_list_remove_link (GList *list, GList *link)
-{
-       if (list == link)
-               list = list->next;
-
-       disconnect_node (link);
-       link->next = NULL;
-       link->prev = NULL;
-
-       return list;
-}
-
-GList*
-g_list_delete_link (GList *list, GList *link)
-{
-       list = g_list_remove_link (list, link);
-       g_list_free_1 (link);
-
-       return list;
-}
-
-GList*
-g_list_find (GList *list, gconstpointer data)
-{
-       while (list){
-               if (list->data == data)
-                       return list;
-
-               list = list->next;
-       }
-
-       return NULL;
-}
-
-GList*
-g_list_find_custom (GList *list, gconstpointer data, GCompareFunc func)
-{
-       if (!func)
-               return NULL;
-       
-       while (list) {
-               if (func (list->data, data) == 0)
-                       return list;
-               
-               list = list->next;
-       }
-       
-       return NULL;
-}
-
-GList*
-g_list_reverse (GList *list)
-{
-       GList *reverse = NULL;
-
-       while (list) {
-               reverse = list;
-               list = reverse->next;
-
-               reverse->next = reverse->prev;
-               reverse->prev = list;
-       }
-
-       return reverse;
-}
-
-GList*
-g_list_first (GList *list)
-{
-       if (!list)
-               return NULL;
-
-       while (list->prev)
-               list = list->prev;
-
-       return list;
-}
-
-GList*
-g_list_last (GList *list)
-{
-       if (!list)
-               return NULL;
-
-       while (list->next)
-               list = list->next;
-
-       return list;
-}
-
-GList*
-g_list_insert_sorted (GList *list, gpointer data, GCompareFunc func)
-{
-       GList *prev = NULL;
-       GList *current;
-       GList *node;
-
-       if (!func)
-               return list;
-
-       /* Invariant: !prev || func (prev->data, data) <= 0) */
-       for (current = list; current; current = current->next) {
-               if (func (current->data, data) > 0)
-                       break;
-               prev = current;
-       }
-
-       node = new_node (prev, data, current);
-       return list == current ? node : list;
-}
-
-GList*
-g_list_insert_before (GList *list, GList *sibling, gpointer data)
-{
-       if (sibling) {
-               GList *node = new_node (sibling->prev, data, sibling);
-               return list == sibling ? node : list;
-       }
-       return g_list_append (list, data);
-}
-
-void
-g_list_foreach (GList *list, GFunc func, gpointer user_data)
-{
-       while (list){
-               (*func) (list->data, user_data);
-               list = list->next;
-       }
-}
-
-gint
-g_list_index (GList *list, gconstpointer data)
-{
-       gint index = 0;
-
-       while (list){
-               if (list->data == data)
-                       return index;
-
-               index ++;
-               list = list->next;
-       }
-
-       return -1;
-}
-
-GList*
-g_list_nth (GList *list, guint n)
-{
-       for (; list; list = list->next) {
-               if (n == 0)
-                       break;
-               n--;
-       }
-       return list;
-}
-
-gpointer
-g_list_nth_data (GList *list, guint n)
-{
-       GList *node = g_list_nth (list, n);
-       return node ? node->data : NULL;
-}
-
-GList*
-g_list_copy (GList *list)
-{
-       GList *copy = NULL;
-
-       if (list) {
-               GList *tmp = new_node (NULL, list->data, NULL);
-               copy = tmp;
-
-               for (list = list->next; list; list = list->next)
-                       tmp = new_node (tmp, list->data, NULL);
-       }
-
-       return copy;
-}
-
-typedef GList list_node;
-#include "sort.frag.h"
-
-GList*
-g_list_sort (GList *list, GCompareFunc func)
-{
-       GList *current;
-       if (!list || !list->next)
-               return list;
-       list = do_sort (list, func);
-
-       /* Fixup: do_sort doesn't update 'prev' pointers */
-       list->prev = NULL;
-       for (current = list; current->next; current = current->next)
-               current->next->prev = current;
-
-       return list;
-}
diff --git a/eglib/src/gmarkup.c b/eglib/src/gmarkup.c
deleted file mode 100644 (file)
index 4e6c664..0000000
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
- * gmakrup.c: Minimal XML markup reader.
- *
- * Unlike the GLib one, this can not be restarted with more text
- * as the Mono use does not require it.
- *
- * Actually, with further thought, I think that this could be made
- * to restart very easily.  The pos == end condition would mean
- * "return to caller" and only at end parse this would be a fatal
- * error.
- *
- * Not that it matters to Mono, but it is very simple to change, there
- * is a tricky situation: there are a few places where we check p+n
- * in the source, and that would have to change to be progressive, instead
- * of depending on the string to be complete at that point, so we would
- * have to introduce extra states to cope with that.
- *
- * Author:
- *   Miguel de Icaza (miguel@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <ctype.h>
-#include <glib.h>
-
-#define set_error(msg, ...) do { if (error != NULL) *error = g_error_new (GINT_TO_POINTER (1), 1, msg, __VA_ARGS__); } while (0);
-
-typedef enum {
-       START,
-       START_ELEMENT,
-       TEXT,
-       FLUSH_TEXT,
-       CLOSING_ELEMENT,
-       COMMENT,
-       SKIP_XML_DECLARATION
-} ParseState;
-
-struct _GMarkupParseContext {
-       GMarkupParser  parser;
-       gpointer       user_data;
-       GDestroyNotify user_data_dnotify;
-       ParseState     state;
-
-       /* Stores the name of the current element, so we can issue the end_element */
-       GSList         *level;
-
-       GString        *text;
-};
-
-GMarkupParseContext *
-g_markup_parse_context_new (const GMarkupParser *parser,
-                           GMarkupParseFlags flags,
-                           gpointer user_data,
-                           GDestroyNotify user_data_dnotify)
-{
-       GMarkupParseContext *context = g_new0 (GMarkupParseContext, 1);
-
-       context->parser = *parser;
-       context->user_data = user_data;
-       context->user_data_dnotify = user_data_dnotify;
-
-       return context;
-}
-
-void
-g_markup_parse_context_free (GMarkupParseContext *context)
-{
-       GSList *l;
-       
-       g_return_if_fail (context != NULL);
-
-       if (context->user_data_dnotify != NULL)
-               (context->user_data_dnotify) (context->user_data);
-       
-       if (context->text != NULL)
-               g_string_free (context->text, TRUE);
-       for (l = context->level; l; l = l->next)
-               g_free (l->data);
-       g_slist_free (context->level);
-       g_free (context);
-}
-
-static gboolean
-my_isspace (char c)
-{
-       if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v')
-               return TRUE;
-       return FALSE;
-}
-
-static gboolean
-my_isalnum (char c)
-{
-       if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
-               return TRUE;
-       if (c >= '0' && c <= '9')
-               return TRUE;
-
-       return FALSE;
-}
-
-static gboolean
-my_isalpha (char c)
-{
-       if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
-               return TRUE;
-       return FALSE;
-}
-
-static const char *
-skip_space (const char *p, const char *end)
-{
-       for (; p < end && my_isspace (*p); p++)
-               ;
-       return p;
-}
-
-static const char *
-parse_value (const char *p, const char *end, char **value, GError **error)
-{
-       const char *start;
-       int l;
-       
-       if (*p != '"'){
-               set_error ("%s", "Expected the attribute value to start with a quote");
-               return end;
-       }
-       start = ++p;
-       for (; p < end && *p != '"'; p++)
-               ;
-       if (p == end)
-               return end;
-       l = (int)(p - start);
-       p++;
-       *value = g_malloc (l + 1);
-       if (*value == NULL)
-               return end;
-       strncpy (*value, start, l);
-       (*value) [l] = 0;
-       return p;
-}
-
-static const char *
-parse_name (const char *p, const char *end, char **value)
-{
-       const char *start = p;
-       int l;
-       
-       for (; p < end && my_isalnum (*p); p++)
-               ;
-       if (p == end)
-               return end;
-
-       l = (int)(p - start);
-       *value = g_malloc (l + 1);
-       if (*value == NULL)
-               return end;
-       strncpy (*value, start, l);
-       (*value) [l] = 0;
-       return p;
-}
-
-static const char *
-parse_attributes (const char *p, const char *end, char ***names, char ***values, GError **error, int *full_stop, int state)
-{
-       int nnames = 0;
-
-       while (TRUE){
-               p = skip_space (p, end);
-               if (p == end)
-                       return end;
-                       
-               if (*p == '>'){
-                       *full_stop = 0;
-                       return p; 
-               }
-               if (state == SKIP_XML_DECLARATION && *p == '?' && ((p+1) < end) && *(p+1) == '>'){
-                       *full_stop = 0;
-                       return p+1;
-               }
-               
-               if (*p == '/' && ((p+1) < end && *(p+1) == '>')){
-                       *full_stop = 1;
-                       return p+1;
-               } else {
-                       char *name, *value;
-                       
-                       p = parse_name (p, end, &name);
-                       if (p == end)
-                               return p;
-
-                       p = skip_space (p, end);
-                       if (p == end){
-                               g_free (name);
-                               return p;
-                       }
-                       if (*p != '='){
-                               set_error ("Expected an = after the attribute name `%s'", name);
-                               g_free (name);
-                               return end;
-                       }
-                       p++;
-                       p = skip_space (p, end);
-                       if (p == end){
-                               g_free (name);
-                               return end;
-                       }
-
-                       p = parse_value (p, end, &value, error);
-                       if (p == end){
-                               g_free (name);
-                               return p;
-                       }
-
-                       ++nnames;
-                       *names = g_realloc (*names, sizeof (char **) * (nnames+1));
-                       *values = g_realloc (*values, sizeof (char **) * (nnames+1));
-                       (*names) [nnames-1] = name;
-                       (*values) [nnames-1] = value;
-                       (*names) [nnames] = NULL;
-                       (*values) [nnames] = NULL;                      
-               }
-       } 
-}
-
-static void
-destroy_parse_state (GMarkupParseContext *context)
-{
-       GSList *p;
-
-       for (p = context->level; p != NULL; p = p->next)
-               g_free (p->data);
-       
-       g_slist_free (context->level);
-       if (context->text != NULL)
-               g_string_free (context->text, TRUE);
-       context->text = NULL;
-       context->level = NULL;
-}
-
-gboolean
-g_markup_parse_context_parse (GMarkupParseContext *context,
-                             const gchar *text, gssize text_len,
-                             GError **error)
-{
-       const char *p,  *end;
-       
-       g_return_val_if_fail (context != NULL, FALSE);
-       g_return_val_if_fail (text != NULL, FALSE);
-       g_return_val_if_fail (text_len >= 0, FALSE);
-
-       end = text + text_len;
-       
-       for (p = text; p < end; p++){
-               char c = *p;
-
-               switch (context->state){
-               case START:
-                       if (c == ' ' || c == '\t' || c == '\f' || c == '\n' || (c & 0x80))
-                               continue;
-                       if (c == '<'){
-                               if (p+1 < end && p [1] == '?'){
-                                       context->state = SKIP_XML_DECLARATION;
-                                       p++;
-                               } else
-                                       context->state = START_ELEMENT;
-                               continue;
-                       }
-                       set_error ("%s", "Expected < to start the document");
-                       goto fail;
-
-               case SKIP_XML_DECLARATION:
-               case START_ELEMENT: {
-                       const char *element_start = p, *element_end;
-                       char *ename = NULL;
-                       int full_stop = 0, l;
-                       gchar **names = NULL, **values = NULL;
-
-                       for (; p < end && my_isspace (*p); p++)
-                               ;
-                       if (p == end){
-                               set_error ("%s", "Unfinished element");
-                               goto fail;
-                       }
-
-                       if (*p == '!' && (p+2 < end) && (p [1] == '-') && (p [2] == '-')){
-                               context->state = COMMENT;
-                               p += 2;
-                               break;
-                       }
-                       
-                       if (!my_isalpha (*p)){
-                               set_error ("%s", "Expected an element name");
-                               goto fail;
-                       }
-                       
-                       for (++p; p < end && (my_isalnum (*p) || (*p == '.')); p++)
-                               ;
-                       if (p == end){
-                               set_error ("%s", "Expected an element");
-                               goto fail;
-                       }
-                       element_end = p;
-                       
-                       for (; p < end && my_isspace (*p); p++)
-                               ;
-                       if (p == end){
-                               set_error ("%s", "Unfinished element");
-                               goto fail;
-                       }
-                       p = parse_attributes (p, end, &names, &values, error, &full_stop, context->state);
-                       if (p == end){
-                               if (names != NULL) {
-                                       g_strfreev (names);
-                                       g_strfreev (values);
-                               }
-                               /* Only set the error if parse_attributes did not */
-                               if (error != NULL && *error == NULL)
-                                       set_error ("%s", "Unfinished sequence");
-                               goto fail;
-                       }
-                       l = (int)(element_end - element_start);
-                       ename = g_malloc (l + 1);
-                       if (ename == NULL)
-                               goto fail;
-                       strncpy (ename, element_start, l);
-                       ename [l] = 0;
-
-                       if (context->state == START_ELEMENT)
-                               if (context->parser.start_element != NULL)
-                                       context->parser.start_element (context, ename,
-                                                                      (const gchar **) names,
-                                                                      (const gchar **) values,
-                                                                      context->user_data, error);
-
-                       if (names != NULL){
-                               g_strfreev (names);
-                               g_strfreev (values);
-                       }
-
-                       if (error != NULL && *error != NULL){
-                               g_free (ename);
-                               goto fail;
-                       }
-                       
-                       if (full_stop){
-                               if (context->parser.end_element != NULL &&  context->state == START_ELEMENT){
-                                       context->parser.end_element (context, ename, context->user_data, error);
-                                       if (error != NULL && *error != NULL){
-                                               g_free (ename);
-                                               goto fail;
-                                       }
-                               }
-                               g_free (ename);
-                       } else {
-                               context->level = g_slist_prepend (context->level, ename);
-                       }
-                       
-                       context->state = TEXT;
-                       break;
-               } /* case START_ELEMENT */
-
-               case TEXT: {
-                       if (c == '<'){
-                               context->state = FLUSH_TEXT;
-                               break;
-                       }
-                       if (context->parser.text != NULL){
-                               if (context->text == NULL)
-                                       context->text = g_string_new ("");
-                               g_string_append_c (context->text, c);
-                       }
-                       break;
-               }
-
-               case COMMENT:
-                       if (*p != '-')
-                               break;
-                       if (p+2 < end && (p [1] == '-') && (p [2] == '>')){
-                               context->state = TEXT;
-                               p += 2;
-                               break;
-                       }
-                       break;
-                       
-               case FLUSH_TEXT:
-                       if (context->parser.text != NULL && context->text != NULL){
-                               context->parser.text (context, context->text->str, context->text->len,
-                                                     context->user_data, error);
-                               if (error != NULL && *error != NULL)
-                                       goto fail;
-                       }
-                       
-                       if (c == '/')
-                               context->state = CLOSING_ELEMENT;
-                       else {
-                               p--;
-                               context->state = START_ELEMENT;
-                       }
-                       break;
-
-               case CLOSING_ELEMENT: {
-                       GSList *current = context->level;
-                       char *text;
-
-                       if (context->level == NULL){
-                               set_error ("%s", "Too many closing tags, not enough open tags");
-                               goto fail;
-                       }
-                       
-                       text = current->data;
-                       if (context->parser.end_element != NULL){
-                               context->parser.end_element (context, text, context->user_data, error);
-                               if (error != NULL && *error != NULL){
-                                       g_free (text);
-                                       goto fail;
-                               }
-                       }
-                       g_free (text);
-
-                       while (p < end && *p != '>')
-                               p++;
-                       
-                       context->level = context->level->next;
-                       g_slist_free_1 (current);
-                       context->state = TEXT;
-                       break;
-               } /* case CLOSING_ELEMENT */
-                       
-               } /* switch */
-       }
-
-
-       return TRUE;
- fail:
-       if (context->parser.error && error != NULL && *error)
-               context->parser.error (context, *error, context->user_data);
-       
-       destroy_parse_state (context);
-       return FALSE;
-}
-
-gboolean
-g_markup_parse_context_end_parse (GMarkupParseContext *context, GError **error)
-{
-       g_return_val_if_fail (context != NULL, FALSE);
-
-       /*
-        * In our case, we always signal errors during parse, not at the end
-        * see the notes at the top of this file for details on how this
-        * could be moved here
-        */
-       return TRUE;
-}
diff --git a/eglib/src/gmem.c b/eglib/src/gmem.c
deleted file mode 100644 (file)
index eff478d..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * gmem.c: memory utility functions
- *
- * Author:
- *     Gonzalo Paniagua Javier (gonzalo@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <config.h>
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-
-#if defined (ENABLE_OVERRIDABLE_ALLOCATORS)
-
-static GMemVTable sGMemVTable = { malloc, realloc, free, calloc };
-
-void
-g_mem_set_vtable (GMemVTable* vtable)
-{
-       sGMemVTable.calloc = vtable->calloc ? vtable->calloc : calloc;
-       sGMemVTable.realloc = vtable->realloc ? vtable->realloc : realloc;
-       sGMemVTable.malloc = vtable->malloc ? vtable->malloc : malloc;
-       sGMemVTable.free = vtable->free ? vtable->free : free;
-}
-
-#define G_FREE_INTERNAL sGMemVTable.free
-#define G_REALLOC_INTERNAL sGMemVTable.realloc
-#define G_CALLOC_INTERNAL sGMemVTable.calloc
-#define G_MALLOC_INTERNAL sGMemVTable.malloc
-#else
-
-void
-g_mem_set_vtable (GMemVTable* vtable)
-{
-}
-
-#define G_FREE_INTERNAL free
-#define G_REALLOC_INTERNAL realloc
-#define G_CALLOC_INTERNAL calloc
-#define G_MALLOC_INTERNAL malloc
-#endif
-void
-g_free (void *ptr)
-{
-       if (ptr != NULL)
-               G_FREE_INTERNAL (ptr);
-}
-
-gpointer
-g_memdup (gconstpointer mem, guint byte_size)
-{
-       gpointer ptr;
-
-       if (mem == NULL)
-               return NULL;
-
-       ptr = g_malloc (byte_size);
-       if (ptr != NULL)
-               memcpy (ptr, mem, byte_size);
-
-       return ptr;
-}
-
-gpointer g_realloc (gpointer obj, gsize size)
-{
-       gpointer ptr;
-       if (!size) {
-               g_free (obj);
-               return 0;
-       }
-       ptr = G_REALLOC_INTERNAL (obj, size);
-       if (ptr)
-               return ptr;
-       g_error ("Could not allocate %i bytes", size);
-}
-
-gpointer 
-g_malloc (gsize x) 
-{ 
-       gpointer ptr;
-       if (!x)
-               return 0;
-       ptr = G_MALLOC_INTERNAL (x);
-       if (ptr) 
-               return ptr;
-       g_error ("Could not allocate %i bytes", x);
-}
-
-gpointer g_calloc (gsize n, gsize x)
-{
-       gpointer ptr;
-       if (!x || !n)
-               return 0;
-               ptr = G_CALLOC_INTERNAL (n, x);
-       if (ptr)
-               return ptr;
-       g_error ("Could not allocate %i (%i * %i) bytes", x*n, n, x);
-}
-gpointer g_malloc0 (gsize x) 
-{ 
-       return g_calloc (1,x);
-}
-
-gpointer g_try_malloc (gsize x) 
-{
-       if (x)
-               return G_MALLOC_INTERNAL (x);
-       return 0;
-}
-
-
-gpointer g_try_realloc (gpointer obj, gsize size)
-{ 
-       if (!size) {
-               G_FREE_INTERNAL (obj);
-               return 0;
-       } 
-       return G_REALLOC_INTERNAL (obj, size);
-}
diff --git a/eglib/src/gmisc-unix.c b/eglib/src/gmisc-unix.c
deleted file mode 100644 (file)
index 2529069..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * gmisc.c: Misc functions with no place to go (right now)
- *
- * Author:
- *   Aaron Bockover (abockover@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <config.h>
-#include <stdlib.h>
-#include <glib.h>
-#include <pthread.h>
-
-#ifdef HAVE_PWD_H
-#include <pwd.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-static pthread_mutex_t env_lock = PTHREAD_MUTEX_INITIALIZER;
-
-/* MONO Comment
- * 
- * As per the UNIX spec, 
- * "The return value from getenv() may point to static data which may be overwritten by subsequent calls to getenv(), setenv(), or unsetenv()."
- * Source: Unix Manual Pages for getenv, IEEE Std 1003.1
- *
- * This means that using pointers returned from getenv may (and does) lead to many
- * pointers which refer to the same piece of memory. When one is freed, all will be freed.
- *
- * This is unsafe and an ergonomics risk to fix in the callers. While the caller could lock,
- * this introduces the risk for looping or exiting while inside of a lock. For this reason,
- * g_getenv does not mimic the behavior of POSIX getenv anymore.
- *
- * The memory address returned will be unique to the invocaton, and must be freed.
- * */ 
-gchar *
-g_getenv (const gchar *variable)
-{
-       gchar *ret = NULL;
-       pthread_mutex_lock (&env_lock);
-       gchar *res = getenv(variable);
-       if (res)
-               ret = g_strdup(res);
-       pthread_mutex_unlock (&env_lock);
-
-       return ret;
-}
-
-/*
- * This function checks if the given variable is non-NULL
- * in the environment. It's useful because it removes memory
- * freeing requirements.
- *
- */
-gboolean
-g_hasenv (const gchar *variable)
-{
-       pthread_mutex_lock (&env_lock);
-       gchar *res = getenv(variable);
-       gboolean not_null = (res != NULL);
-       pthread_mutex_unlock (&env_lock);
-
-       return not_null;
-}
-
-gboolean
-g_setenv(const gchar *variable, const gchar *value, gboolean overwrite)
-{
-       gboolean res;
-       pthread_mutex_lock (&env_lock);
-       res = (setenv(variable, value, overwrite) == 0);
-       pthread_mutex_unlock (&env_lock);
-       return res;
-}
-
-void
-g_unsetenv(const gchar *variable)
-{
-       pthread_mutex_lock (&env_lock);
-       unsetenv(variable);
-       pthread_mutex_unlock (&env_lock);
-}
-
-gchar*
-g_win32_getlocale(void)
-{
-       return NULL;
-}
-
-gboolean
-g_path_is_absolute (const char *filename)
-{
-       g_return_val_if_fail (filename != NULL, FALSE);
-
-       return (*filename == '/');
-}
-
-static pthread_mutex_t pw_lock = PTHREAD_MUTEX_INITIALIZER;
-static const gchar *home_dir;
-static const gchar *user_name;
-
-static void
-get_pw_data (void)
-{
-#ifdef HAVE_GETPWUID_R
-       struct passwd pw;
-       struct passwd *result;
-       char buf [4096];
-#endif
-
-       if (user_name != NULL)
-               return;
-
-       pthread_mutex_lock (&pw_lock);
-       if (user_name != NULL) {
-               pthread_mutex_unlock (&pw_lock);
-               return;
-       }
-
-       home_dir = g_getenv ("HOME");
-       user_name = g_getenv ("USER");
-
-#ifdef HAVE_GETPWUID_R
-       if (home_dir == NULL || user_name == NULL) {
-               if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
-                       if (home_dir == NULL)
-                               home_dir = g_strdup (pw.pw_dir);
-                       if (user_name == NULL)
-                               user_name = g_strdup (pw.pw_name);
-               }
-       }
-#endif
-
-       if (user_name == NULL)
-               user_name = "somebody";
-       if (home_dir == NULL)
-               home_dir = "/";
-
-       pthread_mutex_unlock (&pw_lock);
-}
-
-const gchar *
-g_get_home_dir (void)
-{
-       get_pw_data ();
-       return home_dir;
-}
-
-const char *
-g_get_user_name (void)
-{
-       get_pw_data ();
-       return user_name;
-}
-
-static const char *tmp_dir;
-
-static pthread_mutex_t tmp_lock = PTHREAD_MUTEX_INITIALIZER;
-
-const gchar *
-g_get_tmp_dir (void)
-{
-       if (tmp_dir == NULL){
-               pthread_mutex_lock (&tmp_lock);
-               if (tmp_dir == NULL){
-                       tmp_dir = g_getenv ("TMPDIR");
-                       if (tmp_dir == NULL){
-                               tmp_dir = g_getenv ("TMP");
-                               if (tmp_dir == NULL){
-                                       tmp_dir = g_getenv ("TEMP");
-                                       if (tmp_dir == NULL)
-                                               tmp_dir = "/tmp";
-                               }
-                       }
-               }
-               pthread_mutex_unlock (&tmp_lock);
-       }
-       return tmp_dir;
-}
-
diff --git a/eglib/src/gmisc-win32-uwp.c b/eglib/src/gmisc-win32-uwp.c
deleted file mode 100644 (file)
index cdf5896..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * gmisc-win32-uwp.c: UWP misc support.
- *
- * Copyright 2016 Microsoft
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
-*/
-#include <config.h>
-#include <glib.h>
-
-#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
-#include <windows.h>
-#include <assert.h>
-
-gchar*
-g_win32_getlocale(void)
-{
-       gunichar2 buf[19];
-       gint ccBuf = GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SISO639LANGNAME, buf, 9);
-       assert (ccBuf <= 9);
-       if (ccBuf != 0) {
-               buf[ccBuf - 1] = L'-';
-               ccBuf = GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
-               assert (ccBuf <= 9);
-       }
-
-       // Check for GetLocaleInfoEx failure.
-       if (ccBuf == 0)
-               buf[0] = L'\0';
-
-       return u16to8 (buf);
-}
-
-#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
-
-#ifdef _MSC_VER
-// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
-void __mono_win32_gmisc_win32_uwp_quiet_lnk4221(void) {}
-#endif
-#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/eglib/src/gmisc-win32.c b/eglib/src/gmisc-win32.c
deleted file mode 100644 (file)
index 70d99bf..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * gmisc.c: Misc functions with no place to go (right now)
- *
- * Author:
- *   Aaron Bockover (abockover@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <config.h>
-
-#include <stdlib.h>
-#include <glib.h>
-
-#include <windows.h>
-#if _MSC_VER && G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
-#include <shlobj.h>
-#endif
-#include <direct.h>
-#include <io.h>
-#include <assert.h>
-
-gboolean
-g_hasenv (const gchar *variable)
-{
-       return g_getenv (variable) != NULL;
-}
-
-gchar *
-g_getenv(const gchar *variable)
-{
-       gunichar2 *var, *buffer;
-       gchar* val = NULL;
-       gint32 buffer_size = 1024;
-       gint32 retval;
-       var = u8to16(variable); 
-       buffer = g_malloc(buffer_size*sizeof(gunichar2));
-       retval = GetEnvironmentVariableW (var, buffer, buffer_size);
-       if (retval != 0) {
-               if (retval > buffer_size) {
-                       g_free (buffer);
-                       buffer_size = retval;
-                       buffer = g_malloc(buffer_size*sizeof(gunichar2));
-                       retval = GetEnvironmentVariableW (var, buffer, buffer_size);
-               }
-               val = u16to8 (buffer);
-       } else {
-               if (GetLastError () != ERROR_ENVVAR_NOT_FOUND){
-                       val = g_malloc (1);
-                       *val = 0;
-               }
-       }
-       g_free(var);
-       g_free(buffer);
-       return val; 
-}
-
-gboolean
-g_setenv(const gchar *variable, const gchar *value, gboolean overwrite)
-{
-       gunichar2 *var, *val;
-       gboolean result;
-       var = u8to16(variable); 
-       val = u8to16(value);
-       result = (SetEnvironmentVariableW(var, val) != 0) ? TRUE : FALSE;
-       g_free(var);
-       g_free(val);
-       return result;
-}
-
-void
-g_unsetenv(const gchar *variable)
-{
-       gunichar2 *var;
-       var = u8to16(variable); 
-       SetEnvironmentVariableW(var, L"");
-       g_free(var);
-}
-
-#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
-gchar*
-g_win32_getlocale(void)
-{
-       LCID lcid = GetThreadLocale();
-       gchar buf[19];
-       gint ccBuf = GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, buf, 9);
-       buf[ccBuf - 1] = '-';
-       ccBuf += GetLocaleInfoA(lcid, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
-       return g_strdup (buf);
-}
-#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
-
-gboolean
-g_path_is_absolute (const char *filename)
-{
-       g_return_val_if_fail (filename != NULL, FALSE);
-
-       if (filename[0] != '\0' && filename[1] != '\0') {
-               if (filename[1] == ':' && filename[2] != '\0' &&
-                       (filename[2] == '\\' || filename[2] == '/'))
-                       return TRUE;
-               /* UNC paths */
-               else if (filename[0] == '\\' && filename[1] == '\\' && 
-                       filename[2] != '\0')
-                       return TRUE;
-       }
-
-       return FALSE;
-}
-
-#if _MSC_VER && G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
-static gchar*
-g_get_known_folder_path (void)
-{
-       gchar *folder_path = NULL;
-       PWSTR profile_path = NULL;
-       HRESULT hr = SHGetKnownFolderPath (&FOLDERID_Profile, KF_FLAG_DEFAULT, NULL, &profile_path);
-       if (SUCCEEDED(hr)) {
-               folder_path = u16to8 (profile_path);
-               CoTaskMemFree (profile_path);
-       }
-
-       return folder_path;
-}
-
-#else
-
-static inline gchar *
-g_get_known_folder_path (void)
-{
-       return NULL;
-}
-#endif
-
-const gchar *
-g_get_home_dir (void)
-{
-       gchar *home_dir = g_get_known_folder_path ();
-
-       if (!home_dir) {
-               home_dir = (gchar *) g_getenv ("USERPROFILE");
-       }
-
-       if (!home_dir) {
-               const gchar *drive = g_getenv ("HOMEDRIVE");
-               const gchar *path = g_getenv ("HOMEPATH");
-
-               if (drive && path) {
-                       home_dir = g_malloc (strlen (drive) + strlen (path) + 1);
-                       if (home_dir) {
-                               sprintf (home_dir, "%s%s", drive, path);
-                       }
-               }
-               g_free (drive);
-               g_free (path);
-       }
-
-       return home_dir;
-}
-
-const char *
-g_get_user_name (void)
-{
-       const char * retName = g_getenv ("USER");
-       if (!retName)
-               retName = g_getenv ("USERNAME");
-       return retName;
-}
-
-static const char *tmp_dir;
-
-const gchar *
-g_get_tmp_dir (void)
-{
-       if (tmp_dir == NULL){
-               if (tmp_dir == NULL){
-                       tmp_dir = g_getenv ("TMPDIR");
-                       if (tmp_dir == NULL){
-                               tmp_dir = g_getenv ("TMP");
-                               if (tmp_dir == NULL){
-                                       tmp_dir = g_getenv ("TEMP");
-                                       if (tmp_dir == NULL)
-                                               tmp_dir = "C:\\temp";
-                               }
-                       }
-               }
-       }
-       return tmp_dir;
-}
diff --git a/eglib/src/gmodule-unix.c b/eglib/src/gmodule-unix.c
deleted file mode 100644 (file)
index 9dd5eaa..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * gmodule.c: dl* functions, glib style
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com)
- *   Jonathan Chambers (joncham@gmail.com)
- *   Robert Jordan (robertj@gmx.net)
- *
- * (C) 2006 Novell, Inc.
- * (C) 2006 Jonathan Chambers
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <config.h>
-
-#include <glib.h>
-#include <gmodule.h>
-
-#if defined(G_OS_UNIX) && defined(HAVE_DLFCN_H)
-#include <dlfcn.h>
-
-/* For Linux and Solaris, need to add others as we port this */
-#define LIBPREFIX "lib"
-#define LIBSUFFIX ".so"
-
-struct _GModule {
-       void *handle;
-};
-
-GModule *
-g_module_open (const gchar *file, GModuleFlags flags)
-{
-       int f = 0;
-       GModule *module;
-       void *handle;
-       
-       flags &= G_MODULE_BIND_MASK;
-       if ((flags & G_MODULE_BIND_LAZY) != 0)
-               f |= RTLD_LAZY;
-       if ((flags & G_MODULE_BIND_LOCAL) != 0)
-               f |= RTLD_LOCAL;
-
-       handle = dlopen (file, f);
-       if (handle == NULL)
-               return NULL;
-       
-       module = g_new (GModule,1);
-       module->handle = handle;
-       
-       return module;
-}
-
-gboolean
-g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
-{
-       if (symbol_name == NULL || symbol == NULL)
-               return FALSE;
-
-       if (module == NULL || module->handle == NULL)
-               return FALSE;
-
-       *symbol = dlsym (module->handle, symbol_name);
-       return (*symbol != NULL);
-}
-
-const gchar *
-g_module_error (void)
-{
-       return dlerror ();
-}
-
-gboolean
-g_module_close (GModule *module)
-{
-       void *handle;
-       if (module == NULL || module->handle == NULL)
-               return FALSE;
-
-       handle = module->handle;
-       module->handle = NULL;
-       g_free (module);
-       return (0 == dlclose (handle));
-}
-
-#elif defined (G_OS_WIN32)
-#include <windows.h>
-#include <psapi.h>
-
-#define LIBSUFFIX ".dll"
-#define LIBPREFIX ""
-
-struct _GModule {
-       HMODULE handle;
-       int main_module;
-};
-
-GModule *
-g_module_open (const gchar *file, GModuleFlags flags)
-{
-       GModule *module;
-       module = g_malloc (sizeof (GModule));
-       if (module == NULL)
-               return NULL;
-
-       if (file != NULL) {
-               gunichar2 *file16;
-               file16 = u8to16(file); 
-               module->main_module = FALSE;
-               module->handle = LoadLibrary (file16);
-               g_free(file16);
-               if (!module->handle) {
-                       g_free (module);
-                       return NULL;
-               }
-                       
-       } else {
-               module->main_module = TRUE;
-               module->handle = GetModuleHandle (NULL);
-       }
-
-       return module;
-}
-
-static gpointer
-w32_find_symbol (const gchar *symbol_name)
-{
-       HMODULE *modules;
-       DWORD buffer_size = sizeof (HMODULE) * 1024;
-       DWORD needed, i;
-
-       modules = (HMODULE *) g_malloc (buffer_size);
-
-       if (modules == NULL)
-               return NULL;
-
-       if (!EnumProcessModules (GetCurrentProcess (), modules,
-                                buffer_size, &needed)) {
-               g_free (modules);
-               return NULL;
-       }
-
-       /* check whether the supplied buffer was too small, realloc, retry */
-       if (needed > buffer_size) {
-               g_free (modules);
-
-               buffer_size = needed;
-               modules = (HMODULE *) g_malloc (buffer_size);
-
-               if (modules == NULL)
-                       return NULL;
-
-               if (!EnumProcessModules (GetCurrentProcess (), modules,
-                                        buffer_size, &needed)) {
-                       g_free (modules);
-                       return NULL;
-               }
-       }
-
-       for (i = 0; i < needed / sizeof (HANDLE); i++) {
-               gpointer proc = (gpointer)(intptr_t)GetProcAddress (modules [i], symbol_name);
-               if (proc != NULL) {
-                       g_free (modules);
-                       return proc;
-               }
-       }
-
-       g_free (modules);
-       return NULL;
-}
-
-gboolean
-g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
-{
-       if (module == NULL || symbol_name == NULL || symbol == NULL)
-               return FALSE;
-
-       if (module->main_module) {
-               *symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
-               if (*symbol != NULL)
-                       return TRUE;
-
-               *symbol = w32_find_symbol (symbol_name);
-               return *symbol != NULL;
-       } else {
-               *symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
-               return *symbol != NULL;
-       }
-}
-
-const gchar *
-g_module_error (void)
-{
-       gchar* ret = NULL;
-       TCHAR* buf = NULL;
-       DWORD code = GetLastError ();
-
-       FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 
-               code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 0, NULL);
-
-       ret = u16to8 (buf);
-       LocalFree(buf);
-
-       return ret;
-}
-
-gboolean
-g_module_close (GModule *module)
-{
-       HMODULE handle;
-       int main_module;
-
-       if (module == NULL || module->handle == NULL)
-               return FALSE;
-
-       handle = module->handle;
-       main_module = module->main_module;
-       module->handle = NULL;
-       g_free (module);
-       return (main_module ? 1 : (0 == FreeLibrary (handle)));
-}
-
-#else
-
-#define LIBSUFFIX ""
-#define LIBPREFIX ""
-
-GModule *
-g_module_open (const gchar *file, GModuleFlags flags)
-{
-       g_error ("%s", "g_module_open not implemented on this platform");
-       return NULL;
-}
-
-gboolean
-g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
-{
-       g_error ("%s", "g_module_open not implemented on this platform");
-       return FALSE;
-}
-
-const gchar *
-g_module_error (void)
-{
-       g_error ("%s", "g_module_open not implemented on this platform");
-       return NULL;
-}
-
-gboolean
-g_module_close (GModule *module)
-{
-       g_error ("%s", "g_module_open not implemented on this platform");
-       return FALSE;
-}
-#endif
-
-gchar *
-g_module_build_path (const gchar *directory, const gchar *module_name)
-{
-       char *lib_prefix = "";
-       
-       if (module_name == NULL)
-               return NULL;
-
-       if (strncmp (module_name, "lib", 3) != 0)
-               lib_prefix = LIBPREFIX;
-       
-       if (directory && *directory){ 
-               
-               return g_strdup_printf ("%s/%s%s" LIBSUFFIX, directory, lib_prefix, module_name);
-       }
-       return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name); 
-}
-
diff --git a/eglib/src/gmodule-win32-internals.h b/eglib/src/gmodule-win32-internals.h
deleted file mode 100644 (file)
index d18e27f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __G_MODULE_WINDOWS_INTERNALS_H__
-#define __G_MODULE_WINDOWS_INTERNALS_H__
-
-#include <config.h>
-#include <glib.h>
-
-#ifdef G_OS_WIN32
-#include <gmodule.h>
-
-gpointer
-w32_find_symbol (const gchar *symbol_name);
-#endif /* G_OS_WIN32 */
-#endif /* __G_MODULE_WINDOWS_INTERNALS_H__ */
diff --git a/eglib/src/gmodule-win32-uwp.c b/eglib/src/gmodule-win32-uwp.c
deleted file mode 100644 (file)
index 5117e3b..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * gmodule-win32-uwp.c: UWP gmodule support.
- *
- * Copyright 2016 Microsoft
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
-*/
-#include <config.h>
-#include <glib.h>
-
-#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
-#include <windows.h>
-#include <gmodule-win32-internals.h>
-
-gpointer
-w32_find_symbol (const gchar *symbol_name)
-{
-       g_unsupported_api ("EnumProcessModules");
-       SetLastError (ERROR_NOT_SUPPORTED);
-       return NULL;
-}
-
-const gchar *
-g_module_error (void)
-{
-       gchar *ret = NULL;
-       TCHAR buf [1024];
-       DWORD code = GetLastError ();
-
-       if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
-               code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, G_N_ELEMENTS (buf) - 1, NULL) )
-               buf[0] = TEXT('\0');
-
-       ret = u16to8 (buf);
-       return ret;
-}
-
-#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
-
-#ifdef _MSC_VER
-// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
-void __mono_win32_gmodule_win32_uwp_quiet_lnk4221(void) {}
-#endif
-#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/eglib/src/gmodule-win32.c b/eglib/src/gmodule-win32.c
deleted file mode 100644 (file)
index 72eaca3..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * gmodule.c: dl* functions, glib style
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com)
- *   Jonathan Chambers (joncham@gmail.com)
- *   Robert Jordan (robertj@gmx.net)
- *
- * (C) 2006 Novell, Inc.
- * (C) 2006 Jonathan Chambers
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <config.h>
-#include <glib.h>
-#include <windows.h>
-#include <psapi.h>
-#include <gmodule-win32-internals.h>
-
-#define LIBSUFFIX ".dll"
-#define LIBPREFIX ""
-
-struct _GModule {
-       HMODULE handle;
-       int main_module;
-};
-
-GModule *
-g_module_open (const gchar *file, GModuleFlags flags)
-{
-       GModule *module;
-       module = g_malloc (sizeof (GModule));
-       if (module == NULL)
-               return NULL;
-
-       if (file != NULL) {
-               gunichar2 *file16;
-               file16 = u8to16(file); 
-               module->main_module = FALSE;
-               module->handle = LoadLibraryW (file16);
-               g_free(file16);
-               if (!module->handle) {
-                       g_free (module);
-                       return NULL;
-               }
-                       
-       } else {
-               module->main_module = TRUE;
-               module->handle = GetModuleHandle (NULL);
-       }
-
-       return module;
-}
-
-#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
-gpointer
-w32_find_symbol (const gchar *symbol_name)
-{
-       HMODULE *modules;
-       DWORD buffer_size = sizeof (HMODULE) * 1024;
-       DWORD needed, i;
-
-       modules = (HMODULE *) g_malloc (buffer_size);
-
-       if (modules == NULL)
-               return NULL;
-
-       if (!EnumProcessModules (GetCurrentProcess (), modules,
-                                buffer_size, &needed)) {
-               g_free (modules);
-               return NULL;
-       }
-
-       /* check whether the supplied buffer was too small, realloc, retry */
-       if (needed > buffer_size) {
-               g_free (modules);
-
-               buffer_size = needed;
-               modules = (HMODULE *) g_malloc (buffer_size);
-
-               if (modules == NULL)
-                       return NULL;
-
-               if (!EnumProcessModules (GetCurrentProcess (), modules,
-                                        buffer_size, &needed)) {
-                       g_free (modules);
-                       return NULL;
-               }
-       }
-
-       for (i = 0; i < needed / sizeof (HANDLE); i++) {
-               gpointer proc = (gpointer)(intptr_t)GetProcAddress (modules [i], symbol_name);
-               if (proc != NULL) {
-                       g_free (modules);
-                       return proc;
-               }
-       }
-
-       g_free (modules);
-       return NULL;
-}
-#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
-
-gboolean
-g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
-{
-       if (module == NULL || symbol_name == NULL || symbol == NULL)
-               return FALSE;
-
-       if (module->main_module) {
-               *symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
-               if (*symbol != NULL)
-                       return TRUE;
-
-               *symbol = w32_find_symbol (symbol_name);
-               return *symbol != NULL;
-       } else {
-               *symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
-               return *symbol != NULL;
-       }
-}
-
-#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
-const gchar *
-g_module_error (void)
-{
-       gchar* ret = NULL;
-       TCHAR* buf = NULL;
-       DWORD code = GetLastError ();
-
-       /* FIXME: buf must not be NULL! */
-       FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 
-               code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 0, NULL);
-
-       ret = u16to8 (buf);
-       LocalFree(buf);
-
-       return ret;
-}
-#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
-
-gboolean
-g_module_close (GModule *module)
-{
-       HMODULE handle;
-       int main_module;
-
-       if (module == NULL || module->handle == NULL)
-               return FALSE;
-
-       handle = module->handle;
-       main_module = module->main_module;
-       module->handle = NULL;
-       g_free (module);
-       return (main_module ? 1 : (0 == FreeLibrary (handle)));
-}
-
-gchar *
-g_module_build_path (const gchar *directory, const gchar *module_name)
-{
-       char *lib_prefix = "";
-       
-       if (module_name == NULL)
-               return NULL;
-
-       if (strncmp (module_name, "lib", 3) != 0)
-               lib_prefix = LIBPREFIX;
-       
-       if (directory && *directory){ 
-               
-               return g_strdup_printf ("%s/%s%s" LIBSUFFIX, directory, lib_prefix, module_name);
-       }
-       return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name); 
-}
diff --git a/eglib/src/gmodule.h b/eglib/src/gmodule.h
deleted file mode 100644 (file)
index ee89683..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef __GLIB_GMODULE_H
-#define __GLIB_GMODULE_H
-
-#include <glib.h>
-
-#define G_MODULE_IMPORT extern
-#ifdef G_OS_WIN32
-#define G_MODULE_EXPORT __declspec(dllexport)
-#else
-#define G_MODULE_EXPORT
-#endif
-
-G_BEGIN_DECLS
-
-/*
- * Modules
- */
-typedef enum {
-       G_MODULE_BIND_LAZY = 0x01,
-       G_MODULE_BIND_LOCAL = 0x02,
-       G_MODULE_BIND_MASK = 0x03
-} GModuleFlags;
-typedef struct _GModule GModule;
-
-GModule *g_module_open (const gchar *file, GModuleFlags flags);
-gboolean g_module_symbol (GModule *module, const gchar *symbol_name,
-                         gpointer *symbol);
-const gchar *g_module_error (void);
-gboolean g_module_close (GModule *module);
-gchar *  g_module_build_path (const gchar *directory, const gchar *module_name);
-
-extern char *gmodule_libprefix;
-extern char *gmodule_libsuffix;
-
-G_END_DECLS
-
-#endif
diff --git a/eglib/src/goutput.c b/eglib/src/goutput.c
deleted file mode 100644 (file)
index 2dcf874..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Output and debugging functions
- *
- * Author:
- *   Miguel de Icaza (miguel@novell.com)
- *
- * (C) 2006 Novell, Inc.
- * Copyright 2011 Xamarin Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <glib.h>
-
-/* The current fatal levels, error is always fatal */
-static GLogLevelFlags fatal = G_LOG_LEVEL_ERROR;
-static GLogFunc default_log_func;
-static gpointer default_log_func_user_data;
-static GPrintFunc stdout_handler, stderr_handler;
-
-static void default_stdout_handler (const gchar *string);
-static void default_stderr_handler (const gchar *string);
-
-void
-g_print (const gchar *format, ...)
-{
-       char *msg;
-       va_list args;
-
-       va_start (args, format);
-       if (g_vasprintf (&msg, format, args) < 0) {
-               va_end (args);
-               return;
-       }
-       va_end (args);
-
-       if (!stdout_handler)
-               stdout_handler = default_stdout_handler;
-
-       stdout_handler (msg);
-       g_free (msg);
-}
-
-void
-g_printerr (const gchar *format, ...)
-{
-       char *msg;
-       va_list args;
-
-       va_start (args, format);
-       if (g_vasprintf (&msg, format, args) < 0) {
-               va_end (args);
-               return;
-       }
-       va_end (args);
-
-       if (!stderr_handler)
-               stderr_handler = default_stderr_handler;
-
-       stderr_handler (msg);
-       g_free (msg);
-}
-
-GLogLevelFlags
-g_log_set_always_fatal (GLogLevelFlags fatal_mask)
-{
-       GLogLevelFlags old_fatal = fatal;
-
-       fatal |= fatal_mask;
-       
-       return old_fatal;
-}
-
-GLogLevelFlags
-g_log_set_fatal_mask (const gchar *log_domain, GLogLevelFlags fatal_mask)
-{
-       /*
-        * Mono does not use a G_LOG_DOMAIN currently, so we just assume things are fatal
-        * if we decide to set G_LOG_DOMAIN (we probably should) we should implement
-        * this.
-        */
-       return fatal_mask;
-}
-
-void
-g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args)
-{
-       char *msg;
-
-       if (!default_log_func)
-               default_log_func = g_log_default_handler;
-       
-       if (g_vasprintf (&msg, format, args) < 0)
-               return;
-
-       default_log_func (log_domain, log_level, msg, default_log_func_user_data);
-       g_free (msg);
-}
-
-void
-g_log (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, ...)
-{
-       va_list args;
-
-       va_start (args, format);
-       g_logv (log_domain, log_level, format, args);
-       va_end (args);
-}
-
-void
-g_assertion_message (const gchar *format, ...)
-{
-       va_list args;
-
-       va_start (args, format);
-       g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
-       va_end (args);
-       exit (0);
-}
-
-
-#if PLATFORM_ANDROID
-#include <android/log.h>
-
-static android_LogPriority
-to_android_priority (GLogLevelFlags log_level)
-{
-       switch (log_level & G_LOG_LEVEL_MASK)
-       {
-               case G_LOG_LEVEL_ERROR:     return ANDROID_LOG_FATAL;
-               case G_LOG_LEVEL_CRITICAL:  return ANDROID_LOG_ERROR;
-               case G_LOG_LEVEL_WARNING:   return ANDROID_LOG_WARN;
-               case G_LOG_LEVEL_MESSAGE:   return ANDROID_LOG_INFO;
-               case G_LOG_LEVEL_INFO:      return ANDROID_LOG_DEBUG;
-               case G_LOG_LEVEL_DEBUG:     return ANDROID_LOG_VERBOSE;
-       }
-       return ANDROID_LOG_UNKNOWN;
-}
-
-void
-g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
-{
-       __android_log_write (to_android_priority (log_level), log_domain, message);
-       if (log_level & fatal)
-               abort ();
-}
-
-static void
-default_stdout_handler (const gchar *message)
-{
-       /* TODO: provide a proper app name */
-       __android_log_write (ANDROID_LOG_ERROR, "mono", message);
-}
-
-static void
-default_stderr_handler (const gchar *message)
-{
-       /* TODO: provide a proper app name */
-       __android_log_write (ANDROID_LOG_ERROR, "mono", message);
-}
-
-
-#elif defined(HOST_IOS)
-#include <asl.h>
-
-static int
-to_asl_priority (GLogLevelFlags log_level)
-{
-       switch (log_level & G_LOG_LEVEL_MASK)
-       {
-               case G_LOG_LEVEL_ERROR:     return ASL_LEVEL_CRIT;
-               case G_LOG_LEVEL_CRITICAL:  return ASL_LEVEL_ERR;
-               case G_LOG_LEVEL_WARNING:   return ASL_LEVEL_WARNING;
-               case G_LOG_LEVEL_MESSAGE:   return ASL_LEVEL_NOTICE;
-               case G_LOG_LEVEL_INFO:      return ASL_LEVEL_INFO;
-               case G_LOG_LEVEL_DEBUG:     return ASL_LEVEL_DEBUG;
-       }
-       return ASL_LEVEL_ERR;
-}
-
-void
-g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
-{
-       asl_log (NULL, NULL, to_asl_priority (log_level), "%s", message);
-       if (log_level & fatal)
-               abort ();
-}
-
-static void
-default_stdout_handler (const gchar *message)
-{
-       asl_log (NULL, NULL, ASL_LEVEL_WARNING, "%s", message);
-}
-
-static void
-default_stderr_handler (const gchar *message)
-{
-       asl_log (NULL, NULL, ASL_LEVEL_WARNING, "%s", message);
-}
-
-#else
-
-void
-g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
-{
-       FILE *target = stdout;
-
-       fprintf (target, "%s%s%s\n",
-               log_domain != NULL ? log_domain : "",
-               log_domain != NULL ? ": " : "",
-               message);
-
-       if (log_level & fatal) {
-               fflush (stdout);
-               fflush (stderr);
-               abort ();
-       }
-}
-
-static void
-default_stdout_handler (const gchar *string)
-{
-       fprintf (stdout, "%s", string);
-}
-
-static void
-default_stderr_handler (const gchar *string)
-{
-       fprintf (stderr, "%s", string);
-}
-
-#endif
-
-GLogFunc
-g_log_set_default_handler (GLogFunc log_func, gpointer user_data)
-{
-       GLogFunc old = default_log_func;
-       default_log_func = log_func;
-       default_log_func_user_data = user_data;
-       return old;
-}
-
-GPrintFunc
-g_set_print_handler (GPrintFunc func)
-{
-       GPrintFunc old = stdout_handler;
-       stdout_handler = func;
-       return old;
-}
-
-GPrintFunc
-g_set_printerr_handler (GPrintFunc func)
-{
-       GPrintFunc old = stderr_handler;
-       stderr_handler = func;
-       return old;
-}
-
diff --git a/eglib/src/gpath.c b/eglib/src/gpath.c
deleted file mode 100644 (file)
index 59f5923..0000000
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * Portable Utility Functions
- *
- * Author:
- *   Miguel de Icaza (miguel@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <config.h>
-#include <stdio.h>
-#include <glib.h>
-#include <errno.h>
-#include <sys/stat.h>
-
-#ifdef G_OS_WIN32
-#include <direct.h> 
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-gchar *
-g_build_path (const gchar *separator, const gchar *first_element, ...)
-{
-       const char *elem, *next, *endptr;
-       gboolean trimmed;
-       GString *path;
-       va_list args;
-       size_t slen;
-       
-       g_return_val_if_fail (separator != NULL, NULL);
-       
-       path = g_string_sized_new (48);
-       slen = strlen (separator);
-       
-       va_start (args, first_element);
-       for (elem = first_element; elem != NULL; elem = next) {
-               /* trim any trailing separators from @elem */
-               endptr = elem + strlen (elem);
-               trimmed = FALSE;
-               
-               while (endptr >= elem + slen) {
-                       if (strncmp (endptr - slen, separator, slen) != 0)
-                               break;
-                       
-                       endptr -= slen;
-                       trimmed = TRUE;
-               }
-               
-               /* append elem, not including any trailing separators */
-               if (endptr > elem)
-                       g_string_append_len (path, elem, endptr - elem);
-               
-               /* get the next element */
-               do {
-                       if (!(next = va_arg (args, char *)))
-                               break;
-                       
-                       /* remove leading separators */
-                       while (!strncmp (next, separator, slen))
-                               next += slen;
-               } while (*next == '\0');
-               
-               if (next || trimmed)
-                       g_string_append_len (path, separator, slen);
-       }
-       va_end (args);
-       
-       return g_string_free (path, FALSE);
-}
-
-static gchar*
-strrchr_seperator (const gchar* filename)
-{
-#ifdef G_OS_WIN32
-       char *p2;
-#endif
-       char *p;
-
-       p = strrchr (filename, G_DIR_SEPARATOR);
-#ifdef G_OS_WIN32
-       p2 = strrchr (filename, '/');
-       if (p2 > p)
-               p = p2;
-#endif
-
-       return p;
-}
-
-gchar *
-g_path_get_dirname (const gchar *filename)
-{
-       char *p, *r;
-       size_t count;
-       g_return_val_if_fail (filename != NULL, NULL);
-
-       p = strrchr_seperator (filename);
-       if (p == NULL)
-               return g_strdup (".");
-       if (p == filename)
-               return g_strdup ("/");
-       count = p - filename;
-       r = g_malloc (count + 1);
-       strncpy (r, filename, count);
-       r [count] = 0;
-
-       return r;
-}
-
-gchar *
-g_path_get_basename (const char *filename)
-{
-       char *r;
-       g_return_val_if_fail (filename != NULL, NULL);
-
-       /* Empty filename -> . */
-       if (!*filename)
-               return g_strdup (".");
-
-       /* No separator -> filename */
-       r = strrchr_seperator (filename);
-       if (r == NULL)
-               return g_strdup (filename);
-
-       /* Trailing slash, remove component */
-       if (r [1] == 0){
-               char *copy = g_strdup (filename);
-               copy [r-filename] = 0;
-               r = strrchr_seperator (copy);
-
-               if (r == NULL){
-                       g_free (copy);                  
-                       return g_strdup ("/");
-               }
-               r = g_strdup (&r[1]);
-               g_free (copy);
-               return r;
-       }
-
-       return g_strdup (&r[1]);
-}
-
-#ifndef HAVE_STRTOK_R
-// This is from BSD's strtok_r
-
-char *
-strtok_r(char *s, const char *delim, char **last)
-{
-       char *spanp;
-       int c, sc;
-       char *tok;
-       
-       if (s == NULL && (s = *last) == NULL)
-               return NULL;
-       
-       /*
-        * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
-        */
-cont:
-       c = *s++;
-       for (spanp = (char *)delim; (sc = *spanp++) != 0; ){
-               if (c == sc)
-                       goto cont;
-       }
-
-       if (c == 0){         /* no non-delimiter characters */
-               *last = NULL;
-               return NULL;
-       }
-       tok = s - 1;
-
-       /*
-        * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
-        * Note that delim must have one NUL; we stop if we see that, too.
-        */
-       for (;;){
-               c = *s++;
-               spanp = (char *)delim;
-               do {
-                       if ((sc = *spanp++) == c) {
-                               if (c == 0)
-                                       s = NULL;
-                               else {
-                                       char *w = s - 1;
-                                       *w = '\0';
-                               }
-                               *last = s;
-                               return tok;
-                       }
-               }
-               while (sc != 0);
-       }
-       /* NOTREACHED */
-}
-#endif
-
-gchar *
-g_find_program_in_path (const gchar *program)
-{
-       char *p;
-       char *x, *l;
-       gchar *curdir = NULL;
-       char *save = NULL;
-#ifdef G_OS_WIN32
-       char *program_exe;
-       char *suffix_list[5] = {".exe",".cmd",".bat",".com",NULL};
-       int listx;
-       gboolean hasSuffix;
-#endif
-
-       g_return_val_if_fail (program != NULL, NULL);
-       x = p = g_strdup (g_getenv ("PATH"));
-
-       if (x == NULL || *x == '\0') {
-               curdir = g_get_current_dir ();
-               x = curdir;
-       }
-
-#ifdef G_OS_WIN32
-       /* see if program already has a suffix */
-       listx = 0;
-       hasSuffix = FALSE;
-       while (!hasSuffix && suffix_list[listx]) {
-               hasSuffix = g_str_has_suffix(program,suffix_list[listx++]);
-       }
-#endif
-
-       while ((l = strtok_r (x, G_SEARCHPATH_SEPARATOR_S, &save)) != NULL){
-               char *probe_path; 
-               
-               x = NULL;
-               probe_path = g_build_path (G_DIR_SEPARATOR_S, l, program, NULL);
-               if (access (probe_path, X_OK) == 0){ /* FIXME: on windows this is just a read permissions test */
-                       g_free (curdir);
-                       g_free (p);
-                       return probe_path;
-               }
-               g_free (probe_path);
-
-#ifdef G_OS_WIN32
-               /* check for program with a suffix attached */
-               if (!hasSuffix) {
-                       listx = 0;
-                       while (suffix_list[listx]) {
-                               program_exe = g_strjoin(NULL,program,suffix_list[listx],NULL);
-                               probe_path = g_build_path (G_DIR_SEPARATOR_S, l, program_exe, NULL);
-                               if (access (probe_path, X_OK) == 0){ /* FIXME: on windows this is just a read permissions test */
-                                       g_free (curdir);
-                                       g_free (p);
-                                       g_free (program_exe);
-                                       return probe_path;
-                               }
-                               listx++;
-                               g_free (probe_path);
-                               g_free (program_exe);
-                       }
-               }
-#endif
-       }
-       g_free (curdir);
-       g_free (p);
-       return NULL;
-}
-
-static char *name;
-
-void
-g_set_prgname (const gchar *prgname)
-{
-       name = g_strdup (prgname);
-}
-
-gchar *
-g_get_prgname (void)
-{
-       return name;
-}
-
-gboolean
-g_ensure_directory_exists (const gchar *filename)
-{
-#ifdef G_OS_WIN32
-       gchar *dir_utf8 = g_path_get_dirname (filename);
-       gunichar2 *p;
-       gunichar2 *dir_utf16 = NULL;
-       int retval;
-       
-       if (!dir_utf8 || !dir_utf8 [0])
-               return FALSE;
-
-       dir_utf16 = g_utf8_to_utf16 (dir_utf8, strlen (dir_utf8), NULL, NULL, NULL);
-       g_free (dir_utf8);
-
-       if (!dir_utf16)
-               return FALSE;
-
-       p = dir_utf16;
-
-       /* make life easy and only use one directory seperator */
-       while (*p != '\0')
-       {
-               if (*p == '/')
-                       *p = '\\';
-               p++;
-       }
-
-       p = dir_utf16;
-
-       /* get past C:\ )*/
-       while (*p++ != '\\')    
-       {
-       }
-
-       while (1) {
-               gboolean bRet = FALSE;
-               p = wcschr (p, '\\');
-               if (p)
-                       *p = '\0';
-               retval = _wmkdir (dir_utf16);
-               if (retval != 0 && errno != EEXIST) {
-                       g_free (dir_utf16);
-                       return FALSE;
-               }
-               if (!p)
-                       break;
-               *p++ = '\\';
-       }
-       
-       g_free (dir_utf16);
-       return TRUE;
-#else
-       char *p;
-       gchar *dir = g_path_get_dirname (filename);
-       int retval;
-       struct stat sbuf;
-       
-       if (!dir || !dir [0]) {
-               g_free (dir);
-               return FALSE;
-       }
-       
-       if (stat (dir, &sbuf) == 0 && S_ISDIR (sbuf.st_mode)) {
-               g_free (dir);
-               return TRUE;
-       }
-       
-       p = dir;
-       while (*p == '/')
-               p++;
-
-       while (1) {
-               p = strchr (p, '/');
-               if (p)
-                       *p = '\0';
-               retval = mkdir (dir, 0777);
-               if (retval != 0 && errno != EEXIST) {
-                       g_free (dir);
-                       return FALSE;
-               }
-               if (!p)
-                       break;
-               *p++ = '/';
-       }
-       
-       g_free (dir);
-       return TRUE;
-#endif
-}
-
diff --git a/eglib/src/gpattern.c b/eglib/src/gpattern.c
deleted file mode 100644 (file)
index 8486141..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Simple pattern matching
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#ifndef _MSC_VER
-#include <unistd.h>
-#endif
-
-typedef enum {
-       MATCH_LITERAL,
-       MATCH_ANYCHAR,
-       MATCH_ANYTHING,
-       MATCH_ANYTHING_END,
-       MATCH_INVALID = -1
-} MatchType;
-
-typedef struct {
-       MatchType type;
-       gchar *str;
-} PData;
-
-struct _GPatternSpec {
-       GSList *pattern;
-};
-
-static GSList *
-compile_pattern (const gchar *pattern)
-{
-       GSList *list;
-       size_t i, len;
-       PData *data;
-       gchar c;
-       MatchType last = MATCH_INVALID;
-       GString *str;
-       gboolean free_str;
-
-       if (pattern == NULL)
-               return NULL;
-
-       data = NULL;
-       list = NULL;
-       free_str = TRUE;
-       str = g_string_new ("");
-       for (i = 0, len = strlen (pattern); i < len; i++) {
-               c = pattern [i];
-               if (c == '*' || c == '?') {
-                       if (str->len > 0) {
-                               data = g_new0 (PData, 1);
-                               data->type = MATCH_LITERAL;
-                               data->str = g_string_free (str, FALSE);
-                               list = g_slist_append (list, data);
-                               str = g_string_new ("");
-                       }
-
-                       if (last == MATCH_ANYTHING && c == '*')
-                               continue;
-
-                       data = g_new0 (PData, 1);
-                       data->type = (c == '*') ? MATCH_ANYTHING : MATCH_ANYCHAR;
-                       list = g_slist_append (list, data);
-                       last = data->type;
-               } else {
-                       g_string_append_c (str, c);
-                       last = MATCH_LITERAL;
-               }
-       }
-
-       if (last == MATCH_ANYTHING && str->len == 0) {
-               data->type = MATCH_ANYTHING_END;
-               free_str = TRUE;
-       } else if (str->len > 0) {
-               data = g_new0 (PData, 1);
-               data->type = MATCH_LITERAL;
-               data->str = str->str;
-               free_str = FALSE;
-               list = g_slist_append (list, data);
-       }
-       g_string_free (str, free_str);
-       return list;
-}
-
-#ifdef DEBUG_PATTERN
-static void
-print_pattern (gpointer data, gpointer user_data)
-{
-       PData *d = (PData *) data;
-
-       printf ("Type: %s", d->type == MATCH_LITERAL ? "literal" : d->type == MATCH_ANYCHAR ? "any char" : "anything");
-       if (d->type == MATCH_LITERAL)
-               printf (" String: %s", d->str);
-       printf ("\n");
-}
-#endif
-
-GPatternSpec *
-g_pattern_spec_new (const gchar *pattern)
-{
-       GPatternSpec *spec;
-
-       g_return_val_if_fail (pattern != NULL, NULL);
-       spec = g_new0 (GPatternSpec, 1);
-       if (pattern) {
-               spec->pattern = compile_pattern (pattern);
-#ifdef DEBUG_PATTERN
-               g_slist_foreach (spec->pattern, print_pattern, NULL);
-               printf ("\n");
-#endif
-       }
-       return spec;
-}
-
-static void
-free_pdata (gpointer data, gpointer user_data)
-{
-       PData *d = (PData *) data;
-
-       if (d->str)
-               g_free (d->str);
-       g_free (d);
-}
-
-void
-g_pattern_spec_free (GPatternSpec *pspec)
-{
-       if (pspec) {
-               g_slist_foreach (pspec->pattern, free_pdata, NULL);
-               g_slist_free (pspec->pattern);
-               pspec->pattern = NULL;
-       }
-       g_free (pspec);
-}
-
-static gboolean
-match_string (GSList *list, const gchar *str, size_t idx, size_t max)
-{
-       size_t len;
-
-       while (list && idx < max) {
-               PData *data = (PData *) list->data;
-
-               if (data->type == MATCH_ANYTHING_END)
-                       return TRUE;
-
-               if (data->type == MATCH_LITERAL) {
-                       len = strlen (data->str);
-                       if (strncmp (&str [idx], data->str, len) != 0)
-                               return FALSE;
-                       idx += len;
-                       list = list->next;
-                       if (list) {
-                               /* 
-                                * When recursing, we need this to avoid returning FALSE
-                                * because 'list' will not be NULL
-                                */
-                               data = (PData *) list->data;
-                               if (data->type == MATCH_ANYTHING_END)
-                                       return TRUE;
-                       }
-               } else if (data->type == MATCH_ANYCHAR) {
-                       idx++;
-                       list = list->next;
-               } else if (data->type == MATCH_ANYTHING) {
-                       while (idx < max) {
-                               if (match_string (list->next, str, idx++, max))
-                                       return TRUE;
-                       }
-                       return FALSE;
-               } else {
-                       g_assert_not_reached ();
-               }
-       }
-
-       return (list == NULL && idx >= max);
-}
-gboolean
-g_pattern_match_string (GPatternSpec *pspec, const gchar *string)
-{
-       g_return_val_if_fail (pspec != NULL, FALSE);
-       g_return_val_if_fail (string != NULL, FALSE);
-
-       if (pspec->pattern == NULL)
-               return FALSE;
-       return match_string (pspec->pattern, string, 0, strlen (string));
-}
-
-
diff --git a/eglib/src/gptrarray.c b/eglib/src/gptrarray.c
deleted file mode 100644 (file)
index d3e5407..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Pointer Array
- *
- * Author:
- *   Aaron Bockover (abockover@novell.com)
- *   Gonzalo Paniagua Javier (gonzalo@novell.com)
- *   Jeffrey Stedfast (fejj@novell.com)
- *
- * (C) 2006,2011 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <stdlib.h>
-#include <glib.h>
-
-typedef struct _GPtrArrayPriv {
-       gpointer *pdata;
-       guint len;
-       guint size;
-} GPtrArrayPriv;
-
-static void 
-g_ptr_array_grow(GPtrArrayPriv *array, guint length)
-{
-       guint new_length = array->len + length;
-
-       g_return_if_fail(array != NULL);
-
-       if(new_length <= array->size) {
-               return;
-       }
-
-       array->size = 1;
-
-       while(array->size < new_length) {
-               array->size <<= 1;
-       }
-
-       array->size = MAX(array->size, 16);
-       array->pdata = g_realloc(array->pdata, array->size * sizeof(gpointer));
-}
-
-GPtrArray *
-g_ptr_array_new(void)
-{
-       return g_ptr_array_sized_new(0);
-}
-
-GPtrArray *
-g_ptr_array_sized_new(guint reserved_size)
-{
-       GPtrArrayPriv *array = g_new0(GPtrArrayPriv, 1);
-
-       array->pdata = NULL;
-       array->len = 0;
-       array->size = 0;
-
-       if(reserved_size > 0) {
-               g_ptr_array_grow(array, reserved_size);
-       }
-
-       return (GPtrArray *)array;
-}
-
-gpointer *
-g_ptr_array_free(GPtrArray *array, gboolean free_seg)
-{
-       gpointer *data = NULL;
-       
-       g_return_val_if_fail(array != NULL, NULL);
-
-       if(free_seg) {
-               g_free(array->pdata);
-       } else {
-               data = array->pdata;
-       }
-
-       g_free(array);
-       
-       return data;
-}
-
-void
-g_ptr_array_set_size(GPtrArray *array, gint length)
-{
-       g_return_if_fail(array != NULL);
-
-       if((size_t)length > array->len) {
-               g_ptr_array_grow((GPtrArrayPriv *)array, length);
-               memset(array->pdata + array->len, 0, (length - array->len) 
-                       * sizeof(gpointer));
-       }
-
-       array->len = length;
-}
-
-void
-g_ptr_array_add(GPtrArray *array, gpointer data)
-{
-       g_return_if_fail(array != NULL);
-       g_ptr_array_grow((GPtrArrayPriv *)array, 1);
-       array->pdata[array->len++] = data;
-}
-
-gpointer
-g_ptr_array_remove_index(GPtrArray *array, guint index)
-{
-       gpointer removed_node;
-       
-       g_return_val_if_fail(array != NULL, NULL);
-       g_return_val_if_fail(index < array->len, NULL);
-
-       removed_node = array->pdata[index];
-
-       if(index != array->len - 1) {
-               g_memmove(array->pdata + index, array->pdata + index + 1,
-                       (array->len - index - 1) * sizeof(gpointer));
-       }
-       
-       array->len--;
-       array->pdata[array->len] = NULL;
-
-       return removed_node;
-}
-
-gpointer
-g_ptr_array_remove_index_fast(GPtrArray *array, guint index)
-{
-       gpointer removed_node;
-
-       g_return_val_if_fail(array != NULL, NULL);
-       g_return_val_if_fail(index < array->len, NULL);
-
-       removed_node = array->pdata[index];
-
-       if(index != array->len - 1) {
-               g_memmove(array->pdata + index, array->pdata + array->len - 1,
-                       sizeof(gpointer));
-       }
-
-       array->len--;
-       array->pdata[array->len] = NULL;
-
-       return removed_node;
-}
-
-gboolean
-g_ptr_array_remove(GPtrArray *array, gpointer data)
-{
-       guint i;
-
-       g_return_val_if_fail(array != NULL, FALSE);
-
-       for(i = 0; i < array->len; i++) {
-               if(array->pdata[i] == data) {
-                       g_ptr_array_remove_index(array, i);
-                       return TRUE;
-               }
-       }
-
-       return FALSE;
-}
-
-gboolean
-g_ptr_array_remove_fast(GPtrArray *array, gpointer data)
-{
-       guint i;
-
-       g_return_val_if_fail(array != NULL, FALSE);
-
-       for(i = 0; i < array->len; i++) {
-               if(array->pdata[i] == data) {
-                       array->len--;
-                       if (array->len > 0)
-                               array->pdata [i] = array->pdata [array->len];
-                       else
-                               array->pdata [i] = NULL;
-                       return TRUE;
-               }
-       }
-
-       return FALSE;
-}
-
-void 
-g_ptr_array_foreach(GPtrArray *array, GFunc func, gpointer user_data)
-{
-       guint i;
-
-       for(i = 0; i < array->len; i++) {
-               func(g_ptr_array_index(array, i), user_data);
-       }
-}
-
-void
-g_ptr_array_sort(GPtrArray *array, GCompareFunc compare)
-{
-       g_return_if_fail(array != NULL);
-       qsort(array->pdata, array->len, sizeof(gpointer), compare);
-}
-
-void
-g_ptr_array_sort_with_data (GPtrArray *array, GCompareDataFunc compare, gpointer user_data)
-{
-       g_return_if_fail (array != NULL);
-       
-       g_qsort_with_data (array->pdata, array->len, sizeof (gpointer), compare, user_data);
-}
-
diff --git a/eglib/src/gqsort.c b/eglib/src/gqsort.c
deleted file mode 100644 (file)
index 59bd453..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * QuickSort
- *
- * Author: Jeffrey Stedfast <fejj@novell.com>
- *
- * (C) 2011 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <stdlib.h>
-#include <glib.h>
-
-/* Any segment <= this threshold will be sorted using insertion
- * sort. OpenBSD seems to use a value of 7 so we'll go with that for
- * now... */
-#define MAX_THRESHOLD 7
-
-#define STACK_SIZE (8 * sizeof (size_t))
-
-typedef struct _QSortStack {
-       char *array;
-       size_t count;
-} QSortStack;
-
-#define QSORT_PUSH(sp, a, c) (sp->array = a, sp->count = c, sp++)
-#define QSORT_POP(sp, a, c) (sp--, a = sp->array, c = sp->count)
-
-#define SWAPTYPE(TYPE, a, b) {              \
-       long __n = size / sizeof (TYPE);    \
-       register TYPE *__a = (TYPE *) (a);  \
-       register TYPE *__b = (TYPE *) (b);  \
-       register TYPE t;                    \
-                                           \
-       do {                                \
-               t = *__a;                   \
-               *__a++ = *__b;              \
-               *__b++ = t;                 \
-       } while (--__n > 0);                \
-}
-
-#define SWAPBYTE(a, b) SWAPTYPE(char, (a), (b))
-#define SWAPLONG(a, b) SWAPTYPE(long, (a), (b))
-#define SWAP(a, b) if (swaplong) SWAPLONG((a), (b)) else SWAPBYTE((a), (b))
-
-/* check if we can swap by longs rather than bytes by making sure that
- * memory is properly aligned and that the element size is a multiple
- * of sizeof (long) */
-#define SWAP_INIT() swaplong = (((char *) base) - ((char *) 0)) % sizeof (long) == 0 && (size % sizeof (long)) == 0
-
-void
-g_qsort_with_data (gpointer base, size_t nmemb, size_t size, GCompareDataFunc compare, gpointer user_data)
-{
-       QSortStack stack[STACK_SIZE], *sp;
-       register char *i, *k, *mid;
-       size_t n, n1, n2;
-       char *lo, *hi;
-       int swaplong;
-       
-       if (nmemb <= 1)
-               return;
-       
-       SWAP_INIT ();
-       
-       /* initialize our stack */
-       sp = stack;
-       QSORT_PUSH (sp, base, nmemb);
-       
-       do {
-               QSORT_POP (sp, lo, n);
-               
-               hi = lo + (n - 1) * size;
-               
-               if (n < MAX_THRESHOLD) {
-                       /* switch to insertion sort */
-                       for (i = lo + size; i <= hi; i += size)
-                               for (k = i; k > lo && compare (k - size, k, user_data) > 0; k -= size)
-                                       SWAP (k - size, k);
-                       
-                       continue;
-               }
-               
-               /* calculate the middle element */
-               mid = lo + (n / 2) * size;
-               
-               /* once we re-order the lo, mid, and hi elements to be in
-                * ascending order, we'll use mid as our pivot. */
-               if (compare (mid, lo, user_data) < 0) {
-                       SWAP (mid, lo);
-               }
-               
-               if (compare (hi, mid, user_data) < 0) {
-                       SWAP (mid, hi);
-                       if (compare (mid, lo, user_data) < 0) {
-                               SWAP (mid, lo);
-                       }
-               }
-               
-               /* since we've already guaranteed that lo <= mid and mid <= hi,
-                * we can skip comparing them again */
-               i = lo + size;
-               k = hi - size;
-               
-               do {
-                       /* find the first element with a value > pivot value */
-                       while (i < k && compare (i, mid, user_data) <= 0)
-                               i += size;
-                       
-                       /* find the last element with a value <= pivot value */
-                       while (k >= i && compare (mid, k, user_data) < 0)
-                               k -= size;
-                       
-                       if (k <= i)
-                               break;
-                       
-                       SWAP (i, k);
-                       
-                       /* make sure we keep track of our pivot element */
-                       if (mid == i) {
-                               mid = k;
-                       } else if (mid == k) {
-                               mid = i;
-                       }
-                       
-                       i += size;
-                       k -= size;
-               } while (1);
-               
-               if (k != mid) {
-                       /* swap the pivot with the last element in the first partition */
-                       SWAP (mid, k);
-               }
-               
-               /* calculate segment sizes */
-               n2 = (hi - k) / size;
-               n1 = (k - lo) / size;
-               
-               /* push our partitions onto the stack, largest first
-                * (to make sure we don't run out of stack space) */
-               if (n2 > n1) {
-                       if (n2 > 1) QSORT_PUSH (sp, k + size, n2);
-                       if (n1 > 1) QSORT_PUSH (sp, lo, n1);
-               } else {
-                       if (n1 > 1) QSORT_PUSH (sp, lo, n1);
-                       if (n2 > 1) QSORT_PUSH (sp, k + size, n2);
-               }
-       } while (sp > stack);
-}
diff --git a/eglib/src/gqueue.c b/eglib/src/gqueue.c
deleted file mode 100644 (file)
index cd94e1f..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * gqueue.c: Queue
- *
- * Author:
- *   Duncan Mak (duncan@novell.com)
- *   Gonzalo Paniagua Javier (gonzalo@novell.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Copyright (c) 2006-2009 Novell, Inc.
- *
- */
-
-#include <stdio.h>
-#include <glib.h>
-
-gpointer
-g_queue_pop_head (GQueue *queue)
-{
-       gpointer result;
-       GList *old_head;
-
-       if (!queue || queue->length == 0)
-               return NULL;
-
-       result = queue->head->data;
-       old_head = queue->head;
-       queue->head = old_head->next;
-       g_list_free_1 (old_head);
-
-       if (--queue->length)
-               queue->head->prev = NULL;
-       else
-               queue->tail = NULL;
-
-       return result;
-}
-
-gboolean
-g_queue_is_empty (GQueue *queue)
-{
-       if (!queue)
-               return TRUE;
-       
-       return queue->length == 0;
-}
-
-void
-g_queue_push_head (GQueue *queue, gpointer head)
-{
-       if (!queue)
-               return;
-       
-       queue->head = g_list_prepend (queue->head, head);
-       
-       if (!queue->tail)
-               queue->tail = queue->head;
-
-       queue->length ++;
-}
-
-void
-g_queue_push_tail (GQueue *queue, gpointer data)
-{
-       if (!queue)
-               return;
-
-       queue->tail = g_list_append (queue->tail, data);
-       if (queue->head == NULL)
-               queue->head = queue->tail;
-       else
-               queue->tail = queue->tail->next;
-       queue->length++;
-}
-
-GQueue *
-g_queue_new (void)
-{
-       return g_new0 (GQueue, 1);
-}
-
-void
-g_queue_free (GQueue *queue)
-{
-       if (!queue)
-               return;
-       
-       g_list_free (queue->head);
-       g_free (queue);
-}
-
-void 
-g_queue_foreach (GQueue *queue, GFunc func, gpointer user_data)
-{
-       g_list_foreach (queue->head, func, user_data);
-}
diff --git a/eglib/src/gshell.c b/eglib/src/gshell.c
deleted file mode 100644 (file)
index 43b4c17..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Shell utility functions.
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <glib.h>
-
-static int
-split_cmdline (const gchar *cmdline, GPtrArray *array, GError **error)
-{
-       gchar *ptr;
-       gchar c;
-       gboolean escaped = FALSE, fresh = TRUE;
-       gchar quote_char = '\0';
-       GString *str;
-
-       str = g_string_new ("");
-       ptr = (gchar *) cmdline;
-       while ((c = *ptr++) != '\0') {
-               if (escaped) {
-                       /*
-                        * \CHAR is only special inside a double quote if CHAR is
-                        * one of: $`"\ and newline
-                        */
-                       if (quote_char == '\"'){
-                               if (!(c == '$' || c == '`' || c == '"' || c == '\\'))
-                                       g_string_append_c (str, '\\');
-                               g_string_append_c (str, c);
-                       } else {
-                               if (!g_ascii_isspace (c))
-                                       g_string_append_c (str, c);
-                       }
-                       escaped = FALSE;
-               } else if (quote_char) {
-                       if (c == quote_char) {
-                               quote_char = '\0';
-                               if (fresh && (g_ascii_isspace (*ptr) || *ptr == '\0')){
-                                       g_ptr_array_add (array, g_string_free (str, FALSE));
-                                       str = g_string_new ("");
-                               }
-                       } else if (c == '\\'){
-                               escaped = TRUE;
-                       } else 
-                               g_string_append_c (str, c);
-               } else if (g_ascii_isspace (c)) {
-                       if (str->len > 0) {
-                               g_ptr_array_add (array, g_string_free (str, FALSE));
-                               str = g_string_new ("");
-                       }
-               } else if (c == '\\') {
-                       escaped = TRUE;
-               } else if (c == '\'' || c == '"') {
-                       fresh = str->len == 0;
-                       quote_char = c;
-               } else {
-                       g_string_append_c (str, c);
-               }
-       }
-
-       if (escaped) {
-               if (error)
-                       *error = g_error_new (G_LOG_DOMAIN, 0, "Unfinished escape.");
-               g_string_free (str, TRUE);
-               return -1;
-       }
-
-       if (quote_char) {
-               if (error)
-                       *error = g_error_new (G_LOG_DOMAIN, 0, "Unfinished quote.");
-               g_string_free (str, TRUE);
-               return -1;
-       }
-
-       if (str->len > 0) {
-               g_ptr_array_add (array, g_string_free (str, FALSE));
-       } else {
-               g_string_free (str, TRUE);
-       }
-       g_ptr_array_add (array, NULL);
-       return 0;
-}
-
-gboolean
-g_shell_parse_argv (const gchar *command_line, gint *argcp, gchar ***argvp, GError **error)
-{
-       GPtrArray *array;
-       gint argc;
-       gchar **argv;
-
-       g_return_val_if_fail (command_line, FALSE);
-       g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
-       array = g_ptr_array_new();
-       if (split_cmdline (command_line, array, error)) {
-               g_ptr_array_add (array, NULL);
-               g_strfreev ((gchar **) array->pdata);
-               g_ptr_array_free (array, FALSE);
-               return FALSE;
-       }
-
-       argc = array->len;
-       argv = (gchar **) array->pdata;
-
-       if (argc == 1) {
-               g_strfreev (argv);
-               g_ptr_array_free (array, FALSE);
-               return FALSE;
-       }
-
-       if (argcp) {
-               *argcp = array->len - 1;
-       }
-
-       if (argvp) {
-               *argvp = argv;
-       } else {
-               g_strfreev (argv);
-       }
-
-       g_ptr_array_free (array, FALSE);
-       return TRUE;
-}
-
-gchar *
-g_shell_quote (const gchar *unquoted_string)
-{
-       GString *result = g_string_new ("'");
-       const gchar *p;
-       
-       for (p = unquoted_string; *p; p++){
-               if (*p == '\'')
-                       g_string_append (result, "'\\'");
-               g_string_append_c (result, *p);
-       }
-       g_string_append_c (result, '\'');
-       return g_string_free (result, FALSE);
-}
-
-gchar *
-g_shell_unquote (const gchar *quoted_string, GError **error)
-{
-       GString *result;
-       const char *p;
-       int do_unquote = 0;
-
-       if (quoted_string == NULL)
-               return NULL;
-       
-       /* Quickly try to determine if we need to unquote or not */
-       for (p = quoted_string; *p; p++){
-               if (*p == '\'' || *p == '"' || *p == '\\'){
-                       do_unquote = 1;
-                       break;
-               }
-       }
-       
-       if (!do_unquote)
-               return g_strdup (quoted_string);
-
-       /* We do need to unquote */
-       result = g_string_new ("");
-       for (p = quoted_string; *p; p++){
-
-               if (*p == '\''){
-                       /* Process single quote, not even \ is processed by glib's version */
-                       for (p++; *p; p++){
-                               if (*p == '\'')
-                                       break;
-                               g_string_append_c (result, *p);
-                       }
-                       if (!*p){
-                               g_set_error (error, 0, 0, "Open quote");
-                               return NULL;
-                       }
-               } else if (*p == '"'){
-                       /* Process double quote, allows some escaping */
-                       for (p++; *p; p++){
-                               if (*p == '"')
-                                       break;
-                               if (*p == '\\'){
-                                       p++;
-                                       if (*p == 0){
-                                               g_set_error (error, 0, 0, "Open quote");
-                                               return NULL;
-                                       }
-                                       switch (*p){
-                                       case '$':
-                                       case '"':
-                                       case '\\':
-                                       case '`':
-                                               break;
-                                       default:
-                                               g_string_append_c (result, '\\');
-                                               break;
-                                       }
-                               } 
-                               g_string_append_c (result, *p);
-                       }
-                       if (!*p){
-                               g_set_error (error, 0, 0, "Open quote");
-                               return NULL;
-                       }
-               } else if (*p == '\\'){
-                       char c = *(++p);
-                       if (!(c == '$' || c == '"' || c == '\\' || c == '`' || c == '\'' || c == 0 ))
-                               g_string_append_c (result, '\\');
-                       if (c == 0)
-                               break;
-                       else
-                               g_string_append_c (result, c);
-               } else
-                       g_string_append_c (result, *p);
-       }
-       return g_string_free (result, FALSE);
-}
-
-#if JOINT_TEST
-/*
- * This test is designed to be built with the 2 glib/eglib to compare
- */
-
-char *args [] = {
-       "\\",
-       "\"Foo'bar\"",
-       "'foo'",
-       "'fo\'b'",
-       "'foo\"bar'",
-       "'foo' dingus bar",
-       "'foo' 'bar' 'baz'",
-       "\"foo\" 'bar' \"baz\"",
-       "\"f\\$\\\'",
-       "\"\\",
-       "\\\\",
-       "'\\\\'",
-       "\"f\\$\"\\\"\\\\", //  /\\\"\\\\"
-       "'f\\$'\\\"\\\\", 
-       "'f\\$\\\\'", 
-       NULL
-};
-
-
-int
-main ()
-{
-       char **s = args;
-       int i;
-       
-       while (*s){
-               char *r1 = g_shell_unquote (*s, NULL);
-               char *r2 = g2_shell_unquote (*s, NULL);
-               char *ok = r1 == r2 ? "ok" : (r1 != NULL && r2 != NULL && strcmp (r1, r2) == 0) ? "ok" : "fail";
-               
-               printf ("%s [%s] -> [%s] - [%s]\n", ok, *s, r1, r2);
-               s++;
-       }
-       return;
-       char buffer [10];
-       buffer [0] = '\"';
-       buffer [1] = '\\';
-       buffer [3] = '\"';
-       buffer [4] = 0;
-       
-       for (i = 32; i < 255; i++){
-               buffer [2] = i;
-               printf ("%d [%s] -> [%s]\n", i, buffer, g_shell_unquote (buffer, NULL));
-       }
-}
-#endif
diff --git a/eglib/src/gslist.c b/eglib/src/gslist.c
deleted file mode 100644 (file)
index 5baa297..0000000
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * gslist.c: Singly-linked list implementation
- *
- * Authors:
- *   Duncan Mak (duncan@novell.com)
- *   Raja R Harinath (rharinath@novell.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * (C) 2006 Novell, Inc.
- */
-
-#include <stdio.h>
-#include <glib.h>
-
-GSList*
-g_slist_alloc (void)
-{
-       return g_new0 (GSList, 1);
-}
-
-void
-g_slist_free_1 (GSList *list)
-{
-       g_free (list);
-}
-
-GSList*
-g_slist_append (GSList *list, gpointer data)
-{
-       return g_slist_concat (list, g_slist_prepend (NULL, data));
-}
-
-/* This is also a list node constructor. */
-GSList*
-g_slist_prepend (GSList *list, gpointer data)
-{
-       GSList *head = g_slist_alloc ();
-       head->data = data;
-       head->next = list;
-
-       return head;
-}
-
-/*
- * Insert the given data in a new node after the current node. 
- * Return new node.
- */
-static inline GSList *
-insert_after (GSList *list, gpointer data)
-{
-       list->next = g_slist_prepend (list->next, data);
-       return list->next;
-}
-
-/*
- * Return the node prior to the node containing 'data'.
- * If the list is empty, or the first node contains 'data', return NULL.
- * If no node contains 'data', return the last node.
- */
-static inline GSList*
-find_prev (GSList *list, gconstpointer data)
-{
-       GSList *prev = NULL;
-       while (list) {
-               if (list->data == data)
-                       break;
-               prev = list;
-               list = list->next;
-       }
-       return prev;
-}
-
-/* like 'find_prev', but searches for node 'link' */
-static inline GSList*
-find_prev_link (GSList *list, GSList *link)
-{
-       GSList *prev = NULL;
-       while (list) {
-               if (list == link)
-                       break;
-               prev = list;
-               list = list->next;
-       }
-       return prev;
-}
-
-GSList*
-g_slist_insert_before (GSList *list, GSList *sibling, gpointer data)
-{
-       GSList *prev = find_prev_link (list, sibling);
-
-       if (!prev)
-               return g_slist_prepend (list, data);
-
-       insert_after (prev, data);
-       return list;
-}
-
-void
-g_slist_free (GSList *list)
-{
-       while (list) {
-               GSList *next = list->next;
-               g_slist_free_1 (list);
-               list = next;
-       }
-}
-
-GSList*
-g_slist_copy (GSList *list)
-{
-       GSList *copy, *tmp;
-
-       if (!list)
-               return NULL;
-
-       copy = g_slist_prepend (NULL, list->data);
-       tmp = copy;
-
-       for (list = list->next; list; list = list->next)
-               tmp = insert_after (tmp, list->data);
-
-       return copy;
-}
-
-GSList*
-g_slist_concat (GSList *list1, GSList *list2)
-{
-       if (!list1)
-               return list2;
-
-       g_slist_last (list1)->next = list2;
-       return list1;
-}
-
-void
-g_slist_foreach (GSList *list, GFunc func, gpointer user_data)
-{
-       while (list) {
-               (*func) (list->data, user_data);
-               list = list->next;
-       }
-}
-
-GSList*
-g_slist_last (GSList *list)
-{
-       if (!list)
-               return NULL;
-
-       while (list->next)
-               list = list->next;
-
-       return list;
-}
-
-GSList*
-g_slist_find (GSList *list, gconstpointer data)
-{
-       for (; list; list = list->next)
-               if (list->data == data)
-                       break;
-       return list;
-}
-
-GSList *
-g_slist_find_custom (GSList *list, gconstpointer data, GCompareFunc func)
-{
-       if (!func)
-               return NULL;
-       
-       while (list) {
-               if (func (list->data, data) == 0)
-                       return list;
-               
-               list = list->next;
-       }
-       
-       return NULL;
-}
-
-guint
-g_slist_length (GSList *list)
-{
-       guint length = 0;
-
-       while (list) {
-               length ++;
-               list = list->next;
-       }
-
-       return length;
-}
-
-GSList*
-g_slist_remove (GSList *list, gconstpointer data)
-{
-       GSList *prev = find_prev (list, data);
-       GSList *current = prev ? prev->next : list;
-
-       if (current) {
-               if (prev)
-                       prev->next = current->next;
-               else
-                       list = current->next;
-               g_slist_free_1 (current);
-       }
-
-       return list;
-}
-
-GSList*
-g_slist_remove_all (GSList *list, gconstpointer data)
-{
-       GSList *next = list;
-       GSList *prev = NULL;
-       GSList *current;
-
-       while (next) {
-               GSList *tmp_prev = find_prev (next, data);
-               if (tmp_prev)
-                       prev = tmp_prev;
-               current = prev ? prev->next : list;
-
-               if (!current)
-                       break;
-
-               next = current->next;
-
-               if (prev)
-                       prev->next = next;
-               else
-                       list = next;
-               g_slist_free_1 (current);
-       }
-
-       return list;
-}
-
-GSList*
-g_slist_remove_link (GSList *list, GSList *link)
-{
-       GSList *prev = find_prev_link (list, link);
-       GSList *current = prev ? prev->next : list;
-
-       if (current) {
-               if (prev)
-                       prev->next = current->next;
-               else
-                       list = current->next;
-               current->next = NULL;
-       }
-
-       return list;
-}
-
-GSList*
-g_slist_delete_link (GSList *list, GSList *link)
-{
-       list = g_slist_remove_link (list, link);
-       g_slist_free_1 (link);
-
-       return list;
-}
-
-GSList*
-g_slist_reverse (GSList *list)
-{
-       GSList *prev = NULL;
-       while (list){
-               GSList *next = list->next;
-               list->next = prev;
-               prev = list;
-               list = next;
-       }
-
-       return prev;
-}
-
-GSList*
-g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func)
-{
-       GSList *prev = NULL;
-       
-       if (!func)
-               return list;
-
-       if (!list || func (list->data, data) > 0)
-               return g_slist_prepend (list, data);
-
-       /* Invariant: func (prev->data, data) <= 0) */
-       for (prev = list; prev->next; prev = prev->next)
-               if (func (prev->next->data, data) > 0)
-                       break;
-
-       /* ... && (prev->next == 0 || func (prev->next->data, data) > 0)) */
-       insert_after (prev, data);
-       return list;
-}
-
-gint
-g_slist_index (GSList *list, gconstpointer data)
-{
-       gint index = 0;
-       
-       while (list) {
-               if (list->data == data)
-                       return index;
-               
-               index++;
-               list = list->next;
-       }
-       
-       return -1;
-}
-
-GSList*
-g_slist_nth (GSList *list, guint n)
-{
-       for (; list; list = list->next) {
-               if (n == 0)
-                       break;
-               n--;
-       }
-       return list;
-}
-
-gpointer
-g_slist_nth_data (GSList *list, guint n)
-{
-       GSList *node = g_slist_nth (list, n);
-       return node ? node->data : NULL;
-}
-
-typedef GSList list_node;
-#include "sort.frag.h"
-
-GSList*
-g_slist_sort (GSList *list, GCompareFunc func)
-{
-       if (!list || !list->next)
-               return list;
-       return do_sort (list, func);
-}
diff --git a/eglib/src/gspawn.c b/eglib/src/gspawn.c
deleted file mode 100644 (file)
index 01639be..0000000
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * Spawning processes.
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-
-#include <glib.h>
-
-#ifdef HAVE_UNISTD_H
-#ifndef __USE_GNU
-#define __USE_GNU
-#endif
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-
-#ifdef HAVE_SYS_RESOURCE_H
-#  include <sys/resource.h>
-#endif
-
-#ifdef G_OS_WIN32
-#include <io.h>
-#include <winsock2.h>
-#define open _open
-#define close _close
-#define read _read
-#define write _write
-/* windows pipe api details: http://msdn2.microsoft.com/en-us/library/edze9h7e(VS.80).aspx */
-#define pipe(x) _pipe(x, 256, 0)
-#endif
-
-#define set_error(msg, ...) do { if (error != NULL) *error = g_error_new (G_LOG_DOMAIN, 1, msg, __VA_ARGS__); } while (0)
-#define set_error_cond(cond,msg, ...) do { if ((cond) && error != NULL) *error = g_error_new (G_LOG_DOMAIN, 1, msg, __VA_ARGS__); } while (0)
-#define set_error_status(status,msg, ...) do { if (error != NULL) *error = g_error_new (G_LOG_DOMAIN, status, msg, __VA_ARGS__); } while (0)
-#define NO_INTR(var,cmd) do { (var) = (cmd); } while ((var) == -1 && errno == EINTR)
-#define CLOSE_PIPE(p) do { close (p [0]); close (p [1]); } while (0)
-
-#if defined(__APPLE__)
-#if defined (TARGET_OSX)
-/* Apple defines this in crt_externs.h but doesn't provide that header for 
- * arm-apple-darwin9.  We'll manually define the symbol on Apple as it does
- * in fact exist on all implementations (so far) 
- */
-gchar ***_NSGetEnviron(void);
-#define environ (*_NSGetEnviron())
-#else
-static char *mono_environ[1] = { NULL };
-#define environ mono_environ
-#endif /* defined (TARGET_OSX) */
-#elif defined(_MSC_VER)
-/* MS defines this in stdlib.h */
-#else
-extern char **environ;
-#endif
-
-#ifndef G_OS_WIN32
-static int
-safe_read (int fd, gchar *buffer, gint count, GError **error)
-{
-       int res;
-
-       NO_INTR (res, read (fd, buffer, count));
-       set_error_cond (res == -1, "%s", "Error reading from pipe.");
-       return res;
-}
-
-static int
-read_pipes (int outfd, gchar **out_str, int errfd, gchar **err_str, GError **error)
-{
-       fd_set rfds;
-       int res;
-       gboolean out_closed;
-       gboolean err_closed;
-       GString *out = NULL;
-       GString *err = NULL;
-       gchar *buffer = NULL;
-       gint nread;
-
-       out_closed = (outfd < 0);
-       err_closed = (errfd < 0);
-       if (out_str) {
-               *out_str = NULL;
-               out = g_string_new ("");
-       }       
-
-       if (err_str) {
-               *err_str = NULL;
-               err = g_string_new ("");
-       }       
-
-       do {
-               if (out_closed && err_closed)
-                       break;
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4389)
-#endif
-
-               FD_ZERO (&rfds);
-               if (!out_closed && outfd >= 0)
-                       FD_SET (outfd, &rfds);
-               if (!err_closed && errfd >= 0)
-                       FD_SET (errfd, &rfds);
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-               res = select (MAX (outfd, errfd) + 1, &rfds, NULL, NULL, NULL);
-               if (res > 0) {
-                       if (buffer == NULL)
-                               buffer = g_malloc (1024);
-                       if (!out_closed && FD_ISSET (outfd, &rfds)) {
-                               nread = safe_read (outfd, buffer, 1024, error);
-                               if (nread < 0) {
-                                       close (errfd);
-                                       close (outfd);
-                                       return -1;
-                               }
-                               g_string_append_len (out, buffer, nread);
-                               if (nread <= 0) {
-                                       out_closed = TRUE;
-                                       close (outfd);
-                               }
-                       }
-
-                       if (!err_closed && FD_ISSET (errfd, &rfds)) {
-                               nread = safe_read (errfd, buffer, 1024, error);
-                               if (nread < 0) {
-                                       close (errfd);
-                                       close (outfd);
-                                       return -1;
-                               }
-                               g_string_append_len (err, buffer, nread);
-                               if (nread <= 0) {
-                                       err_closed = TRUE;
-                                       close (errfd);
-                               }
-                       }
-               }
-       } while (res > 0 || (res == -1 && errno == EINTR));
-
-       g_free (buffer);
-       if (out_str)
-               *out_str = g_string_free (out, FALSE);
-
-       if (err_str)
-               *err_str = g_string_free (err, FALSE);
-
-       return 0;
-}
-
-static gboolean
-create_pipe (int *fds, GError **error)
-{
-       if (pipe (fds) == -1) {
-               set_error ("%s", "Error creating pipe.");
-               return FALSE;
-       }
-       return TRUE;
-}
-#endif /* G_OS_WIN32 */
-
-static int
-write_all (int fd, const void *vbuf, size_t n)
-{
-       const char *buf = (const char *) vbuf;
-       size_t nwritten = 0;
-       int w;
-       
-       do {
-               do {
-                       w = write (fd, buf + nwritten, n - nwritten);
-               } while (w == -1 && errno == EINTR);
-               
-               if (w == -1)
-                       return -1;
-               
-               nwritten += w;
-       } while (nwritten < n);
-       
-       return nwritten;
-}
-
-#ifndef G_OS_WIN32
-int
-eg_getdtablesize (void)
-{
-#ifdef HAVE_GETRLIMIT
-       struct rlimit limit;
-       int res;
-
-       res = getrlimit (RLIMIT_NOFILE, &limit);
-       g_assert (res == 0);
-       return limit.rlim_cur;
-#else
-       return getdtablesize ();
-#endif
-}
-#else
-int
-eg_getdtablesize (void)
-{
-       g_error ("Should not be called");
-}
-#endif
-
-gboolean
-g_spawn_command_line_sync (const gchar *command_line,
-                               gchar **standard_output,
-                               gchar **standard_error,
-                               gint *exit_status,
-                               GError **error)
-{
-#ifdef G_OS_WIN32
-#elif !defined (HAVE_FORK) || !defined (HAVE_EXECV)
-       fprintf (stderr, "g_spawn_command_line_sync not supported on this platform\n");
-       return FALSE;
-#else
-       pid_t pid;
-       gchar **argv;
-       gint argc;
-       int stdout_pipe [2] = { -1, -1 };
-       int stderr_pipe [2] = { -1, -1 };
-       int status;
-       int res;
-       
-       if (!g_shell_parse_argv (command_line, &argc, &argv, error))
-               return FALSE;
-
-       if (standard_output && !create_pipe (stdout_pipe, error))
-               return FALSE;
-
-       if (standard_error && !create_pipe (stderr_pipe, error)) {
-               if (standard_output) {
-                       CLOSE_PIPE (stdout_pipe);
-               }
-               return FALSE;
-       }
-
-       pid = fork ();
-       if (pid == 0) {
-               gint i;
-
-               if (standard_output) {
-                       close (stdout_pipe [0]);
-                       dup2 (stdout_pipe [1], STDOUT_FILENO);
-               }
-
-               if (standard_error) {
-                       close (stderr_pipe [0]);
-                       dup2 (stderr_pipe [1], STDERR_FILENO);
-               }
-               for (i = eg_getdtablesize () - 1; i >= 3; i--)
-                       close (i);
-
-               /* G_SPAWN_SEARCH_PATH is always enabled for g_spawn_command_line_sync */
-               if (!g_path_is_absolute (argv [0])) {
-                       gchar *arg0;
-
-                       arg0 = g_find_program_in_path (argv [0]);
-                       if (arg0 == NULL) {
-                               exit (1);
-                       }
-                       //g_free (argv [0]);
-                       argv [0] = arg0;
-               }
-               execv (argv [0], argv);
-               exit (1); /* TODO: What now? */
-       }
-
-       g_strfreev (argv);
-       if (standard_output)
-               close (stdout_pipe [1]);
-
-       if (standard_error)
-               close (stderr_pipe [1]);
-
-       if (standard_output || standard_error) {
-               res = read_pipes (stdout_pipe [0], standard_output, stderr_pipe [0], standard_error, error);
-               if (res) {
-                       waitpid (pid, &status, WNOHANG); /* avoid zombie */
-                       return FALSE;
-               }
-       }
-
-       NO_INTR (res, waitpid (pid, &status, 0));
-
-       /* TODO: What if error? */
-       if (WIFEXITED (status) && exit_status) {
-               *exit_status = WEXITSTATUS (status);
-       }
-#endif
-       return TRUE;
-}
-
-/*
- * This is the only use we have in mono/metadata
-!g_spawn_async_with_pipes (NULL, (char**)addr_argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &child_pid, &ch_in, &ch_out, NULL, NULL)
-*/
-gboolean
-g_spawn_async_with_pipes (const gchar *working_directory,
-                       gchar **argv,
-                       gchar **envp,
-                       GSpawnFlags flags,
-                       GSpawnChildSetupFunc child_setup,
-                       gpointer user_data,
-                       GPid *child_pid,
-                       gint *standard_input,
-                       gint *standard_output,
-                       gint *standard_error,
-                       GError **error)
-{
-#ifdef G_OS_WIN32
-#elif !defined (HAVE_FORK) || !defined (HAVE_EXECVE)
-       fprintf (stderr, "g_spawn_async_with_pipes is not supported on this platform\n");
-       return FALSE;
-#else
-       pid_t pid;
-       int info_pipe [2];
-       int in_pipe [2] = { -1, -1 };
-       int out_pipe [2] = { -1, -1 };
-       int err_pipe [2] = { -1, -1 };
-       int status;
-
-       g_return_val_if_fail (argv != NULL, FALSE); /* Only mandatory arg */
-
-       if (!create_pipe (info_pipe, error))
-               return FALSE;
-
-       if (standard_output && !create_pipe (out_pipe, error)) {
-               CLOSE_PIPE (info_pipe);
-               return FALSE;
-       }
-
-       if (standard_error && !create_pipe (err_pipe, error)) {
-               CLOSE_PIPE (info_pipe);
-               CLOSE_PIPE (out_pipe);
-               return FALSE;
-       }
-
-       if (standard_input && !create_pipe (in_pipe, error)) {
-               CLOSE_PIPE (info_pipe);
-               CLOSE_PIPE (out_pipe);
-               CLOSE_PIPE (err_pipe);
-               return FALSE;
-       }
-
-       pid = fork ();
-       if (pid == -1) {
-               CLOSE_PIPE (info_pipe);
-               CLOSE_PIPE (out_pipe);
-               CLOSE_PIPE (err_pipe);
-               CLOSE_PIPE (in_pipe);
-               set_error ("%s", "Error in fork ()");
-               return FALSE;
-       }
-
-       if (pid == 0) {
-               /* No zombie left behind */
-               if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0) {
-                       pid = fork ();
-               }
-
-               if (pid != 0) {
-                       exit (pid == -1 ? 1 : 0);
-               }  else {
-                       gint i;
-                       int fd;
-                       gchar *arg0;
-                       gchar **actual_args;
-                       gint unused;
-
-                       close (info_pipe [0]);
-                       close (in_pipe [1]);
-                       close (out_pipe [0]);
-                       close (err_pipe [0]);
-
-                       /* when exec* succeeds, we want to close this fd, which will return
-                        * a 0 read on the parent. We're not supposed to keep it open forever.
-                        * If exec fails, we still can write the error to it before closing.
-                        */
-                       fcntl (info_pipe [1], F_SETFD, FD_CLOEXEC);
-
-                       if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0) {
-                               pid = getpid ();
-                               NO_INTR (unused, write_all (info_pipe [1], &pid, sizeof (pid_t)));
-                       }
-
-                       if (working_directory && chdir (working_directory) == -1) {
-                               int err = errno;
-                               NO_INTR (unused, write_all (info_pipe [1], &err, sizeof (int)));
-                               exit (0);
-                       }
-
-                       if (standard_output) {
-                               dup2 (out_pipe [1], STDOUT_FILENO);
-                       } else if ((flags & G_SPAWN_STDOUT_TO_DEV_NULL) != 0) {
-                               fd = open ("/dev/null", O_WRONLY);
-                               dup2 (fd, STDOUT_FILENO);
-                       }
-
-                       if (standard_error) {
-                               dup2 (err_pipe [1], STDERR_FILENO);
-                       } else if ((flags & G_SPAWN_STDERR_TO_DEV_NULL) != 0) {
-                               fd = open ("/dev/null", O_WRONLY);
-                               dup2 (fd, STDERR_FILENO);
-                       }
-
-                       if (standard_input) {
-                               dup2 (in_pipe [0], STDIN_FILENO);
-                       } else if ((flags & G_SPAWN_CHILD_INHERITS_STDIN) == 0) {
-                               fd = open ("/dev/null", O_RDONLY);
-                               dup2 (fd, STDIN_FILENO);
-                       }
-
-                       if ((flags & G_SPAWN_LEAVE_DESCRIPTORS_OPEN) != 0) {
-                               for (i = eg_getdtablesize () - 1; i >= 3; i--)
-                                       close (i);
-                       }
-
-                       actual_args = ((flags & G_SPAWN_FILE_AND_ARGV_ZERO) == 0) ? argv : argv + 1;
-                       if (envp == NULL)
-                               envp = environ;
-
-                       if (child_setup)
-                               child_setup (user_data);
-
-                       arg0 = argv [0];
-                       if (!g_path_is_absolute (arg0) || (flags & G_SPAWN_SEARCH_PATH) != 0) {
-                               arg0 = g_find_program_in_path (argv [0]);
-                               if (arg0 == NULL) {
-                                       int err = ENOENT;
-                                       write_all (info_pipe [1], &err, sizeof (int));
-                                       exit (0);
-                               }
-                       }
-
-                       execve (arg0, actual_args, envp);
-                       write_all (info_pipe [1], &errno, sizeof (int));
-                       exit (0);
-               }
-       } else if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0) {
-               int w;
-               /* Wait for the first child if two are created */
-               NO_INTR (w, waitpid (pid, &status, 0));
-               if (status == 1 || w == -1) {
-                       CLOSE_PIPE (info_pipe);
-                       CLOSE_PIPE (out_pipe);
-                       CLOSE_PIPE (err_pipe);
-                       CLOSE_PIPE (in_pipe);
-                       set_error ("Error in fork (): %d", status);
-                       return FALSE;
-               }
-       }
-       close (info_pipe [1]);
-       close (in_pipe [0]);
-       close (out_pipe [1]);
-       close (err_pipe [1]);
-
-       if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0) {
-               int x;
-               NO_INTR (x, read (info_pipe [0], &pid, sizeof (pid_t))); /* if we read < sizeof (pid_t)... */
-       }
-
-       if (child_pid) {
-               *child_pid = pid;
-       }
-
-       if (read (info_pipe [0], &status, sizeof (int)) != 0) {
-               close (info_pipe [0]);
-               close (in_pipe [0]);
-               close (out_pipe [1]);
-               close (err_pipe [1]);
-               set_error_status (status, "Error in exec (%d -> %s)", status, strerror (status));
-               return FALSE;
-       }
-
-       close (info_pipe [0]);
-       if (standard_input)
-               *standard_input = in_pipe [1];
-       if (standard_output)
-               *standard_output = out_pipe [0];
-       if (standard_error)
-               *standard_error = err_pipe [0];
-#endif
-       return TRUE;
-}
-
-
diff --git a/eglib/src/gstr.c b/eglib/src/gstr.c
deleted file mode 100644 (file)
index 98d8faf..0000000
+++ /dev/null
@@ -1,1028 +0,0 @@
-/*
- * gstr.c: String Utility Functions.
- *
- * Author:
- *   Miguel de Icaza (miguel@novell.com)
- *   Aaron Bockover (abockover@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <config.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <glib.h>
-
-#ifndef G_OS_WIN32
-#include <pthread.h>
-#endif
-
-#include <errno.h>
-
-/* 
- * g_strndup and g_vasprintf need to allocate memory with g_malloc if 
- * ENABLE_OVERRIDABLE_ALLOCATORS is defined so that it can be safely freed with g_free 
- * rather than free.
- */
-
-/* This is not a macro, because I dont want to put _GNU_SOURCE in the glib.h header */
-gchar *
-g_strndup (const gchar *str, gsize n)
-{
-#if defined (HAVE_STRNDUP) && !defined (ENABLE_OVERRIDABLE_ALLOCATORS)
-       return strndup (str, n);
-#else
-       if (str) {
-               char *retval = g_malloc(n+1);
-               if (retval) {
-                       strncpy(retval, str, n)[n] = 0;
-               }
-               return retval;
-       }
-       return NULL;
-#endif
-}
-
-gint g_vasprintf (gchar **ret, const gchar *fmt, va_list ap)
-{
-#if defined (HAVE_VASPRINTF) && !defined (ENABLE_OVERRIDABLE_ALLOCATORS)
-  return vasprintf (ret, fmt, ap);
-#else
-       char *buf;
-       int len;
-       size_t buflen;
-       va_list ap2;
-       
-#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR)
-       ap2 = ap;
-       len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( )
-#else
-       va_copy(ap2, ap);
-       len = vsnprintf(NULL, 0, fmt, ap2);
-#endif
-
-       if (len >= 0 && (buf = g_malloc ((buflen = (size_t) (len + 1)))) != NULL) {
-               len = vsnprintf(buf, buflen, fmt, ap);
-               *ret = buf;
-       } else {
-               *ret = NULL;
-               len = -1;
-       }
-
-       va_end(ap2);
-       return len;
-#endif
-}
-
-void
-g_strfreev (gchar **str_array)
-{
-       gchar **orig = str_array;
-       if (str_array == NULL)
-               return;
-       while (*str_array != NULL){
-               g_free (*str_array);
-               str_array++;
-       }
-       g_free (orig);
-}
-
-gchar **
-g_strdupv (gchar **str_array)
-{
-       guint length;
-       gchar **ret;
-       guint i;
-
-       if (!str_array)
-               return NULL;
-
-       length = g_strv_length(str_array);
-       ret = g_new0(gchar *, length + 1);
-       for (i = 0; str_array[i]; i++) {
-               ret[i] = g_strdup(str_array[i]);
-       }
-       ret[length] = NULL;
-       return ret;
-}
-
-guint
-g_strv_length(gchar **str_array)
-{
-       gint length = 0;
-       g_return_val_if_fail(str_array != NULL, 0);
-       for(length = 0; str_array[length] != NULL; length++);
-       return length;
-}
-
-gboolean
-g_str_has_suffix(const gchar *str, const gchar *suffix)
-{
-       size_t str_length;
-       size_t suffix_length;
-       
-       g_return_val_if_fail(str != NULL, FALSE);
-       g_return_val_if_fail(suffix != NULL, FALSE);
-
-       str_length = strlen(str);
-       suffix_length = strlen(suffix);
-
-       return suffix_length <= str_length ?
-               strncmp(str + str_length - suffix_length, suffix, suffix_length) == 0 :
-               FALSE;
-}
-
-gboolean
-g_str_has_prefix(const gchar *str, const gchar *prefix)
-{
-       size_t str_length;
-       size_t prefix_length;
-       
-       g_return_val_if_fail(str != NULL, FALSE);
-       g_return_val_if_fail(prefix != NULL, FALSE);
-
-       str_length = strlen(str);
-       prefix_length = strlen(prefix);
-
-       return prefix_length <= str_length ?
-               strncmp(str, prefix, prefix_length) == 0 :
-               FALSE;
-}
-
-gchar *
-g_strdup_vprintf (const gchar *format, va_list args)
-{
-       int n;
-       char *ret;
-       
-       n = g_vasprintf (&ret, format, args);
-       if (n == -1)
-               return NULL;
-
-       return ret;
-}
-
-gchar *
-g_strdup_printf (const gchar *format, ...)
-{
-       gchar *ret;
-       va_list args;
-       int n;
-
-       va_start (args, format);
-       n = g_vasprintf (&ret, format, args);
-       va_end (args);
-       if (n == -1)
-               return NULL;
-
-       return ret;
-}
-
-
-/*
-Max error number we support. It's empirically found by looking at our target OS.
-
-Last this was checked was June-2017.
-
-Apple is at 106.
-Android is at 133.
-*/
-#define MONO_ERRNO_MAX 200
-#define str(s) #s
-
-#ifndef G_OS_WIN32
-static pthread_mutex_t strerror_lock = PTHREAD_MUTEX_INITIALIZER;
-#endif
-
-static char *error_messages [MONO_ERRNO_MAX];
-
-const gchar *
-g_strerror (gint errnum)
-{
-       if (errnum < 0)
-               errnum = -errnum;
-       if (errnum >= MONO_ERRNO_MAX)
-               return ("Error number higher than " str (MONO_ERRNO_MAX));
-
-       if (!error_messages [errnum]) {
-#ifndef G_OS_WIN32
-               pthread_mutex_lock (&strerror_lock);
-#endif
-
-#ifdef HAVE_STRERROR_R
-               char tmp_buff [128]; //Quite arbitrary, should be large enough
-               char *buff = tmp_buff;
-               int buff_len = sizeof (tmp_buff);
-               int r;
-               buff [0] = 0;
-
-               while ((r = strerror_r (errnum, buff, buff_len - 1))) {
-                       if (r != ERANGE) {
-                               buff = g_strdup_printf ("Invalid Error code '%d'", errnum);
-                               break;
-                       }
-                       if (buff == tmp_buff)
-                               buff = g_malloc (buff_len * 2);
-                       else
-                               buff = g_realloc (buff, buff_len * 2);
-                       buff_len *= 2;
-                //Spec is not clean on whether size argument includes space for null terminator or not 
-               }
-               if (!error_messages [errnum])
-                       error_messages [errnum] = g_strdup (buff);
-               if (buff != tmp_buff)
-                       g_free (buff);
-#else
-               if (!error_messages [errnum])
-                       error_messages [errnum] = g_strdup_printf ("Error code '%d'", errnum);
-#endif
-
-
-#ifndef G_OS_WIN32
-               pthread_mutex_unlock (&strerror_lock);
-#endif
-
-       }
-       return error_messages [errnum];
-}
-
-gchar *
-g_strconcat (const gchar *first, ...)
-{
-       va_list args;
-       size_t total = 0;
-       char *s, *ret;
-       g_return_val_if_fail (first != NULL, NULL);
-
-       total += strlen (first);
-       va_start (args, first);
-       for (s = va_arg (args, char *); s != NULL; s = va_arg(args, char *)){
-               total += strlen (s);
-       }
-       va_end (args);
-       
-       ret = g_malloc (total + 1);
-       if (ret == NULL)
-               return NULL;
-
-       ret [total] = 0;
-       strcpy (ret, first);
-       va_start (args, first);
-       for (s = va_arg (args, char *); s != NULL; s = va_arg(args, char *)){
-               strcat (ret, s);
-       }
-       va_end (args);
-
-       return ret;
-}
-
-static void
-add_to_vector (gchar ***vector, int size, gchar *token)
-{
-       *vector = *vector == NULL ? 
-               (gchar **)g_malloc(2 * sizeof(*vector)) :
-               (gchar **)g_realloc(*vector, (size + 1) * sizeof(*vector));
-               
-       (*vector)[size - 1] = token;
-}
-
-gchar ** 
-g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens)
-{
-       const gchar *c;
-       gchar *token, **vector;
-       gint size = 1;
-       
-       g_return_val_if_fail (string != NULL, NULL);
-       g_return_val_if_fail (delimiter != NULL, NULL);
-       g_return_val_if_fail (delimiter[0] != 0, NULL);
-       
-       if (strncmp (string, delimiter, strlen (delimiter)) == 0) {
-               vector = (gchar **)g_malloc (2 * sizeof(vector));
-               vector[0] = g_strdup ("");
-               size++;
-               string += strlen (delimiter);
-       } else {
-               vector = NULL;
-       }
-
-       while (*string && !(max_tokens > 0 && size >= max_tokens)) {
-               c = string;
-               if (strncmp (string, delimiter, strlen (delimiter)) == 0) {
-                       token = g_strdup ("");
-                       string += strlen (delimiter);
-               } else {
-                       while (*string && strncmp (string, delimiter, strlen (delimiter)) != 0) {
-                               string++;
-                       }
-
-                       if (*string) {
-                               gsize toklen = (string - c);
-                               token = g_strndup (c, toklen);
-
-                               /* Need to leave a trailing empty
-                                * token if the delimiter is the last
-                                * part of the string
-                                */
-                               if (strcmp (string, delimiter) != 0) {
-                                       string += strlen (delimiter);
-                               }
-                       } else {
-                               token = g_strdup (c);
-                       }
-               }
-                       
-               add_to_vector (&vector, size, token);
-               size++;
-       }
-
-       if (*string) {
-               if (strcmp (string, delimiter) == 0)
-                       add_to_vector (&vector, size, g_strdup (""));
-               else {
-                       /* Add the rest of the string as the last element */
-                       add_to_vector (&vector, size, g_strdup (string));
-               }
-               size++;
-       }
-       
-       if (vector == NULL) {
-               vector = (gchar **) g_malloc (2 * sizeof (vector));
-               vector [0] = NULL;
-       } else if (size > 0) {
-               vector[size - 1] = NULL;
-       }
-       
-       return vector;
-}
-
-static gboolean
-charcmp (gchar testchar, const gchar *compare)
-{
-       while(*compare) {
-               if (*compare == testchar) {
-                       return TRUE;
-               }
-               compare++;
-       }
-       
-       return FALSE;
-}
-
-gchar ** 
-g_strsplit_set (const gchar *string, const gchar *delimiter, gint max_tokens)
-{
-       const gchar *c;
-       gchar *token, **vector;
-       gint size = 1;
-       
-       g_return_val_if_fail (string != NULL, NULL);
-       g_return_val_if_fail (delimiter != NULL, NULL);
-       g_return_val_if_fail (delimiter[0] != 0, NULL);
-       
-       if (charcmp (*string, delimiter)) {
-               vector = (gchar **)g_malloc (2 * sizeof(vector));
-               vector[0] = g_strdup ("");
-               size++;
-               string++;
-       } else {
-               vector = NULL;
-       }
-
-       c = string;
-       while (*string && !(max_tokens > 0 && size >= max_tokens)) {
-               if (charcmp (*string, delimiter)) {
-                       gsize toklen = (string - c);
-                       if (toklen == 0) {
-                               token = g_strdup ("");
-                       } else {
-                               token = g_strndup (c, toklen);
-                       }
-                       
-                       c = string + 1;
-                       
-                       add_to_vector (&vector, size, token);
-                       size++;
-               }
-
-               string++;
-       }
-       
-       if (max_tokens > 0 && size >= max_tokens) {
-               if (*string) {
-                       /* Add the rest of the string as the last element */
-                       add_to_vector (&vector, size, g_strdup (string));
-                       size++;
-               }
-       } else {
-               if (*c) {
-                       /* Fill in the trailing last token */
-                       add_to_vector (&vector, size, g_strdup (c));
-                       size++;
-               } else {
-                       /* Need to leave a trailing empty token if the
-                        * delimiter is the last part of the string
-                        */
-                       add_to_vector (&vector, size, g_strdup (""));
-                       size++;
-               }
-       }
-       
-       if (vector == NULL) {
-               vector = (gchar **) g_malloc (2 * sizeof (vector));
-               vector [0] = NULL;
-       } else if (size > 0) {
-               vector[size - 1] = NULL;
-       }
-       
-       return vector;
-}
-
-gchar *
-g_strreverse (gchar *str)
-{
-       size_t i, j;
-       gchar c;
-
-       if (str == NULL)
-               return NULL;
-
-       if (*str == 0)
-               return str;
-
-       for (i = 0, j = strlen (str) - 1; i < j; i++, j--) {
-               c = str [i];
-               str [i] = str [j];
-               str [j] = c;
-       }
-
-       return str;
-}
-
-gchar *
-g_strjoin (const gchar *separator, ...)
-{
-       va_list args;
-       char *res, *s, *r;
-       size_t len, slen;
-
-       if (separator != NULL)
-               slen = strlen (separator);
-       else
-               slen = 0;
-       
-       len = 0;
-       va_start (args, separator);
-       for (s = va_arg (args, char *); s != NULL; s = va_arg (args, char *)){
-               len += strlen (s);
-               len += slen;
-       }
-       va_end (args);
-
-       if (len == 0)
-               return g_strdup ("");
-       
-       /* Remove the last separator */
-       if (slen > 0 && len > 0)
-               len -= slen;
-
-       res = g_malloc (len + 1);
-       va_start (args, separator);
-       s = va_arg (args, char *);
-       r = g_stpcpy (res, s);
-       for (s = va_arg (args, char *); s != NULL; s = va_arg (args, char *)){
-               if (separator != NULL)
-                       r = g_stpcpy (r, separator);
-               r = g_stpcpy (r, s);
-       }
-       va_end (args);
-
-       return res;
-}
-
-gchar *
-g_strjoinv (const gchar *separator, gchar **str_array)
-{
-       char *res, *r;
-       size_t slen, len, i;
-       
-       if (separator != NULL)
-               slen = strlen (separator);
-       else
-               slen = 0;
-       
-       len = 0;
-       for (i = 0; str_array [i] != NULL; i++){
-               len += strlen (str_array [i]);
-               len += slen;
-       }
-
-       if (len == 0)
-               return g_strdup ("");
-
-       if (slen > 0 && len > 0)
-               len -= slen;
-
-       res = g_malloc (len + 1);
-       r = g_stpcpy (res, str_array [0]);
-       for (i = 1; str_array [i] != NULL; i++){
-               if (separator != NULL)
-                       r = g_stpcpy (r, separator);
-               r = g_stpcpy (r, str_array [i]);
-       }
-
-       return res;
-}
-
-gchar *
-g_strchug (gchar *str)
-{
-       size_t len;
-       gchar *tmp;
-
-       if (str == NULL)
-               return NULL;
-
-       tmp = str;
-       while (*tmp && isspace (*tmp)) tmp++;
-       if (str != tmp) {
-               len = strlen (str) - (tmp - str - 1);
-               memmove (str, tmp, len);
-       }
-       return str;
-}
-
-gchar *
-g_strchomp (gchar *str)
-{
-       gchar *tmp;
-
-       if (str == NULL)
-               return NULL;
-
-       tmp = str + strlen (str) - 1;
-       while (*tmp && isspace (*tmp)) tmp--;
-       *(tmp + 1) = '\0';
-       return str;
-}
-
-gint
-g_printf(gchar const *format, ...)
-{
-       va_list args;
-       gint ret;
-
-       va_start(args, format);
-       ret = vprintf(format, args);
-       va_end(args);
-
-       return ret;
-}
-
-gint
-g_fprintf(FILE *file, gchar const *format, ...)
-{
-       va_list args;
-       gint ret;
-
-       va_start(args, format);
-       ret = vfprintf(file, format, args);
-       va_end(args);
-
-       return ret;
-}
-
-gint
-g_sprintf(gchar *string, gchar const *format, ...)
-{
-       va_list args;
-       gint ret;
-
-       va_start(args, format);
-       ret = vsprintf(string, format, args);
-       va_end(args);
-
-       return ret;
-}
-
-gint
-g_snprintf(gchar *string, gulong n, gchar const *format, ...)
-{
-       va_list args;
-       gint ret;
-       
-       va_start(args, format);
-       ret = vsnprintf(string, n, format, args);
-       va_end(args);
-
-       return ret;
-}
-
-static const char hx [] = { '0', '1', '2', '3', '4', '5', '6', '7',
-                                 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-
-static gboolean
-char_needs_encoding (char c)
-{
-       if (((unsigned char)c) >= 0x80)
-               return TRUE;
-       
-       if ((c >= '@' && c <= 'Z') ||
-           (c >= 'a' && c <= 'z') ||
-           (c >= '&' && c < 0x3b) ||
-           (c == '!') || (c == '$') || (c == '_') || (c == '=') || (c == '~'))
-               return FALSE;
-       return TRUE;
-}
-
-gchar *
-g_filename_to_uri (const gchar *filename, const gchar *hostname, GError **error)
-{
-       size_t n;
-       char *ret, *rp;
-       const char *p;
-#ifdef G_OS_WIN32
-       const char *uriPrefix = "file:///";
-#else
-       const char *uriPrefix = "file://";
-#endif
-       
-       g_return_val_if_fail (filename != NULL, NULL);
-
-       if (hostname != NULL)
-               g_warning ("%s", "eglib: g_filename_to_uri: hostname not handled");
-
-       if (!g_path_is_absolute (filename)){
-               if (error != NULL)
-                       *error = g_error_new (NULL, 2, "Not an absolute filename");
-               
-               return NULL;
-       }
-       
-       n = strlen (uriPrefix) + 1;
-       for (p = filename; *p; p++){
-#ifdef G_OS_WIN32
-               if (*p == '\\') {
-                       n++;
-                       continue;
-               }
-#endif
-               if (char_needs_encoding (*p))
-                       n += 3;
-               else
-                       n++;
-       }
-       ret = g_malloc (n);
-       strcpy (ret, uriPrefix);
-       for (p = filename, rp = ret + strlen (ret); *p; p++){
-#ifdef G_OS_WIN32
-               if (*p == '\\') {
-                       *rp++ = '/';
-                       continue;
-               }
-#endif
-               if (char_needs_encoding (*p)){
-                       *rp++ = '%';
-                       *rp++ = hx [((unsigned char)(*p)) >> 4];
-                       *rp++ = hx [((unsigned char)(*p)) & 0xf];
-               } else
-                       *rp++ = *p;
-       }
-       *rp = 0;
-       return ret;
-}
-
-static int
-decode (char p)
-{
-       if (p >= '0' && p <= '9')
-               return p - '0';
-       if (p >= 'A' && p <= 'F')
-               return p - 'A';
-       if (p >= 'a' && p <= 'f')
-               return p - 'a';
-       g_assert_not_reached ();
-       return 0;
-}
-
-gchar *
-g_filename_from_uri (const gchar *uri, gchar **hostname, GError **error)
-{
-       const char *p;
-       char *r, *result;
-       int flen = 0;
-       
-       g_return_val_if_fail (uri != NULL, NULL);
-
-       if (hostname != NULL)
-               g_warning ("%s", "eglib: g_filename_from_uri: hostname not handled");
-
-       if (strncmp (uri, "file:///", 8) != 0){
-               if (error != NULL)
-                       *error = g_error_new (NULL, 2, "URI does not start with the file: scheme");
-               return NULL;
-       }
-
-       for (p = uri + 8; *p; p++){
-               if (*p == '%'){
-                       if (p [1] && p [2] && isxdigit (p [1]) && isxdigit (p [2])){
-                               p += 2;
-                       } else {
-                               if (error != NULL)
-                                       *error = g_error_new (NULL, 2, "URI contains an invalid escape sequence");
-                               return NULL;
-                       }
-               } 
-               flen++;
-       }
-#ifndef G_OS_WIN32
-       flen++;
-#endif
-
-       result = g_malloc (flen + 1);
-       result [flen] = 0;
-
-#ifndef G_OS_WIN32
-       *result = '/';
-       r = result + 1;
-#else
-       r = result;
-#endif
-
-       for (p = uri + 8; *p; p++){
-               if (*p == '%'){
-                       *r++ = (char)((decode (p [1]) << 4) | decode (p [2]));
-                       p += 2;
-               } else
-                       *r++ = *p;
-               flen++;
-       }
-       return result;
-}
-
-void
-g_strdown (gchar *string)
-{
-       g_return_if_fail (string != NULL);
-
-       while (*string){
-               *string = (gchar)tolower (*string);
-               string++;
-       }
-}
-
-gchar
-g_ascii_tolower (gchar c)
-{
-       return c >= 'A' && c <= 'Z' ? c + ('a' - 'A') : c;
-}
-
-gchar *
-g_ascii_strdown (const gchar *str, gssize len)
-{
-       char *ret;
-       int i;
-       
-       g_return_val_if_fail  (str != NULL, NULL);
-
-       if (len == -1)
-               len = strlen (str);
-       
-       ret = g_malloc (len + 1);
-       for (i = 0; i < len; i++)
-               ret [i] = (guchar) g_ascii_tolower (str [i]);
-       ret [i] = 0;
-       
-       return ret;
-}
-
-gchar
-g_ascii_toupper (gchar c)
-{
-       return c >= 'a' && c <= 'z' ? c + ('A' - 'a') : c;
-}
-
-gchar *
-g_ascii_strup (const gchar *str, gssize len)
-{
-       char *ret;
-       int i;
-       
-       g_return_val_if_fail  (str != NULL, NULL);
-
-       if (len == -1)
-               len = strlen (str);
-       
-       ret = g_malloc (len + 1);
-       for (i = 0; i < len; i++)
-               ret [i] = (guchar) g_ascii_toupper (str [i]);
-       ret [i] = 0;
-       
-       return ret;
-}
-
-gint
-g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n)
-{
-       gsize i;
-       
-       g_return_val_if_fail (s1 != NULL, 0);
-       g_return_val_if_fail (s2 != NULL, 0);
-
-       for (i = 0; i < n; i++) {
-               gchar c1 = g_ascii_tolower (*s1++);
-               gchar c2 = g_ascii_tolower (*s2++);
-               
-               if (c1 != c2)
-                       return c1 - c2;
-       }
-       
-       return 0;
-}
-
-gint
-g_ascii_strcasecmp (const gchar *s1, const gchar *s2)
-{
-       const char *sp1 = s1;
-       const char *sp2 = s2;
-       
-       g_return_val_if_fail (s1 != NULL, 0);
-       g_return_val_if_fail (s2 != NULL, 0);
-       
-       while (*sp1 != '\0') {
-               char c1 = g_ascii_tolower (*sp1++);
-               char c2 = g_ascii_tolower (*sp2++);
-               
-               if (c1 != c2)
-                       return c1 - c2;
-       }
-       
-       return (*sp1) - (*sp2);
-}
-
-gchar *
-g_strdelimit (gchar *string, const gchar *delimiters, gchar new_delimiter)
-{
-       gchar *ptr;
-
-       g_return_val_if_fail (string != NULL, NULL);
-
-       if (delimiters == NULL)
-               delimiters = G_STR_DELIMITERS;
-
-       for (ptr = string; *ptr; ptr++) {
-               if (strchr (delimiters, *ptr))
-                       *ptr = new_delimiter;
-       }
-       
-       return string;
-}
-
-gsize 
-g_strlcpy (gchar *dest, const gchar *src, gsize dest_size)
-{
-#ifdef HAVE_STRLCPY
-       return strlcpy (dest, src, dest_size);
-#else
-       gchar *d;
-       const gchar *s;
-       gchar c;
-       gsize len;
-       
-       g_return_val_if_fail (src != NULL, 0);
-       g_return_val_if_fail (dest != NULL, 0);
-
-       len = dest_size;
-       if (len == 0)
-               return 0;
-
-       s = src;
-       d = dest;
-       while (--len) {
-               c = *s++;
-               *d++ = c;
-               if (c == '\0')
-                       return (dest_size - len - 1);
-       }
-
-       /* len is 0 i we get here */
-       *d = '\0';
-       /* we need to return the length of src here */
-       while (*s++) ; /* instead of a plain strlen, we use 's' */
-       return s - src - 1;
-#endif
-}
-
-gchar *
-g_stpcpy (gchar *dest, const char *src)
-{
-       g_return_val_if_fail (dest != NULL, dest);
-       g_return_val_if_fail (src != NULL, dest);
-
-#if HAVE_STPCPY
-       return stpcpy (dest, src);
-#else
-       while (*src)
-               *dest++ = *src++;
-       
-       *dest = '\0';
-       
-       return dest;
-#endif
-}
-
-static const gchar escaped_dflt [256] = {
-       1, 1, 1, 1, 1, 1, 1, 1, 'b', 't', 'n', 1, 'f', 'r', 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-       0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '\\', 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-};
-
-gchar *
-g_strescape (const gchar *source, const gchar *exceptions)
-{
-       gchar escaped [256];
-       const gchar *ptr;
-       gchar c;
-       gchar op;
-       gchar *result;
-       gchar *res_ptr;
-
-       g_return_val_if_fail (source != NULL, NULL);
-
-       memcpy (escaped, escaped_dflt, 256);
-       if (exceptions != NULL) {
-               for (ptr = exceptions; *ptr; ptr++)
-                       escaped [(int) *ptr] = 0;
-       }
-       result = g_malloc (strlen (source) * 4 + 1); /* Worst case: everything octal. */
-       res_ptr = result;
-       for (ptr = source; *ptr; ptr++) {
-               c = *ptr;
-               op = escaped [(int) c];
-               if (op == 0) {
-                       *res_ptr++ = c;
-               } else {
-                       *res_ptr++ = '\\';
-                       if (op != 1) {
-                               *res_ptr++ = op;
-                       } else {
-                               *res_ptr++ = '0' + ((c >> 6) & 3);
-                               *res_ptr++ = '0' + ((c >> 3) & 7);
-                               *res_ptr++ = '0' + (c & 7);
-                       }
-               }
-       }
-       *res_ptr = '\0';
-       return result;
-}
-
-gint
-g_ascii_xdigit_value (gchar c)
-{
-       return ((isxdigit (c) == 0) ? -1 :
-               ((c >= '0' && c <= '9') ? (c - '0') :
-                ((c >= 'a' && c <= 'f') ? (c - 'a' + 10) :
-                 (c - 'A' + 10))));
-}
-
-gchar *
-g_strnfill (gsize length, gchar fill_char)
-{
-       gchar *ret = g_new (gchar, length + 1);
-
-       memset (ret, fill_char, length);
-       ret [length] = 0;
-       return ret;
-}
diff --git a/eglib/src/gstring.c b/eglib/src/gstring.c
deleted file mode 100644 (file)
index ba75789..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * String functions
- *
- * Author:
- *   Miguel de Icaza (miguel@novell.com)
- *   Aaron Bockover (abockover@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <glib.h>
-
-#define GROW_IF_NECESSARY(s,l) { \
-       if(s->len + l >= s->allocated_len) { \
-               s->allocated_len = (s->allocated_len + l + 16) * 2; \
-               s->str = g_realloc(s->str, s->allocated_len); \
-       } \
-}
-
-GString *
-g_string_new_len (const gchar *init, gssize len)
-{
-       GString *ret = g_new (GString, 1);
-
-       if (init == NULL)
-               ret->len = 0;
-       else
-               ret->len = len < 0 ? strlen(init) : len;
-       ret->allocated_len = MAX(ret->len + 1, 16);
-       ret->str = g_malloc(ret->allocated_len);
-       if (init)
-               memcpy(ret->str, init, ret->len);
-       ret->str[ret->len] = 0;
-
-       return ret;
-}
-
-GString *
-g_string_new (const gchar *init)
-{
-       return g_string_new_len(init, -1);
-}
-
-GString *
-g_string_sized_new (gsize default_size)
-{
-       GString *ret = g_new (GString, 1);
-
-       ret->str = g_malloc (default_size);
-       ret->str [0] = 0;
-       ret->len = 0;
-       ret->allocated_len = default_size;
-
-       return ret;
-}
-
-gchar *
-g_string_free (GString *string, gboolean free_segment)
-{
-       gchar *data;
-       
-       g_return_val_if_fail (string != NULL, NULL);
-
-       data = string->str;
-       g_free(string);
-       
-       if(!free_segment) {
-               return data;
-       }
-
-       g_free(data);
-       return NULL;
-}
-
-GString *
-g_string_append_len (GString *string, const gchar *val, gssize len)
-{
-       g_return_val_if_fail(string != NULL, NULL);
-       g_return_val_if_fail(val != NULL, string);
-
-       if(len < 0) {
-               len = strlen(val);
-       }
-
-       GROW_IF_NECESSARY(string, len);
-       memcpy(string->str + string->len, val, len);
-       string->len += len;
-       string->str[string->len] = 0;
-
-       return string;
-}
-
-GString *
-g_string_append (GString *string, const gchar *val)
-{
-       g_return_val_if_fail(string != NULL, NULL);
-       g_return_val_if_fail(val != NULL, string);
-
-       return g_string_append_len(string, val, -1);
-}
-
-GString *
-g_string_append_c (GString *string, gchar c)
-{
-       g_return_val_if_fail(string != NULL, NULL);
-
-       GROW_IF_NECESSARY(string, 1);
-       
-       string->str[string->len] = c;
-       string->str[string->len + 1] = 0;
-       string->len++;
-
-       return string;
-}
-
-GString *
-g_string_append_unichar (GString *string, gunichar c)
-{
-       gchar utf8[6];
-       gint len;
-       
-       g_return_val_if_fail (string != NULL, NULL);
-       
-       if ((len = g_unichar_to_utf8 (c, utf8)) <= 0)
-               return string;
-       
-       return g_string_append_len (string, utf8, len);
-}
-
-GString *
-g_string_prepend (GString *string, const gchar *val)
-{
-       gssize len;
-       
-       g_return_val_if_fail (string != NULL, string);
-       g_return_val_if_fail (val != NULL, string);
-
-       len = strlen (val);
-       
-       GROW_IF_NECESSARY(string, len); 
-       memmove(string->str + len, string->str, string->len + 1);
-       memcpy(string->str, val, len);
-
-       return string;
-}
-
-GString *
-g_string_insert (GString *string, gssize pos, const gchar *val)
-{
-       gssize len;
-       
-       g_return_val_if_fail (string != NULL, string);
-       g_return_val_if_fail (val != NULL, string);
-       g_return_val_if_fail (pos <= string->len, string);
-
-       len = strlen (val);
-       
-       GROW_IF_NECESSARY(string, len); 
-       memmove(string->str + pos + len, string->str + pos, string->len - pos - len + 1);
-       memcpy(string->str + pos, val, len);
-
-       return string;
-}
-
-void
-g_string_append_printf (GString *string, const gchar *format, ...)
-{
-       char *ret;
-       va_list args;
-       
-       g_return_if_fail (string != NULL);
-       g_return_if_fail (format != NULL);
-
-       va_start (args, format);
-       ret = g_strdup_vprintf (format, args);
-       va_end (args);
-       g_string_append (string, ret);
-
-       g_free (ret);
-}
-
-void
-g_string_append_vprintf (GString *string, const gchar *format, va_list args)
-{
-       char *ret;
-
-       g_return_if_fail (string != NULL);
-       g_return_if_fail (format != NULL);
-
-       ret = g_strdup_vprintf (format, args);
-       g_string_append (string, ret);
-       g_free (ret);
-}
-
-void
-g_string_printf (GString *string, const gchar *format, ...)
-{
-       va_list args;
-       
-       g_return_if_fail (string != NULL);
-       g_return_if_fail (format != NULL);
-
-       g_free (string->str);
-       
-       va_start (args, format);
-       string->str = g_strdup_vprintf (format, args);
-       va_end (args);
-
-       string->len = strlen (string->str);
-       string->allocated_len = string->len+1;
-}
-
-GString *
-g_string_truncate (GString *string, gsize len)
-{
-       g_return_val_if_fail (string != NULL, string);
-
-       /* Silent return */
-       if (len >= string->len)
-               return string;
-       
-       string->len = len;
-       string->str[len] = 0;
-       return string;
-}
-
-GString *
-g_string_set_size (GString *string, gsize len)
-{
-       g_return_val_if_fail (string != NULL, string);
-
-       GROW_IF_NECESSARY(string, len);
-       
-       string->len = len;
-       string->str[len] = 0;
-       return string;
-}
-
-GString *
-g_string_erase (GString *string, gssize pos, gssize len)
-{
-       g_return_val_if_fail (string != NULL, string);
-
-       /* Silent return */
-       if (pos >= string->len)
-               return string;
-
-       if (len == -1 || (pos + len) >= string->len) {
-               string->str[pos] = 0;
-       }
-       else {
-               memmove (string->str + pos, string->str + pos + len, string->len - (pos + len) + 1);
-               string->len -= len;
-       }
-
-       return string;
-}
diff --git a/eglib/src/gtimer-unix.c b/eglib/src/gtimer-unix.c
deleted file mode 100644 (file)
index 085e2c1..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Timer
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <glib.h>
-#include <sys/time.h>
-
-struct _GTimer {
-       struct timeval start;
-       struct timeval stop;
-};
-
-GTimer *g_timer_new (void)
-{
-       GTimer *timer;
-
-       timer = g_new0 (GTimer, 1);
-       g_timer_start (timer);
-       return timer;
-}
-
-void
-g_timer_destroy (GTimer *timer)
-{
-       g_return_if_fail (timer != NULL);
-       g_free (timer);
-}
-
-void
-g_timer_start (GTimer *timer)
-{
-       g_return_if_fail (timer != NULL);
-       gettimeofday (&timer->start, NULL);
-       memset (&timer->stop, 0, sizeof (struct timeval));
-}
-
-void
-g_timer_stop (GTimer *timer)
-{
-       g_return_if_fail (timer != NULL);
-       gettimeofday (&timer->stop, NULL);
-}
-
-gdouble
-g_timer_elapsed (GTimer *timer, gulong *microseconds)
-{
-       struct timeval tv;
-       gulong seconds;
-       long usec;
-       gdouble result;
-
-       g_return_val_if_fail (timer != NULL, 0.0);
-
-       if (timer->stop.tv_sec == 0 && timer->stop.tv_usec == 0) {
-               gettimeofday (&tv, NULL);
-       } else {
-               tv = timer->stop;
-       }
-
-       usec = (tv.tv_usec) - (timer->start.tv_usec);
-       seconds = tv.tv_sec - timer->start.tv_sec;
-       if (microseconds) {
-               if (usec < 0) {
-                       usec += 1000000;
-                       seconds--;
-               }
-               *microseconds = usec;
-       }
-       result = seconds * 1000000 + usec;
-       return (result / 1000000);
-}
-
-
diff --git a/eglib/src/gtimer-win32.c b/eglib/src/gtimer-win32.c
deleted file mode 100644 (file)
index 07e802b..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Timer
- *
- * Author:
- *   Gonzalo Paniagua Javier (gonzalo@novell.com
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <glib.h>
-#include <windows.h>
-
-struct _GTimer {
-       guint64 start;
-       guint64 stop;
-};
-
-GTimer *g_timer_new (void)
-{
-       GTimer *timer;
-
-       timer = g_new0 (GTimer, 1);
-       g_timer_start (timer);
-       return timer;
-}
-
-void
-g_timer_destroy (GTimer *timer)
-{
-       g_return_if_fail (timer != NULL);
-       g_free (timer);
-}
-
-void
-g_timer_start (GTimer *timer)
-{
-       g_return_if_fail (timer != NULL);
-
-       QueryPerformanceCounter ((LARGE_INTEGER*)&timer->start);
-}
-
-void
-g_timer_stop (GTimer *timer)
-{
-       g_return_if_fail (timer != NULL);
-
-       QueryPerformanceCounter ((LARGE_INTEGER*)&timer->stop);
-}
-
-gdouble
-g_timer_elapsed (GTimer *timer, gulong *microseconds)
-{
-       static guint64 freq = 0;
-       guint64 delta, stop;
-
-       if (freq == 0) {
-               if (!QueryPerformanceFrequency ((LARGE_INTEGER *)&freq))
-                       freq = 1;
-       }
-
-       if (timer->stop == 0) {
-               QueryPerformanceCounter ((LARGE_INTEGER*)&stop);
-       }
-       else {
-               stop = timer->stop;
-       }
-
-       delta = stop - timer->start;
-
-       if (microseconds)
-               *microseconds = (gulong) (delta * (1000000.0 / freq));
-
-       return (gdouble) delta / (gdouble) freq;
-}
-
-
diff --git a/eglib/src/gunicode-win32-uwp.c b/eglib/src/gunicode-win32-uwp.c
deleted file mode 100644 (file)
index ef36ffc..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * gunicode-win32-uwp.c: UWP unicode support.
- *
- * Copyright 2016 Microsoft
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
-*/
-#include <config.h>
-#include <glib.h>
-
-#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
-#define CODESET 1
-#include <windows.h>
-
-extern const char *my_charset;
-static gboolean is_utf8;
-
-gboolean
-g_get_charset (G_CONST_RETURN char **charset)
-{
-       if (my_charset == NULL) {
-               static char buf [14];
-               CPINFOEXA cp_info;
-
-               GetCPInfoExA (CP_ACP, 0, &cp_info);
-               sprintf (buf, "CP%u", cp_info.CodePage);
-               my_charset = buf;
-               is_utf8 = FALSE;
-       }
-       
-       if (charset != NULL)
-               *charset = my_charset;
-
-       return is_utf8;
-}
-
-#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
-
-#ifdef _MSC_VER
-// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
-void __mono_win32_gunicode_win32_uwp_quiet_lnk4221(void) {}
-#endif
-#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/eglib/src/gunicode-win32.c b/eglib/src/gunicode-win32.c
deleted file mode 100644 (file)
index a35cfcd..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * gunicode-win32.c: Windows unicode support.
- *
- * Copyright 2016 Microsoft
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
-*/
-#include <config.h>
-#include <glib.h>
-
-#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
-#define CODESET 1
-#include <windows.h>
-
-extern const char *my_charset;
-static gboolean is_utf8;
-
-gboolean
-g_get_charset (G_CONST_RETURN char **charset)
-{
-       if (my_charset == NULL) {
-               static char buf [14];
-               sprintf (buf, "CP%u", GetACP ());
-               my_charset = buf;
-               is_utf8 = FALSE;
-       }
-       
-       if (charset != NULL)
-               *charset = my_charset;
-
-       return is_utf8;
-}
-
-#else /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
-
-#ifdef _MSC_VER
-// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
-void __mono_win32_mono_gunicode_win32_quiet_lnk4221(void) {}
-#endif
-#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
diff --git a/eglib/src/gunicode.c b/eglib/src/gunicode.c
deleted file mode 100644 (file)
index c1280f9..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * gunicode.c: Some Unicode routines 
- *
- * Author:
- *   Miguel de Icaza (miguel@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * utf8 validation code came from:
- *     libxml2-2.6.26 licensed under the MIT X11 license
- *
- * Authors credit in libxml's string.c:
- *   William Brack <wbrack@mmm.com.hk>
- *   daniel@veillard.com
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-#include <config.h>
-#include <stdio.h>
-#include <glib.h>
-#include <unicode-data.h>
-#include <errno.h>
-
-#ifndef G_OS_WIN32
-#    ifdef HAVE_LOCALCHARSET_H
-#       include <localcharset.h>
-#    endif
-#endif
-
-const char *my_charset;
-
-/*
- * Character set conversion
- */
-
-GUnicodeType 
-g_unichar_type (gunichar c)
-{
-       int i;
-
-       guint16 cp = (guint16) c;
-       for (i = 0; i < unicode_category_ranges_count; i++) {
-               if (cp < unicode_category_ranges [i].start)
-                       continue;
-               if (unicode_category_ranges [i].end <= cp)
-                       continue;
-               return unicode_category [i] [cp - unicode_category_ranges [i].start];
-       }
-
-       /*
-       // 3400-4DB5: OtherLetter
-       // 4E00-9FC3: OtherLetter
-       // AC00-D7A3: OtherLetter
-       // D800-DFFF: OtherSurrogate
-       // E000-F8FF: OtherPrivateUse
-       // 20000-2A6D6 OtherLetter
-       // F0000-FFFFD OtherPrivateUse
-       // 100000-10FFFD OtherPrivateUse
-       */
-       if (0x3400 <= cp && cp < 0x4DB5)
-               return G_UNICODE_OTHER_LETTER;
-       if (0x4E00 <= cp && cp < 0x9FC3)
-               return G_UNICODE_OTHER_LETTER;
-       if (0xAC00<= cp && cp < 0xD7A3)
-               return G_UNICODE_OTHER_LETTER;
-       if (0xD800 <= cp && cp < 0xDFFF)
-               return G_UNICODE_SURROGATE;
-       if (0xE000 <= cp && cp < 0xF8FF)
-               return G_UNICODE_PRIVATE_USE;
-       /* since the argument is UTF-16, we cannot check beyond FFFF */
-
-       /* It should match any of above */
-       return 0;
-}
-
-GUnicodeBreakType
-g_unichar_break_type (gunichar c)
-{
-       // MOONLIGHT_FIXME
-       return G_UNICODE_BREAK_UNKNOWN;
-}
-
-gunichar
-g_unichar_case (gunichar c, gboolean upper)
-{
-       gint8 i, i2;
-       guint32 cp = (guint32) c, v;
-
-       for (i = 0; i < simple_case_map_ranges_count; i++) {
-               if (cp < simple_case_map_ranges [i].start)
-                       return c;
-               if (simple_case_map_ranges [i].end <= cp)
-                       continue;
-               if (c < 0x10000) {
-                       const guint16 *tab = upper ? simple_upper_case_mapping_lowarea [i] : simple_lower_case_mapping_lowarea [i];
-                       v = tab [cp - simple_case_map_ranges [i].start];
-               } else {
-                       const guint32 *tab;
-                       i2 = (gint8)(i - (upper ? simple_upper_case_mapping_lowarea_table_count : simple_lower_case_mapping_lowarea_table_count));
-                       tab = upper ? simple_upper_case_mapping_higharea [i2] : simple_lower_case_mapping_higharea [i2];
-                       v = tab [cp - simple_case_map_ranges [i].start];
-               }
-               return v != 0 ? (gunichar) v : c;
-       }
-       return c;
-}
-
-gunichar
-g_unichar_toupper (gunichar c)
-{
-       return g_unichar_case (c, TRUE);
-}
-
-gunichar
-g_unichar_tolower (gunichar c)
-{
-       return g_unichar_case (c, FALSE);
-}
-
-gunichar
-g_unichar_totitle (gunichar c)
-{
-       guint8 i;
-       guint32 cp;
-
-       cp = (guint32) c;
-       for (i = 0; i < simple_titlecase_mapping_count; i++) {
-               if (simple_titlecase_mapping [i].codepoint == cp)
-                       return simple_titlecase_mapping [i].title;
-               if (simple_titlecase_mapping [i].codepoint > cp)
-                       /* it is ordered, hence no more match */
-                       break;
-       }
-       return g_unichar_toupper (c);
-}
-
-gboolean
-g_unichar_isxdigit (gunichar c)
-{
-       return (g_unichar_xdigit_value (c) != -1);
-
-}
-
-gint
-g_unichar_xdigit_value (gunichar c)
-{
-       if (c >= 0x30 && c <= 0x39) /*0-9*/
-               return (c - 0x30);
-       if (c >= 0x41 && c <= 0x46) /*A-F*/
-               return (c - 0x37);
-       if (c >= 0x61 && c <= 0x66) /*a-f*/
-               return (c - 0x57);
-       return -1;
-}
-
-gboolean
-g_unichar_isspace (gunichar c)
-{
-       GUnicodeType type = g_unichar_type (c);
-       if (type == G_UNICODE_LINE_SEPARATOR ||
-           type == G_UNICODE_PARAGRAPH_SEPARATOR ||
-           type == G_UNICODE_SPACE_SEPARATOR)
-               return TRUE;
-
-       return FALSE;
-}
-
-
-/*
- * This is broken, and assumes an UTF8 system, but will do for eglib's first user
- */
-gchar *
-g_filename_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read, gsize *bytes_written, GError **error)
-{
-       char *res;
-       
-       if (len == -1)
-               len = strlen (utf8string);
-
-       res = g_malloc (len + 1);
-       g_strlcpy (res, utf8string, len + 1);
-       return res;
-}
-
-#ifndef G_OS_WIN32
-static gboolean is_utf8;
-
-gboolean
-g_get_charset (G_CONST_RETURN char **charset)
-{
-       if (my_charset == NULL) {
-               /* These shouldn't be heap allocated */
-#if defined(HAVE_LOCALCHARSET_H)
-               my_charset = locale_charset ();
-#else
-               my_charset = "UTF-8";
-#endif
-               is_utf8 = strcmp (my_charset, "UTF-8") == 0;
-       }
-       
-       if (charset != NULL)
-               *charset = my_charset;
-
-       return is_utf8;
-}
-#endif /* G_OS_WIN32 */
-
-gchar *
-g_locale_to_utf8 (const gchar *opsysstring, gssize len, gsize *bytes_read, gsize *bytes_written, GError **error)
-{
-       g_get_charset (NULL);
-
-       return g_convert (opsysstring, len, "UTF-8", my_charset, bytes_read, bytes_written, error);
-}
-
-gchar *
-g_locale_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read, gsize *bytes_written, GError **error)
-{
-       g_get_charset (NULL);
-
-       return g_convert (utf8string, len, my_charset, "UTF-8", bytes_read, bytes_written, error);
-}
diff --git a/eglib/src/gutf8.c b/eglib/src/gutf8.c
deleted file mode 100644 (file)
index c4c9b91..0000000
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * gutf8.c: UTF-8 conversion
- *
- * Author:
- *   Atsushi Enomoto  <atsushi@ximian.com>
- *
- * (C) 2006 Novell, Inc.
- * Copyright 2012 Xamarin Inc
- */
-
-#include <stdio.h>
-#include <glib.h>
-
-/*
- * Index into the table below with the first byte of a UTF-8 sequence to get
- * the number of bytes that are supposed to follow it to complete the sequence.
- *
- * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is left
- * as-is for anyone who may want to do such conversion, which was allowed in
- * earlier algorithms.
-*/
-const guchar g_utf8_jump_table[256] = {
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
-       3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1
-};
-
-static gchar *
-utf8_case_conv (const gchar *str, gssize len, gboolean upper)
-{
-       gunichar *ustr;
-       glong i, ulen;
-       gchar *utf8;
-       
-       ustr = g_utf8_to_ucs4_fast (str, (glong) len, &ulen);
-       for (i = 0; i < ulen; i++)
-               ustr[i] = upper ? g_unichar_toupper (ustr[i]) : g_unichar_tolower (ustr[i]);
-       utf8 = g_ucs4_to_utf8 (ustr, ulen, NULL, NULL, NULL);
-       g_free (ustr);
-       
-       return utf8;
-}
-
-gchar *
-g_utf8_strup (const gchar *str, gssize len)
-{
-       return utf8_case_conv (str, len, TRUE);
-}
-
-gchar *
-g_utf8_strdown (const gchar *str, gssize len)
-{
-       return utf8_case_conv (str, len, FALSE);
-}
-
-static gboolean
-utf8_validate (const unsigned char *inptr, size_t len)
-{
-       const unsigned char *ptr = inptr + len;
-       unsigned char c;
-       
-       /* Everything falls through when TRUE... */
-       switch (len) {
-       default:
-               return FALSE;
-       case 4:
-               if ((c = (*--ptr)) < 0x80 || c > 0xBF)
-                       return FALSE;
-               
-               if ((c == 0xBF || c == 0xBE) && ptr[-1] == 0xBF) {
-                       if (ptr[-2] == 0x8F || ptr[-2] == 0x9F ||
-                           ptr[-2] == 0xAF || ptr[-2] == 0xBF)
-                               return FALSE;
-               }
-       case 3:
-               if ((c = (*--ptr)) < 0x80 || c > 0xBF)
-                       return FALSE;
-       case 2:
-               if ((c = (*--ptr)) < 0x80 || c > 0xBF)
-                       return FALSE;
-               
-               /* no fall-through in this inner switch */
-               switch (*inptr) {
-               case 0xE0: if (c < 0xA0) return FALSE; break;
-               case 0xED: if (c > 0x9F) return FALSE; break;
-               case 0xEF: if (c == 0xB7 && (ptr[1] > 0x8F && ptr[1] < 0xB0)) return FALSE;
-                       if (c == 0xBF && (ptr[1] == 0xBE || ptr[1] == 0xBF)) return FALSE;
-                       break;
-               case 0xF0: if (c < 0x90) return FALSE; break;
-               case 0xF4: if (c > 0x8F) return FALSE; break;
-               default:   if (c < 0x80) return FALSE; break;
-               }
-       case 1: if (*inptr >= 0x80 && *inptr < 0xC2) return FALSE;
-       }
-       
-       if (*inptr > 0xF4)
-               return FALSE;
-       
-       return TRUE;
-}
-
-/**
- * g_utf8_validate:
- * @str: a utf-8 encoded string
- * @max_len: max number of bytes to validate (or -1 to validate the entire null-terminated string)
- * @end: output parameter to mark the end of the valid input
- *
- * Checks @utf for being valid UTF-8. @str is assumed to be
- * null-terminated. This function is not super-strict, as it will
- * allow longer UTF-8 sequences than necessary. Note that Java is
- * capable of producing these sequences if provoked. Also note, this
- * routine checks for the 4-byte maximum size, but does not check for
- * 0x10ffff maximum value.
- *
- * Return value: %TRUE if @str is valid or %FALSE otherwise.
- **/
-gboolean
-g_utf8_validate (const gchar *str, gssize max_len, const gchar **end)
-{
-       guchar *inptr = (guchar *) str;
-       gboolean valid = TRUE;
-       guint length, min;
-       gssize n = 0;
-       
-       if (max_len == 0)
-               return FALSE;
-       
-       if (max_len < 0) {
-               while (*inptr != 0) {
-                       length = g_utf8_jump_table[*inptr];
-                       if (!utf8_validate (inptr, length)) {
-                               valid = FALSE;
-                               break;
-                       }
-                       
-                       inptr += length;
-               }
-       } else {
-               while (n < max_len) {
-                       if (*inptr == 0) {
-                               /* Note: return FALSE if we encounter nul-byte
-                                * before max_len is reached. */
-                               valid = FALSE;
-                               break;
-                       }
-                       
-                       length = g_utf8_jump_table[*inptr];
-                       min = MIN (length, max_len - n);
-                       
-                       if (!utf8_validate (inptr, min)) {
-                               valid = FALSE;
-                               break;
-                       }
-                       
-                       if (min < length) {
-                               valid = FALSE;
-                               break;
-                       }
-                       
-                       inptr += length;
-                       n += length;
-               }
-       }
-       
-       if (end != NULL)
-               *end = (gchar *) inptr;
-       
-       return valid;
-}
-
-gunichar
-g_utf8_get_char_validated (const gchar *str, gssize max_len)
-{
-       unsigned char *inptr = (unsigned char *) str;
-       gunichar u = *inptr;
-       int n, i;
-       
-       if (max_len == 0)
-               return -2;
-       
-       if (u < 0x80) {
-               /* simple ascii case */
-               return u;
-       } else if (u < 0xc2) {
-               return -1;
-       } else if (u < 0xe0) {
-               u &= 0x1f;
-               n = 2;
-       } else if (u < 0xf0) {
-               u &= 0x0f;
-               n = 3;
-       } else if (u < 0xf8) {
-               u &= 0x07;
-               n = 4;
-       } else if (u < 0xfc) {
-               u &= 0x03;
-               n = 5;
-       } else if (u < 0xfe) {
-               u &= 0x01;
-               n = 6;
-       } else {
-               return -1;
-       }
-       
-       if (max_len > 0) {
-               if (!utf8_validate (inptr, MIN (max_len, n)))
-                       return -1;
-               
-               if (max_len < n)
-                       return -2;
-       } else {
-               if (!utf8_validate (inptr, n))
-                       return -1;
-       }
-       
-       for (i = 1; i < n; i++)
-               u = (u << 6) | (*++inptr ^ 0x80);
-       
-       return u;
-}
-
-glong
-g_utf8_strlen (const gchar *str, gssize max_len)
-{
-       const guchar *inptr = (const guchar *) str;
-       glong clen = 0, len = 0, n;
-       
-       if (max_len == 0)
-               return 0;
-       
-       if (max_len < 0) {
-               while (*inptr) {
-                       inptr += g_utf8_jump_table[*inptr];
-                       len++;
-               }
-       } else {
-               while (len < max_len && *inptr) {
-                       n = g_utf8_jump_table[*inptr];
-                       if ((clen + n) > max_len)
-                               break;
-                       
-                       inptr += n;
-                       clen += n;
-                       len++;
-               }
-       }
-       
-       return len;
-}
-
-gunichar
-g_utf8_get_char (const gchar *src)
-{
-       unsigned char *inptr = (unsigned char *) src;
-       gunichar u = *inptr;
-       int n, i;
-       
-       if (u < 0x80) {
-               /* simple ascii case */
-               return u;
-       } else if (u < 0xe0) {
-               u &= 0x1f;
-               n = 2;
-       } else if (u < 0xf0) {
-               u &= 0x0f;
-               n = 3;
-       } else if (u < 0xf8) {
-               u &= 0x07;
-               n = 4;
-       } else if (u < 0xfc) {
-               u &= 0x03;
-               n = 5;
-       } else {
-               u &= 0x01;
-               n = 6;
-       }
-       
-       for (i = 1; i < n; i++)
-               u = (u << 6) | (*++inptr ^ 0x80);
-       
-       return u;
-}
-
-gchar *
-g_utf8_find_prev_char (const gchar *str, const gchar *p)
-{
-       while (p > str) {
-               p--;
-               if ((*p & 0xc0) != 0xb0)
-                       return (gchar *)p;
-       }
-       return NULL;
-}
-
-gchar *
-g_utf8_prev_char (const gchar *str)
-{
-       const gchar *p = str;
-       do {
-               p--;
-       } while ((*p & 0xc0) == 0xb0);
-       
-       return (gchar *)p;
-}
-
-gchar *
-g_utf8_offset_to_pointer (const gchar *str, glong offset)
-{
-       const gchar *p = str;
-
-       if (offset > 0) {
-               do {
-                       p = g_utf8_next_char (p);
-                       offset --;
-               } while (offset > 0);
-       }
-       else if (offset < 0) {
-               const gchar *jump = str;
-               do {
-                       // since the minimum size of a character is 1
-                       // we know we can step back at least offset bytes
-                       jump = jump + offset;
-                       
-                       // if we land in the middle of a character
-                       // walk to the beginning
-                       while ((*jump & 0xc0) == 0xb0)
-                               jump --;
-                       
-                       // count how many characters we've actually walked
-                       // by going forward
-                       p = jump;
-                       do {
-                               p = g_utf8_next_char (p);
-                               offset ++;
-                       } while (p < jump);
-                       
-               } while (offset < 0);
-       }
-       
-       return (gchar *)p;
-}
-
-glong
-g_utf8_pointer_to_offset (const gchar *str, const gchar *pos)
-{
-       const gchar *inptr, *inend;
-       glong offset = 0;
-       glong sign = 1;
-       
-       if (pos == str)
-               return 0;
-       
-       if (str < pos) {
-               inptr = str;
-               inend = pos;
-       } else {
-               inptr = pos;
-               inend = str;
-               sign = -1;
-       }
-       
-       do {
-               inptr = g_utf8_next_char (inptr);
-               offset++;
-       } while (inptr < inend);
-       
-       return offset * sign;
-}
diff --git a/eglib/src/sort.frag.h b/eglib/src/sort.frag.h
deleted file mode 100644 (file)
index 6dc1950..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * sort.frag.h: Common implementation of linked-list sorting
- *
- * Author:
- *   Raja R Harinath (rharinath@novell.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * (C) 2006 Novell, Inc.
- */
-
-/*
- * This code requires a typedef named 'list_node' for the list node.  It
- * is assumed that the list type is the type of a pointer to a list
- * node, and that the node has a field named 'next' that implements to
- * the linked list.  No additional invariant is maintained (e.g. the
- * 'prev' pointer of a doubly-linked list node is _not_ updated).  Any
- * invariant would require a post-processing pass to fix matters if
- * necessary.
- */
-typedef list_node *digit;
-
-/*
- * The maximum possible depth of the merge tree
- *   = ceiling (log2 (maximum number of list nodes))
- *   = ceiling (log2 (maximum possible memory size/size of each list node))
- *   = number of bits in 'size_t' - floor (log2 (sizeof digit))
- * Also, each list in sort_info is at least 2 nodes long: we can reduce the depth by 1
- */
-#define FLOOR_LOG2(x) (((x)>=2) + ((x)>=4) + ((x)>=8) + ((x)>=16) + ((x)>=32) + ((x)>=64) + ((x)>=128))
-#define MAX_RANKS ((sizeof (size_t) * 8) - FLOOR_LOG2(sizeof (list_node)) - 1)
-
-struct sort_info
-{
-       int min_rank, n_ranks;
-       GCompareFunc func;
-
-       /* Invariant: ranks[i] == NULL || length(ranks[i]) >= 2**(i+1) */
-       list_node *ranks [MAX_RANKS]; /* ~ 128 bytes on 32bit, ~ 512 bytes on 64bit */
-};
-
-static inline void
-init_sort_info (struct sort_info *si, GCompareFunc func)
-{
-       si->min_rank = si->n_ranks = 0;
-       si->func = func;
-       /* we don't need to initialize si->ranks, since we never lookup past si->n_ranks.  */
-}
-
-static inline list_node *
-merge_lists (list_node *first, list_node *second, GCompareFunc func)
-{
-       /* merge the two lists */
-       list_node *list = NULL;
-       list_node **pos = &list;
-       while (first && second) {
-               if (func (first->data, second->data) > 0) {
-                       *pos = second;
-                       second = second->next;
-               } else {
-                       *pos = first;
-                       first = first->next;
-               }
-               pos = &((*pos)->next);
-       }
-       *pos = first ? first : second;
-       return list;
-}
-
-/* Pre-condition: upto <= si->n_ranks, list == NULL || length(list) == 1 */
-static inline list_node *
-sweep_up (struct sort_info *si, list_node *list, int upto)
-{
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
-       /*
-        * GCC incorrectly thinks we're writing below si->ranks array bounds.
-        */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warray-bounds"
-#endif
-
-       int i;
-       for (i = si->min_rank; i < upto; ++i) {
-               list = merge_lists (si->ranks [i], list, si->func);
-               si->ranks [i] = NULL;
-       }
-       return list;
-
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
-#pragma GCC diagnostic pop
-#endif
-}
-
-/*
- * The 'ranks' array essentially captures the recursion stack of a mergesort.
- * The merge tree is built in a bottom-up manner.  The control loop for
- * updating the 'ranks' array is analogous to incrementing a binary integer,
- * and the O(n) time for counting upto n translates to O(n) merges when
- * inserting rank-0 lists.  When we plug in the sizes of the lists involved in
- * those merges, we get the O(n log n) time for the sort.
- *
- * Inserting higher-ranked lists reduce the height of the merge tree, and also
- * eliminate a lot of redundant comparisons when merging two lists that would've
- * been part of the same run.  Adding a rank-i list is analogous to incrementing
- * a binary integer by 2**i in one operation, thus sharing a similar speedup.
- *
- * When inserting higher-ranked lists, we choose to clear out the lower ranks
- * in the interests of keeping the sort stable, but this makes analysis harder.
- * Note that clearing the lower-ranked lists is O(length(list))-- thus it
- * shouldn't affect the O(n log n) behaviour.  IOW, inserting one rank-i list
- * is equivalent to inserting 2**i rank-0 lists, thus even if we do i additional
- * merges in the clearing-out (taking at most 2**i time) we are still fine.
- */
-
-#define stringify2(x) #x
-#define stringify(x) stringify2(x)
-
-/* Pre-condition: 2**(rank+1) <= length(list) < 2**(rank+2) (therefore: length(list) >= 2) */
-static inline void
-insert_list (struct sort_info *si, list_node* list, int rank)
-{
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
-       /*
-        * GCC incorrectly thinks we're writing below si->ranks array bounds.
-        */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warray-bounds"
-#endif
-
-       int i;
-
-       if (rank > si->n_ranks) {
-               if (rank > MAX_RANKS) {
-                       g_warning ("Rank '%d' should not exceed " stringify (MAX_RANKS), rank);
-                       rank = MAX_RANKS;
-               }
-               list = merge_lists (sweep_up (si, NULL, si->n_ranks), list, si->func);
-               for (i = si->n_ranks; i < rank; ++i)
-                       si->ranks [i] = NULL;
-       } else {
-               if (rank)
-                       list = merge_lists (sweep_up (si, NULL, rank), list, si->func);
-               for (i = rank; i < si->n_ranks && si->ranks [i]; ++i) {
-                       list = merge_lists (si->ranks [i], list, si->func);
-                       si->ranks [i] = NULL;
-               }
-       }
-
-       if (i == MAX_RANKS) /* Will _never_ happen: so we can just devolve into quadratic ;-) */
-               --i;
-       if (i >= si->n_ranks)
-               si->n_ranks = i + 1;
-       si->min_rank = i;
-       si->ranks [i] = list;
-
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
-#pragma GCC diagnostic pop
-#endif
-}
-
-#undef stringify2
-#undef stringify
-#undef MAX_RANKS
-#undef FLOOR_LOG2
-
-/* A non-recursive mergesort */
-static inline digit
-do_sort (list_node* list, GCompareFunc func)
-{
-       struct sort_info si;
-
-       init_sort_info (&si, func);
-
-       while (list && list->next) {
-               list_node* next = list->next;
-               list_node* tail = next->next;
-
-               if (func (list->data, next->data) > 0) {
-                       next->next = list;
-                       next = list;
-                       list = list->next;
-               }
-               next->next = NULL;
-
-               insert_list (&si, list, 0);
-
-               list = tail;
-       }
-
-       return sweep_up (&si, list, si.n_ranks);
-}
diff --git a/eglib/src/unicode-data.h b/eglib/src/unicode-data.h
deleted file mode 100644 (file)
index 1cd75f3..0000000
+++ /dev/null
@@ -1,2152 +0,0 @@
-/*
-This file is automatically generated by ucd.exe.
-The source for this generator should be in Mono repository
-(mcs/class/corlib/Mono.Globalization.Unicode directory).
-*/
-
-#ifndef __UNICODE_DATA_H
-#define __UNICODE_DATA_H
-
-#include <glib.h>
-
-
-/* ======== Structures ======== */
-typedef struct {
-       guint32 codepoint;
-       guint32 upper;
-       guint32 title;
-} SimpleTitlecaseMapping;
-typedef struct {
-       guint32 start;
-       guint32 end;
-} CodePointRange;
-typedef struct {
-       guint32 upper;
-       guint32 lower;
-} SimpleCaseMapping;
-
-/* ======== Unicode Categories ======== */
-static const guint8 unicode_category_ranges_count = 11;
-static const CodePointRange unicode_category_ranges [] = {
-{0x000000, 0x003400},
-{0x004DC0, 0x004E00},
-{0x00A000, 0x00AA80},
-{0x00F900, 0x010000},
-{0x010000, 0x0104C0},
-{0x010800, 0x010A80},
-{0x012000, 0x012480},
-{0x01D000, 0x01D800},
-{0x01F000, 0x01F0C0},
-{0x02F800, 0x02FA40},
-{0x0E0000, 0x0E0200},
-{0, 0}};
-static const guint8 unicode_category_table0 [] = {
-       /* ==== 0-3400 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       29,21,21,21,23,21,21,21,22,18,21,25,21,17,21,21,
-       13,13,13,13,13,13,13,13,13,13,21,21,25,25,25,21,
-       21,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,22,21,18,24,16,
-       24,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,22,25,18,25,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       29,21,23,23,23,23,26,26,24,26,5,20,25,1,26,24,
-       26,25,15,15,24,5,26,21,24,15,5,19,15,15,15,21,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,25,9,9,9,9,9,9,9,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,25,5,5,5,5,5,5,5,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,5,9,5,9,5,9,5,9,
-       5,9,5,9,5,9,5,9,5,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,9,5,9,5,9,5,5,
-       5,9,9,5,9,5,9,9,5,9,9,9,5,5,9,9,
-       9,9,5,9,9,5,9,9,9,5,5,5,9,9,5,9,
-       9,5,9,5,9,5,9,9,5,9,5,5,9,5,9,9,
-       5,9,9,9,5,9,5,9,9,5,5,7,9,5,5,5,
-       7,7,7,7,9,8,5,9,8,5,9,8,5,9,5,9,
-       5,9,5,9,5,9,5,9,5,9,5,9,5,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       5,9,8,5,9,5,9,9,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,5,5,5,5,5,5,9,9,5,9,9,5,
-       5,9,5,9,9,9,9,5,9,5,9,5,9,5,9,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,7,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-       6,6,24,24,24,24,6,6,6,6,6,6,6,6,6,6,
-       6,6,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
-       6,6,6,6,6,24,24,24,24,24,24,24,6,24,6,24,
-       24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       9,5,9,5,6,24,9,5,0,0,6,5,5,5,21,0,
-       0,0,0,0,24,24,9,21,9,9,9,0,9,0,9,9,
-       5,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,0,9,9,9,9,9,9,9,9,9,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,9,
-       5,5,9,9,9,5,5,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       5,5,5,5,9,5,25,9,5,9,9,5,5,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,26,12,12,12,12,12,11,11,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,9,5,9,5,9,5,9,5,9,5,9,5,9,5,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,0,0,6,21,21,21,21,21,21,
-       0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,0,21,17,0,0,0,0,0,
-       0,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,17,12,
-       21,12,12,21,12,12,21,12,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,
-       7,7,7,21,21,0,0,0,0,0,0,0,0,0,0,0,
-       1,1,1,1,0,0,25,25,25,21,21,23,21,21,26,26,
-       12,12,12,12,12,12,12,12,12,12,12,21,0,0,21,21,
-       0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       6,7,7,7,7,7,7,7,7,7,7,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,0,
-       13,13,13,13,13,13,13,13,13,13,21,21,21,21,7,7,
-       12,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,21,7,12,12,12,12,12,12,12,1,11,12,
-       12,12,12,12,12,6,6,12,12,26,12,12,12,12,7,7,
-       13,13,13,13,13,13,13,13,13,13,7,7,7,26,26,7,
-       21,21,21,21,21,21,21,21,21,21,21,21,21,21,0,1,
-       7,12,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,0,0,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,12,12,12,12,12,12,12,12,12,12,
-       12,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       13,13,13,13,13,13,13,13,13,13,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,12,12,12,12,12,
-       12,12,12,12,6,6,26,21,21,21,6,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,12,12,10,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,0,0,12,7,10,10,
-       10,12,12,12,12,12,12,12,12,10,10,10,10,12,0,0,
-       7,12,12,12,12,0,0,0,7,7,7,7,7,7,7,7,
-       7,7,12,12,21,21,13,13,13,13,13,13,13,13,13,13,
-       21,6,7,0,0,0,0,0,0,0,0,7,7,7,7,7,
-       0,12,10,10,0,7,7,7,7,7,7,7,7,0,0,7,
-       7,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
-       7,0,7,0,0,0,7,7,7,7,0,0,12,7,10,10,
-       10,12,12,12,12,0,0,10,10,0,0,10,10,12,7,0,
-       0,0,0,0,0,0,0,10,0,0,0,0,7,7,0,7,
-       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
-       7,7,23,23,15,15,15,15,15,15,26,0,0,0,0,0,
-       0,12,12,10,0,7,7,7,7,7,7,0,0,0,0,7,
-       7,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
-       7,0,7,7,0,7,7,0,7,7,0,0,12,0,10,10,
-       10,12,12,0,0,0,0,12,12,0,0,12,12,12,0,0,
-       0,12,0,0,0,0,0,0,0,7,7,7,7,0,7,0,
-       0,0,0,0,0,0,13,13,13,13,13,13,13,13,13,13,
-       12,12,7,7,7,12,0,0,0,0,0,0,0,0,0,0,
-       0,12,12,10,0,7,7,7,7,7,7,7,7,7,0,7,
-       7,7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
-       7,0,7,7,0,7,7,7,7,7,0,0,12,7,10,10,
-       10,12,12,12,12,12,0,12,12,10,0,10,10,12,0,0,
-       7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
-       0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,12,10,10,0,7,7,7,7,7,7,7,7,0,0,7,
-       7,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
-       7,0,7,7,0,7,7,7,7,7,0,0,12,7,10,12,
-       10,12,12,12,12,0,0,10,10,0,0,10,10,12,0,0,
-       0,0,0,0,0,0,12,10,0,0,0,0,7,7,0,7,
-       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
-       26,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,12,7,0,7,7,7,7,7,7,0,0,0,7,7,
-       7,0,7,7,7,7,0,0,0,7,7,0,7,0,7,7,
-       0,0,0,7,7,0,0,0,7,7,7,0,0,0,7,7,
-       7,7,7,7,7,7,7,7,7,7,0,0,0,0,10,10,
-       12,10,10,0,0,0,10,10,10,0,10,10,10,12,0,0,
-       7,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,13,13,13,13,13,13,13,13,13,13,
-       15,15,15,26,26,26,26,26,26,23,26,0,0,0,0,0,
-       0,10,10,10,0,7,7,7,7,7,7,7,7,0,7,7,
-       7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
-       7,7,7,7,0,7,7,7,7,7,0,0,0,7,12,12,
-       12,10,10,10,10,0,12,12,12,0,12,12,12,12,0,0,
-       0,0,0,0,0,12,12,0,7,7,0,0,0,0,0,0,
-       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
-       0,0,0,0,0,0,0,0,15,15,15,15,15,15,15,26,
-       0,0,10,10,0,7,7,7,7,7,7,7,7,0,7,7,
-       7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
-       7,7,7,7,0,7,7,7,7,7,0,0,12,7,10,12,
-       10,10,10,10,10,0,12,10,10,0,10,10,12,12,0,0,
-       0,0,0,0,0,10,10,0,0,0,0,0,0,0,7,0,
-       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
-       0,26,26,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,10,10,0,7,7,7,7,7,7,7,7,0,7,7,
-       7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,0,0,0,7,10,10,
-       10,12,12,12,12,0,10,10,10,0,10,10,10,12,0,0,
-       0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,
-       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
-       15,15,15,15,15,15,0,0,0,26,7,7,7,7,7,7,
-       0,0,10,10,0,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,0,0,0,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,0,7,7,7,7,7,7,7,7,7,0,7,0,0,
-       7,7,7,7,7,7,7,0,0,0,12,0,0,0,0,10,
-       10,10,12,12,12,0,12,0,10,10,10,10,10,10,10,10,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,10,10,21,0,0,0,0,0,0,0,0,0,0,0,
-       0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,12,7,7,12,12,12,12,12,12,12,0,0,0,0,23,
-       7,7,7,7,7,7,6,12,12,12,12,12,12,12,12,21,
-       13,13,13,13,13,13,13,13,13,13,21,21,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,7,7,0,7,0,0,7,7,0,7,0,0,7,0,0,
-       0,0,0,0,7,7,7,7,0,7,7,7,7,7,7,7,
-       0,7,7,7,0,7,0,7,0,0,7,7,0,7,7,7,
-       7,12,7,7,12,12,12,12,12,12,0,12,12,7,0,0,
-       7,7,7,7,7,0,6,0,12,12,12,12,12,12,0,0,
-       13,13,13,13,13,13,13,13,13,13,0,0,7,7,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,26,26,26,21,21,21,21,21,21,21,21,21,21,21,21,
-       21,21,21,26,26,26,26,26,12,12,26,26,26,26,26,26,
-       13,13,13,13,13,13,13,13,13,13,15,15,15,15,15,15,
-       15,15,15,15,26,12,26,12,26,12,22,18,22,18,10,10,
-       7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,
-       0,12,12,12,12,12,12,12,12,12,12,12,12,12,12,10,
-       12,12,12,12,12,21,12,12,7,7,7,7,0,0,0,0,
-       12,12,12,12,12,12,12,12,0,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,0,26,26,
-       26,26,26,26,26,26,12,26,26,26,26,26,26,0,26,26,
-       21,21,21,21,21,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,10,10,12,12,12,
-       12,10,12,12,12,12,12,12,10,12,12,10,10,12,12,7,
-       13,13,13,13,13,13,13,13,13,13,21,21,21,21,21,21,
-       7,7,7,7,7,7,10,10,12,12,7,7,7,7,12,12,
-       12,7,10,10,10,7,7,10,10,10,10,10,10,10,7,7,
-       7,12,12,12,12,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,12,10,10,12,12,10,10,10,10,10,10,12,7,10,
-       13,13,13,13,13,13,13,13,13,13,0,0,0,0,26,26,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,21,6,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,0,0,0,0,0,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,0,7,7,7,7,0,0,
-       7,7,7,7,7,7,7,0,7,0,7,7,7,7,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,0,7,7,7,7,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,0,7,7,7,7,0,0,7,7,7,7,7,7,7,0,
-       7,0,7,7,7,7,0,0,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,0,7,7,7,7,0,0,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,12,
-       26,21,21,21,21,21,21,21,21,15,15,15,15,15,15,15,
-       15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       26,26,26,26,26,26,26,26,26,26,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,
-       0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,21,21,7,
-       7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,
-       29,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,22,18,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,21,21,21,14,14,
-       14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,0,7,7,
-       7,7,12,12,12,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,12,12,12,21,21,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,12,12,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,0,7,7,
-       7,0,12,12,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,1,1,10,12,12,12,12,12,12,12,10,10,
-       10,10,10,10,10,10,12,10,10,12,12,12,12,12,12,12,
-       12,12,12,12,21,21,21,6,21,21,21,23,7,12,0,0,
-       13,13,13,13,13,13,13,13,13,13,0,0,0,0,0,0,
-       15,15,15,15,15,15,15,15,15,15,0,0,0,0,0,0,
-       21,21,21,21,21,21,17,21,21,21,21,12,12,12,29,0,
-       13,13,13,13,13,13,13,13,13,13,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,6,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,12,7,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,
-       12,12,12,10,10,10,10,12,12,10,10,10,0,0,0,0,
-       10,10,12,10,10,10,10,10,10,12,12,12,0,0,0,0,
-       26,0,0,0,21,21,13,13,13,13,13,13,13,13,13,13,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
-       7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,
-       10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
-       10,7,7,7,7,7,7,7,10,10,0,0,0,0,0,0,
-       13,13,13,13,13,13,13,13,13,13,0,0,0,0,21,21,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,12,12,10,10,10,0,0,21,21,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       12,12,12,12,10,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,12,10,12,12,12,12,12,10,12,10,10,10,
-       10,10,12,10,10,7,7,7,7,7,7,7,0,0,0,0,
-       13,13,13,13,13,13,13,13,13,13,21,21,21,21,21,21,
-       21,26,26,26,26,26,26,26,26,26,26,12,12,12,12,12,
-       12,12,12,12,26,26,26,26,26,26,26,26,26,0,0,0,
-       12,12,10,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,10,12,12,12,12,10,10,12,12,10,0,0,0,7,7,
-       13,13,13,13,13,13,13,13,13,13,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,10,10,10,10,10,10,10,10,12,12,12,12,
-       12,12,12,12,10,10,12,12,0,0,0,21,21,21,21,21,
-       13,13,13,13,13,13,13,13,13,13,0,0,0,7,7,7,
-       13,13,13,13,13,13,13,13,13,13,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,6,6,6,6,6,6,21,21,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,
-       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-       6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,6,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,
-       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,12,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,5,5,5,5,5,5,5,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
-       5,5,5,5,5,5,0,0,9,9,9,9,9,9,0,0,
-       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
-       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
-       5,5,5,5,5,5,0,0,9,9,9,9,9,9,0,0,
-       5,5,5,5,5,5,5,5,0,9,0,9,0,9,0,9,
-       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,
-       5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8,
-       5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8,
-       5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8,
-       5,5,5,5,5,0,5,5,9,9,9,9,8,24,5,24,
-       24,24,5,5,5,0,5,5,9,9,9,9,8,24,24,24,
-       5,5,5,5,0,0,5,5,9,9,9,9,0,24,24,24,
-       5,5,5,5,5,5,5,5,9,9,9,9,9,24,24,24,
-       0,0,5,5,5,0,5,5,9,9,9,9,8,24,24,0,
-       29,29,29,29,29,29,29,29,29,29,29,1,1,1,1,1,
-       17,17,17,17,17,17,21,21,20,19,22,20,20,19,22,20,
-       21,21,21,21,21,21,21,21,27,28,1,1,1,1,1,29,
-       21,21,21,21,21,21,21,21,21,20,19,21,21,21,21,16,
-       16,21,21,21,25,22,18,21,21,21,21,21,21,21,21,21,
-       21,21,25,21,16,21,21,21,21,21,21,21,21,21,21,29,
-       1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
-       15,5,0,0,15,15,15,15,15,15,25,25,25,22,18,5,
-       15,15,15,15,15,15,15,15,15,15,25,25,25,22,18,0,
-       6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,
-       23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
-       23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,11,
-       11,12,11,11,11,12,12,12,12,12,12,12,12,12,12,12,
-       12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       26,26,9,26,26,26,26,9,26,26,5,9,9,9,5,5,
-       9,9,9,5,26,9,26,26,26,9,9,9,9,9,26,26,
-       26,26,26,26,9,26,9,26,9,26,9,9,9,9,26,5,
-       9,9,9,9,5,7,7,7,7,5,26,26,5,5,9,9,
-       25,25,25,25,25,9,5,5,5,5,26,25,26,26,5,26,
-       0,0,0,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,9,5,14,14,14,14,0,0,0,0,0,0,0,
-       25,25,25,25,25,26,26,26,26,26,25,25,26,26,26,26,
-       25,26,26,25,26,26,25,26,26,26,26,26,26,26,25,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,25,25,
-       26,26,25,26,25,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       26,26,26,26,26,26,26,26,25,25,25,25,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       25,25,26,26,26,26,26,26,26,22,18,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,25,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,25,25,25,25,
-       25,25,26,26,26,26,26,26,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       15,15,15,15,15,15,15,15,15,15,15,15,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,15,15,15,15,15,15,
-       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,25,26,26,26,26,26,26,26,26,
-       26,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,25,25,25,25,25,25,25,25,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,25,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,
-       26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,26,26,26,26,0,26,26,26,26,0,0,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,0,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,0,26,0,26,
-       26,26,26,0,0,0,26,0,26,26,26,26,26,26,26,0,
-       0,26,26,26,26,26,26,26,22,18,22,18,22,18,22,18,
-       22,18,22,18,22,18,15,15,15,15,15,15,15,15,15,15,
-       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       15,15,15,15,26,0,0,0,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       0,26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,
-       25,25,25,25,25,22,18,25,25,25,25,0,25,0,0,0,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,22,18,22,18,22,18,22,18,22,18,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,22,18,22,18,22,18,22,18,22,18,22,18,22,
-       18,22,18,22,18,22,18,22,18,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,22,18,22,18,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,22,18,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
-       25,25,25,25,25,26,26,25,25,25,25,25,25,0,0,0,
-       26,26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,
-       9,5,9,9,9,5,5,9,5,9,5,9,5,9,9,9,
-       0,5,9,5,5,9,5,5,5,5,5,5,5,6,0,0,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,5,26,26,26,26,26,26,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,21,21,21,21,15,21,21,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,6,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,0,
-       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,0,
-       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,0,
-       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,0,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       21,21,20,19,20,19,21,21,21,20,19,21,20,19,21,21,
-       21,21,21,21,21,21,21,17,21,21,17,21,20,19,21,21,
-       20,19,22,18,22,18,22,18,22,18,21,21,21,21,21,6,
-       21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,0,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,0,
-       29,21,21,21,26,6,7,14,22,18,22,18,22,18,22,18,
-       22,18,26,26,22,18,22,18,22,18,22,18,17,22,18,18,
-       26,14,14,14,14,14,14,14,14,14,12,12,12,12,12,12,
-       17,6,6,6,6,6,26,26,14,14,14,6,7,21,26,26,
-       0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,0,0,12,12,24,24,6,6,7,
-       17,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,21,6,6,6,7,
-       0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
-       0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,
-       26,26,15,15,15,15,26,26,26,26,26,26,26,26,26,26,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,
-       15,15,15,15,15,15,15,15,15,15,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,0,
-       26,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       15,15,15,15,15,15,15,15,15,15,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       0};
-static const guint8 unicode_category_table1 [] = {
-       /* ==== 4DC0-4E00 ==== */
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       0};
-static const guint8 unicode_category_table2 [] = {
-       /* ==== A000-AA80 ==== */
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,6,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,6,21,21,21,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       13,13,13,13,13,13,13,13,13,13,7,7,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       0,0,9,5,9,5,9,5,9,5,9,5,9,5,7,12,
-       11,11,11,21,0,0,0,0,0,0,0,0,12,12,21,6,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
-       24,24,24,24,24,24,24,6,6,6,6,6,6,6,6,6,
-       24,24,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       5,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
-       6,5,5,5,5,5,5,5,5,9,5,9,5,9,9,5,
-       9,5,9,5,9,5,9,5,6,24,24,9,5,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,
-       7,7,12,7,7,7,12,7,7,7,7,12,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,10,10,12,12,10,26,26,26,26,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,21,21,21,21,0,0,0,0,0,0,0,0,
-       10,10,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,10,10,10,10,10,10,10,10,10,10,10,10,
-       10,10,10,10,12,0,0,0,0,0,0,0,0,0,21,21,
-       13,13,13,13,13,13,13,13,13,13,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       13,13,13,13,13,13,13,13,13,13,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,12,12,12,12,12,12,12,12,21,21,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,12,12,12,12,12,12,12,12,12,
-       12,12,10,10,0,0,0,0,0,0,0,0,0,0,0,21,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,12,12,12,12,12,12,10,
-       10,12,12,10,10,12,12,0,0,0,0,0,0,0,0,0,
-       7,7,7,12,7,7,7,7,7,7,7,7,12,10,0,0,
-       13,13,13,13,13,13,13,13,13,13,0,0,21,21,21,21,
-       0};
-static const guint8 unicode_category_table3 [] = {
-       /* ==== F900-10000 ==== */
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,
-       0,0,0,5,5,5,5,5,0,0,0,0,0,7,12,7,
-       7,7,7,7,7,7,7,7,7,25,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,0,7,7,7,7,7,0,7,0,
-       7,7,0,7,7,0,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,22,18,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,23,26,0,0,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       21,21,21,21,21,21,21,22,18,21,0,0,0,0,0,0,
-       12,12,12,12,12,12,12,0,0,0,0,0,0,0,0,0,
-       21,17,17,16,16,22,18,22,18,22,18,22,18,22,18,22,
-       18,22,18,22,18,21,21,22,18,21,21,21,21,16,16,16,
-       21,21,21,0,21,21,21,21,17,22,18,22,18,22,18,21,
-       21,21,25,17,25,25,25,0,21,23,21,21,0,0,0,0,
-       7,7,7,7,7,0,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,1,
-       0,21,21,21,23,21,21,21,22,18,21,25,21,17,21,21,
-       13,13,13,13,13,13,13,13,13,13,21,21,25,25,25,21,
-       21,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,22,21,18,24,16,
-       24,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,22,25,18,25,22,
-       18,21,22,18,21,21,7,7,7,7,7,7,7,7,7,7,
-       6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,
-       0,0,7,7,7,7,7,7,0,0,7,7,7,7,7,7,
-       0,0,7,7,7,7,7,7,0,0,7,7,7,0,0,0,
-       23,23,25,24,26,23,23,0,26,25,25,25,25,26,26,0,
-       0,0,0,0,0,0,0,0,0,1,1,1,26,26,0};
-static const guint8 unicode_category_table4 [] = {
-       /* ==== 10000-104C0 ==== */
-       7,7,7,7,7,7,7,7,7,7,7,7,0,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,0,7,7,0,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,
-       21,21,26,0,0,0,0,15,15,15,15,15,15,15,15,15,
-       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       15,15,15,15,0,0,0,26,26,26,26,26,26,26,26,26,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,14,14,15,15,15,15,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,15,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,12,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,
-       15,15,15,15,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,14,7,7,7,7,7,7,7,7,14,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,21,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,0,0,0,0,7,7,7,7,7,7,7,7,
-       21,14,14,14,14,14,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
-       13,13,13,13,13,13,13,13,13,13,0};
-static const guint8 unicode_category_table5 [] = {
-       /* ==== 10800-10A80 ==== */
-       7,7,7,7,7,7,0,0,7,0,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,0,7,7,0,0,0,7,0,0,7,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,15,15,15,15,0,0,0,0,0,21,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,21,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       7,12,12,12,0,12,12,0,0,0,0,0,12,12,12,12,
-       7,7,7,7,0,7,7,7,0,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,0,0,0,0,12,12,12,0,0,0,0,12,
-       15,15,15,15,15,15,15,15,0,0,0,0,0,0,0,0,
-       21,21,21,21,21,21,21,21,21,0};
-static const guint8 unicode_category_table6 [] = {
-       /* ==== 12000-12480 ==== */
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
-       14,14,14,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       21,21,21,21,0};
-static const guint8 unicode_category_table7 [] = {
-       /* ==== 1D000-1D800 ==== */
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,0,0,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,10,10,12,12,12,26,26,26,10,10,10,
-       10,10,10,1,1,1,1,1,1,1,1,12,12,12,12,12,
-       12,12,12,26,26,12,12,12,12,12,12,12,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,12,12,12,12,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,12,12,12,26,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,
-       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-       15,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,5,
-       5,5,5,5,5,0,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,9,0,9,9,
-       0,0,9,0,0,9,9,0,0,9,9,9,9,0,9,9,
-       9,9,9,9,9,9,5,5,5,5,0,5,0,5,5,5,
-       5,5,5,5,0,5,5,5,5,5,5,5,5,5,5,5,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,9,9,0,9,9,9,9,0,0,9,9,9,
-       9,9,9,9,9,0,9,9,9,9,9,9,9,0,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,9,9,0,9,9,9,9,0,
-       9,9,9,9,9,0,9,0,0,0,9,9,9,9,9,9,
-       9,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,0,0,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,25,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,25,5,5,5,5,
-       5,5,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,25,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,25,5,5,5,5,5,5,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,25,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,25,
-       5,5,5,5,5,5,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,25,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,25,5,5,5,5,5,5,
-       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-       9,9,9,9,9,9,9,9,9,25,5,5,5,5,5,5,
-       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-       5,5,5,25,5,5,5,5,5,5,9,5,0,0,13,13,
-       13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
-       13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
-       13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
-       0};
-static const guint8 unicode_category_table8 [] = {
-       /* ==== 1F000-1F0C0 ==== */
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,0,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
-       26,26,26,26,0};
-static const guint8 unicode_category_table9 [] = {
-       /* ==== 2F800-2FA40 ==== */
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0};
-static const guint8 unicode_category_table10 [] = {
-       /* ==== E0000-E0200 ==== */
-       0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
-       0};
-static const guint8 *unicode_category [11]  = {
-       unicode_category_table0,
-       unicode_category_table1,
-       unicode_category_table2,
-       unicode_category_table3,
-       unicode_category_table4,
-       unicode_category_table5,
-       unicode_category_table6,
-       unicode_category_table7,
-       unicode_category_table8,
-       unicode_category_table9,
-       unicode_category_table10
-};
-
-static const guint8 simple_case_map_ranges_count = 9;
-static const CodePointRange simple_case_map_ranges [] = {
-{0x000040, 0x000600},
-{0x001000, 0x0010D0},
-{0x001D00, 0x002000},
-{0x002100, 0x0021C0},
-{0x002480, 0x002500},
-{0x002C00, 0x002D80},
-{0x00A640, 0x00A7C0},
-{0x00FF20, 0x00FF80},
-{0x010400, 0x010480},
-{0, 0}};
-static const guint16 simple_upper_case_mapping_lowarea_table0 [] = {
-       /* ==== 40-600 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
-       0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0x39C,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
-       0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x178,
-       0,0x100,0,0x102,0,0x104,0,0x106,0,0x108,0,0x10A,0,0x10C,0,0x10E,
-       0,0x110,0,0x112,0,0x114,0,0x116,0,0x118,0,0x11A,0,0x11C,0,0x11E,
-       0,0x120,0,0x122,0,0x124,0,0x126,0,0x128,0,0x12A,0,0x12C,0,0x12E,
-       0,0x49,0,0x132,0,0x134,0,0x136,0,0,0x139,0,0x13B,0,0x13D,0,
-       0x13F,0,0x141,0,0x143,0,0x145,0,0x147,0,0,0x14A,0,0x14C,0,0x14E,
-       0,0x150,0,0x152,0,0x154,0,0x156,0,0x158,0,0x15A,0,0x15C,0,0x15E,
-       0,0x160,0,0x162,0,0x164,0,0x166,0,0x168,0,0x16A,0,0x16C,0,0x16E,
-       0,0x170,0,0x172,0,0x174,0,0x176,0,0,0x179,0,0x17B,0,0x17D,0x53,
-       0x243,0,0,0x182,0,0x184,0,0,0x187,0,0,0,0x18B,0,0,0,
-       0,0,0x191,0,0,0x1F6,0,0,0,0x198,0x23D,0,0,0,0x220,0,
-       0,0x1A0,0,0x1A2,0,0x1A4,0,0,0x1A7,0,0,0,0,0x1AC,0,0,
-       0x1AF,0,0,0,0x1B3,0,0x1B5,0,0,0x1B8,0,0,0,0x1BC,0,0x1F7,
-       0,0,0,0,0,0x1C4,0x1C4,0,0x1C7,0x1C7,0,0x1CA,0x1CA,0,0x1CD,0,
-       0x1CF,0,0x1D1,0,0x1D3,0,0x1D5,0,0x1D7,0,0x1D9,0,0x1DB,0x18E,0,0x1DE,
-       0,0x1E0,0,0x1E2,0,0x1E4,0,0x1E6,0,0x1E8,0,0x1EA,0,0x1EC,0,0x1EE,
-       0,0,0x1F1,0x1F1,0,0x1F4,0,0,0,0x1F8,0,0x1FA,0,0x1FC,0,0x1FE,
-       0,0x200,0,0x202,0,0x204,0,0x206,0,0x208,0,0x20A,0,0x20C,0,0x20E,
-       0,0x210,0,0x212,0,0x214,0,0x216,0,0x218,0,0x21A,0,0x21C,0,0x21E,
-       0,0,0,0x222,0,0x224,0,0x226,0,0x228,0,0x22A,0,0x22C,0,0x22E,
-       0,0x230,0,0x232,0,0,0,0,0,0,0,0,0x23B,0,0,0,
-       0,0,0x241,0,0,0,0,0x246,0,0x248,0,0x24A,0,0x24C,0,0x24E,
-       0x2C6F,0x2C6D,0,0x181,0x186,0,0x189,0x18A,0,0x18F,0,0x190,0,0,0,0,
-       0x193,0,0,0x194,0,0,0,0,0x197,0x196,0,0x2C62,0,0,0,0x19C,
-       0,0x2C6E,0x19D,0,0,0x19F,0,0,0,0,0,0,0,0x2C64,0,0,
-       0x1A6,0,0,0x1A9,0,0,0,0,0x1AE,0x244,0x1B1,0x1B2,0x245,0,0,0,
-       0,0,0x1B7,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0x399,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0x370,0,0x372,0,0,0,0x376,0,0,0,0x3FD,0x3FE,0x3FF,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0x386,0x388,0x389,0x38A,
-       0,0x391,0x392,0x393,0x394,0x395,0x396,0x397,0x398,0x399,0x39A,0x39B,0x39C,0x39D,0x39E,0x39F,
-       0x3A0,0x3A1,0x3A3,0x3A3,0x3A4,0x3A5,0x3A6,0x3A7,0x3A8,0x3A9,0x3AA,0x3AB,0x38C,0x38E,0x38F,0,
-       0x392,0x398,0,0,0,0x3A6,0x3A0,0x3CF,0,0x3D8,0,0x3DA,0,0x3DC,0,0x3DE,
-       0,0x3E0,0,0x3E2,0,0x3E4,0,0x3E6,0,0x3E8,0,0x3EA,0,0x3EC,0,0x3EE,
-       0x39A,0x3A1,0x3F9,0,0,0x395,0,0,0x3F7,0,0,0x3FA,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x410,0x411,0x412,0x413,0x414,0x415,0x416,0x417,0x418,0x419,0x41A,0x41B,0x41C,0x41D,0x41E,0x41F,
-       0x420,0x421,0x422,0x423,0x424,0x425,0x426,0x427,0x428,0x429,0x42A,0x42B,0x42C,0x42D,0x42E,0x42F,
-       0x400,0x401,0x402,0x403,0x404,0x405,0x406,0x407,0x408,0x409,0x40A,0x40B,0x40C,0x40D,0x40E,0x40F,
-       0,0x460,0,0x462,0,0x464,0,0x466,0,0x468,0,0x46A,0,0x46C,0,0x46E,
-       0,0x470,0,0x472,0,0x474,0,0x476,0,0x478,0,0x47A,0,0x47C,0,0x47E,
-       0,0x480,0,0,0,0,0,0,0,0,0,0x48A,0,0x48C,0,0x48E,
-       0,0x490,0,0x492,0,0x494,0,0x496,0,0x498,0,0x49A,0,0x49C,0,0x49E,
-       0,0x4A0,0,0x4A2,0,0x4A4,0,0x4A6,0,0x4A8,0,0x4AA,0,0x4AC,0,0x4AE,
-       0,0x4B0,0,0x4B2,0,0x4B4,0,0x4B6,0,0x4B8,0,0x4BA,0,0x4BC,0,0x4BE,
-       0,0,0x4C1,0,0x4C3,0,0x4C5,0,0x4C7,0,0x4C9,0,0x4CB,0,0x4CD,0x4C0,
-       0,0x4D0,0,0x4D2,0,0x4D4,0,0x4D6,0,0x4D8,0,0x4DA,0,0x4DC,0,0x4DE,
-       0,0x4E0,0,0x4E2,0,0x4E4,0,0x4E6,0,0x4E8,0,0x4EA,0,0x4EC,0,0x4EE,
-       0,0x4F0,0,0x4F2,0,0x4F4,0,0x4F6,0,0x4F8,0,0x4FA,0,0x4FC,0,0x4FE,
-       0,0x500,0,0x502,0,0x504,0,0x506,0,0x508,0,0x50A,0,0x50C,0,0x50E,
-       0,0x510,0,0x512,0,0x514,0,0x516,0,0x518,0,0x51A,0,0x51C,0,0x51E,
-       0,0x520,0,0x522,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0x531,0x532,0x533,0x534,0x535,0x536,0x537,0x538,0x539,0x53A,0x53B,0x53C,0x53D,0x53E,0x53F,
-       0x540,0x541,0x542,0x543,0x544,0x545,0x546,0x547,0x548,0x549,0x54A,0x54B,0x54C,0x54D,0x54E,0x54F,
-       0x550,0x551,0x552,0x553,0x554,0x555,0x556,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0};
-static const guint16 simple_upper_case_mapping_lowarea_table1 [] = {
-       /* ==== 1000-10D0 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0};
-static const guint16 simple_upper_case_mapping_lowarea_table2 [] = {
-       /* ==== 1D00-2000 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0xA77D,0,0,0,0x2C63,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0x1E00,0,0x1E02,0,0x1E04,0,0x1E06,0,0x1E08,0,0x1E0A,0,0x1E0C,0,0x1E0E,
-       0,0x1E10,0,0x1E12,0,0x1E14,0,0x1E16,0,0x1E18,0,0x1E1A,0,0x1E1C,0,0x1E1E,
-       0,0x1E20,0,0x1E22,0,0x1E24,0,0x1E26,0,0x1E28,0,0x1E2A,0,0x1E2C,0,0x1E2E,
-       0,0x1E30,0,0x1E32,0,0x1E34,0,0x1E36,0,0x1E38,0,0x1E3A,0,0x1E3C,0,0x1E3E,
-       0,0x1E40,0,0x1E42,0,0x1E44,0,0x1E46,0,0x1E48,0,0x1E4A,0,0x1E4C,0,0x1E4E,
-       0,0x1E50,0,0x1E52,0,0x1E54,0,0x1E56,0,0x1E58,0,0x1E5A,0,0x1E5C,0,0x1E5E,
-       0,0x1E60,0,0x1E62,0,0x1E64,0,0x1E66,0,0x1E68,0,0x1E6A,0,0x1E6C,0,0x1E6E,
-       0,0x1E70,0,0x1E72,0,0x1E74,0,0x1E76,0,0x1E78,0,0x1E7A,0,0x1E7C,0,0x1E7E,
-       0,0x1E80,0,0x1E82,0,0x1E84,0,0x1E86,0,0x1E88,0,0x1E8A,0,0x1E8C,0,0x1E8E,
-       0,0x1E90,0,0x1E92,0,0x1E94,0,0,0,0,0,0x1E60,0,0,0,0,
-       0,0x1EA0,0,0x1EA2,0,0x1EA4,0,0x1EA6,0,0x1EA8,0,0x1EAA,0,0x1EAC,0,0x1EAE,
-       0,0x1EB0,0,0x1EB2,0,0x1EB4,0,0x1EB6,0,0x1EB8,0,0x1EBA,0,0x1EBC,0,0x1EBE,
-       0,0x1EC0,0,0x1EC2,0,0x1EC4,0,0x1EC6,0,0x1EC8,0,0x1ECA,0,0x1ECC,0,0x1ECE,
-       0,0x1ED0,0,0x1ED2,0,0x1ED4,0,0x1ED6,0,0x1ED8,0,0x1EDA,0,0x1EDC,0,0x1EDE,
-       0,0x1EE0,0,0x1EE2,0,0x1EE4,0,0x1EE6,0,0x1EE8,0,0x1EEA,0,0x1EEC,0,0x1EEE,
-       0,0x1EF0,0,0x1EF2,0,0x1EF4,0,0x1EF6,0,0x1EF8,0,0x1EFA,0,0x1EFC,0,0x1EFE,
-       0x1F08,0x1F09,0x1F0A,0x1F0B,0x1F0C,0x1F0D,0x1F0E,0x1F0F,0,0,0,0,0,0,0,0,
-       0x1F18,0x1F19,0x1F1A,0x1F1B,0x1F1C,0x1F1D,0,0,0,0,0,0,0,0,0,0,
-0x1F28,0x1F29,0x1F2A,0x1F2B,0x1F2C,0x1F2D,0x1F2E,0x1F2F,0,0,0,0,0,0,0,0,
-       0x1F38,0x1F39,0x1F3A,0x1F3B,0x1F3C,0x1F3D,0x1F3E,0x1F3F,0,0,0,0,0,0,0,0,
-       0x1F48,0x1F49,0x1F4A,0x1F4B,0x1F4C,0x1F4D,0,0,0,0,0,0,0,0,0,0,
-0,0x1F59,0,0x1F5B,0,0x1F5D,0,0x1F5F,0,0,0,0,0,0,0,0,
-       0x1F68,0x1F69,0x1F6A,0x1F6B,0x1F6C,0x1F6D,0x1F6E,0x1F6F,0,0,0,0,0,0,0,0,
-       0x1FBA,0x1FBB,0x1FC8,0x1FC9,0x1FCA,0x1FCB,0x1FDA,0x1FDB,0x1FF8,0x1FF9,0x1FEA,0x1FEB,0x1FFA,0x1FFB,0,0,
-0x1F88,0x1F89,0x1F8A,0x1F8B,0x1F8C,0x1F8D,0x1F8E,0x1F8F,0,0,0,0,0,0,0,0,
-       0x1F98,0x1F99,0x1F9A,0x1F9B,0x1F9C,0x1F9D,0x1F9E,0x1F9F,0,0,0,0,0,0,0,0,
-       0x1FA8,0x1FA9,0x1FAA,0x1FAB,0x1FAC,0x1FAD,0x1FAE,0x1FAF,0,0,0,0,0,0,0,0,
-       0x1FB8,0x1FB9,0,0x1FBC,0,0,0,0,0,0,0,0,0,0,0x399,0,
-       0,0,0,0x1FCC,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x1FD8,0x1FD9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x1FE8,0x1FE9,0,0,0,0x1FEC,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0x1FFC,0,0,0,0,0,0,0,0,0,0,0,0};
-static const guint16 simple_upper_case_mapping_lowarea_table3 [] = {
-       /* ==== 2100-21C0 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x2132,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,0x2167,0x2168,0x2169,0x216A,0x216B,0x216C,0x216D,0x216E,0x216F,
-       0,0,0,0,0x2183,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0};
-static const guint16 simple_upper_case_mapping_lowarea_table4 [] = {
-       /* ==== 2480-2500 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x24B6,0x24B7,0x24B8,0x24B9,0x24BA,0x24BB,0x24BC,0x24BD,0x24BE,0x24BF,0x24C0,0x24C1,0x24C2,0x24C3,0x24C4,0x24C5,
-       0x24C6,0x24C7,0x24C8,0x24C9,0x24CA,0x24CB,0x24CC,0x24CD,0x24CE,0x24CF,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0};
-static const guint16 simple_upper_case_mapping_lowarea_table5 [] = {
-       /* ==== 2C00-2D80 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0x2C00,0x2C01,0x2C02,0x2C03,0x2C04,0x2C05,0x2C06,0x2C07,0x2C08,0x2C09,0x2C0A,0x2C0B,0x2C0C,0x2C0D,0x2C0E,0x2C0F,
-       0x2C10,0x2C11,0x2C12,0x2C13,0x2C14,0x2C15,0x2C16,0x2C17,0x2C18,0x2C19,0x2C1A,0x2C1B,0x2C1C,0x2C1D,0x2C1E,0x2C1F,
-       0x2C20,0x2C21,0x2C22,0x2C23,0x2C24,0x2C25,0x2C26,0x2C27,0x2C28,0x2C29,0x2C2A,0x2C2B,0x2C2C,0x2C2D,0x2C2E,0,
-0,0x2C60,0,0,0,0x23A,0x23E,0,0x2C67,0,0x2C69,0,0x2C6B,0,0,0,
-       0,0,0,0x2C72,0,0,0x2C75,0,0,0,0,0,0,0,0,0,
-0,0x2C80,0,0x2C82,0,0x2C84,0,0x2C86,0,0x2C88,0,0x2C8A,0,0x2C8C,0,0x2C8E,
-       0,0x2C90,0,0x2C92,0,0x2C94,0,0x2C96,0,0x2C98,0,0x2C9A,0,0x2C9C,0,0x2C9E,
-       0,0x2CA0,0,0x2CA2,0,0x2CA4,0,0x2CA6,0,0x2CA8,0,0x2CAA,0,0x2CAC,0,0x2CAE,
-       0,0x2CB0,0,0x2CB2,0,0x2CB4,0,0x2CB6,0,0x2CB8,0,0x2CBA,0,0x2CBC,0,0x2CBE,
-       0,0x2CC0,0,0x2CC2,0,0x2CC4,0,0x2CC6,0,0x2CC8,0,0x2CCA,0,0x2CCC,0,0x2CCE,
-       0,0x2CD0,0,0x2CD2,0,0x2CD4,0,0x2CD6,0,0x2CD8,0,0x2CDA,0,0x2CDC,0,0x2CDE,
-       0,0x2CE0,0,0x2CE2,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x10A0,0x10A1,0x10A2,0x10A3,0x10A4,0x10A5,0x10A6,0x10A7,0x10A8,0x10A9,0x10AA,0x10AB,0x10AC,0x10AD,0x10AE,0x10AF,
-       0x10B0,0x10B1,0x10B2,0x10B3,0x10B4,0x10B5,0x10B6,0x10B7,0x10B8,0x10B9,0x10BA,0x10BB,0x10BC,0x10BD,0x10BE,0x10BF,
-       0x10C0,0x10C1,0x10C2,0x10C3,0x10C4,0x10C5,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0};
-static const guint16 simple_upper_case_mapping_lowarea_table6 [] = {
-       /* ==== A640-A7C0 ==== */
-       0,0xA640,0,0xA642,0,0xA644,0,0xA646,0,0xA648,0,0xA64A,0,0xA64C,0,0xA64E,
-       0,0xA650,0,0xA652,0,0xA654,0,0xA656,0,0xA658,0,0xA65A,0,0xA65C,0,0xA65E,
-       0,0,0,0xA662,0,0xA664,0,0xA666,0,0xA668,0,0xA66A,0,0xA66C,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0xA680,0,0xA682,0,0xA684,0,0xA686,0,0xA688,0,0xA68A,0,0xA68C,0,0xA68E,
-       0,0xA690,0,0xA692,0,0xA694,0,0xA696,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0xA722,0,0xA724,0,0xA726,0,0xA728,0,0xA72A,0,0xA72C,0,0xA72E,
-       0,0,0,0xA732,0,0xA734,0,0xA736,0,0xA738,0,0xA73A,0,0xA73C,0,0xA73E,
-       0,0xA740,0,0xA742,0,0xA744,0,0xA746,0,0xA748,0,0xA74A,0,0xA74C,0,0xA74E,
-       0,0xA750,0,0xA752,0,0xA754,0,0xA756,0,0xA758,0,0xA75A,0,0xA75C,0,0xA75E,
-       0,0xA760,0,0xA762,0,0xA764,0,0xA766,0,0xA768,0,0xA76A,0,0xA76C,0,0xA76E,
-       0,0,0,0,0,0,0,0,0,0,0xA779,0,0xA77B,0,0,0xA77E,
-       0,0xA780,0,0xA782,0,0xA784,0,0xA786,0,0,0,0,0xA78B,0};
-static const guint16 simple_upper_case_mapping_lowarea_table7 [] = {
-       /* ==== FF20-FF80 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27,0xFF28,0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F,
-       0xFF30,0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,0xFF38,0xFF39,0xFF3A,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0};
-static const guint16 *simple_upper_case_mapping_lowarea [] = {
-       simple_upper_case_mapping_lowarea_table0,
-       simple_upper_case_mapping_lowarea_table1,
-       simple_upper_case_mapping_lowarea_table2,
-       simple_upper_case_mapping_lowarea_table3,
-       simple_upper_case_mapping_lowarea_table4,
-       simple_upper_case_mapping_lowarea_table5,
-       simple_upper_case_mapping_lowarea_table6,
-       simple_upper_case_mapping_lowarea_table7};
-static const int simple_upper_case_mapping_lowarea_table_count = 8;
-
-static const guint32 simple_upper_case_mapping_higharea_table0 [] = {
-       /* ==== 10400-10480 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0x10400,0x10401,0x10402,0x10403,0x10404,0x10405,0x10406,0x10407,
-       0x10408,0x10409,0x1040A,0x1040B,0x1040C,0x1040D,0x1040E,0x1040F,0x10410,0x10411,0x10412,0x10413,0x10414,0x10415,0x10416,0x10417,
-       0x10418,0x10419,0x1041A,0x1041B,0x1041C,0x1041D,0x1041E,0x1041F,0x10420,0x10421,0x10422,0x10423,0x10424,0x10425,0x10426,0x10427,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0};
-static const guint32 *simple_upper_case_mapping_higharea [] = {
-       simple_upper_case_mapping_higharea_table0};
-
-static const guint16 simple_lower_case_mapping_lowarea_table0 [] = {
-       /* ==== 40-600 ==== */
-       0,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
-       0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
-       0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x101,0,0x103,0,0x105,0,0x107,0,0x109,0,0x10B,0,0x10D,0,0x10F,0,
-       0x111,0,0x113,0,0x115,0,0x117,0,0x119,0,0x11B,0,0x11D,0,0x11F,0,
-       0x121,0,0x123,0,0x125,0,0x127,0,0x129,0,0x12B,0,0x12D,0,0x12F,0,
-       0x69,0,0x133,0,0x135,0,0x137,0,0,0x13A,0,0x13C,0,0x13E,0,0x140,
-       0,0x142,0,0x144,0,0x146,0,0x148,0,0,0x14B,0,0x14D,0,0x14F,0,
-       0x151,0,0x153,0,0x155,0,0x157,0,0x159,0,0x15B,0,0x15D,0,0x15F,0,
-       0x161,0,0x163,0,0x165,0,0x167,0,0x169,0,0x16B,0,0x16D,0,0x16F,0,
-       0x171,0,0x173,0,0x175,0,0x177,0,0xFF,0x17A,0,0x17C,0,0x17E,0,0,
-       0,0x253,0x183,0,0x185,0,0x254,0x188,0,0x256,0x257,0x18C,0,0,0x1DD,0x259,
-       0x25B,0x192,0,0x260,0x263,0,0x269,0x268,0x199,0,0,0,0x26F,0x272,0,0x275,
-       0x1A1,0,0x1A3,0,0x1A5,0,0x280,0x1A8,0,0x283,0,0,0x1AD,0,0x288,0x1B0,
-       0,0x28A,0x28B,0x1B4,0,0x1B6,0,0x292,0x1B9,0,0,0,0x1BD,0,0,0,
-       0,0,0,0,0x1C6,0x1C6,0,0x1C9,0x1C9,0,0x1CC,0x1CC,0,0x1CE,0,0x1D0,
-       0,0x1D2,0,0x1D4,0,0x1D6,0,0x1D8,0,0x1DA,0,0x1DC,0,0,0x1DF,0,
-       0x1E1,0,0x1E3,0,0x1E5,0,0x1E7,0,0x1E9,0,0x1EB,0,0x1ED,0,0x1EF,0,
-       0,0x1F3,0x1F3,0,0x1F5,0,0x195,0x1BF,0x1F9,0,0x1FB,0,0x1FD,0,0x1FF,0,
-       0x201,0,0x203,0,0x205,0,0x207,0,0x209,0,0x20B,0,0x20D,0,0x20F,0,
-       0x211,0,0x213,0,0x215,0,0x217,0,0x219,0,0x21B,0,0x21D,0,0x21F,0,
-       0x19E,0,0x223,0,0x225,0,0x227,0,0x229,0,0x22B,0,0x22D,0,0x22F,0,
-       0x231,0,0x233,0,0,0,0,0,0,0,0x2C65,0x23C,0,0x19A,0x2C66,0,
-       0,0x242,0,0x180,0x289,0x28C,0x247,0,0x249,0,0x24B,0,0x24D,0,0x24F,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x371,0,0x373,0,0,0,0x377,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0x3AC,0,0x3AD,0x3AE,0x3AF,0,0x3CC,0,0x3CD,0x3CE,
-       0,0x3B1,0x3B2,0x3B3,0x3B4,0x3B5,0x3B6,0x3B7,0x3B8,0x3B9,0x3BA,0x3BB,0x3BC,0x3BD,0x3BE,0x3BF,
-       0x3C0,0x3C1,0,0x3C3,0x3C4,0x3C5,0x3C6,0x3C7,0x3C8,0x3C9,0x3CA,0x3CB,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x3D7,
-       0,0,0,0,0,0,0,0,0x3D9,0,0x3DB,0,0x3DD,0,0x3DF,0,
-       0x3E1,0,0x3E3,0,0x3E5,0,0x3E7,0,0x3E9,0,0x3EB,0,0x3ED,0,0x3EF,0,
-       0,0,0,0,0x3B8,0,0,0x3F8,0,0x3F2,0x3FB,0,0,0x37B,0x37C,0x37D,
-       0x450,0x451,0x452,0x453,0x454,0x455,0x456,0x457,0x458,0x459,0x45A,0x45B,0x45C,0x45D,0x45E,0x45F,
-       0x430,0x431,0x432,0x433,0x434,0x435,0x436,0x437,0x438,0x439,0x43A,0x43B,0x43C,0x43D,0x43E,0x43F,
-       0x440,0x441,0x442,0x443,0x444,0x445,0x446,0x447,0x448,0x449,0x44A,0x44B,0x44C,0x44D,0x44E,0x44F,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x461,0,0x463,0,0x465,0,0x467,0,0x469,0,0x46B,0,0x46D,0,0x46F,0,
-       0x471,0,0x473,0,0x475,0,0x477,0,0x479,0,0x47B,0,0x47D,0,0x47F,0,
-       0x481,0,0,0,0,0,0,0,0,0,0x48B,0,0x48D,0,0x48F,0,
-       0x491,0,0x493,0,0x495,0,0x497,0,0x499,0,0x49B,0,0x49D,0,0x49F,0,
-       0x4A1,0,0x4A3,0,0x4A5,0,0x4A7,0,0x4A9,0,0x4AB,0,0x4AD,0,0x4AF,0,
-       0x4B1,0,0x4B3,0,0x4B5,0,0x4B7,0,0x4B9,0,0x4BB,0,0x4BD,0,0x4BF,0,
-       0x4CF,0x4C2,0,0x4C4,0,0x4C6,0,0x4C8,0,0x4CA,0,0x4CC,0,0x4CE,0,0,
-       0x4D1,0,0x4D3,0,0x4D5,0,0x4D7,0,0x4D9,0,0x4DB,0,0x4DD,0,0x4DF,0,
-       0x4E1,0,0x4E3,0,0x4E5,0,0x4E7,0,0x4E9,0,0x4EB,0,0x4ED,0,0x4EF,0,
-       0x4F1,0,0x4F3,0,0x4F5,0,0x4F7,0,0x4F9,0,0x4FB,0,0x4FD,0,0x4FF,0,
-       0x501,0,0x503,0,0x505,0,0x507,0,0x509,0,0x50B,0,0x50D,0,0x50F,0,
-       0x511,0,0x513,0,0x515,0,0x517,0,0x519,0,0x51B,0,0x51D,0,0x51F,0,
-       0x521,0,0x523,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0x561,0x562,0x563,0x564,0x565,0x566,0x567,0x568,0x569,0x56A,0x56B,0x56C,0x56D,0x56E,0x56F,
-       0x570,0x571,0x572,0x573,0x574,0x575,0x576,0x577,0x578,0x579,0x57A,0x57B,0x57C,0x57D,0x57E,0x57F,
-       0x580,0x581,0x582,0x583,0x584,0x585,0x586,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0};
-static const guint16 simple_lower_case_mapping_lowarea_table1 [] = {
-       /* ==== 1000-10D0 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x2D00,0x2D01,0x2D02,0x2D03,0x2D04,0x2D05,0x2D06,0x2D07,0x2D08,0x2D09,0x2D0A,0x2D0B,0x2D0C,0x2D0D,0x2D0E,0x2D0F,
-       0x2D10,0x2D11,0x2D12,0x2D13,0x2D14,0x2D15,0x2D16,0x2D17,0x2D18,0x2D19,0x2D1A,0x2D1B,0x2D1C,0x2D1D,0x2D1E,0x2D1F,
-       0x2D20,0x2D21,0x2D22,0x2D23,0x2D24,0x2D25,0};
-static const guint16 simple_lower_case_mapping_lowarea_table2 [] = {
-       /* ==== 1D00-2000 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x1E01,0,0x1E03,0,0x1E05,0,0x1E07,0,0x1E09,0,0x1E0B,0,0x1E0D,0,0x1E0F,0,
-       0x1E11,0,0x1E13,0,0x1E15,0,0x1E17,0,0x1E19,0,0x1E1B,0,0x1E1D,0,0x1E1F,0,
-       0x1E21,0,0x1E23,0,0x1E25,0,0x1E27,0,0x1E29,0,0x1E2B,0,0x1E2D,0,0x1E2F,0,
-       0x1E31,0,0x1E33,0,0x1E35,0,0x1E37,0,0x1E39,0,0x1E3B,0,0x1E3D,0,0x1E3F,0,
-       0x1E41,0,0x1E43,0,0x1E45,0,0x1E47,0,0x1E49,0,0x1E4B,0,0x1E4D,0,0x1E4F,0,
-       0x1E51,0,0x1E53,0,0x1E55,0,0x1E57,0,0x1E59,0,0x1E5B,0,0x1E5D,0,0x1E5F,0,
-       0x1E61,0,0x1E63,0,0x1E65,0,0x1E67,0,0x1E69,0,0x1E6B,0,0x1E6D,0,0x1E6F,0,
-       0x1E71,0,0x1E73,0,0x1E75,0,0x1E77,0,0x1E79,0,0x1E7B,0,0x1E7D,0,0x1E7F,0,
-       0x1E81,0,0x1E83,0,0x1E85,0,0x1E87,0,0x1E89,0,0x1E8B,0,0x1E8D,0,0x1E8F,0,
-       0x1E91,0,0x1E93,0,0x1E95,0,0,0,0,0,0,0,0,0,0xDF,0,
-       0x1EA1,0,0x1EA3,0,0x1EA5,0,0x1EA7,0,0x1EA9,0,0x1EAB,0,0x1EAD,0,0x1EAF,0,
-       0x1EB1,0,0x1EB3,0,0x1EB5,0,0x1EB7,0,0x1EB9,0,0x1EBB,0,0x1EBD,0,0x1EBF,0,
-       0x1EC1,0,0x1EC3,0,0x1EC5,0,0x1EC7,0,0x1EC9,0,0x1ECB,0,0x1ECD,0,0x1ECF,0,
-       0x1ED1,0,0x1ED3,0,0x1ED5,0,0x1ED7,0,0x1ED9,0,0x1EDB,0,0x1EDD,0,0x1EDF,0,
-       0x1EE1,0,0x1EE3,0,0x1EE5,0,0x1EE7,0,0x1EE9,0,0x1EEB,0,0x1EED,0,0x1EEF,0,
-       0x1EF1,0,0x1EF3,0,0x1EF5,0,0x1EF7,0,0x1EF9,0,0x1EFB,0,0x1EFD,0,0x1EFF,0,
-       0,0,0,0,0,0,0,0,0x1F00,0x1F01,0x1F02,0x1F03,0x1F04,0x1F05,0x1F06,0x1F07,
-       0,0,0,0,0,0,0,0,0x1F10,0x1F11,0x1F12,0x1F13,0x1F14,0x1F15,0,0,
-0,0,0,0,0,0,0,0,0x1F20,0x1F21,0x1F22,0x1F23,0x1F24,0x1F25,0x1F26,0x1F27,
-       0,0,0,0,0,0,0,0,0x1F30,0x1F31,0x1F32,0x1F33,0x1F34,0x1F35,0x1F36,0x1F37,
-       0,0,0,0,0,0,0,0,0x1F40,0x1F41,0x1F42,0x1F43,0x1F44,0x1F45,0,0,
-0,0,0,0,0,0,0,0,0,0x1F51,0,0x1F53,0,0x1F55,0,0x1F57,
-       0,0,0,0,0,0,0,0,0x1F60,0x1F61,0x1F62,0x1F63,0x1F64,0x1F65,0x1F66,0x1F67,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0x1F80,0x1F81,0x1F82,0x1F83,0x1F84,0x1F85,0x1F86,0x1F87,
-       0,0,0,0,0,0,0,0,0x1F90,0x1F91,0x1F92,0x1F93,0x1F94,0x1F95,0x1F96,0x1F97,
-       0,0,0,0,0,0,0,0,0x1FA0,0x1FA1,0x1FA2,0x1FA3,0x1FA4,0x1FA5,0x1FA6,0x1FA7,
-       0,0,0,0,0,0,0,0,0x1FB0,0x1FB1,0x1F70,0x1F71,0x1FB3,0,0,0,
-       0,0,0,0,0,0,0,0,0x1F72,0x1F73,0x1F74,0x1F75,0x1FC3,0,0,0,
-       0,0,0,0,0,0,0,0,0x1FD0,0x1FD1,0x1F76,0x1F77,0,0,0,0,
-       0,0,0,0,0,0,0,0,0x1FE0,0x1FE1,0x1F7A,0x1F7B,0x1FE5,0,0,0,
-       0,0,0,0,0,0,0,0,0x1F78,0x1F79,0x1F7C,0x1F7D,0x1FF3,0,0,0};
-static const guint16 simple_lower_case_mapping_lowarea_table3 [] = {
-       /* ==== 2100-21C0 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0x3C9,0,0,0,0x6B,0xE5,0,0,0,0,
-       0,0,0x214E,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177,0x2178,0x2179,0x217A,0x217B,0x217C,0x217D,0x217E,0x217F,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0x2184,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0};
-static const guint16 simple_lower_case_mapping_lowarea_table4 [] = {
-       /* ==== 2480-2500 ==== */
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0x24D0,0x24D1,0x24D2,0x24D3,0x24D4,0x24D5,0x24D6,0x24D7,0x24D8,0x24D9,
-       0x24DA,0x24DB,0x24DC,0x24DD,0x24DE,0x24DF,0x24E0,0x24E1,0x24E2,0x24E3,0x24E4,0x24E5,0x24E6,0x24E7,0x24E8,0x24E9,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0};
-static const guint16 simple_lower_case_mapping_lowarea_table5 [] = {
-       /* ==== 2C00-2D80 ==== */
-       0x2C30,0x2C31,0x2C32,0x2C33,0x2C34,0x2C35,0x2C36,0x2C37,0x2C38,0x2C39,0x2C3A,0x2C3B,0x2C3C,0x2C3D,0x2C3E,0x2C3F,
-       0x2C40,0x2C41,0x2C42,0x2C43,0x2C44,0x2C45,0x2C46,0x2C47,0x2C48,0x2C49,0x2C4A,0x2C4B,0x2C4C,0x2C4D,0x2C4E,0x2C4F,
-       0x2C50,0x2C51,0x2C52,0x2C53,0x2C54,0x2C55,0x2C56,0x2C57,0x2C58,0x2C59,0x2C5A,0x2C5B,0x2C5C,0x2C5D,0x2C5E,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0x2C61,0,0x26B,0x1D7D,0x27D,0,0,0x2C68,0,0x2C6A,0,0x2C6C,0,0x251,0x271,0x250,
-       0,0,0x2C73,0,0,0x2C76,0,0,0,0,0,0,0,0,0,0,
-0x2C81,0,0x2C83,0,0x2C85,0,0x2C87,0,0x2C89,0,0x2C8B,0,0x2C8D,0,0x2C8F,0,
-       0x2C91,0,0x2C93,0,0x2C95,0,0x2C97,0,0x2C99,0,0x2C9B,0,0x2C9D,0,0x2C9F,0,
-       0x2CA1,0,0x2CA3,0,0x2CA5,0,0x2CA7,0,0x2CA9,0,0x2CAB,0,0x2CAD,0,0x2CAF,0,
-       0x2CB1,0,0x2CB3,0,0x2CB5,0,0x2CB7,0,0x2CB9,0,0x2CBB,0,0x2CBD,0,0x2CBF,0,
-       0x2CC1,0,0x2CC3,0,0x2CC5,0,0x2CC7,0,0x2CC9,0,0x2CCB,0,0x2CCD,0,0x2CCF,0,
-       0x2CD1,0,0x2CD3,0,0x2CD5,0,0x2CD7,0,0x2CD9,0,0x2CDB,0,0x2CDD,0,0x2CDF,0,
-       0x2CE1,0,0x2CE3,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0};
-static const guint16 simple_lower_case_mapping_lowarea_table6 [] = {
-       /* ==== A640-A7C0 ==== */
-       0xA641,0,0xA643,0,0xA645,0,0xA647,0,0xA649,0,0xA64B,0,0xA64D,0,0xA64F,0,
-       0xA651,0,0xA653,0,0xA655,0,0xA657,0,0xA659,0,0xA65B,0,0xA65D,0,0xA65F,0,
-       0,0,0xA663,0,0xA665,0,0xA667,0,0xA669,0,0xA66B,0,0xA66D,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0xA681,0,0xA683,0,0xA685,0,0xA687,0,0xA689,0,0xA68B,0,0xA68D,0,0xA68F,0,
-       0xA691,0,0xA693,0,0xA695,0,0xA697,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0xA723,0,0xA725,0,0xA727,0,0xA729,0,0xA72B,0,0xA72D,0,0xA72F,0,
-       0,0,0xA733,0,0xA735,0,0xA737,0,0xA739,0,0xA73B,0,0xA73D,0,0xA73F,0,
-       0xA741,0,0xA743,0,0xA745,0,0xA747,0,0xA749,0,0xA74B,0,0xA74D,0,0xA74F,0,
-       0xA751,0,0xA753,0,0xA755,0,0xA757,0,0xA759,0,0xA75B,0,0xA75D,0,0xA75F,0,
-       0xA761,0,0xA763,0,0xA765,0,0xA767,0,0xA769,0,0xA76B,0,0xA76D,0,0xA76F,0,
-       0,0,0,0,0,0,0,0,0,0xA77A,0,0xA77C,0,0x1D79,0xA77F,0,
-       0xA781,0,0xA783,0,0xA785,0,0xA787,0,0,0,0,0xA78C,0,0};
-static const guint16 simple_lower_case_mapping_lowarea_table7 [] = {
-       /* ==== FF20-FF80 ==== */
-       0,0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47,0xFF48,0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F,
-       0xFF50,0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57,0xFF58,0xFF59,0xFF5A,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0};
-static const guint16 *simple_lower_case_mapping_lowarea [] = {
-       simple_lower_case_mapping_lowarea_table0,
-       simple_lower_case_mapping_lowarea_table1,
-       simple_lower_case_mapping_lowarea_table2,
-       simple_lower_case_mapping_lowarea_table3,
-       simple_lower_case_mapping_lowarea_table4,
-       simple_lower_case_mapping_lowarea_table5,
-       simple_lower_case_mapping_lowarea_table6,
-       simple_lower_case_mapping_lowarea_table7};
-static const int simple_lower_case_mapping_lowarea_table_count = 8;
-
-static const guint32 simple_lower_case_mapping_higharea_table0 [] = {
-       /* ==== 10400-10480 ==== */
-       0x10428,0x10429,0x1042A,0x1042B,0x1042C,0x1042D,0x1042E,0x1042F,0x10430,0x10431,0x10432,0x10433,0x10434,0x10435,0x10436,0x10437,
-       0x10438,0x10439,0x1043A,0x1043B,0x1043C,0x1043D,0x1043E,0x1043F,0x10440,0x10441,0x10442,0x10443,0x10444,0x10445,0x10446,0x10447,
-       0x10448,0x10449,0x1044A,0x1044B,0x1044C,0x1044D,0x1044E,0x1044F,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0};
-static const guint32 *simple_lower_case_mapping_higharea [] = {
-       simple_lower_case_mapping_higharea_table0};
-
-
-static const SimpleTitlecaseMapping simple_titlecase_mapping [] = {
-       {0x0001C4, 0x000000, 0x0001C5},
-       {0x0001C5, 0x0001C4, 0x0001C5},
-       {0x0001C6, 0x0001C4, 0x0001C5},
-       {0x0001C7, 0x000000, 0x0001C8},
-       {0x0001C8, 0x0001C7, 0x0001C8},
-       {0x0001C9, 0x0001C7, 0x0001C8},
-       {0x0001CA, 0x000000, 0x0001CB},
-       {0x0001CB, 0x0001CA, 0x0001CB},
-       {0x0001CC, 0x0001CA, 0x0001CB},
-       {0x0001F1, 0x000000, 0x0001F2},
-       {0x0001F2, 0x0001F1, 0x0001F2},
-       {0x0001F3, 0x0001F1, 0x0001F2}
-};
-static const guint8 simple_titlecase_mapping_count = 12;
-
-#endif
-
diff --git a/eglib/test/.gitignore b/eglib/test/.gitignore
deleted file mode 100644 (file)
index 2d669e1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/Makefile
-/Makefile.in
-/.libs
-/.deps
-/*.lo
-/*.la
-/*.o
-/semantic.cache
-/.project
-/.cproject
-/test-eglib
-/test-glib
diff --git a/eglib/test/Makefile.am b/eglib/test/Makefile.am
deleted file mode 100644 (file)
index c669d84..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-EXTRA_DIST = UTF-8.txt UTF-16BE.txt UTF-16LE.txt UTF-32BE.txt UTF-32LE.txt
-
-SOURCES = \
-       test.c          \
-       test.h          \
-       tests.h         \
-       driver.c        \
-       hashtable.c     \
-       string-util.c   \
-       string.c        \
-       slist.c         \
-       sizes.c         \
-       ptrarray.c      \
-       list.c          \
-       array.c         \
-       fake.c          \
-       path.c          \
-       queue.c         \
-       shell.c         \
-       spawn.c         \
-       timer.c         \
-       file.c          \
-       pattern.c       \
-       dir.c           \
-       markup.c        \
-       unicode.c       \
-       utf8.c          \
-       endian.c        \
-       module.c        \
-       memory.c
-
-test_eglib_SOURCES = $(SOURCES)
-
-test_eglib_CFLAGS = -Wall -DEGLIB_TESTS=1 -D_FORTIFY_SOURCE=2 -I$(srcdir)/../src -I../src -DDRIVER_NAME=\"EGlib\"
-test_eglib_LDADD = ../src/libeglib.la $(LIBICONV)
-
-run-eglib: all
-       srcdir=`readlink -f $(srcdir)` ./test-eglib
-
-noinst_PROGRAMS = test-eglib
-
-run-both: run-eglib
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/eglib/test/README b/eglib/test/README
deleted file mode 100644 (file)
index 7c28d03..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-EGlib Unit Testing
-===============================================================================
-
-       1. Writing new tests
-       2. Using the test driver
-
-===============================================================================
-1. Writing new tests
-===============================================================================
-
-Tests are easy to write, but must be grouped in to logical cases. For instance,
-the GPtrArray group has a number of tests that cover the entire GPtrArray
-implementation.
-
-These logical case groups should be in a single C file, and must have
-three elements:
-
-       #include <glib.h>
-       #include "test.h"
-
-       ...
-       <define test implementations>
-       ...
-
-       static Test groupname_tests [] = {
-               {"groupname_test1", groupname_test1},
-               {"groupname_test1", groupname_test2},
-               {NULL, NULL}
-       };
-
-       DEFINE_TEST_GROUP_INIT(groupname_tests_init, groupname_tests)
-
-A test implementation should look like:
-
-       RESULT groupname_test1()
-       {
-               <perform the test>
-
-               if(test_failed) {
-                       return FAILED("reason: %s", "this works like printf");
-               }
-
-               return OK; /* just NULL, but OK is cute */
-       }
-
-Once a test group is written, it needs to be added to the groups table
-in tests.h:
-
-       DEFINE_TEST_GROUP_INIT_H(groupname_tests_init) // same as in impl
-
-       static Group test_groups [] = {
-               ...
-               {"groupname", groupname_tests_init}
-               ...
-       };
-
-===============================================================================
-2. Using the test driver
-===============================================================================
-
-When tests are written, they are rebuilt with make. Two programs will be
-built:
-
-       test-eglib: the test driver and tests linked against eglib
-       test-glib:  the test driver and tests linked against system glib-2.0
-
-Each driver program works exactly the same. Running test-eglib will run 
-the tests against eglib, and test-glib against glib-2.0.
-
-The test driver supports a few options to allow for performance measuring:
-
-       --help          show all options and available test groups
-       --time          time the overall run and report it, even if --quiet is set
-       --quiet         do not print test results, useful for timing
-       --iterations N  run all or specified test groups N times
-
-Run "test-eglib --help" for more details.
-
-Example: run the ptrarray test group 100000 times and only print the time 
-         it took to perform all iterations
-
-       ./test-eglib -tqi 100000 ptrarray
-
-Example: show single iteration of test output for two groups
-       
-       ./test-eglib ptrarray hashtable
-
-Example: show test output of all available groups
-
-       ./test-eglib
-
-The 'test-both' script can be used to run both test-eglib and test-glib
-with the same options back to back:
-
-       $ ./test-both -tqi 100000 ptrarray
-       EGlib Total Time: 1.1961s
-       GLib Total Time: 0.955957s
-
-test-both also has a nice --speed-compare mode that shows comparison
-information about EGlib vs GLib. It can run all tests or specific tests
-with a configurable number of iterations. --speed-compare mode always runs
-the drivers with -qtni
-
-The syntax for --speed-compare is:
-
-       ./test-both --speed-compare [ITERATIONS] [GROUPS...]
-
-       $ ./test-both --speed-compare       Runs all tests with default iterations
-       $ ./test-both --speed-compare 500   Runs all tests with 500 iterations
-       $ ./test-both --speed-compare ptrarray   Runs ptrarray test with default
-                                                iterations
-
-
diff --git a/eglib/test/UTF-16BE.txt b/eglib/test/UTF-16BE.txt
deleted file mode 100644 (file)
index b7e494c..0000000
Binary files a/eglib/test/UTF-16BE.txt and /dev/null differ
diff --git a/eglib/test/UTF-16LE.txt b/eglib/test/UTF-16LE.txt
deleted file mode 100644 (file)
index 30fe7b0..0000000
Binary files a/eglib/test/UTF-16LE.txt and /dev/null differ
diff --git a/eglib/test/UTF-32BE.txt b/eglib/test/UTF-32BE.txt
deleted file mode 100644 (file)
index a1fd543..0000000
Binary files a/eglib/test/UTF-32BE.txt and /dev/null differ
diff --git a/eglib/test/UTF-32LE.txt b/eglib/test/UTF-32LE.txt
deleted file mode 100644 (file)
index 043afc9..0000000
Binary files a/eglib/test/UTF-32LE.txt and /dev/null differ
diff --git a/eglib/test/UTF-8.txt b/eglib/test/UTF-8.txt
deleted file mode 100644 (file)
index 4363f27..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-
-UTF-8 encoded sample plain-text file
-‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-
-Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25
-
-
-The ASCII compatible UTF-8 encoding used in this plain-text file
-is defined in Unicode, ISO 10646-1, and RFC 2279.
-
-
-Using Unicode/UTF-8, you can write in emails and source code things such as
-
-Mathematics and sciences:
-
-  ∮ E⋅da = Q,  n → ∞, ∑ f(i) = ∏ g(i),      ⎧⎡⎛┌─────┐⎞⎤⎫
-                                            ⎪⎢⎜│a²+b³ ⎟⎥⎪
-  ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β),    ⎪⎢⎜│───── ⎟⎥⎪
-                                            ⎪⎢⎜⎷ c₈   ⎟⎥⎪
-  ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ,                   ⎨⎢⎜       ⎟⎥⎬
-                                            ⎪⎢⎜ ∞     ⎟⎥⎪
-  ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫),      ⎪⎢⎜ ⎲     ⎟⎥⎪
-                                            ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪
-  2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm     ⎩⎣⎝i=1    ⎠⎦⎭
-
-Linguistics and dictionaries:
-
-  ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn
-  Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ]
-
-APL:
-
-  ((V⍳V)=⍳⍴V)/V←,V    ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈
-
-Nicer typography in plain text files:
-
-  ╔══════════════════════════════════════════╗
-  ║                                          ║
-  ║   • ‘single’ and “double” quotes         ║
-  ║                                          ║
-  ║   • Curly apostrophes: “We’ve been here” ║
-  ║                                          ║
-  ║   • Latin-1 apostrophe and accents: '´`  ║
-  ║                                          ║
-  ║   • ‚deutsche‘ „Anführungszeichen“       ║
-  ║                                          ║
-  ║   • †, ‡, ‰, •, 3–4, —, −5/+5, ™, …      ║
-  ║                                          ║
-  ║   • ASCII safety test: 1lI|, 0OD, 8B     ║
-  ║                      ╭─────────╮         ║
-  ║   • the euro symbol: │ 14.95 € │         ║
-  ║                      ╰─────────╯         ║
-  ╚══════════════════════════════════════════╝
-
-Combining characters:
-
-  STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑
-
-Greek (in Polytonic):
-
-  The Greek anthem:
-
-  Σὲ γνωρίζω ἀπὸ τὴν κόψη
-  τοῦ σπαθιοῦ τὴν τρομερή,
-  σὲ γνωρίζω ἀπὸ τὴν ὄψη
-  ποὺ μὲ βία μετράει τὴ γῆ.
-
-  ᾿Απ᾿ τὰ κόκκαλα βγαλμένη
-  τῶν ῾Ελλήνων τὰ ἱερά
-  καὶ σὰν πρῶτα ἀνδρειωμένη
-  χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά!
-
-  From a speech of Demosthenes in the 4th century BC:
-
-  Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι,
-  ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς
-  λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ
-  τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿
-  εἰς τοῦτο προήκοντα,  ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ
-  πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν
-  οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι,
-  οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν
-  ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον
-  τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι
-  γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν
-  προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους
-  σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ
-  τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ
-  τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς
-  τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον.
-
-  Δημοσθένους, Γ´ ᾿Ολυνθιακὸς
-
-Georgian:
-
-  From a Unicode conference invitation:
-
-  გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო
-  კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს,
-  ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს
-  ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი,
-  ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება
-  ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში,
-  ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში.
-
-Russian:
-
-  From a Unicode conference invitation:
-
-  Зарегистрируйтесь сейчас на Десятую Международную Конференцию по
-  Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии.
-  Конференция соберет широкий круг экспертов по  вопросам глобального
-  Интернета и Unicode, локализации и интернационализации, воплощению и
-  применению Unicode в различных операционных системах и программных
-  приложениях, шрифтах, верстке и многоязычных компьютерных системах.
-
-Thai (UCS Level 2):
-
-  Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese
-  classic 'San Gua'):
-
-  [----------------------------|------------------------]
-    ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช  พระปกเกศกองบู๊กู้ขึ้นใหม่
-  สิบสองกษัตริย์ก่อนหน้าแลถัดไป       สององค์ไซร้โง่เขลาเบาปัญญา
-    ทรงนับถือขันทีเป็นที่พึ่ง           บ้านเมืองจึงวิปริตเป็นนักหนา
-  โฮจิ๋นเรียกทัพทั่วหัวเมืองมา         หมายจะฆ่ามดชั่วตัวสำคัญ
-    เหมือนขับไสไล่เสือจากเคหา      รับหมาป่าเข้ามาเลยอาสัญ
-  ฝ่ายอ้องอุ้นยุแยกให้แตกกัน          ใช้สาวนั้นเป็นชนวนชื่นชวนใจ
-    พลันลิฉุยกุยกีกลับก่อเหตุ          ช่างอาเพศจริงหนาฟ้าร้องไห้
-  ต้องรบราฆ่าฟันจนบรรลัย           ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ
-
-  (The above is a two-column text. If combining characters are handled
-  correctly, the lines of the second column should be aligned with the
-  | character above.)
-
-Ethiopian:
-
-  Proverbs in the Amharic language:
-
-  ሰማይ አይታረስ ንጉሥ አይከሰስ።
-  ብላ ካለኝ እንደአባቴ በቆመጠኝ።
-  ጌጥ ያለቤቱ ቁምጥና ነው።
-  ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው።
-  የአፍ ወለምታ በቅቤ አይታሽም።
-  አይጥ በበላ ዳዋ ተመታ።
-  ሲተረጉሙ ይደረግሙ።
-  ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል።
-  ድር ቢያብር አንበሳ ያስር።
-  ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም።
-  እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም።
-  የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ።
-  ሥራ ከመፍታት ልጄን ላፋታት።
-  ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል።
-  የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ።
-  ተንጋሎ ቢተፉ ተመልሶ ባፉ።
-  ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው።
-  እግርህን በፍራሽህ ልክ ዘርጋ።
-
-Runes:
-
-  ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ
-
-  (Old English, which transcribed into Latin reads 'He cwaeth that he
-  bude thaem lande northweardum with tha Westsae.' and means 'He said
-  that he lived in the northern land near the Western Sea.')
-
-Braille:
-
-  ⡌⠁⠧⠑ ⠼⠁⠒  ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌
-
-  ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞
-  ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎
-  ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂
-  ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙
-  ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑
-  ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲
-
-  ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲
-
-  ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹
-  ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞
-  ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕
-  ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹
-  ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎
-  ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎
-  ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳
-  ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞
-  ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲
-
-  (The first couple of paragraphs of "A Christmas Carol" by Dickens)
-
-Compact font selection example text:
-
-  ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789
-  abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ
-  –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд
-  ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა
-
-Greetings in various languages:
-
-  Hello world, Καλημέρα κόσμε, コンニチハ
-
-Box drawing alignment tests:                                          █
-                                                                      ▉
-  ╔══╦══╗  ┌──┬──┐  ╭──┬──╮  ╭──┬──╮  ┏━━┳━━┓  ┎┒┏┑   ╷  ╻ ┏┯┓ ┌┰┐    ▊ ╱╲╱╲╳╳╳
-  ║┌─╨─┐║  │╔═╧═╗│  │╒═╪═╕│  │╓─╁─╖│  ┃┌─╂─┐┃  ┗╃╄┙  ╶┼╴╺╋╸┠┼┨ ┝╋┥    ▋ ╲╱╲╱╳╳╳
-  ║│╲ ╱│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╿ │┃  ┍╅╆┓   ╵  ╹ ┗┷┛ └┸┘    ▌ ╱╲╱╲╳╳╳
-  ╠╡ ╳ ╞╣  ├╢   ╟┤  ├┼─┼─┼┤  ├╫─╂─╫┤  ┣┿╾┼╼┿┫  ┕┛┖┚     ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳
-  ║│╱ ╲│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╽ │┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▎
-  ║└─╥─┘║  │╚═╤═╝│  │╘═╪═╛│  │╙─╀─╜│  ┃└─╂─┘┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▏
-  ╚══╩══╝  └──┴──┘  ╰──┴──╯  ╰──┴──╯  ┗━━┻━━┛  ▗▄▖▛▀▜   └╌╌┘ ╎ ┗╍╍┛ ┋  ▁▂▃▄▅▆▇█
-                                               ▝▀▘▙▄▟
diff --git a/eglib/test/array.c b/eglib/test/array.c
deleted file mode 100644 (file)
index 37d5486..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-#include "test.h"
-
-/* example from glib documentation */
-RESULT
-test_array_big ()
-{
-       GArray *garray;
-       gint i;
-
-       /* We create a new array to store gint values.
-          We don't want it zero-terminated or cleared to 0's. */
-       garray = g_array_new (FALSE, FALSE, sizeof (gint));
-       for (i = 0; i < 10000; i++)
-               g_array_append_val (garray, i);
-
-       for (i = 0; i < 10000; i++)
-               if (g_array_index (garray, gint, i) != i)
-                       return FAILED ("array value didn't match");
-       
-       g_array_free (garray, TRUE);
-
-       return NULL;
-}
-
-RESULT
-test_array_index ()
-{
-       GArray *array = g_array_new (FALSE, FALSE, sizeof (int));
-       int v;
-
-       v = 27;
-       g_array_append_val (array, v);
-
-       if (27 != g_array_index (array, int, 0))
-               return FAILED ("");
-
-       g_array_free (array, TRUE);
-
-       return NULL;
-}
-
-RESULT
-test_array_append_zero_terminated ()
-{
-       GArray *array = g_array_new (TRUE, FALSE, sizeof (int));
-       int v;
-
-       v = 27;
-       g_array_append_val (array, v);
-
-       if (27 != g_array_index (array, int, 0))
-               return FAILED ("g_array_append_val failed");
-
-       if (0 != g_array_index (array, int, 1))
-               return FAILED ("zero_terminated didn't append a zero element");
-
-       g_array_free (array, TRUE);
-
-       return NULL;
-}
-
-RESULT
-test_array_append ()
-{
-       GArray *array = g_array_new (FALSE, FALSE, sizeof (int));
-       int v;
-
-       if (0 != array->len)
-               return FAILED ("initial array length not zero");
-
-       v = 27;
-
-       g_array_append_val (array, v);
-
-       if (1 != array->len)
-               return FAILED ("array append failed");
-
-       g_array_free (array, TRUE);
-
-       return NULL;
-}
-
-RESULT
-test_array_insert_val ()
-{
-       GArray *array = g_array_new (FALSE, FALSE, sizeof (gpointer));
-       gpointer ptr0, ptr1, ptr2, ptr3;
-
-       g_array_insert_val (array, 0, array);
-
-       if (array != g_array_index (array, gpointer, 0))
-               return FAILED ("1 The value in the array is incorrect");
-
-       g_array_insert_val (array, 1, array);
-       if (array != g_array_index (array, gpointer, 1))
-               return FAILED ("2 The value in the array is incorrect");
-
-       g_array_insert_val (array, 2, array);
-       if (array != g_array_index (array, gpointer, 2))
-               return FAILED ("3 The value in the array is incorrect");
-       
-       g_array_free (array, TRUE);
-       array = g_array_new (FALSE, FALSE, sizeof (gpointer));
-       ptr0 = array;
-       ptr1 = array + 1;
-       ptr2 = array + 2;
-       ptr3 = array + 3;
-
-       g_array_insert_val (array, 0, ptr0);
-       g_array_insert_val (array, 1, ptr1);
-       g_array_insert_val (array, 2, ptr2);
-       g_array_insert_val (array, 1, ptr3);
-       if (ptr0 != g_array_index (array, gpointer, 0))
-               return FAILED ("4 The value in the array is incorrect");
-       if (ptr3 != g_array_index (array, gpointer, 1))
-               return FAILED ("5 The value in the array is incorrect");
-       if (ptr1 != g_array_index (array, gpointer, 2))
-               return FAILED ("6 The value in the array is incorrect");
-       if (ptr2 != g_array_index (array, gpointer, 3))
-               return FAILED ("7 The value in the array is incorrect");
-
-       g_array_free (array, TRUE);
-       return NULL;
-}
-
-RESULT
-test_array_remove ()
-{
-       GArray *array = g_array_new (FALSE, FALSE, sizeof (int));
-       int v[] = {30, 29, 28, 27, 26, 25};
-
-       g_array_append_vals (array, v, 6);
-
-       if (6 != array->len)
-               return FAILED ("append_vals fail");
-
-       g_array_remove_index (array, 3);
-
-       if (5 != array->len)
-               return FAILED ("remove_index failed to update length");
-
-       if (26 != g_array_index (array, int, 3))
-               return FAILED ("remove_index failed to update the array");
-
-       g_array_free (array, TRUE);
-
-       return NULL;
-}
-
-static Test array_tests [] = {
-       {"big", test_array_big},
-       {"append", test_array_append},
-       {"insert_val", test_array_insert_val},
-       {"index", test_array_index},
-       {"remove", test_array_remove},
-       {"append_zero_term", test_array_append_zero_terminated},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(array_tests_init, array_tests)
diff --git a/eglib/test/dir.c b/eglib/test/dir.c
deleted file mode 100644 (file)
index f871121..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <config.h>
-#include <glib.h>
-#include <string.h>
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef G_OS_UNIX
-#include <pthread.h>
-#endif
-#include "test.h"
-
-/* This test is just to be used with valgrind */
-RESULT
-test_dir ()
-{
-       GDir *dir;
-       GError *error;
-       const gchar *name;
-
-       /*
-       dir = g_dir_open (NULL, 0, NULL);
-       */
-       dir = g_dir_open ("", 0, NULL);
-       if (dir != NULL)
-               return FAILED ("1 Should be an error");
-
-       dir = g_dir_open ("", 9, NULL);
-       if (dir != NULL)
-               return FAILED ("2 Should be an error");
-
-       error = NULL;
-       dir = g_dir_open (".ljasdslakjd", 9, &error);
-       if (dir != NULL)
-               return FAILED ("3 opendir should fail");
-       if (error == NULL)
-               return FAILED ("4 got no error");
-       g_error_free (error);
-       error = NULL;
-       dir = g_dir_open (g_get_tmp_dir (), 9, &error);
-       if (dir == NULL)
-               return FAILED ("5 opendir should succeed");
-       if (error != NULL)
-               return FAILED ("6 got an error");
-       name = NULL;
-       name = g_dir_read_name (dir);
-       if (name == NULL)
-               return FAILED ("7 didn't read a file name");
-       while ((name = g_dir_read_name (dir)) != NULL) {
-               if (strcmp (name, ".") == 0)
-                       return FAILED (". directory found");
-               if (strcmp (name, "..") == 0)
-                       return FAILED (".. directory found");
-       }
-       g_dir_close (dir);
-       return OK;
-}
-
-static Test dir_tests [] = {
-       {"g_dir_*", test_dir},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(dir_tests_init, dir_tests)
-
-
diff --git a/eglib/test/driver.c b/eglib/test/driver.c
deleted file mode 100644 (file)
index 806e8b6..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * EGLib Unit Test Driver
- *
- * Author:
- *   Aaron Bockover (abockover@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <config.h>
-#include "test.h"
-
-#ifndef DRIVER_EXTERNAL_TESTS
-#include "tests.h"
-#endif
-
-#include <stdio.h>
-#ifdef HAVE_GETOPT_H
-#include <getopt.h>
-#endif
-
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-
-#ifndef DRIVER_NAME
-#define DRIVER_NAME "EGlib"
-#endif
-
-typedef struct _StringArray {
-       gchar **strings;
-       gint length;
-} StringArray;
-
-static StringArray *
-string_array_append(StringArray *array, gchar *string)
-{
-       if(array == NULL) {
-               array = g_new0(StringArray, 1);
-               array->length = 1;
-               array->strings = g_malloc(sizeof(gchar *) * 2);
-       } else {
-               array->length++;
-               array->strings = g_realloc(array->strings, sizeof(gchar *) 
-                       * (array->length + 1));
-       }
-       
-       array->strings[array->length - 1] = string;
-       array->strings[array->length] = NULL;
-
-       return array;
-}
-
-gint global_passed = 0, global_tests = 0;
-
-static void
-string_array_free(StringArray *array)
-{
-       g_free(array->strings);
-       g_free(array);
-}
-
-static void print_help(char *s)
-{
-       gint i;
-       
-       printf("Usage: %s [OPTION]... [TESTGROUP]...\n\n", s);
-       printf("OPTIONS are:\n");
-       printf("  -h, --help          show this help\n");
-       printf("  -t, --time          time the tests\n");
-       printf("  -i, --iterations    number of times to run tests\n");
-       printf("  -q, --quiet         do not print test results; "
-               "final time always prints\n");
-       printf("  -n, --no-labels     print final time without labels, "
-               "nice for scripts\n");
-       printf("  -d, --debug         do not run tests, "
-               "debug the driver itself for valgrind\n\n");
-       printf("TESTGROUPS available:\n");
-
-       for(i = 0; test_groups[i].name != NULL; i++) {
-               if(test_groups[i].handler != fake_tests_init) {
-                       printf("  %s\n", test_groups[i].name);
-               }
-       }
-
-       printf("\n");
-}
-
-#ifdef DRIVER_EXTERNAL_MAIN
-gint run_tests_main(gint argc, gchar **argv)
-#else
-gint main(gint argc, gchar **argv)
-#endif
-{
-       gint i, j, c, iterations = 1;
-       StringArray *tests_to_run = NULL;
-       gdouble time_start;
-       gboolean report_time = FALSE;
-       gboolean quiet = FALSE;
-       gboolean global_failure = FALSE;
-       gboolean no_final_time_labels = FALSE;
-       gboolean debug = FALSE;
-
-#if HAVE_GETOPT_H
-       static struct option long_options [] = {
-               {"help",       no_argument,       0, 'h'},
-               {"time",       no_argument,       0, 't'},
-               {"quiet",      no_argument,       0, 'q'},
-               {"iterations", required_argument, 0, 'i'},
-               {"debug",      no_argument,       0, 'd'},
-               {"no-labels",  no_argument,       0, 'n'},
-               {0, 0, 0, 0}
-       };
-
-       while((c = getopt_long(argc, argv, "dhtqni:", long_options, NULL)) != -1) {                     switch(c) {
-                       case 'h':
-                               print_help(argv[0]);
-                               return 1;
-                       case 't':
-                               report_time = TRUE;
-                               break;
-                       case 'i':
-                               iterations = atoi(optarg);
-                               break;
-                       case 'q':
-                               quiet = TRUE;
-                               break;
-                       case 'n':
-                               no_final_time_labels = TRUE;
-                               break;
-                       case 'd':
-                               debug = TRUE;
-                               break;
-               }
-       }
-
-       for(i = optind; i < argc; i++) {
-               if(argv[i][0] == '-') {
-                       continue;
-               }
-
-               tests_to_run = string_array_append(tests_to_run, argv[i]);
-       }
-#endif
-
-       time_start = get_timestamp();
-       
-       for(j = 0; test_groups[j].name != NULL; j++) {
-               gboolean run = TRUE;
-               gchar *tests = NULL;
-               gchar *group = NULL;
-               
-               if(tests_to_run != NULL) {
-                       gint k;
-                       run = FALSE;
-                       
-                       for(k = 0; k < tests_to_run->length; k++) {     
-                               gchar *user = tests_to_run->strings[k];
-                               const gchar *table = test_groups[j].name;
-                               size_t user_len = strlen(user);
-                               size_t table_len = strlen(table);
-                               
-                               if(strncmp(user, table, table_len) == 0) {
-                                       if(user_len > table_len && user[table_len] != ':') {
-                                               break;
-                                       }
-                                       
-                                       run = TRUE;
-                                       group = tests_to_run->strings[k];
-                                       break;
-                               }
-                       }
-               }
-       
-               if(run) {
-                       gboolean passed;
-                       gchar **split = NULL;
-                       
-                       if(debug && test_groups[j].handler != fake_tests_init) {
-                               printf("Skipping %s, in driver debug mode\n", 
-                                       test_groups[j].name);
-                               continue;
-                       } else if(!debug && test_groups[j].handler == fake_tests_init) {
-                               continue;
-                       }
-
-                       if(group != NULL) {
-                               split = eg_strsplit(group, ":", -1);    
-                               if(split != NULL) {
-                                       gint m;
-                                       for(m = 0; split[m] != NULL; m++) {
-                                               if(m == 1) {
-                                                       tests = strdup(split[m]);
-                                                       break;
-                                               }
-                                       }
-                                       eg_strfreev(split);
-                               }
-                       }
-                       
-                       passed = run_group(&(test_groups[j]), 
-                               iterations, quiet, report_time, tests);
-
-                       if(tests != NULL) {
-                               g_free(tests);
-                       }
-
-                       if(!passed && !global_failure) {
-                               global_failure = TRUE;
-                       }
-               }
-       }
-       
-       if(!quiet) {
-               gdouble pass_percentage = ((gdouble)global_passed / (gdouble)global_tests) * 100.0;
-               printf("=============================\n");
-               printf("Overall result: %s : %d / %d (%g%%)\n", global_failure ? "FAILED" : "OK", global_passed, global_tests, pass_percentage);
-       }
-       
-       if(report_time) {
-               gdouble duration = get_timestamp() - time_start;
-               if(no_final_time_labels) {
-                       printf("%g\n", duration);
-               } else {
-                       printf("%s Total Time: %g\n", DRIVER_NAME, duration);
-               }
-       }
-
-       if(tests_to_run != NULL) {
-               string_array_free(tests_to_run);
-       }
-
-       return global_tests - global_passed;
-}
-
-
diff --git a/eglib/test/endian.c b/eglib/test/endian.c
deleted file mode 100644 (file)
index 3347d76..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "test.h"
-
-RESULT
-test_swap ()
-{
-       guint32 a = 0xabcdef01, res32;
-       guint64 b = (((guint64)a) << 32) | a, res64;
-       guint64 b_expect = (((guint64)0x1efcdab) << 32) | 0x01efcdab;
-       guint16 c = 0xabcd, res16;
-       
-       res32 = GUINT32_SWAP_LE_BE (a);
-       if (res32 != 0x01efcdab)
-               return FAILED ("GUINT32_SWAP_LE_BE returned 0x%x", res32);
-       res32 = GUINT32_SWAP_LE_BE (1);
-       if (res32 != 0x1000000)
-               return FAILED ("GUINT32_SWAP_LE_BE returned 0x%x", res32);
-
-       res64 = GUINT64_SWAP_LE_BE(b);
-       if (res64 != b_expect)
-               return FAILED ("GUINT64_SWAP_LE_BE returned 0x%llx (had=0x%llx)", res64, b);
-       res16 = GUINT16_SWAP_LE_BE(c);
-       if (res16 != 0xcdab)
-               return FAILED ("GUINT16_SWAP_LE_BE returned 0x%x", (guint32) res16);    
-       
-       return OK;
-}
-
-/*
- * test initialization
- */
-
-static Test endian_tests [] = {
-       {"swap", test_swap},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(endian_tests_init, endian_tests)
-
diff --git a/eglib/test/fake.c b/eglib/test/fake.c
deleted file mode 100644 (file)
index c8d9af6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Fake test allows debugging of the driver itself
- */
-#include "test.h"
-
-RESULT
-test_fake()
-{
-       return OK;
-}
-
-static Test fake_tests [] = {
-       {"fake", test_fake},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(fake_tests_init, fake_tests)
-
diff --git a/eglib/test/file.c b/eglib/test/file.c
deleted file mode 100644 (file)
index 19276c9..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-#include <config.h>
-#include <glib.h>
-#include <string.h>
-#include <stdlib.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include "test.h"
-
-#ifdef G_OS_WIN32
-#include <io.h>
-#define close _close
-#endif
-
-RESULT
-test_file_get_contents ()
-{
-       GError *error;
-       gchar *content;
-       gboolean ret;
-       gsize length;
-#ifdef G_OS_WIN32
-       const gchar *filename = "c:\\Windows\\system.ini";
-#else
-       const gchar *filename = "/etc/hosts";
-#endif
-
-       /*
-       filename != NULL
-       ret = g_file_get_contents (NULL, NULL, NULL, NULL);
-       contents != NULL
-       ret = g_file_get_contents ("", NULL, NULL, NULL);
-       error no such file and fails for 'error' not being null too
-       ret = g_file_get_contents ("", &content, NULL, &error);
-       */
-
-       error = NULL;
-       ret = g_file_get_contents ("", &content, NULL, &error);
-       if (ret)
-               return FAILED ("HAH!");
-       if (error == NULL)
-               return FAILED ("Got nothing as error.");
-       if (content != NULL)
-               return FAILED ("Content is uninitialized");
-
-       g_error_free (error);
-       error = NULL;
-       ret = g_file_get_contents (filename, &content, &length, &error);
-       if (!ret)
-               return FAILED ("The error is %d %s\n", error->code, error->message);
-       if (error != NULL)
-               return FAILED ("Got an error returning TRUE");
-       if (content == NULL)
-               return FAILED ("Content is NULL");
-       if (strlen (content) != length)
-               return FAILED ("length is %d but the string is %d", length, strlen (content));
-       g_free (content);
-
-       return OK;
-}
-
-RESULT
-test_open_tmp ()
-{
-       GError *error;
-       gint fd;
-       gchar *name = GINT_TO_POINTER (-1);
-
-       /*
-        * Okay, this works, but creates a .xxx file in /tmp on every run. Disabled.
-        * fd = g_file_open_tmp (NULL, NULL, NULL);
-        * if (fd < 0)
-        *      return FAILED ("Default failed.");
-        * close (fd);
-       */
-       error = NULL;
-       fd = g_file_open_tmp ("invalidtemplate", NULL, &error);
-       if (fd != -1)
-               return FAILED ("The template was invalid and accepted");
-       if (error == NULL)
-               return FAILED ("No error returned.");
-       g_error_free (error);
-
-       error = NULL;
-       fd = g_file_open_tmp ("i/nvalidtemplate", &name, &error);
-       if (fd != -1)
-               return FAILED ("The template was invalid and accepted");
-       if (error == NULL)
-               return FAILED ("No error returned.");
-       if (name == NULL)
-               return FAILED ("'name' is not reset");
-       g_error_free (error);
-
-       error = NULL;
-       fd = g_file_open_tmp ("valid-XXXXXX", &name, &error);
-       if (fd == -1)
-               return FAILED ("This should be valid");
-       if (error != NULL)
-               return FAILED ("No error returned.");
-       if (name == NULL)
-               return FAILED ("No name returned.");
-       close (fd);
-       unlink (name);
-       g_free (name);
-       return OK;
-}
-
-RESULT
-test_file ()
-{
-       gboolean res;
-       const gchar *tmp;
-       gchar *path;
-
-#ifndef G_OS_WIN32 /* FIXME */
-       gchar *sympath;
-       gint ignored G_GNUC_UNUSED;
-#endif
-
-       res = g_file_test (NULL, 0);
-       if (res)
-               return FAILED ("Should return FALSE HERE");
-
-       res = g_file_test ("file.c", 0);
-       if (res)
-               return FAILED ("Should return FALSE HERE");
-
-       tmp = g_get_tmp_dir ();
-       res = g_file_test (tmp, G_FILE_TEST_EXISTS);
-       if (!res)
-               return FAILED ("tmp does not exist.");
-       res = g_file_test (tmp, G_FILE_TEST_IS_REGULAR);
-       if (res)
-               return FAILED ("tmp is regular");
-
-       res = g_file_test (tmp, G_FILE_TEST_IS_DIR);
-       if (!res)
-               return FAILED ("tmp is not a directory");
-       res = g_file_test (tmp, G_FILE_TEST_IS_EXECUTABLE);
-       if (!res)
-               return FAILED ("tmp is not a executable");
-
-       res = g_file_test (tmp, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_SYMLINK);
-       if (!res)
-               return FAILED ("2 tmp does not exist.");
-       res = g_file_test (tmp, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK);
-       if (res)
-               return FAILED ("2 tmp is regular");
-
-       res = g_file_test (tmp, G_FILE_TEST_IS_DIR | G_FILE_TEST_IS_SYMLINK);
-       if (!res)
-               return FAILED ("2 tmp is not a directory");
-       res = g_file_test (tmp, G_FILE_TEST_IS_EXECUTABLE | G_FILE_TEST_IS_SYMLINK);
-       if (!res)
-               return FAILED ("2 tmp is not a executable");
-
-       close (g_file_open_tmp (NULL, &path, NULL)); /* create an empty file */
-       res = g_file_test (path, G_FILE_TEST_EXISTS);
-       if (!res)
-               return FAILED ("3 %s should exist", path);
-       res = g_file_test (path, G_FILE_TEST_IS_REGULAR);
-       /* This is strange. Empty file is reported as not existing! */
-       if (!res)
-               return FAILED ("3 %s IS_REGULAR", path);
-       res = g_file_test (path, G_FILE_TEST_IS_DIR);
-       if (res)
-               return FAILED ("3 %s should not be a directory", path);
-       res = g_file_test (path, G_FILE_TEST_IS_EXECUTABLE);
-       if (res)
-               return FAILED ("3 %s should not be executable", path);
-       res = g_file_test (path, G_FILE_TEST_IS_SYMLINK);
-       if (res)
-               return FAILED ("3 %s should not be a symlink", path);
-
-#ifndef G_OS_WIN32 /* FIXME */
-       sympath = g_strconcat (path, "-link", NULL);
-       ignored = symlink (path, sympath);
-       res = g_file_test (sympath, G_FILE_TEST_EXISTS);
-       if (!res)
-               return FAILED ("4 %s should not exist", sympath);
-       res = g_file_test (sympath, G_FILE_TEST_IS_REGULAR);
-       if (!res)
-               return FAILED ("4 %s should not be a regular file", sympath);
-       res = g_file_test (sympath, G_FILE_TEST_IS_DIR);
-       if (res)
-               return FAILED ("4 %s should not be a directory", sympath);
-       res = g_file_test (sympath, G_FILE_TEST_IS_EXECUTABLE);
-       if (res)
-               return FAILED ("4 %s should not be executable", sympath);
-       res = g_file_test (sympath, G_FILE_TEST_IS_SYMLINK);
-       if (!res)
-               return FAILED ("4 %s should be a symlink", sympath);
-
-       unlink (path);
-
-       res = g_file_test (sympath, G_FILE_TEST_EXISTS);
-       if (res)
-               return FAILED ("5 %s should exist", sympath);
-       res = g_file_test (sympath, G_FILE_TEST_IS_REGULAR);
-       if (res)
-               return FAILED ("5 %s should be a regular file", sympath);
-       res = g_file_test (sympath, G_FILE_TEST_IS_DIR);
-       if (res)
-               return FAILED ("5 %s should not be a directory", sympath);
-       res = g_file_test (sympath, G_FILE_TEST_IS_EXECUTABLE);
-       if (res)
-               return FAILED ("5 %s should not be executable", sympath);
-       res = g_file_test (sympath, G_FILE_TEST_IS_SYMLINK);
-       if (!res)
-               return FAILED ("5 %s should be a symlink", sympath);
-       unlink (sympath);
-       g_free (sympath);
-#endif
-       g_free (path);
-       return OK;
-}
-
-static Test file_tests [] = {
-       {"g_file_get_contents", test_file_get_contents},
-       {"g_file_open_tmp", test_open_tmp},
-       {"g_file_test", test_file},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(file_tests_init, file_tests)
-
-
diff --git a/eglib/test/hashtable.c b/eglib/test/hashtable.c
deleted file mode 100644 (file)
index 8eb9885..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-#include "test.h"
-
-int foreach_count = 0;
-int foreach_fail = 0;
-
-void foreach (gpointer key, gpointer value, gpointer user_data)
-{
-       foreach_count++;
-       if (GPOINTER_TO_INT (user_data) != 'a')
-               foreach_fail = 1;
-}
-
-RESULT hash_t1 (void)
-{
-       GHashTable *t = g_hash_table_new (g_str_hash, g_str_equal);
-
-       foreach_count = 0;
-       foreach_fail = 0;
-       g_hash_table_insert (t, "hello", "world");
-       g_hash_table_insert (t, "my", "god");
-
-       g_hash_table_foreach (t, foreach, GINT_TO_POINTER('a'));
-       if (foreach_count != 2)
-               return FAILED ("did not find all keys, got %d expected 2", foreach_count);
-       if (foreach_fail)
-               return FAILED("failed to pass the user-data to foreach");
-       
-       if (!g_hash_table_remove (t, "my"))
-               return FAILED ("did not find known key");
-       if (g_hash_table_size (t) != 1)
-               return FAILED ("unexpected size");
-       g_hash_table_insert(t, "hello", "moon");
-       if (strcmp (g_hash_table_lookup (t, "hello"), "moon") != 0)
-               return FAILED ("did not replace world with moon");
-               
-       if (!g_hash_table_remove (t, "hello"))
-               return FAILED ("did not find known key");
-       if (g_hash_table_size (t) != 0)
-               return FAILED ("unexpected size");
-       g_hash_table_destroy (t);
-
-       return OK;
-}
-
-RESULT hash_t2 (void)
-{
-       return OK;
-}
-
-RESULT hash_default (void)
-{
-       GHashTable *hash = g_hash_table_new (NULL, NULL);
-
-       if (hash == NULL)
-               return FAILED ("g_hash_table_new should return a valid hash");
-
-       g_hash_table_destroy (hash);
-       return NULL;
-}
-
-RESULT
-hash_null_lookup (void)
-{
-       GHashTable *hash = g_hash_table_new (NULL, NULL);
-       gpointer ok, ov;
-               
-       g_hash_table_insert (hash, NULL, GINT_TO_POINTER (1));
-       g_hash_table_insert (hash, GINT_TO_POINTER(1), GINT_TO_POINTER(2));
-
-       if (!g_hash_table_lookup_extended (hash, NULL, &ok, &ov))
-               return FAILED ("Did not find the NULL");
-       if (ok != NULL)
-               return FAILED ("Incorrect key found");
-       if (ov != GINT_TO_POINTER (1))
-               return FAILED ("Got wrong value %p\n", ov);
-
-       if (!g_hash_table_lookup_extended (hash, GINT_TO_POINTER(1), &ok, &ov))
-               return FAILED ("Did not find the 1");
-       if (ok != GINT_TO_POINTER(1))
-               return FAILED ("Incorrect key found");
-       if (ov != GINT_TO_POINTER (2))
-               return FAILED ("Got wrong value %p\n", ov);
-       
-       g_hash_table_destroy (hash);
-
-       return NULL;
-}
-
-static void
-counter (gpointer key, gpointer value, gpointer user_data)
-{
-       int *counter = (int *) user_data;
-
-       (*counter)++;
-}
-
-RESULT hash_grow (void)
-{
-       GHashTable *hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-       int i, count = 0;
-       
-       for (i = 0; i < 1000; i++)
-               g_hash_table_insert (hash, g_strdup_printf ("%d", i), g_strdup_printf ("x-%d", i));
-
-       for (i = 0; i < 1000; i++){
-               char buffer [30];
-               gpointer value;
-               
-               sprintf (buffer, "%d", i);
-
-               value = g_hash_table_lookup (hash, buffer);
-               sprintf (buffer, "x-%d", i);
-               if (strcmp (value, buffer) != 0){
-                       return FAILED ("Failed to lookup the key %d, the value was %s\n", i, value);
-               }
-       }
-
-       if (g_hash_table_size (hash) != 1000)
-               return FAILED ("Did not find 1000 elements on the hash, found %d\n", g_hash_table_size (hash));
-
-       /* Now do the manual count, lets not trust the internals */
-       g_hash_table_foreach (hash, counter, &count);
-       if (count != 1000){
-               return FAILED ("Foreach count is not 1000");
-       }
-
-       g_hash_table_destroy (hash);
-       return NULL;
-}
-
-RESULT hash_iter (void)
-{
-#if !defined(GLIB_MAJOR_VERSION) || GLIB_CHECK_VERSION(2, 16, 0)
-       GHashTable *hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
-       GHashTableIter iter;
-       int i, sum, keys_sum, values_sum;
-       gpointer key, value;
-
-       sum = 0;
-       for (i = 0; i < 1000; i++) {
-               sum += i;
-               g_hash_table_insert (hash, GUINT_TO_POINTER (i), GUINT_TO_POINTER (i));
-       }
-
-       keys_sum = values_sum = 0;
-       g_hash_table_iter_init (&iter, hash);
-       while (g_hash_table_iter_next (&iter, &key, &value)) {
-               if (key != value)
-                       return FAILED ("key != value");
-               keys_sum += GPOINTER_TO_UINT (key);
-               values_sum += GPOINTER_TO_UINT (value);
-       }
-       if (keys_sum != sum || values_sum != sum)
-               return FAILED ("Did not find all key-value pairs");
-       g_hash_table_destroy (hash);
-       return NULL;
-#else
-       /* GHashTableIter was added in glib 2.16 */
-       return NULL;
-#endif
-}
-
-static Test hashtable_tests [] = {
-       {"t1", hash_t1},
-       {"t2", hash_t2},
-       {"grow", hash_grow},
-       {"default", hash_default},
-       {"null_lookup", hash_null_lookup},
-       {"iter", hash_iter},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(hashtable_tests_init, hashtable_tests)
-
diff --git a/eglib/test/list.c b/eglib/test/list.c
deleted file mode 100644 (file)
index 68dadee..0000000
+++ /dev/null
@@ -1,438 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-#include "test.h"
-
-RESULT
-test_list_length ()
-{
-       GList *list = g_list_prepend (NULL, "foo");
-
-       if (g_list_length (list) != 1)
-               return FAILED ("length failed. #1");
-
-       list = g_list_prepend (list, "bar");
-       if (g_list_length (list) != 2)
-               return FAILED ("length failed. #2");
-
-       list = g_list_append (list, "bar");
-       if (g_list_length (list) != 3)
-               return FAILED ("length failed. #3");
-
-       g_list_free (list);
-       return NULL;
-}
-
-RESULT
-test_list_nth ()
-{
-       char *foo = "foo";
-       char *bar = "bar";
-       char *baz = "baz";
-       GList *nth, *list;
-       list = g_list_prepend (NULL, baz);
-       list = g_list_prepend (list, bar);
-       list = g_list_prepend (list, foo);
-
-       nth = g_list_nth (list, 0);
-       if (nth->data != foo)
-               return FAILED ("nth failed. #0");
-
-       nth = g_list_nth (list, 1);
-       if (nth->data != bar)
-               return FAILED ("nth failed. #1");
-       
-       nth = g_list_nth (list, 2);
-       if (nth->data != baz)
-               return FAILED ("nth failed. #2");
-
-       nth = g_list_nth (list, 3);
-       if (nth)
-               return FAILED ("nth failed. #3: %s", nth->data);
-
-       g_list_free (list);
-       return OK;
-}
-
-RESULT
-test_list_index ()
-{
-       int i;
-       char *foo = "foo";
-       char *bar = "bar";
-       char *baz = "baz";
-       GList *list;
-       list = g_list_prepend (NULL, baz);
-       list = g_list_prepend (list, bar);
-       list = g_list_prepend (list, foo);
-
-       i = g_list_index (list, foo);
-       if (i != 0)
-               return FAILED ("index failed. #0: %d", i);
-
-       i = g_list_index (list, bar);
-       if (i != 1)
-               return FAILED ("index failed. #1: %d", i);
-       
-       i = g_list_index (list, baz);
-       if (i != 2)
-               return FAILED ("index failed. #2: %d", i);
-
-       g_list_free (list);
-       return OK;
-}
-
-RESULT
-test_list_append ()
-{
-       GList *list = g_list_prepend (NULL, "first");
-       if (g_list_length (list) != 1)
-               return FAILED ("Prepend failed");
-
-       list = g_list_append (list, "second");
-
-       if (g_list_length (list) != 2)
-               return FAILED ("Append failed");
-
-       g_list_free (list);
-       return OK;
-}
-
-RESULT
-test_list_last ()
-{
-       GList *foo = g_list_prepend (NULL, "foo");
-       GList *bar = g_list_prepend (NULL, "bar");
-       GList *last;
-       
-       foo = g_list_concat (foo, bar);
-       last = g_list_last (foo);
-
-       if (last != bar)
-               return FAILED ("last failed. #1");
-
-       foo = g_list_concat (foo, g_list_prepend (NULL, "baz"));
-       foo = g_list_concat (foo, g_list_prepend (NULL, "quux"));
-
-       last = g_list_last (foo);       
-       if (strcmp ("quux", last->data))
-               return FAILED ("last failed. #2");
-
-       g_list_free (foo);
-
-       return OK;
-}
-
-RESULT
-test_list_concat ()
-{
-       GList *foo = g_list_prepend (NULL, "foo");
-       GList *bar = g_list_prepend (NULL, "bar");
-       GList *list = g_list_concat (foo, bar);
-
-       if (g_list_length (list) != 2)
-               return FAILED ("Concat failed. #1");
-
-       if (strcmp (list->data, "foo"))
-               return FAILED ("Concat failed. #2");
-
-       if (strcmp (list->next->data, "bar"))
-               return FAILED ("Concat failed. #3");
-
-       if (g_list_first (list) != foo)
-               return FAILED ("Concat failed. #4");
-       
-       if (g_list_last (list) != bar)
-               return FAILED ("Concat failed. #5");
-
-       g_list_free (list);
-
-       return OK;
-}
-
-
-static gint
-compare (gconstpointer a, gconstpointer b)
-{
-       char *foo = (char *) a;
-       char *bar = (char *) b;
-
-       if (strlen (foo) < strlen (bar))
-               return -1;
-
-       return 1;
-}
-
-RESULT
-test_list_insert_sorted ()
-{
-       GList *list = g_list_prepend (NULL, "a");
-       list = g_list_append (list, "aaa");
-
-       /* insert at the middle */
-       list = g_list_insert_sorted (list, "aa", compare);
-       if (strcmp ("aa", list->next->data))
-               return FAILED ("insert_sorted failed. #1");
-
-       /* insert at the beginning */
-       list = g_list_insert_sorted (list, "", compare);
-       if (strcmp ("", list->data))
-               return FAILED ("insert_sorted failed. #2");             
-
-       /* insert at the end */
-       list = g_list_insert_sorted (list, "aaaa", compare);
-       if (strcmp ("aaaa", g_list_last (list)->data))
-               return FAILED ("insert_sorted failed. #3");
-
-       g_list_free (list);
-       return OK;
-}
-
-RESULT
-test_list_copy ()
-{
-       int i, length;
-       GList *list, *copy;
-       list = g_list_prepend (NULL, "a");
-       list = g_list_append  (list, "aa");
-       list = g_list_append  (list, "aaa");
-       list = g_list_append  (list, "aaaa");
-
-       length = g_list_length (list);
-       copy = g_list_copy (list);
-
-       for (i = 0; i < length; i++)
-               if (strcmp (g_list_nth (list, i)->data,
-                           g_list_nth (copy, i)->data))
-                       return FAILED ("copy failed.");
-
-       g_list_free (list);
-       g_list_free (copy);     
-       return OK;
-}
-
-RESULT
-test_list_reverse ()
-{
-       guint i, length;
-       GList *list, *reverse;
-       list = g_list_prepend (NULL, "a");
-       list = g_list_append  (list, "aa");
-       list = g_list_append  (list, "aaa");
-       list = g_list_append  (list, "aaaa");
-
-       length  = g_list_length (list);
-       reverse = g_list_reverse (g_list_copy (list));
-
-       if (g_list_length (reverse) != length)
-               return FAILED ("reverse failed #1");
-
-       for (i = 0; i < length; i++){
-               guint j = length - i - 1;
-               if (strcmp (g_list_nth (list, i)->data,
-                           g_list_nth (reverse, j)->data))
-                       return FAILED ("reverse failed. #2");
-       }
-
-       g_list_free (list);
-       g_list_free (reverse);  
-       return OK;
-}
-
-RESULT
-test_list_remove ()
-{
-       GList *list = g_list_prepend (NULL, "three");
-       char *one = "one";
-       list = g_list_prepend (list, "two");
-       list = g_list_prepend (list, one);
-
-       list = g_list_remove (list, one);
-
-       if (g_list_length (list) != 2)
-               return FAILED ("Remove failed");
-
-       if (strcmp ("two", list->data) != 0)
-               return FAILED ("Remove failed");
-
-       g_list_free (list);
-       return OK;
-}
-
-RESULT
-test_list_remove_link ()
-{
-       GList *foo = g_list_prepend (NULL, "a");
-       GList *bar = g_list_prepend (NULL, "b");
-       GList *baz = g_list_prepend (NULL, "c");
-       GList *list = foo;
-
-       foo = g_list_concat (foo, bar);
-       foo = g_list_concat (foo, baz); 
-
-       list = g_list_remove_link (list, bar);
-
-       if (g_list_length (list) != 2)
-               return FAILED ("remove_link failed #1");
-
-       if (bar->next != NULL)
-               return FAILED ("remove_link failed #2");
-
-       g_list_free (list);     
-       g_list_free (bar);
-       return OK;
-}
-
-RESULT
-test_list_insert_before ()
-{
-       GList *foo, *bar, *baz;
-
-       foo = g_list_prepend (NULL, "foo");
-       foo = g_list_insert_before (foo, NULL, "bar");
-       bar = g_list_last (foo);
-
-       if (strcmp (bar->data, "bar"))
-               return FAILED ("1");
-
-       baz = g_list_insert_before (foo, bar, "baz");
-       if (foo != baz)
-               return FAILED ("2");
-
-       if (strcmp (g_list_nth_data (foo, 1), "baz"))
-               return FAILED ("3: %s", g_list_nth_data (foo, 1));      
-
-       g_list_free (foo);
-       return OK;
-}
-
-#define N_ELEMS 101
-
-static int intcompare (gconstpointer p1, gconstpointer p2)
-{
-       return GPOINTER_TO_INT (p1) - GPOINTER_TO_INT (p2);
-}
-
-static gboolean verify_sort (GList *list, int len)
-{
-       int prev;
-
-       if (list->prev)
-               return FALSE;
-
-       prev = GPOINTER_TO_INT (list->data);
-       len--;
-       for (list = list->next; list; list = list->next) {
-               int curr = GPOINTER_TO_INT (list->data);
-               if (prev > curr)
-                       return FALSE;
-               prev = curr;
-
-               if (!list->prev || list->prev->next != list)
-                       return FALSE;
-
-               if (len == 0)
-                       return FALSE;
-               len--;
-       }
-       return len == 0;
-}
-
-RESULT
-test_list_sort ()
-{
-       int i, j, mul;
-       GList *list = NULL;
-
-       for (i = 0; i < N_ELEMS; ++i)
-               list = g_list_prepend (list, GINT_TO_POINTER (i));
-       list = g_list_sort (list, intcompare);
-       if (!verify_sort (list, N_ELEMS))
-               return FAILED ("decreasing list");
-
-       g_list_free (list);
-
-       list = NULL;
-       for (i = 0; i < N_ELEMS; ++i)
-               list = g_list_prepend (list, GINT_TO_POINTER (-i));
-       list = g_list_sort (list, intcompare);
-       if (!verify_sort (list, N_ELEMS))
-               return FAILED ("increasing list");
-
-       g_list_free (list);
-
-       list = g_list_prepend (NULL, GINT_TO_POINTER (0));
-       for (i = 1; i < N_ELEMS; ++i) {
-               list = g_list_prepend (list, GINT_TO_POINTER (i));
-               list = g_list_prepend (list, GINT_TO_POINTER (-i));
-       }
-       list = g_list_sort (list, intcompare);
-       if (!verify_sort (list, 2*N_ELEMS-1))
-               return FAILED ("alternating list");
-
-       g_list_free (list);
-
-       list = NULL;
-       mul = 1;
-       for (i = 1; i < N_ELEMS; ++i) {
-               mul = -mul;
-               for (j = 0; j < i; ++j)
-                       list = g_list_prepend (list, GINT_TO_POINTER (mul * j));
-       }
-       list = g_list_sort (list, intcompare);
-       if (!verify_sort (list, (N_ELEMS*N_ELEMS - N_ELEMS)/2))
-               return FAILED ("wavering list");
-
-       g_list_free (list);
-
-       return OK;
-}
-
-static gint
-find_custom (gconstpointer a, gconstpointer b)
-{
-       return(strcmp (a, b));
-}
-
-RESULT
-test_list_find_custom ()
-{
-       GList *list = NULL, *found;
-       char *foo = "foo";
-       char *bar = "bar";
-       char *baz = "baz";
-       
-       list = g_list_prepend (list, baz);
-       list = g_list_prepend (list, bar);
-       list = g_list_prepend (list, foo);
-       
-       found = g_list_find_custom (list, baz, find_custom);
-       
-       if (found == NULL)
-               return FAILED ("Find failed");
-       
-       g_list_free (list);
-       
-       return OK;
-}
-
-static Test list_tests [] = {
-       {       "length", test_list_length},
-       {          "nth", test_list_nth},
-       {        "index", test_list_index},     
-       {         "last", test_list_last},      
-       {       "append", test_list_append},
-       {       "concat", test_list_concat},
-       {"insert_sorted", test_list_insert_sorted},
-       {"insert_before", test_list_insert_before},
-       {         "copy", test_list_copy},
-       {      "reverse", test_list_reverse},
-       {       "remove", test_list_remove},
-       {  "remove_link", test_list_remove_link},
-       {  "remove_link", test_list_remove_link},
-       {         "sort", test_list_sort},
-       {  "find_custom", test_list_find_custom},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(list_tests_init, list_tests)
diff --git a/eglib/test/markup.c b/eglib/test/markup.c
deleted file mode 100644 (file)
index cf8d3f2..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-#include "test.h"
-
-#define do_bad_test(s) do { char *r = markup_test (s); if (r == NULL) return FAILED ("Failed on test " # s); else g_free (r); } while (0)
-#define do_ok_test(s) do { char *r = markup_test (s); if (r != NULL) return FAILED ("Could not parse valid " # s); } while (0)
-
-static char *
-markup_test (const char *s)
-{
-       GMarkupParser *parser = g_new0 (GMarkupParser, 1);
-       GMarkupParseContext *context;
-       GError *error = NULL;
-       
-       context = g_markup_parse_context_new (parser, 0, 0, 0);
-
-       g_markup_parse_context_parse (context, s, strlen (s), &error);
-       g_markup_parse_context_free (context);
-
-       if (error != NULL){
-               char *msg = g_strdup (error->message);
-               g_error_free (error);
-
-               g_free (parser);
-               return msg;
-       }
-       g_free (parser);
-       return NULL;
-}
-
-RESULT
-invalid_documents (void)
-{
-       /* These should fail */
-       do_bad_test ("<1>");
-       do_bad_test ("<a<");
-       do_bad_test ("</a>");
-       do_bad_test ("<a b>");
-       do_bad_test ("<a b=>");
-       do_bad_test ("<a b=c>");
-       
-       return OK;
-}
-
-RESULT
-valid_documents (void)
-{
-       /* These should fail */
-       do_ok_test ("<a>");
-       do_ok_test ("<a a=\"b\">");
-       
-       return OK;
-}
-
-/*
- * This is a test for the kind of files that the code in mono/domain.c
- * parses;  This code comes from Mono
- */
-typedef struct {
-        GSList *supported_runtimes;
-        char *required_runtime;
-        int configuration_count;
-        int startup_count;
-} AppConfigInfo;
-
-static char *
-get_attribute_value (const gchar **attribute_names,
-                    const gchar **attribute_values,
-                    const char *att_name)
-{
-        int n;
-        for (n=0; attribute_names[n] != NULL; n++) {
-                if (strcmp (attribute_names[n], att_name) == 0)
-                        return g_strdup (attribute_values[n]);
-        }
-        return NULL;
-}
-
-static void
-start_element (GMarkupParseContext *context,
-              const gchar         *element_name,
-              const gchar        **attribute_names,
-              const gchar        **attribute_values,
-              gpointer             user_data,
-              GError             **error)
-{
-        AppConfigInfo* app_config = (AppConfigInfo*) user_data;
-
-        if (strcmp (element_name, "configuration") == 0) {
-                app_config->configuration_count++;
-                return;
-        }
-        if (strcmp (element_name, "startup") == 0) {
-                app_config->startup_count++;
-                return;
-        }
-
-        if (app_config->configuration_count != 1 || app_config->startup_count != 1)
-                return;
-
-        if (strcmp (element_name, "requiredRuntime") == 0) {
-                app_config->required_runtime = get_attribute_value (attribute_names, attribute_values, "version");
-        } else if (strcmp (element_name, "supportedRuntime") == 0) {
-                char *version = get_attribute_value (attribute_names, attribute_values, "version");
-                app_config->supported_runtimes = g_slist_append (app_config->supported_runtimes, version);
-        }
-}
-
-static void
-end_element   (GMarkupParseContext *context,
-              const gchar         *element_name,
-              gpointer             user_data,
-              GError             **error)
-{
-        AppConfigInfo* app_config = (AppConfigInfo*) user_data;
-       
-        if (strcmp (element_name, "configuration") == 0) {
-                app_config->configuration_count--;
-        } else if (strcmp (element_name, "startup") == 0) {
-                app_config->startup_count--;
-        }
-}
-
-static const GMarkupParser
-mono_parser = {
-        start_element,
-        end_element,
-        NULL,
-        NULL,
-        NULL
-};
-
-AppConfigInfo *
-domain_test (char *text)
-{
-       AppConfigInfo *app_config = g_new0 (AppConfigInfo, 1);
-       GMarkupParseContext *context;
-       
-        context = g_markup_parse_context_new (&mono_parser, 0, app_config, NULL);
-        if (g_markup_parse_context_parse (context, text, strlen (text), NULL)) {
-                g_markup_parse_context_end_parse (context, NULL);
-        }
-        g_markup_parse_context_free (context);
-
-       return app_config;
-}
-
-void
-domain_free (AppConfigInfo *info)
-{
-       GSList *l;
-       if (info->required_runtime)
-               g_free (info->required_runtime);
-       for (l = info->supported_runtimes; l != NULL; l = l->next){
-               g_free (l->data);
-       }
-       g_slist_free (info->supported_runtimes);
-       g_free (info);
-}
-
-RESULT
-mono_domain (void)
-{
-       AppConfigInfo *info;
-
-       info = domain_test ("<configuration><!--hello--><startup><!--world--><requiredRuntime version=\"v1\"><!--r--></requiredRuntime></startup></configuration>"); 
-       if (info->required_runtime == NULL)
-               return FAILED ("No required runtime section");
-       if (strcmp (info->required_runtime, "v1") != 0)
-               return FAILED ("Got a runtime version %s, expected v1", info->required_runtime);
-       domain_free (info);
-
-       info = domain_test ("<configuration><startup><requiredRuntime version=\"v1\"/><!--comment--></configuration><!--end-->");
-       if (info->required_runtime == NULL)
-               return FAILED ("No required runtime section on auto-close section");
-       if (strcmp (info->required_runtime, "v1") != 0)
-               return FAILED ("Got a runtime version %s, expected v1", info->required_runtime);
-       domain_free (info);
-
-       info = domain_test ("<!--start--><configuration><startup><supportedRuntime version=\"v1\"/><!--middle--><supportedRuntime version=\"v2\"/></startup></configuration>");
-       if ((strcmp ((char*)info->supported_runtimes->data, "v1") == 0)){
-               if (info->supported_runtimes->next == NULL)
-                       return FAILED ("Expected 2 supported runtimes");
-               
-               if ((strcmp ((char*)info->supported_runtimes->next->data, "v2") != 0))
-                       return FAILED ("Expected v1, v2, got %s", info->supported_runtimes->next->data);
-               if (info->supported_runtimes->next->next != NULL)
-                       return FAILED ("Expected v1, v2, got more");
-       } else
-               return FAILED ("Expected `v1', got %s", info->supported_runtimes->data);
-       domain_free (info);
-
-       return NULL;
-}
-
-RESULT
-mcs_config (void)
-{
-       return markup_test ("<configuration>\r\n  <system.diagnostics>\r\n    <trace autoflush=\"true\" indentsize=\"4\">\r\n      <listeners>\r\n        <add name=\"compilerLogListener\" type=\"System.Diagnostics.TextWriterTraceListener,System\"/>      </listeners>    </trace>   </system.diagnostics> </configuration>");
-
-}
-
-RESULT
-xml_parse (void)
-{
-       return markup_test ("<?xml version=\"1.0\" encoding=\"utf-8\"?><a></a>");
-}
-
-RESULT
-machine_config (void)
-{
-       char *data;
-       gsize size;
-       
-       if (g_file_get_contents ("../../data/net_1_1/machine.config", &data, &size, NULL)){
-               return markup_test (data);
-       }
-       printf ("Ignoring this test\n");
-       return NULL;
-}
-
-static Test markup_tests [] = {
-       {"invalid_documents", invalid_documents},
-       {"good_documents", valid_documents},
-       {"mono_domain", mono_domain},
-       {"mcs_config", mcs_config},
-       {"xml_parse", xml_parse},
-       {"machine_config", machine_config},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(markup_tests_init, markup_tests)
-
diff --git a/eglib/test/memory.c b/eglib/test/memory.c
deleted file mode 100644 (file)
index db7db08..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-
-#include <glib.h>
-#include "test.h"
-
-RESULT
-test_memory_zero_size_allocations ()
-{
-       gpointer p;
-
-       p = g_malloc (0);
-        if (p)
-                return FAILED ("Calling g_malloc with size zero should return NULL.");
-
-       p = g_malloc0 (0);
-        if (p)
-                return FAILED ("Calling g_malloc0 with size zero should return NULL.");
-
-       p = g_realloc (NULL, 0);
-        if (p)
-                return FAILED ("Calling g_realloc with size zero should return NULL.");
-
-       p = g_new (int, 0);
-        if (p)
-                return FAILED ("Calling g_new with size zero should return NULL.");
-
-       p = g_new0 (int, 0);
-        if (p)
-                return FAILED ("Calling g_new0 with size zero should return NULL.");
-
-        return OK;
-}
-
-
-static Test memory_tests [] = {
-        {       "zero_size_allocations", test_memory_zero_size_allocations},
-        {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(memory_tests_init, memory_tests)
-
diff --git a/eglib/test/module.c b/eglib/test/module.c
deleted file mode 100644 (file)
index a283637..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#include <config.h>
-#include <glib.h>
-#include <gmodule.h>
-#include <string.h>
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include "test.h"
-
-#if defined (G_OS_WIN32)
-#define EXTERNAL_SYMBOL "GetProcAddress"
-#else
-#define EXTERNAL_SYMBOL "system"
-#endif
-
-void G_MODULE_EXPORT
-dummy_test_export ()
-{
-}
-
-/* test for g_module_open (NULL, ...) */
-RESULT
-test_module_symbol_null ()
-{
-       gpointer proc = GINT_TO_POINTER (42);
-
-       GModule *m = g_module_open (NULL, G_MODULE_BIND_LAZY);
-
-       if (m == NULL)
-               return FAILED ("bind to main module failed. #0");
-
-       if (g_module_symbol (m, "__unlikely_\nexistent__", &proc))
-               return FAILED ("non-existent symbol lookup failed. #1");
-
-       if (proc)
-               return FAILED ("non-existent symbol lookup failed. #2");
-
-       if (!g_module_symbol (m, EXTERNAL_SYMBOL, &proc))
-               return FAILED ("external lookup failed. #3");
-
-       if (!proc)
-               return FAILED ("external lookup failed. #4");
-
-       if (!g_module_symbol (m, "dummy_test_export", &proc))
-               return FAILED ("in-proc lookup failed. #5");
-
-       if (!proc)
-               return FAILED ("in-proc lookup failed. #6");
-
-       if (!g_module_close (m))
-               return FAILED ("close failed. #7");
-
-       return OK;
-}
-
-static Test module_tests [] = {
-       {"g_module_symbol_null", test_module_symbol_null},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(module_tests_init, module_tests)
-
-
diff --git a/eglib/test/path.c b/eglib/test/path.c
deleted file mode 100644 (file)
index e3832a0..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-#include <config.h>
-#include <glib.h>
-#include <string.h>
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef G_OS_UNIX
-#include <pthread.h>
-#endif
-#include "test.h"
-
-#ifdef G_OS_WIN32
-#include <direct.h>
-#define chdir _chdir
-#endif
-
-/* This test is just to be used with valgrind */
-RESULT
-test_buildpath ()
-{
-       char *s;
-       char *buffer = "var/private";
-       char *dir = "/";
-       
-       s = g_build_path ("/", "hola///", "//mundo", NULL);
-       if (strcmp (s, "hola/mundo") != 0)
-               return FAILED ("1 Got wrong result, got: %s", s);
-       g_free (s);
-
-       s = g_build_path ("/", "hola/", "/mundo", NULL);
-       if (strcmp (s, "hola/mundo") != 0)
-               return FAILED ("2 Got wrong result, got: %s", s);
-       g_free (s);
-
-       s = g_build_path ("/", "hola/", "mundo", NULL);
-       if (strcmp (s, "hola/mundo") != 0)
-               return FAILED ("3 Got wrong result, got: %s", s);
-       g_free (s);
-
-       s = g_build_path ("/", "hola", "/mundo", NULL);
-       if (strcmp (s, "hola/mundo") != 0)
-               return FAILED ("4 Got wrong result, got: %s", s);
-       g_free (s);
-
-       s = g_build_path ("/", "/hello", "world/", NULL);
-       if (strcmp (s, "/hello/world/") != 0)
-               return FAILED ("5 Got wrong result, got: %s", s);
-       g_free (s);
-       
-       /* Now test multi-char-separators */
-       s = g_build_path ("**", "hello", "world", NULL);
-       if (strcmp (s, "hello**world") != 0)
-               return FAILED ("6 Got wrong result, got: %s", s);
-       g_free (s);
-
-       s = g_build_path ("**", "hello**", "world", NULL);
-       if (strcmp (s, "hello**world") != 0)
-               return FAILED ("7 Got wrong result, got: %s", s);
-       g_free (s);
-
-       s = g_build_path ("**", "hello**", "**world", NULL);
-       if (strcmp (s, "hello**world") != 0)
-               return FAILED ("8 Got wrong result, got: %s", s);
-       g_free (s);
-       
-       s = g_build_path ("**", "hello**", "**world", NULL);
-       if (strcmp (s, "hello**world") != 0)
-               return FAILED ("9 Got wrong result, got: %s", s);
-       g_free (s);
-
-       s = g_build_path ("1234567890", "hello", "world", NULL);
-       if (strcmp (s, "hello1234567890world") != 0)
-               return FAILED ("10 Got wrong result, got: %s", s);
-       g_free (s);
-
-       s = g_build_path ("1234567890", "hello1234567890", "1234567890world", NULL);
-       if (strcmp (s, "hello1234567890world") != 0)
-               return FAILED ("11 Got wrong result, got: %s", s);
-       g_free (s);
-
-       s = g_build_path ("1234567890", "hello12345678901234567890", "1234567890world", NULL);
-       if (strcmp (s, "hello1234567890world") != 0)
-               return FAILED ("12 Got wrong result, got: %s", s);
-       g_free (s);
-
-       /* Multiple */
-       s = g_build_path ("/", "a", "b", "c", "d", NULL);
-       if (strcmp (s, "a/b/c/d") != 0)
-               return FAILED ("13 Got wrong result, got: %s", s);
-       g_free (s);
-
-       s = g_build_path ("/", "/a", "", "/c/", NULL);
-       if (strcmp (s, "/a/c/") != 0)
-               return FAILED ("14 Got wrong result, got: %s", s);
-       g_free (s);
-
-       /* Null */
-       s = g_build_path ("/", NULL, NULL);
-       if (s == NULL)
-               return FAILED ("must get a non-NULL return");
-       if (s [0] != 0)
-               return FAILED ("must get an empty string");
-
-       // This is to test the regression introduced by Levi for the Windows support
-       // that code errouneously read below the allowed area (in this case dir [-1]).
-       // and caused all kinds of random errors.
-       dir = "//";
-       dir++;
-       s = g_build_filename (dir, buffer, NULL);
-       if (s [0] != '/')
-               return FAILED ("Must have a '/' at the start");
-
-       g_free (s);
-       return OK;
-}
-
-RESULT
-test_buildfname ()
-{
-       char *s;
-       
-       s = g_build_filename ("a", "b", "c", "d", NULL);
-#ifdef G_OS_WIN32
-       if (strcmp (s, "a\\b\\c\\d") != 0)
-#else
-       if (strcmp (s, "a/b/c/d") != 0)
-#endif
-               return FAILED ("1 Got wrong result, got: %s", s);
-       g_free (s);
-
-#ifdef G_OS_WIN32
-       s = g_build_filename ("C:\\", "a", NULL);
-       if (strcmp (s, "C:\\a") != 0)
-#else
-       s = g_build_filename ("/", "a", NULL);
-       if (strcmp (s, "/a") != 0)
-#endif
-               return FAILED ("1 Got wrong result, got: %s", s);
-
-#ifndef G_OS_WIN32
-       s = g_build_filename ("/", "foo", "/bar", "tolo/", "/meo/", NULL);
-       if (strcmp (s, "/foo/bar/tolo/meo/") != 0)
-               return FAILED ("1 Got wrong result, got: %s", s);
-#endif
-       
-       return OK;
-}
-
-char *
-test_dirname ()
-{
-       char *s;
-
-#ifdef G_OS_WIN32
-       s = g_path_get_dirname ("c:\\home\\miguel");
-       if (strcmp (s, "c:\\home") != 0)
-               return FAILED ("Expected c:\\home, got %s", s);
-       g_free (s);
-
-       s = g_path_get_dirname ("c:/home/miguel");
-       if (strcmp (s, "c:/home") != 0)
-               return FAILED ("Expected c:/home, got %s", s);
-       g_free (s);
-
-       s = g_path_get_dirname ("c:\\home\\dingus\\");
-       if (strcmp (s, "c:\\home\\dingus") != 0)
-               return FAILED ("Expected c:\\home\\dingus, got %s", s);
-       g_free (s);
-
-       s = g_path_get_dirname ("dir.c");
-       if (strcmp (s, ".") != 0)
-               return FAILED ("Expected `.', got %s", s);
-       g_free (s);
-
-       s = g_path_get_dirname ("c:\\index.html");
-       if (strcmp (s, "c:") != 0)
-               return FAILED ("Expected [c:], got [%s]", s);
-#else
-       s = g_path_get_dirname ("/home/miguel");
-       if (strcmp (s, "/home") != 0)
-               return FAILED ("Expected /home, got %s", s);
-       g_free (s);
-
-       s = g_path_get_dirname ("/home/dingus/");
-       if (strcmp (s, "/home/dingus") != 0)
-               return FAILED ("Expected /home/dingus, got %s", s);
-       g_free (s);
-
-       s = g_path_get_dirname ("dir.c");
-       if (strcmp (s, ".") != 0)
-               return FAILED ("Expected `.', got %s", s);
-       g_free (s);
-
-       s = g_path_get_dirname ("/index.html");
-       if (strcmp (s, "/") != 0)
-               return FAILED ("Expected [/], got [%s]", s);
-#endif 
-       return OK;
-}
-
-char *
-test_basename ()
-{
-       char *s;
-
-#ifdef G_OS_WIN32
-       s = g_path_get_basename ("");
-       if (strcmp (s, ".") != 0)
-               return FAILED ("Expected `.', got %s", s);
-       g_free (s);
-
-       s = g_path_get_basename ("c:\\home\\dingus\\");
-       if (strcmp (s, "dingus") != 0)
-               return FAILED ("1 Expected dingus, got %s", s);
-       g_free (s);
-
-       s = g_path_get_basename ("c:/home/dingus/");
-       if (strcmp (s, "dingus") != 0)
-               return FAILED ("1 Expected dingus, got %s", s);
-       g_free (s);
-
-       s = g_path_get_basename ("c:\\home\\dingus");
-       if (strcmp (s, "dingus") != 0)
-               return FAILED ("2 Expected dingus, got %s", s);
-       g_free (s);
-
-       s = g_path_get_basename ("c:/home/dingus");
-       if (strcmp (s, "dingus") != 0)
-               return FAILED ("2 Expected dingus, got %s", s);
-       g_free (s);
-#else
-       s = g_path_get_basename ("");
-       if (strcmp (s, ".") != 0)
-               return FAILED ("Expected `.', got %s", s);
-       g_free (s);
-
-       s = g_path_get_basename ("/home/dingus/");
-       if (strcmp (s, "dingus") != 0)
-               return FAILED ("1 Expected dingus, got %s", s);
-       g_free (s);
-
-       s = g_path_get_basename ("/home/dingus");
-       if (strcmp (s, "dingus") != 0)
-               return FAILED ("2 Expected dingus, got %s", s);
-       g_free (s);
-#endif
-       return OK;
-}
-
-gchar *
-test_ppath ()
-{
-       char *s;
-#ifdef G_OS_WIN32
-       const gchar *searchfor = "explorer.exe";
-#else
-       const gchar *searchfor = "ls";
-#endif
-       s = g_find_program_in_path (searchfor);
-       if (s == NULL)
-               return FAILED ("No %s on this system?", searchfor);
-       g_free (s);
-       return OK;
-}
-
-gchar *
-test_ppath2 ()
-{
-       char *s;
-       const char *path = g_getenv ("PATH");
-#ifdef G_OS_WIN32
-       const gchar *searchfor = "test_eglib.exe";
-#else
-       const gchar *searchfor = "test-glib";
-#endif
-       
-       g_setenv ("PATH", "", TRUE);
-       s = g_find_program_in_path ("ls");
-       if (s != NULL) {
-               g_setenv ("PATH", path, TRUE);
-               return FAILED ("Found something interesting here: %s", s);
-       }
-       g_free (s);
-       s = g_find_program_in_path (searchfor);
-       if (s == NULL) {
-               g_setenv ("PATH", path, TRUE);
-               return FAILED ("It should find '%s' in the current directory.", searchfor);
-       }
-       g_free (s);
-       g_setenv ("PATH", path, TRUE);
-       return OK;
-}
-
-#ifndef DISABLE_FILESYSTEM_TESTS
-gchar *
-test_cwd ()
-{
-       char *dir = g_get_current_dir ();
-#ifdef G_OS_WIN32
-       const gchar *newdir = "C:\\Windows";
-#else
-       const gchar *newdir = "/bin";
-#endif
-
-       if (dir == NULL)
-               return FAILED ("No current directory?");
-       g_free (dir);
-       
-       if (chdir (newdir) == -1)
-               return FAILED ("No %s?", newdir);
-       
-       dir = g_get_current_dir ();
-       if (strcmp (dir, newdir) != 0)
-               return FAILED("Did not go to %s?", newdir);
-       g_free (dir);
-       
-       return OK;
-}
-#else
-gchar *
-test_cwd ()
-{
-       return OK;
-}
-#endif
-
-gchar *
-test_misc ()
-{
-       const char *home = g_get_home_dir ();
-       const char *tmp = g_get_tmp_dir ();
-       
-       if (home == NULL)
-               return FAILED ("Where did my home go?");
-
-       if (tmp == NULL)
-               return FAILED ("Where did my /tmp go?");
-
-       return OK;
-}
-
-static Test path_tests [] = {
-       {"g_build_filename", test_buildfname},
-       {"g_buildpath", test_buildpath},
-       {"g_path_get_dirname", test_dirname},
-       {"g_path_get_basename", test_basename},
-       {"g_find_program_in_path", test_ppath},
-       {"g_find_program_in_path2", test_ppath2},
-       {"test_cwd", test_cwd },
-       {"test_misc", test_misc },
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(path_tests_init, path_tests)
-
-
diff --git a/eglib/test/pattern.c b/eglib/test/pattern.c
deleted file mode 100644 (file)
index 7db5a7b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#include <config.h>
-#include <glib.h>
-#include <string.h>
-#include <stdlib.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include "test.h"
-
-#define MATCH(pat,string,error_if,msg) \
-       spec = g_pattern_spec_new (pat); \
-       res = g_pattern_match_string (spec, string); \
-       if (res == error_if) \
-               return FAILED (msg " returned %s", res ? "TRUE" : "FALSE"); \
-       g_pattern_spec_free (spec);
-
-#define TEST_MATCH(pat,string,n) MATCH (pat, string, FALSE, "MATCH " #n)
-#define TEST_NO_MATCH(pat,string,n) MATCH (pat, string,TRUE, "NO_MATCH " #n)
-
-RESULT
-test_pattern_spec ()
-{
-       GPatternSpec *spec;
-       gboolean res;
-
-       /* spec = g_pattern_spec_new (NULL); */
-       TEST_MATCH ("*", "hola", 1);
-       TEST_MATCH ("hola", "hola", 2);
-       TEST_MATCH ("????", "hola", 3);
-       TEST_MATCH ("???a", "hola", 4);
-       TEST_MATCH ("h??a", "hola", 5);
-       TEST_MATCH ("h??*", "hola", 6);
-       TEST_MATCH ("h*", "hola", 7);
-       TEST_MATCH ("*hola", "hola", 8);
-       TEST_MATCH ("*l*", "hola", 9);
-       TEST_MATCH ("h*??", "hola", 10);
-       TEST_MATCH ("h*???", "hola", 11);
-       TEST_MATCH ("?o??", "hola", 12);
-       TEST_MATCH ("*h*o*l*a*", "hola", 13);
-       TEST_MATCH ("h*o*l*a", "hola", 14);
-       TEST_MATCH ("h?*?", "hola", 15);
-
-       TEST_NO_MATCH ("", "hola", 1);
-       TEST_NO_MATCH ("?????", "hola", 2);
-       TEST_NO_MATCH ("???", "hola", 3);
-       TEST_NO_MATCH ("*o", "hola", 4);
-       TEST_NO_MATCH ("h", "hola", 5);
-       TEST_NO_MATCH ("h*????", "hola", 6);
-
-       return OK;
-}
-
-static Test pattern_tests [] = {
-       {"g_pattern_spec*", test_pattern_spec},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(pattern_tests_init, pattern_tests)
-
-
diff --git a/eglib/test/ptrarray.c b/eglib/test/ptrarray.c
deleted file mode 100644 (file)
index 34d78b0..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-#include <stdio.h>
-#include <glib.h>
-#include "test.h"
-
-/* Redefine the private structure only to verify proper allocations */
-typedef struct _GPtrArrayPriv {
-       gpointer *pdata;
-       guint len;
-       guint size;
-} GPtrArrayPriv;
-
-/* Don't add more than 32 items to this please */
-static const char *items [] = {
-       "Apples", "Oranges", "Plumbs", "Goats", "Snorps", "Grapes", 
-       "Tickle", "Place", "Coffee", "Cookies", "Cake", "Cheese",
-       "Tseng", "Holiday", "Avenue", "Smashing", "Water", "Toilet",
-       NULL
-};
-
-static GPtrArray *ptrarray_alloc_and_fill(guint *item_count)
-{
-       GPtrArray *array = g_ptr_array_new();
-       gint i;
-       
-       for(i = 0; items[i] != NULL; i++) {
-               g_ptr_array_add(array, (gpointer)items[i]);
-       }
-
-       if(item_count != NULL) {
-               *item_count = i;
-       }
-       
-       return array;
-}
-
-static guint guess_size(guint length)
-{
-       guint size = 1;
-
-       while(size < length) {
-               size <<= 1;
-       }
-
-       return size;
-}
-
-RESULT ptrarray_alloc()
-{
-       GPtrArrayPriv *array;
-       guint i;
-       
-       array = (GPtrArrayPriv *)ptrarray_alloc_and_fill(&i);
-       
-       if(array->size != guess_size(array->len)) {
-               return FAILED("Size should be %d, but it is %d", 
-                       guess_size(array->len), array->size);
-       }
-       
-       if(array->len != i) {
-               return FAILED("Expected %d node(s) in the array", i);
-       }
-       
-       g_ptr_array_free((GPtrArray *)array, TRUE);
-
-       return OK;
-}
-
-RESULT ptrarray_for_iterate()
-{
-       GPtrArray *array = ptrarray_alloc_and_fill(NULL);
-       guint i;
-
-       for(i = 0; i < array->len; i++) {
-               char *item = (char *)g_ptr_array_index(array, i);
-               if(item != items[i]) {
-                       return FAILED(
-                               "Expected item at %d to be %s, but it was %s", 
-                               i, items[i], item);
-               }
-       }
-
-       g_ptr_array_free(array, TRUE);
-
-       return OK;
-}
-
-static gint foreach_iterate_index = 0;
-static char *foreach_iterate_error = NULL;
-
-void foreach_callback(gpointer data, gpointer user_data)
-{
-       char *item = (char *)data;
-       const char *item_cmp = items[foreach_iterate_index++];
-
-       if(foreach_iterate_error != NULL) {
-               return;
-       }
-
-       if(item != item_cmp) {
-               foreach_iterate_error = FAILED(
-                       "Expected item at %d to be %s, but it was %s", 
-                               foreach_iterate_index - 1, item_cmp, item);
-       }
-}
-
-RESULT ptrarray_foreach_iterate()
-{
-       GPtrArray *array = ptrarray_alloc_and_fill(NULL);
-       
-       foreach_iterate_index = 0;
-       foreach_iterate_error = NULL;
-       
-       g_ptr_array_foreach(array, foreach_callback, array);
-       
-       g_ptr_array_free(array, TRUE);
-
-       return foreach_iterate_error;
-}
-
-RESULT ptrarray_set_size()
-{
-       GPtrArray *array = g_ptr_array_new();
-       guint i, grow_length = 50;
-       
-       g_ptr_array_add(array, (gpointer)items[0]);
-       g_ptr_array_add(array, (gpointer)items[1]);
-       g_ptr_array_set_size(array, grow_length);
-
-       if(array->len != grow_length) {
-               return FAILED("Array length should be 50, it is %d", array->len);
-       } else if(array->pdata[0] != items[0]) {
-               return FAILED("Item 0 was overwritten, should be %s", items[0]);
-       } else if(array->pdata[1] != items[1]) {
-               return FAILED("Item 1 was overwritten, should be %s", items[1]);
-       }
-
-       for(i = 2; i < array->len; i++) {
-               if(array->pdata[i] != NULL) {
-                       return FAILED("Item %d is not NULL, it is %p", i, array->pdata[i]);
-               }
-       }
-
-       g_ptr_array_free(array, TRUE);
-
-       return OK;
-}
-
-RESULT ptrarray_remove_index()
-{
-       GPtrArray *array;
-       guint i;
-       
-       array = ptrarray_alloc_and_fill(&i);
-       
-       g_ptr_array_remove_index(array, 0);
-       if(array->pdata[0] != items[1]) {
-               return FAILED("First item is not %s, it is %s", items[1],
-                       array->pdata[0]);
-       }
-
-       g_ptr_array_remove_index(array, array->len - 1);
-       
-       if(array->pdata[array->len - 1] != items[array->len]) {
-               return FAILED("Last item is not %s, it is %s", 
-                       items[array->len - 2], array->pdata[array->len - 1]);
-       }
-
-       g_ptr_array_free(array, TRUE);
-
-       return OK;
-}
-
-RESULT ptrarray_remove_index_fast()
-{
-       GPtrArray *array;
-       guint i;
-
-       array = ptrarray_alloc_and_fill(&i);
-
-       g_ptr_array_remove_index_fast(array, 0);
-       if(array->pdata[0] != items[array->len]) {
-               return FAILED("First item is not %s, it is %s", items[array->len],
-                       array->pdata[0]);
-       }
-
-       g_ptr_array_remove_index_fast(array, array->len - 1);
-       if(array->pdata[array->len - 1] != items[array->len - 1]) {
-               return FAILED("Last item is not %s, it is %s",
-                       items[array->len - 1], array->pdata[array->len - 1]);
-       }
-
-       g_ptr_array_free(array, TRUE);
-
-       return OK;
-}
-
-RESULT ptrarray_remove()
-{
-       GPtrArray *array;
-       guint i;
-       
-       array = ptrarray_alloc_and_fill(&i);
-
-       g_ptr_array_remove(array, (gpointer)items[7]);
-
-       if(!g_ptr_array_remove(array, (gpointer)items[4])) {
-               return FAILED("Item %s not removed", items[4]);
-       }
-
-       if(g_ptr_array_remove(array, (gpointer)items[4])) {
-               return FAILED("Item %s still in array after removal", items[4]);
-       }
-
-       if(array->pdata[array->len - 1] != items[array->len + 1]) {
-               return FAILED("Last item in GPtrArray not correct");
-       }
-
-       g_ptr_array_free(array, TRUE);
-
-       return OK;
-}
-
-static gint ptrarray_sort_compare(gconstpointer a, gconstpointer b)
-{
-       gchar *stra = *(gchar **) a;
-       gchar *strb = *(gchar **) b;
-       return strcmp(stra, strb);
-}
-
-RESULT ptrarray_sort()
-{
-       GPtrArray *array = g_ptr_array_new();
-       guint i;
-       gchar *letters [] = { "A", "B", "C", "D", "E" };
-       
-       g_ptr_array_add(array, letters[0]);
-       g_ptr_array_add(array, letters[1]);
-       g_ptr_array_add(array, letters[2]);
-       g_ptr_array_add(array, letters[3]);
-       g_ptr_array_add(array, letters[4]);
-       
-       g_ptr_array_sort(array, ptrarray_sort_compare);
-
-       for(i = 0; i < array->len; i++) {
-               if(array->pdata[i] != letters[i]) {
-                       return FAILED("Array out of order, expected %s got %s at position %d",
-                               letters [i], (gchar *) array->pdata [i], i);
-               }
-       }
-
-       g_ptr_array_free(array, TRUE);
-       
-       return OK;
-}
-
-static gint ptrarray_sort_compare_with_data (gconstpointer a, gconstpointer b, gpointer user_data)
-{
-       gchar *stra = *(gchar **) a;
-       gchar *strb = *(gchar **) b;
-
-       if (strcmp (user_data, "this is the data for qsort") != 0)
-               fprintf (stderr, "oops at compare with_data\n");
-
-       return strcmp(stra, strb);
-}
-
-RESULT ptrarray_sort_with_data ()
-{
-       GPtrArray *array = g_ptr_array_new();
-       guint i;
-       gchar *letters [] = { "A", "B", "C", "D", "E" };
-
-       g_ptr_array_add(array, letters[4]);
-       g_ptr_array_add(array, letters[1]);
-       g_ptr_array_add(array, letters[2]);
-       g_ptr_array_add(array, letters[0]);
-       g_ptr_array_add(array, letters[3]);
-
-       g_ptr_array_sort_with_data(array, ptrarray_sort_compare_with_data, "this is the data for qsort");
-
-       for(i = 0; i < array->len; i++) {
-               if(array->pdata[i] != letters[i]) {
-                       return FAILED("Array out of order, expected %s got %s at position %d",
-                               letters [i], (gchar *) array->pdata [i], i);
-               }
-       }
-
-       g_ptr_array_free(array, TRUE);
-
-       return OK;
-}
-
-RESULT ptrarray_remove_fast()
-{
-       GPtrArray *array = g_ptr_array_new();
-       gchar *letters [] = { "A", "B", "C", "D", "E" };
-       
-       if (g_ptr_array_remove_fast (array, NULL))
-               return FAILED ("Removing NULL succeeded");
-
-       g_ptr_array_add(array, letters[0]);
-       if (!g_ptr_array_remove_fast (array, letters[0]) || array->len != 0)
-               return FAILED ("Removing last element failed");
-
-       g_ptr_array_add(array, letters[0]);
-       g_ptr_array_add(array, letters[1]);
-       g_ptr_array_add(array, letters[2]);
-       g_ptr_array_add(array, letters[3]);
-       g_ptr_array_add(array, letters[4]);
-
-       if (!g_ptr_array_remove_fast (array, letters[0]) || array->len != 4)
-               return FAILED ("Removing first element failed");
-
-       if (array->pdata [0] != letters [4])
-               return FAILED ("First element wasn't replaced with last upon removal");
-
-       if (g_ptr_array_remove_fast (array, letters[0]))
-               return FAILED ("Succedeed removing a non-existing element");
-
-       if (!g_ptr_array_remove_fast (array, letters[3]) || array->len != 3)
-               return FAILED ("Failed removing \"D\"");
-
-       if (!g_ptr_array_remove_fast (array, letters[1]) || array->len != 2)
-               return FAILED ("Failed removing \"B\"");
-
-       if (array->pdata [0] != letters [4] || array->pdata [1] != letters [2])
-               return FAILED ("Last two elements are wrong");
-       g_ptr_array_free(array, TRUE);
-       
-       return OK;
-}
-
-static Test ptrarray_tests [] = {
-       {"alloc", ptrarray_alloc},
-       {"for_iterate", ptrarray_for_iterate},
-       {"foreach_iterate", ptrarray_foreach_iterate},
-       {"set_size", ptrarray_set_size},
-       {"remove_index", ptrarray_remove_index},
-       {"remove_index_fast", ptrarray_remove_index_fast},
-       {"remove", ptrarray_remove},
-       {"sort", ptrarray_sort},
-       {"remove_fast", ptrarray_remove_fast},
-       {"sort_with_data", ptrarray_sort_with_data},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(ptrarray_tests_init, ptrarray_tests)
-
-
diff --git a/eglib/test/queue.c b/eglib/test/queue.c
deleted file mode 100644 (file)
index b12ddec..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-#include "test.h"
-
-RESULT
-test_queue_push ()
-{
-       GQueue *queue = g_queue_new ();
-
-       g_queue_push_head (queue, "foo");
-       g_queue_push_head (queue, "bar");
-       g_queue_push_head (queue, "baz");
-
-       if (queue->length != 3)
-               return FAILED ("push failed");
-
-       if (NULL != queue->head->prev)
-               return FAILED ("HEAD: prev is wrong");
-       if (strcmp ("baz", queue->head->data))
-               return FAILED ("HEAD: First element is wrong");
-       if (strcmp ("bar", queue->head->next->data))
-               return FAILED ("HEAD: Second element is wrong");
-       if (strcmp ("foo", queue->head->next->next->data))
-               return FAILED ("HEAD: Third element is wrong");
-       if (NULL != queue->head->next->next->next)
-               return FAILED ("HEAD: End is wrong");
-
-       if (NULL != queue->tail->next)
-               return FAILED ("TAIL: next is wrong");
-       if (strcmp ("foo", queue->tail->data))
-               return FAILED ("TAIL: Third element is wrong");
-       if (strcmp ("bar", queue->tail->prev->data))
-               return FAILED ("TAIL: Second element is wrong");
-       if (strcmp ("baz", queue->tail->prev->prev->data))
-               return FAILED ("TAIL: First element is wrong");
-       if (NULL != queue->tail->prev->prev->prev)
-               return FAILED ("TAIL: End is wrong");
-
-       g_queue_free (queue);
-       return OK;
-}
-
-RESULT
-test_queue_push_tail ()
-{
-       GQueue *queue = g_queue_new ();
-
-       g_queue_push_tail (queue, "baz");
-       g_queue_push_tail (queue, "bar");
-       g_queue_push_tail (queue, "foo");
-
-       if (queue->length != 3)
-               return FAILED ("push failed");
-
-       if (NULL != queue->head->prev)
-               return FAILED ("HEAD: prev is wrong");
-       if (strcmp ("baz", queue->head->data))
-               return FAILED ("HEAD: First element is wrong");
-       if (strcmp ("bar", queue->head->next->data))
-               return FAILED ("HEAD: Second element is wrong");
-       if (strcmp ("foo", queue->head->next->next->data))
-               return FAILED ("HEAD: Third element is wrong");
-       if (NULL != queue->head->next->next->next)
-               return FAILED ("HEAD: End is wrong");
-
-       if (NULL != queue->tail->next)
-               return FAILED ("TAIL: next is wrong");
-       if (strcmp ("foo", queue->tail->data))
-               return FAILED ("TAIL: Third element is wrong");
-       if (strcmp ("bar", queue->tail->prev->data))
-               return FAILED ("TAIL: Second element is wrong");
-       if (strcmp ("baz", queue->tail->prev->prev->data))
-               return FAILED ("TAIL: First element is wrong");
-       if (NULL != queue->tail->prev->prev->prev)
-               return FAILED ("TAIL: End is wrong");
-
-       g_queue_free (queue);
-       return OK;
-}
-
-RESULT
-test_queue_pop ()
-{
-       GQueue *queue = g_queue_new ();
-       gpointer data;
-
-       g_queue_push_head (queue, "foo");
-       g_queue_push_head (queue, "bar");
-       g_queue_push_head (queue, "baz");
-
-       data = g_queue_pop_head (queue);
-       if (strcmp ("baz", data))
-               return FAILED ("expect baz.");
-
-       data = g_queue_pop_head (queue);
-       if (strcmp ("bar", data))
-               return FAILED ("expect bar.");  
-
-       data = g_queue_pop_head (queue);
-       if (strcmp ("foo", data))
-               return FAILED ("expect foo.");
-       
-       if (g_queue_is_empty (queue) == FALSE)
-               return FAILED ("expect is_empty.");
-
-       if (queue->length != 0)
-               return FAILED ("expect 0 length .");
-
-       g_queue_push_head (queue, "foo");
-       g_queue_push_head (queue, "bar");
-       g_queue_push_head (queue, "baz");
-
-       g_queue_pop_head (queue);
-
-       if (NULL != queue->head->prev)
-               return FAILED ("HEAD: prev is wrong");
-       if (strcmp ("bar", queue->head->data))
-               return FAILED ("HEAD: Second element is wrong");
-       if (strcmp ("foo", queue->head->next->data))
-               return FAILED ("HEAD: Third element is wrong");
-       if (NULL != queue->head->next->next)
-               return FAILED ("HEAD: End is wrong");
-
-       if (NULL != queue->tail->next)
-               return FAILED ("TAIL: next is wrong");
-       if (strcmp ("foo", queue->tail->data))
-               return FAILED ("TAIL: Second element is wrong");
-       if (strcmp ("bar", queue->tail->prev->data))
-               return FAILED ("TAIL: First element is wrong");
-       if (NULL != queue->tail->prev->prev)
-               return FAILED ("TAIL: End is wrong");
-
-       g_queue_free (queue);
-       return OK;
-}
-
-RESULT
-test_queue_new ()
-{
-       GQueue *queue = g_queue_new ();
-
-       if (queue->length != 0)
-               return FAILED ("expect length == 0");
-
-       if (queue->head != NULL)
-               return FAILED ("expect head == NULL");
-
-       if (queue->tail != NULL)
-               return FAILED ("expect tail == NULL");
-
-       g_queue_free (queue);
-       return OK;
-}
-
-RESULT
-test_queue_is_empty ()
-{
-       GQueue *queue = g_queue_new ();
-
-       if (g_queue_is_empty (queue) == FALSE)
-               return FAILED ("new queue should be empty");
-
-       g_queue_push_head (queue, "foo");
-
-       if (g_queue_is_empty (queue) == TRUE)
-               return FAILED ("expected TRUE");
-
-       g_queue_free (queue);
-
-       return OK;
-}
-
-static Test queue_tests [] = {
-       {    "push", test_queue_push},
-       {"push_tail", test_queue_push_tail},
-       {     "pop", test_queue_pop},
-       {     "new", test_queue_new},
-       {"is_empty", test_queue_is_empty},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(queue_tests_init, queue_tests)
-
diff --git a/eglib/test/shell.c b/eglib/test/shell.c
deleted file mode 100644 (file)
index 4715f1c..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-#include <glib.h>
-#include <string.h>
-#include <stdio.h>
-#include "test.h"
-
-RESULT
-test_shell_argv1 ()
-{
-       GError *error;
-       gint argc;
-       gchar **argv;
-       gboolean ret;
-
-       /* The next line prints a critical error and returns FALSE 
-       ret = g_shell_parse_argv (NULL, NULL, NULL, NULL);
-       */
-       ret = g_shell_parse_argv ("", NULL, NULL, NULL);
-       if (ret)
-               return FAILED ("1. It should return FALSE");
-
-       ret = g_shell_parse_argv ("hola", NULL, NULL, NULL);
-       if (!ret)
-               return FAILED ("2. It should return TRUE");
-
-       argc = 0;
-       ret = g_shell_parse_argv ("hola", &argc, NULL, NULL);
-       if (!ret)
-               return FAILED ("3. It should return TRUE");
-       if (argc != 1)
-               return FAILED ("4. argc was %d", argc);
-
-       argc = 0;
-       ret = g_shell_parse_argv ("hola bola", &argc, NULL, NULL);
-       if (!ret)
-               return FAILED ("5. It should return TRUE");
-       if (argc != 2)
-               return FAILED ("6. argc was %d", argc);
-
-       argc = 0;
-       ret = g_shell_parse_argv ("hola bola", &argc, &argv, NULL);
-       if (!ret)
-               return FAILED ("7. It should return TRUE");
-       if (argc != 2)
-               return FAILED ("8. argc was %d", argc);
-       if (strcmp (argv [0], "hola"))
-               return FAILED ("9. argv[0] was %s", argv [0]);
-       if (strcmp (argv [1], "bola"))
-               return FAILED ("10. argv[1] was %s", argv [1]);
-
-       g_strfreev (argv);
-       argv = NULL;
-       argc = 0;
-       error = NULL;
-       ret = g_shell_parse_argv ("hola      'bola'", &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("11. It should return TRUE");
-       if (argc != 2)
-               return FAILED ("12. argc was %d expected 2", argc);
-       if (strcmp (argv [0], "hola"))
-               return FAILED ("13. argv[0] was %s", argv [0]);
-       if (strcmp (argv [1], "bola"))
-               return FAILED ("14. argv[1] was %s", argv [1]);
-       if (error != NULL)
-               return FAILED ("15. error is not null");
-
-
-       g_strfreev (argv);
-       argv = NULL;
-       argc = 0;
-       error = NULL;
-       ret = g_shell_parse_argv ("hola    ''  'bola'", &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("16. It should return TRUE");
-       if (argc != 3)
-               return FAILED ("17. argc was %d expected 3", argc);
-       if (strcmp (argv [0], "hola"))
-               return FAILED ("18. argv[0] was %s", argv [0]);
-       if (strcmp (argv [1], ""))
-               return FAILED ("19. argv[2] was %s", argv [1]);
-       if (strcmp (argv [2], "bola"))
-               return FAILED ("19. argv[2] was %s", argv [2]);
-       if (error != NULL)
-               return FAILED ("20. error is not null");
-
-       g_strfreev (argv);
-       argv = NULL;
-       argc = 0;
-       error = NULL;
-       ret = g_shell_parse_argv ("hola'' bola", &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("21. It should return TRUE");
-       if (argc != 2)
-               return FAILED ("22. argc was %d expected 2", argc);
-       if (strcmp (argv [0], "hola"))
-               return FAILED ("23. argv[0] was %s", argv [0]);
-       if (strcmp (argv [1], "bola"))
-               return FAILED ("24. argv[2] was %s", argv [1]);
-       if (error != NULL)
-               return FAILED ("25. error is not null");
-       
-       return OK;
-}
-
-RESULT
-test_shell_argv2 ()
-{
-       GError *error;
-       gint argc;
-       gchar **argv;
-       gboolean ret;
-
-       argv = NULL;
-       argc = 0;
-       error = NULL;
-       ret = g_shell_parse_argv ("hola      \"bola\"", &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("1. It should return TRUE");
-       if (argc != 2)
-               return FAILED ("2. argc was %d expected 2", argc);
-       if (strcmp (argv [0], "hola"))
-               return FAILED ("3. argv[0] was %s", argv [0]);
-       if (strcmp (argv [1], "bola"))
-               return FAILED ("4. argv[1] was %s", argv [1]);
-       if (error != NULL)
-               return FAILED ("5. error is not null");
-
-       g_strfreev (argv);
-       argv = NULL;
-       argc = 0;
-       error = NULL;
-       ret = g_shell_parse_argv ("hola    \"\"  \"bola \"", &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("6. It should return TRUE");
-       if (argc != 3)
-               return FAILED ("7. argc was %d expected 3", argc);
-       if (strcmp (argv [0], "hola"))
-               return FAILED ("8. argv[0] was %s", argv [0]);
-       if (strcmp (argv [1], ""))
-               return FAILED ("9. argv[2] was %s", argv [1]);
-       if (strcmp (argv [2], "bola "))
-               return FAILED ("10. argv[2] was %s", argv [2]);
-       if (error != NULL)
-               return FAILED ("11. error is not null");
-
-       g_strfreev (argv);
-       argv = NULL;
-       argc = 0;
-       error = NULL;
-       ret = g_shell_parse_argv ("hola\n\t    \"\t\"  \"bola \"", &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("10. It should return TRUE");
-       if (argc != 3)
-               return FAILED ("11. argc was %d expected 3", argc);
-       if (strcmp (argv [0], "hola"))
-               return FAILED ("12. argv[0] was %s", argv [0]);
-       if (strcmp (argv [1], "\t"))
-               return FAILED ("13. argv[2] was %s", argv [1]);
-       if (strcmp (argv [2], "bola "))
-               return FAILED ("14. argv[2] was %s", argv [2]);
-       if (error != NULL)
-               return FAILED ("15. error is not null");
-
-       g_strfreev (argv);
-       argv = NULL;
-       argc = 0;
-       error = NULL;
-       ret = g_shell_parse_argv ("hola\n\t  \\\n  \"\t\"  \"bola \"", &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("16. It should return TRUE");
-       if (argc != 3)
-               return FAILED ("17. argc was %d expected 3", argc);
-       if (strcmp (argv [0], "hola"))
-               return FAILED ("18. argv[0] was %s", argv [0]);
-       if (strcmp (argv [1], "\t"))
-               return FAILED ("19. argv[2] was %s", argv [1]);
-       if (strcmp (argv [2], "bola "))
-               return FAILED ("20. argv[2] was %s", argv [2]);
-       if (error != NULL)
-               return FAILED ("21. error is not null");
-
-       g_strfreev (argv);
-       return OK;
-}
-
-RESULT
-test_shell_argv3 ()
-{
-       GError *error;
-       gint argc;
-       gchar **argv;
-       gboolean ret;
-
-       argv = NULL;
-       argc = 0;
-       error = NULL;
-       ret = g_shell_parse_argv ("hola      \"bola", &argc, &argv, &error);
-       if (ret)
-               return FAILED ("1. It should return FALSE");
-       if (argc != 0)
-               return FAILED ("2. argc was %d expected 0", argc);
-       if (argv != NULL)
-               return FAILED ("3. argv[0] was %s", argv [0]);
-       if (error == NULL)
-               return FAILED ("4. error is null");
-
-       /* Text ended before matching quote was found for ". (The text was 'hola      "bola') */
-       g_error_free (error);
-       error = NULL;
-       ret = g_shell_parse_argv ("hola      \\\"bola", &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("5. It should return TRUE");
-       if (argc != 2)
-               return FAILED ("6. argc was %d expected 2", argc);
-       if (strcmp (argv [0], "hola"))
-               return FAILED ("18. argv[0] was %s", argv [0]);
-       if (strcmp (argv [1], "\"bola"))
-               return FAILED ("18. argv[1] was %s", argv [1]);
-       if (error != NULL)
-               return FAILED ("8. error is not null");
-
-       g_strfreev (argv);
-       argv = NULL;
-       argc = 0;
-       ret = g_shell_parse_argv ("hola      \"\n\\'bola\"", &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("9. It should return TRUE. %s", error->message);
-       if (argc != 2)
-               return FAILED ("10. argc was %d expected 2", argc);
-       if (strcmp (argv [0], "hola"))
-               return FAILED ("11. argv[0] was %s", argv [0]);
-       if (strcmp (argv [1], "\n\\'bola"))
-               return FAILED ("12. argv[1] was %s", argv [1]);
-       if (error != NULL)
-               return FAILED ("13. error is not null");
-
-       g_strfreev (argv);
-       argv = NULL;
-       argc = 0;
-       return OK;
-}
-
-// This was the 2.8 showstopper error
-RESULT
-test_shell_argv4 ()
-{
-       GError *error;
-       gint argc;
-       gchar **argv;
-       gboolean ret;
-       char *str = "'/usr/bin/gnome-terminal' -e \"bash -c 'read -p \\\"Press any key to continue...\\\" -n1;'\"";
-
-       argv = NULL;
-       argc = 0;
-       error = NULL;
-       ret = g_shell_parse_argv (str, &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("1. It should return TRUE");
-       if (argc != 3)
-               return FAILED ("2. argc was %d expected 3", argc);
-       if (argv == NULL)
-               return FAILED ("3. argv[0] was NULL");
-       if (error != NULL)
-               return FAILED ("4. error was set");
-
-       if (strcmp (argv [0], "/usr/bin/gnome-terminal"))
-               return FAILED ("5. Expected /usr/bin/gnome-terminal got %s", argv [0]);
-       if (strcmp (argv [1], "-e"))
-               return FAILED ("6. Expected -e, got: %s", argv [1]);
-       if (strcmp (argv [2], "bash -c 'read -p \"Press any key to continue...\" -n1;'"))
-               return FAILED ("7. Got unexpected result: %s\n", argv [2]);
-       
-       return OK;
-}
-
-// This is https://bugzilla.novell.com/show_bug.cgi?id=655896
-RESULT
-test_shell_argv5 ()
-{
-       GError *error;
-       gint argc;
-       gchar **argv;
-       gboolean ret;
-       char *str = "echo \"foo\",\"bar\"";
-
-       argv = NULL;
-       argc = 0;
-       error = NULL;
-       ret = g_shell_parse_argv (str, &argc, &argv, &error);
-       if (!ret)
-               return FAILED ("1. It should return TRUE");
-       if (argc != 2)
-               return FAILED ("2. argc was %d expected 2", argc);
-       if (argv == NULL)
-               return FAILED ("3. argv[0] was NULL");
-       if (error != NULL)
-               return FAILED ("4. error was set");
-
-       if (strcmp (argv [0], "echo"))
-               return FAILED ("5. Expected echo got %s", argv [0]);
-       if (strcmp (argv [1], "foo,bar"))
-               return FAILED ("6. Expected foo,bar, got: %s", argv [1]);
-       
-       return OK;
-}
-
-RESULT
-test_quote ()
-{
-       if (strcmp (g_shell_quote ("foo"), "'foo'"))
-               return FAILED ("Should return 'foo'");
-
-       if (strcmp (g_shell_quote ("foo'bar"), "'foo'\\''bar'"))
-               return FAILED ("Should return 'foo'\\''bar'");
-
-       if (strcmp (g_shell_quote ("foo bar"), "'foo bar'"))
-               return FAILED ("Should return 'foo bar'");
-       return OK;
-}
-
-static Test shell_tests [] = {
-       {"test_shell_argv1", test_shell_argv1},
-       {"test_shell_argv2", test_shell_argv2},
-       {"test_shell_argv3", test_shell_argv3},
-       {"test_shell_argv4", test_shell_argv4},
-       {"test_shell_argv5", test_shell_argv5},
-       {"g_shell_quote", test_quote},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(shell_tests_init, shell_tests)
-
diff --git a/eglib/test/sizes.c b/eglib/test/sizes.c
deleted file mode 100644 (file)
index 06ed8a5..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Tests to ensure that our type definitions are correct
- *
- * These depend on -Werror, -Wall being set to catch the build error.
- */
-#include <stdio.h>
-#ifndef _MSC_VER
-#include <stdint.h>
-#endif
-#include <string.h>
-#include <glib.h>
-#include "test.h"
-
-RESULT
-test_formats ()
-{
-       char buffer [1024];
-       gsize a = 1;
-       
-       sprintf (buffer, "%" G_GSIZE_FORMAT, a);
-
-       return NULL;
-}
-
-RESULT
-test_ptrconv ()
-{
-       int iv, iv2;
-       unsigned int uv, uv2;
-       gpointer ptr;
-
-       iv = G_MAXINT32;
-       ptr = GINT_TO_POINTER (iv);
-       iv2 = GPOINTER_TO_INT (ptr);
-       if (iv != iv2)
-               return FAILED ("int to pointer and back conversions fail %d != %d", iv, iv2);
-
-       iv = G_MININT32;
-       ptr = GINT_TO_POINTER (iv);
-       iv2 = GPOINTER_TO_INT (ptr);
-       if (iv != iv2)
-               return FAILED ("int to pointer and back conversions fail %d != %d", iv, iv2);
-
-       iv = 1;
-       ptr = GINT_TO_POINTER (iv);
-       iv2 = GPOINTER_TO_INT (ptr);
-       if (iv != iv2)
-               return FAILED ("int to pointer and back conversions fail %d != %d", iv, iv2);
-
-       iv = -1;
-       ptr = GINT_TO_POINTER (iv);
-       iv2 = GPOINTER_TO_INT (ptr);
-       if (iv != iv2)
-               return FAILED ("int to pointer and back conversions fail %d != %d", iv, iv2);
-
-       iv = 0;
-       ptr = GINT_TO_POINTER (iv);
-       iv2 = GPOINTER_TO_INT (ptr);
-       if (iv != iv2)
-               return FAILED ("int to pointer and back conversions fail %d != %d", iv, iv2);
-
-       uv = 0;
-       ptr = GUINT_TO_POINTER (uv);
-       uv2 = GPOINTER_TO_UINT (ptr);
-       if (uv != uv2)
-               return FAILED ("uint to pointer and back conversions fail %u != %d", uv, uv2);
-       
-       uv = 1;
-       ptr = GUINT_TO_POINTER (uv);
-       uv2 = GPOINTER_TO_UINT (ptr);
-       if (uv != uv2)
-               return FAILED ("uint to pointer and back conversions fail %u != %d", uv, uv2);
-
-       uv = UINT32_MAX;
-       ptr = GUINT_TO_POINTER (uv);
-       uv2 = GPOINTER_TO_UINT (ptr);
-       if (uv != uv2)
-               return FAILED ("uint to pointer and back conversions fail %u != %d", uv, uv2);
-
-       return NULL;
-       
-}
-
-typedef struct {
-       int a;
-       int b;
-} my_struct;
-
-RESULT
-test_offset ()
-{
-       if (G_STRUCT_OFFSET (my_struct, a) != 0)
-               return FAILED ("offset of a is not zero");
-       
-       if (G_STRUCT_OFFSET (my_struct, b) != 4 && G_STRUCT_OFFSET (my_struct, b) != 8)
-               return FAILED ("offset of b is 4 or 8, macro might be busted");
-
-       return OK;
-}
-
-static Test size_tests [] = {
-       {"formats", test_formats},
-       {"ptrconv", test_ptrconv},
-       {"g_struct_offset", test_offset},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(size_tests_init, size_tests)
diff --git a/eglib/test/slist.c b/eglib/test/slist.c
deleted file mode 100644 (file)
index 3f8360e..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-#include "test.h"
-
-
-RESULT
-test_slist_nth ()
-{
-       char *foo = "foo";
-       char *bar = "bar";
-       char *baz = "baz";
-       GSList *nth, *list;
-       list = g_slist_prepend (NULL, baz);
-       list = g_slist_prepend (list, bar);
-       list = g_slist_prepend (list, foo);
-
-       nth = g_slist_nth (list, 0);
-       if (nth->data != foo)
-               return FAILED ("nth failed. #0");
-
-       nth = g_slist_nth (list, 1);
-       if (nth->data != bar)
-               return FAILED ("nth failed. #1");
-       
-       nth = g_slist_nth (list, 2);
-       if (nth->data != baz)
-               return FAILED ("nth failed. #2");
-
-       nth = g_slist_nth (list, 3);
-       if (nth)
-               return FAILED ("nth failed. #3: %s", nth->data);
-
-       g_slist_free (list);
-       return OK;
-}
-
-RESULT
-test_slist_index ()
-{
-       int i;
-       char *foo = "foo";
-       char *bar = "bar";
-       char *baz = "baz";
-       GSList *list;
-       list = g_slist_prepend (NULL, baz);
-       list = g_slist_prepend (list, bar);
-       list = g_slist_prepend (list, foo);
-
-       i = g_slist_index (list, foo);
-       if (i != 0)
-               return FAILED ("index failed. #0: %d", i);
-
-       i = g_slist_index (list, bar);
-       if (i != 1)
-               return FAILED ("index failed. #1: %d", i);
-       
-       i = g_slist_index (list, baz);
-       if (i != 2)
-               return FAILED ("index failed. #2: %d", i);
-
-       g_slist_free (list);
-       return OK;
-}
-
-RESULT
-test_slist_append ()
-{
-       GSList *foo;
-       GSList *list = g_slist_append (NULL, "first");
-       if (g_slist_length (list) != 1)
-               return FAILED ("append(null,...) failed");
-
-       foo = g_slist_append (list, "second");
-       if (foo != list)
-               return FAILED ("changed list head on non-empty");
-
-       if (g_slist_length (list) != 2)
-               return FAILED ("Append failed");
-
-       g_slist_free (list);
-       return OK;
-}
-
-RESULT
-test_slist_concat ()
-{
-       GSList *foo = g_slist_prepend (NULL, "foo");
-       GSList *bar = g_slist_prepend (NULL, "bar");
-
-       GSList *list = g_slist_concat (foo, bar);
-
-       if (g_slist_length (list) != 2)
-               return FAILED ("Concat failed.");
-
-       g_slist_free (list);
-       return OK;
-}
-
-RESULT
-test_slist_find ()
-{
-       GSList *list = g_slist_prepend (NULL, "three");
-       GSList *found;
-       char *data;
-               
-       list = g_slist_prepend (list, "two");
-       list = g_slist_prepend (list, "one");
-
-       data = "four";
-       list = g_slist_append (list, data);
-
-       found = g_slist_find (list, data);
-
-       if (found->data != data)
-               return FAILED ("Find failed");
-
-       g_slist_free (list);
-       return OK;
-}
-
-static gint
-find_custom (gconstpointer a, gconstpointer b)
-{
-       return(strcmp (a, b));
-}
-
-RESULT
-test_slist_find_custom ()
-{
-       GSList *list = NULL, *found;
-       char *foo = "foo";
-       char *bar = "bar";
-       char *baz = "baz";
-       
-       list = g_slist_prepend (list, baz);
-       list = g_slist_prepend (list, bar);
-       list = g_slist_prepend (list, foo);
-       
-       found = g_slist_find_custom (list, baz, find_custom);
-       
-       if (found == NULL)
-               return FAILED ("Find failed");
-       
-       g_slist_free (list);
-       
-       return OK;
-}
-
-RESULT
-test_slist_remove ()
-{
-       GSList *list = g_slist_prepend (NULL, "three");
-       char *one = "one";
-       list = g_slist_prepend (list, "two");
-       list = g_slist_prepend (list, one);
-
-       list = g_slist_remove (list, one);
-
-       if (g_slist_length (list) != 2)
-               return FAILED ("Remove failed");
-
-       if (strcmp ("two", list->data) != 0)
-               return FAILED ("Remove failed");
-
-       g_slist_free (list);
-       return OK;
-}
-
-RESULT
-test_slist_remove_link ()
-{
-       GSList *foo = g_slist_prepend (NULL, "a");
-       GSList *bar = g_slist_prepend (NULL, "b");
-       GSList *baz = g_slist_prepend (NULL, "c");
-       GSList *list = foo;
-
-       foo = g_slist_concat (foo, bar);
-       foo = g_slist_concat (foo, baz);        
-
-       list = g_slist_remove_link (list, bar);
-
-       if (g_slist_length (list) != 2)
-               return FAILED ("remove_link failed #1");
-
-       if (bar->next != NULL)
-               return FAILED ("remove_link failed #2");
-
-       g_slist_free (list);    
-       g_slist_free (bar);
-
-       return OK;
-}
-
-static gint
-compare (gconstpointer a, gconstpointer b)
-{
-       char *foo = (char *) a;
-       char *bar = (char *) b;
-
-       if (strlen (foo) < strlen (bar))
-               return -1;
-
-       return 1;
-}
-
-RESULT
-test_slist_insert_sorted ()
-{
-       GSList *list = g_slist_prepend (NULL, "a");
-       list = g_slist_append (list, "aaa");
-
-       /* insert at the middle */
-       list = g_slist_insert_sorted (list, "aa", compare);
-       if (strcmp ("aa", list->next->data))
-               return FAILED("insert_sorted failed #1");
-
-       /* insert at the beginning */
-       list = g_slist_insert_sorted (list, "", compare);
-       if (strcmp ("", list->data))
-               return FAILED ("insert_sorted failed #2");
-
-       /* insert at the end */
-       list = g_slist_insert_sorted (list, "aaaa", compare);
-       if (strcmp ("aaaa", g_slist_last (list)->data))
-               return FAILED ("insert_sorted failed #3");
-
-       g_slist_free (list);    
-       return OK;
-}
-
-RESULT
-test_slist_insert_before ()
-{
-       GSList *foo, *bar, *baz;
-
-       foo = g_slist_prepend (NULL, "foo");
-       foo = g_slist_insert_before (foo, NULL, "bar");
-       bar = g_slist_last (foo);
-
-       if (strcmp (bar->data, "bar"))
-               return FAILED ("1");
-
-       baz = g_slist_insert_before (foo, bar, "baz");
-       if (foo != baz)
-               return FAILED ("2");
-
-       if (strcmp (foo->next->data, "baz"))
-               return FAILED ("3: %s", foo->next->data);
-
-       g_slist_free (foo);
-       return OK;
-}
-
-#define N_ELEMS 100
-
-static int intcompare (gconstpointer p1, gconstpointer p2)
-{
-       return GPOINTER_TO_INT (p1) - GPOINTER_TO_INT (p2);
-}
-
-static gboolean verify_sort (GSList *list, int len)
-{
-       int prev = GPOINTER_TO_INT (list->data);
-       len--;
-       for (list = list->next; list; list = list->next) {
-               int curr = GPOINTER_TO_INT (list->data);
-               if (prev > curr)
-                       return FALSE;
-               prev = curr;
-
-               if (len == 0)
-                       return FALSE;
-               len--;
-       }
-       return len == 0;
-}
-
-RESULT
-test_slist_sort ()
-{
-       int i, j, mul;
-       GSList *list = NULL;
-
-       for (i = 0; i < N_ELEMS; ++i)
-               list = g_slist_prepend (list, GINT_TO_POINTER (i));
-       list = g_slist_sort (list, intcompare);
-       if (!verify_sort (list, N_ELEMS))
-               return FAILED ("decreasing list");
-
-       g_slist_free (list);
-
-       list = NULL;
-       for (i = 0; i < N_ELEMS; ++i)
-               list = g_slist_prepend (list, GINT_TO_POINTER (-i));
-       list = g_slist_sort (list, intcompare);
-       if (!verify_sort (list, N_ELEMS))
-               return FAILED ("increasing list");
-
-       g_slist_free (list);
-
-       list = g_slist_prepend (NULL, GINT_TO_POINTER (0));
-       for (i = 1; i < N_ELEMS; ++i) {
-               list = g_slist_prepend (list, GINT_TO_POINTER (-i));
-               list = g_slist_prepend (list, GINT_TO_POINTER (i));
-       }
-       list = g_slist_sort (list, intcompare);
-       if (!verify_sort (list, 2*N_ELEMS-1))
-               return FAILED ("alternating list");
-
-       g_slist_free (list);
-
-       list = NULL;
-       mul = 1;
-       for (i = 1; i < N_ELEMS; ++i) {
-               mul = -mul;
-               for (j = 0; j < i; ++j)
-                       list = g_slist_prepend (list, GINT_TO_POINTER (mul * j));
-       }
-       list = g_slist_sort (list, intcompare);
-       if (!verify_sort (list, (N_ELEMS*N_ELEMS - N_ELEMS)/2))
-               return FAILED ("wavering list");
-
-       g_slist_free (list);
-
-       return OK;
-}
-
-static Test slist_tests [] = {
-       {"nth", test_slist_nth},
-       {"index", test_slist_index},
-       {"append", test_slist_append},
-       {"concat", test_slist_concat},
-       {"find", test_slist_find},
-       {"find_custom", test_slist_find_custom},
-       {"remove", test_slist_remove},
-       {"remove_link", test_slist_remove_link},
-       {"insert_sorted", test_slist_insert_sorted},
-       {"insert_before", test_slist_insert_before},
-       {"sort", test_slist_sort},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(slist_tests_init, slist_tests)
-
diff --git a/eglib/test/spawn.c b/eglib/test/spawn.c
deleted file mode 100644 (file)
index ec30fc8..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#include <config.h>
-#include <glib.h>
-#include <string.h>
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include "test.h"
-
-#ifdef G_OS_WIN32
-#include <io.h>
-#define read _read
-#define close _close
-#endif
-
-RESULT
-test_spawn_sync ()
-{
-       gchar *out;
-       gchar *err;
-       gint status = -1;
-       GError *error = NULL;
-
-       if (!g_spawn_command_line_sync ("ls", &out, &err, &status, &error))
-               return FAILED ("Error executing 'ls'");
-
-       if (status != 0)
-               return FAILED ("Status is %d", status);
-
-       if (out == NULL || strlen (out) == 0)
-               return FAILED ("Didn't get any output from ls!?");
-
-       g_free (out);
-       g_free (err);
-       return OK;
-}
-
-RESULT
-test_spawn_async ()
-{
-       /*
-gboolean
-g_spawn_async_with_pipes (const gchar *working_directory,
-                       gchar **argv,
-                       gchar **envp,
-                       GSpawnFlags flags,
-                       GSpawnChildSetupFunc child_setup,
-                       gpointer user_data,
-                       GPid *child_pid,
-                       gint *standard_input,
-                       gint *standard_output,
-                       gint *standard_error,
-                       GError **error) */
-       char *argv [15];
-       int stdout_fd = -1;
-       char buffer [512];
-       pid_t child_pid = 0;
-
-       memset (argv, 0, 15 * sizeof (char *));
-       argv [0] = "ls";
-       if (!g_spawn_async_with_pipes (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &child_pid, NULL, &stdout_fd, NULL, NULL))
-               return FAILED ("1 Failed to run ls");
-       if (child_pid == 0)
-               return FAILED ("2 child pid not returned");
-       if (stdout_fd == -1)
-               return FAILED ("3 out fd is -1");
-
-       while (read (stdout_fd, buffer, 512) > 0);
-       close (stdout_fd);
-
-       return OK;
-}
-
-static Test spawn_tests [] = {
-       {"g_shell_spawn_sync", test_spawn_sync},
-       {"g_shell_spawn_async_with_pipes", test_spawn_async},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(spawn_tests_init, spawn_tests)
-
-
diff --git a/eglib/test/string-util.c b/eglib/test/string-util.c
deleted file mode 100644 (file)
index 73efd13..0000000
+++ /dev/null
@@ -1,698 +0,0 @@
-#include <glib.h>
-#include <string.h>
-#include <stdio.h>
-#include "test.h"
-
-/* This test is just to be used with valgrind */
-RESULT
-test_strfreev ()
-{
-       gchar **array = g_new (gchar *, 4);
-       array [0] = g_strdup ("one");
-       array [1] = g_strdup ("two");
-       array [2] = g_strdup ("three");
-       array [3] = NULL;
-       
-       g_strfreev (array);
-       g_strfreev (NULL);
-
-       return OK;
-}
-
-RESULT
-test_concat ()
-{
-       gchar *x = g_strconcat ("Hello", ", ", "world", NULL);
-       if (strcmp (x, "Hello, world") != 0)
-               return FAILED("concat failed, got: %s", x);
-       g_free (x);
-       return OK;
-}
-
-RESULT
-test_split ()
-{
-       const gchar *to_split = "Hello world, how are we doing today?";
-       gint i;
-       gchar **v;
-       
-       v= g_strsplit(to_split, " ", 0);
-       
-       if(v == NULL) {
-               return FAILED("split failed, got NULL vector (1)");
-       }
-       
-       for(i = 0; v[i] != NULL; i++);
-       if(i != 7) {
-               return FAILED("split failed, expected 7 tokens, got %d", i);
-       }
-       
-       g_strfreev(v);
-
-       v = g_strsplit(to_split, ":", -1);
-       if(v == NULL) {
-               return FAILED("split failed, got NULL vector (2)");
-       }
-
-       for(i = 0; v[i] != NULL; i++);
-       if(i != 1) {
-               return FAILED("split failed, expected 1 token, got %d", i);
-       }
-
-       if(strcmp(v[0], to_split) != 0) {
-               return FAILED("expected vector[0] to be '%s' but it was '%s'",
-                       to_split, v[0]);
-       }
-       g_strfreev(v);
-
-       v = g_strsplit ("", ":", 0);
-       if (v == NULL)
-               return FAILED ("g_strsplit returned NULL");
-       g_strfreev (v);
-
-       v = g_strsplit ("/home/miguel/dingus", "/", 0);
-       if (v [0][0] != 0)
-               return FAILED ("Got a non-empty first element");
-       g_strfreev (v);
-
-       v = g_strsplit ("appdomain1, Version=0.0.0.0, Culture=neutral", ",", 4);
-       if (strcmp (v [0], "appdomain1") != 0)
-               return FAILED ("Invalid value");
-       
-       if (strcmp (v [1], " Version=0.0.0.0") != 0)
-               return FAILED ("Invalid value");
-       
-       if (strcmp (v [2], " Culture=neutral") != 0)
-               return FAILED ("Invalid value");
-
-       if (v [3] != NULL)
-               return FAILED ("Expected only 3 elements");
-       
-       g_strfreev (v);
-
-       v = g_strsplit ("abcXYdefXghiXYjklYmno", "XY", 4);
-       if (strcmp (v [0], "abc") != 0)
-               return FAILED ("Invalid value 0");
-       
-       if (strcmp (v [1], "defXghi") != 0)
-               return FAILED ("Invalid value 1");
-
-       if (strcmp (v [2], "jklYmno") != 0)
-               return FAILED ("Invalid value 2");
-
-       if (v [3] != NULL)
-               return FAILED ("Expected only 3 elements (1)");
-       
-       g_strfreev (v);
-
-       v = g_strsplit ("abcXYdefXghiXYjklYmno", "XY", 2);
-       if (strcmp (v [0], "abc") != 0)
-               return FAILED ("Invalid value 3");
-       
-       if (strcmp (v [1], "defXghiXYjklYmno") != 0)
-               return FAILED ("Invalid value 4");
-
-       if (v [2] != NULL)
-               return FAILED ("Expected only 2 elements (2)");
-       
-       g_strfreev (v);
-
-       v = g_strsplit ("abcXYdefXghiXYjklYmnoXY", "XY", 3);
-       if (strcmp (v [0], "abc") != 0)
-               return FAILED ("Invalid value 5");
-       
-       if (strcmp (v [1], "defXghi") != 0)
-               return FAILED ("Invalid value 6");
-
-       if (strcmp (v [2], "jklYmnoXY") != 0)
-               return FAILED ("Invalid value 7");
-
-       if (v [3] != NULL)
-               return FAILED ("Expected only 3 elements (3)");
-       
-       g_strfreev (v);
-
-       v = g_strsplit ("abcXYXYXYdefXY", "XY", -1);
-       if (strcmp (v [0], "abc") != 0)
-               return FAILED ("Invalid value 8");
-
-       if (strcmp (v [1], "") != 0)
-               return FAILED ("Invalid value 9");
-
-       if (strcmp (v [2], "") != 0)
-               return FAILED ("Invalid value 10");
-       
-       if (strcmp (v [3], "def") != 0)
-               return FAILED ("Invalid value 11");
-
-       if (strcmp (v [4], "") != 0)
-               return FAILED ("Invalid value 12");
-
-       if (v [5] != NULL)
-               return FAILED ("Expected only 5 elements (4)");
-       
-       g_strfreev (v);
-
-       v = g_strsplit ("XYXYXYabcXYdef", "XY", -1);
-       if (strcmp (v [0], "") != 0)
-               return FAILED ("Invalid value 13");
-       
-       if (strcmp (v [1], "") != 0)
-               return FAILED ("Invalid value 14");
-       
-       if (strcmp (v [2], "") != 0)
-               return FAILED ("Invalid value 15");
-       
-       if (strcmp (v [3], "abc") != 0)
-               return FAILED ("Invalid value 16");
-       
-       if (strcmp (v [4], "def") != 0)
-               return FAILED ("Invalid value 17");
-
-       if (v [5] != NULL)
-               return FAILED ("Expected only 5 elements (5)");
-       
-       g_strfreev (v);
-
-       v = g_strsplit ("value=", "=", 2);
-       if (strcmp (v [0], "value") != 0)
-               return FAILED ("Invalid value 18; expected 'value', got '%s'", v [0]);
-       if (strcmp (v [1], "") != 0)
-               return FAILED ("Invalid value 19; expected '', got '%s'", v [1]);
-       if (v [2] != NULL)
-               return FAILED ("Expected only 2 elements (6)");
-
-       g_strfreev (v);
-
-       return OK;
-}
-
-RESULT
-test_split_set ()
-{
-       gchar **v;
-       
-       v = g_strsplit_set ("abcXYdefXghiXYjklYmno", "XY", 6);
-       if (strcmp (v [0], "abc") != 0)
-               return FAILED ("Invalid value 0");
-
-       if (strcmp (v [1], "") != 0)
-               return FAILED ("Invalid value 1");
-       
-       if (strcmp (v [2], "def") != 0)
-               return FAILED ("Invalid value 2");
-
-       if (strcmp (v [3], "ghi") != 0)
-               return FAILED ("Invalid value 3");
-
-       if (strcmp (v [4], "") != 0)
-               return FAILED ("Invalid value 4");
-
-       if (strcmp (v [5], "jklYmno") != 0)
-               return FAILED ("Invalid value 5");
-
-       if (v [6] != NULL)
-               return FAILED ("Expected only 6 elements (1)");
-
-       g_strfreev (v);
-
-       v = g_strsplit_set ("abcXYdefXghiXYjklYmno", "XY", 3);
-       if (strcmp (v [0], "abc") != 0)
-               return FAILED ("Invalid value 6");
-
-       if (strcmp (v [1], "") != 0)
-               return FAILED ("Invalid value 7");
-       
-       if (strcmp (v [2], "defXghiXYjklYmno") != 0)
-               return FAILED ("Invalid value 8");
-
-       if (v [3] != NULL)
-               return FAILED ("Expected only 3 elements (2)");
-       
-       g_strfreev (v);
-
-       v = g_strsplit_set ("abcXdefYghiXjklYmnoX", "XY", 5);
-       if (strcmp (v [0], "abc") != 0)
-               return FAILED ("Invalid value 9");
-       
-       if (strcmp (v [1], "def") != 0)
-               return FAILED ("Invalid value 10");
-
-       if (strcmp (v [2], "ghi") != 0)
-               return FAILED ("Invalid value 11");
-
-       if (strcmp (v [3], "jkl") != 0)
-               return FAILED ("Invalid value 12");
-
-       if (strcmp (v [4], "mnoX") != 0)
-               return FAILED ("Invalid value 13");
-
-       if (v [5] != NULL)
-               return FAILED ("Expected only 5 elements (5)");
-       
-       g_strfreev (v);
-
-       v = g_strsplit_set ("abcXYXdefXY", "XY", -1);
-       if (strcmp (v [0], "abc") != 0)
-               return FAILED ("Invalid value 14");
-
-       if (strcmp (v [1], "") != 0)
-               return FAILED ("Invalid value 15");
-
-       if (strcmp (v [2], "") != 0)
-               return FAILED ("Invalid value 16");
-       
-       if (strcmp (v [3], "def") != 0)
-               return FAILED ("Invalid value 17");
-
-       if (strcmp (v [4], "") != 0)
-               return FAILED ("Invalid value 18");
-
-       if (strcmp (v [5], "") != 0)
-               return FAILED ("Invalid value 19");
-
-       if (v [6] != NULL)
-               return FAILED ("Expected only 6 elements (4)");
-       
-       g_strfreev (v);
-
-       v = g_strsplit_set ("XYXabcXYdef", "XY", -1);
-       if (strcmp (v [0], "") != 0)
-               return FAILED ("Invalid value 20");
-       
-       if (strcmp (v [1], "") != 0)
-               return FAILED ("Invalid value 21");
-       
-       if (strcmp (v [2], "") != 0)
-               return FAILED ("Invalid value 22");
-       
-       if (strcmp (v [3], "abc") != 0)
-               return FAILED ("Invalid value 23");
-
-       if (strcmp (v [4], "") != 0)
-               return FAILED ("Invalid value 24");
-       
-       if (strcmp (v [5], "def") != 0)
-               return FAILED ("Invalid value 25");
-
-       if (v [6] != NULL)
-               return FAILED ("Expected only 6 elements (5)");
-       
-       g_strfreev (v);
-
-       return OK;
-}
-
-RESULT
-test_strreverse ()
-{
-       RESULT res = OK;
-       gchar *a = g_strdup ("onetwothree");
-       gchar *a_target = "eerhtowteno";
-       gchar *b = g_strdup ("onetwothre");
-       gchar *b_target = "erhtowteno";
-       gchar *c = g_strdup ("");
-       gchar *c_target = "";
-
-       g_strreverse (a);
-       if (strcmp (a, a_target)) {
-               res = FAILED("strreverse failed. Expecting: '%s' and got '%s'\n", a, a_target);
-               goto cleanup;
-       }
-
-       g_strreverse (b);
-       if (strcmp (b, b_target)) {
-               res = FAILED("strreverse failed. Expecting: '%s' and got '%s'\n", b, b_target);
-               goto cleanup;
-       }
-
-       g_strreverse (c);
-       if (strcmp (c, c_target)) {
-               res = FAILED("strreverse failed. Expecting: '%s' and got '%s'\n", b, b_target);
-               goto cleanup;
-       }
-
-cleanup:
-       g_free (c);
-       g_free (b);
-       g_free (a);
-       return res;
-}
-
-RESULT
-test_strjoin ()
-{
-       char *s;
-       
-       s = g_strjoin (NULL, "a", "b", NULL);
-       if (strcmp (s, "ab") != 0)
-               return FAILED ("Join of two strings with no separator fails");
-       g_free (s);
-
-       s = g_strjoin ("", "a", "b", NULL);
-       if (strcmp (s, "ab") != 0)
-               return FAILED ("Join of two strings with empty separator fails");
-       g_free (s);
-
-       s = g_strjoin ("-", "a", "b", NULL);
-       if (strcmp (s, "a-b") != 0)
-               return FAILED ("Join of two strings with separator fails");
-       g_free (s);
-
-       s = g_strjoin ("-", "aaaa", "bbbb", "cccc", "dddd", NULL);
-       if (strcmp (s, "aaaa-bbbb-cccc-dddd") != 0)
-               return FAILED ("Join of multiple strings fails");
-       g_free (s);
-
-       s = g_strjoin ("-", NULL);
-       if (s == NULL || (strcmp (s, "") != 0))
-               return FAILED ("Failed to join empty arguments");
-       g_free (s);
-
-       return OK;
-}
-
-RESULT
-test_strchug ()
-{
-       char *str = g_strdup (" \t\n hola");
-
-       g_strchug (str);
-       if (strcmp ("hola", str)) {
-               fprintf (stderr, "%s\n", str);
-               g_free (str);
-               return FAILED ("Failed.");
-       }
-       g_free (str);
-       return OK;
-}
-
-RESULT
-test_strchomp ()
-{
-       char *str = g_strdup ("hola  \t");
-
-       g_strchomp (str);
-       if (strcmp ("hola", str)) {
-               fprintf (stderr, "%s\n", str);
-               g_free (str);
-               return FAILED ("Failed.");
-       }
-       g_free (str);
-       return OK;
-}
-
-RESULT
-test_strstrip ()
-{
-       char *str = g_strdup (" \t hola   ");
-
-       g_strstrip (str);
-       if (strcmp ("hola", str)) {
-               fprintf (stderr, "%s\n", str);
-               g_free (str);
-               return FAILED ("Failed.");
-       }
-       g_free (str);
-       return OK;
-}
-
-#define urit(so,j) do { s = g_filename_to_uri (so, NULL, NULL); if (strcmp (s, j) != 0) return FAILED("Got %s expected %s", s, j); g_free (s); } while (0);
-
-#define errit(so) do { s = g_filename_to_uri (so, NULL, NULL); if (s != NULL) return FAILED ("got %s, expected NULL", s); } while (0);
-
-RESULT
-test_filename_to_uri ()
-{
-#ifdef G_OS_WIN32
-#else
-       char *s;
-
-       urit ("/a", "file:///a");
-       urit ("/home/miguel", "file:///home/miguel");
-       urit ("/home/mig uel", "file:///home/mig%20uel");
-       urit ("/\303\241", "file:///%C3%A1");
-       urit ("/\303\241/octal", "file:///%C3%A1/octal");
-       urit ("/%", "file:///%25");
-       urit ("/\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040", "file:///%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20");
-       urit ("/!$&'()*+,-./", "file:///!$&'()*+,-./");
-       urit ("/\042\043\045", "file:///%22%23%25");
-       urit ("/0123456789:=", "file:///0123456789:=");
-       urit ("/\073\074\076\077", "file:///%3B%3C%3E%3F");
-       urit ("/\133\134\135\136_\140\173\174\175", "file:///%5B%5C%5D%5E_%60%7B%7C%7D");
-       urit ("/\173\174\175\176\177\200", "file:///%7B%7C%7D~%7F%80");
-       urit ("/@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", "file:///@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
-       errit ("a");
-       errit ("./hola");
-#endif
-       
-       return OK;
-}
-
-#define fileit(so,j) do { s = g_filename_from_uri (so, NULL, NULL); if (strcmp (s, j) != 0) return FAILED("Got %s expected %s", s, j); g_free (s); } while (0);
-
-#define ferrit(so) do { s = g_filename_from_uri (so, NULL, NULL); if (s != NULL) return FAILED ("got %s, expected NULL", s); } while (0);
-
-RESULT
-test_filename_from_uri ()
-{
-#ifdef G_OS_WIN32
-#else
-       char *s;
-
-       fileit ("file:///a", "/a");
-       fileit ("file:///%41", "/A");
-       fileit ("file:///home/miguel", "/home/miguel");
-       fileit ("file:///home/mig%20uel", "/home/mig uel");
-       ferrit ("/a");
-       ferrit ("a");
-       ferrit ("file://a");
-       ferrit ("file:a");
-       ferrit ("file:///%");
-       ferrit ("file:///%0");
-       ferrit ("file:///%jj");
-#endif
-       
-       return OK;
-}
-
-RESULT
-test_ascii_xdigit_value ()
-{
-       int i;
-       gchar j;
-
-       i = g_ascii_xdigit_value ('9' + 1);
-       if (i != -1)
-               return FAILED ("'9' + 1");
-       i = g_ascii_xdigit_value ('0' - 1);
-       if (i != -1)
-               return FAILED ("'0' - 1");
-       i = g_ascii_xdigit_value ('a' - 1);
-       if (i != -1)
-               return FAILED ("'a' - 1");
-       i = g_ascii_xdigit_value ('f' + 1);
-       if (i != -1)
-               return FAILED ("'f' + 1");
-       i = g_ascii_xdigit_value ('A' - 1);
-       if (i != -1)
-               return FAILED ("'A' - 1");
-       i = g_ascii_xdigit_value ('F' + 1);
-       if (i != -1)
-               return FAILED ("'F' + 1");
-
-       for (j = '0'; j < '9'; j++) {
-               int c = g_ascii_xdigit_value (j);
-               if (c  != (j - '0'))
-                       return FAILED ("Digits %c -> %d", j, c);
-       }
-       for (j = 'a'; j < 'f'; j++) {
-               int c = g_ascii_xdigit_value (j);
-               if (c  != (j - 'a' + 10))
-                       return FAILED ("Lower %c -> %d", j, c);
-       }
-       for (j = 'A'; j < 'F'; j++) {
-               int c = g_ascii_xdigit_value (j);
-               if (c  != (j - 'A' + 10))
-                       return FAILED ("Upper %c -> %d", j, c);
-       }
-       return OK;
-}
-
-RESULT
-test_strdelimit ()
-{
-       gchar *str;
-
-       str = g_strdup (G_STR_DELIMITERS);
-       str = g_strdelimit (str, NULL, 'a');
-       if (0 != strcmp ("aaaaaaa", str))
-               return FAILED ("All delimiters: '%s'", str);
-       g_free (str);
-       str = g_strdup ("hola");
-       str = g_strdelimit (str, "ha", '+');
-       if (0 != strcmp ("+ol+", str))
-               return FAILED ("2 delimiters: '%s'", str);
-       g_free (str);
-       return OK;
-}
-
-#define NUMBERS "0123456789"
-
-RESULT
-test_strlcpy ()
-{
-       const gchar *src = "onetwothree";
-       gchar *dest;
-       gsize i;
-
-       dest = g_malloc (strlen (src) + 1);
-       memset (dest, 0, strlen (src) + 1);
-       i = g_strlcpy (dest, src, (gsize)-1);
-       if (i != strlen (src))
-               return FAILED ("Test1 got %d", i);
-
-       if (0 != strcmp (dest, src))
-               return FAILED ("Src and dest not equal");
-
-       i = g_strlcpy (dest, src, 3);
-       if (i != strlen (src))
-               return FAILED ("Test1 got %d", i);
-       if (0 != strcmp (dest, "on"))
-               return FAILED ("Test2");
-
-       i = g_strlcpy (dest, src, 1);
-       if (i != strlen (src))
-               return FAILED ("Test3 got %d", i);
-       if (*dest != '\0')
-               return FAILED ("Test4");
-
-       i = g_strlcpy (dest, src, 12345);
-       if (i != strlen (src))
-               return FAILED ("Test4 got %d", i);
-       if (0 != strcmp (dest, src))
-               return FAILED ("Src and dest not equal 2");
-       g_free (dest);
-
-       /* This is a test for g_filename_from_utf8, even if it does not look like it */
-       dest = g_filename_from_utf8 (NUMBERS, strlen (NUMBERS), NULL, NULL, NULL);
-       if (0 != strcmp (dest, NUMBERS))
-               return FAILED ("problem [%s] and [%s]", dest, NUMBERS);
-       g_free (dest);
-       
-       return OK;
-}
-
-RESULT
-test_strescape ()
-{
-       gchar *str;
-
-       str = g_strescape ("abc", NULL);
-       if (strcmp ("abc", str))
-               return FAILED ("#1");
-       str = g_strescape ("\t\b\f\n\r\\\"abc", NULL);
-       if (strcmp ("\\t\\b\\f\\n\\r\\\\\\\"abc", str))
-               return FAILED ("#2 %s", str);
-       str = g_strescape ("\001abc", NULL);
-       if (strcmp ("\\001abc", str))
-               return FAILED ("#3 %s", str);
-       str = g_strescape ("\001abc", "\001");
-       if (strcmp ("\001abc", str))
-               return FAILED ("#3 %s", str);
-       return OK;
-}
-
-RESULT
-test_ascii_strncasecmp ()
-{
-       int n;
-
-       n = g_ascii_strncasecmp ("123", "123", 1);
-       if (n != 0)
-               return FAILED ("Should have been 0");
-       
-       n = g_ascii_strncasecmp ("423", "123", 1);
-       if (n != 3)
-               return FAILED ("Should have been 3, got %d", n);
-
-       n = g_ascii_strncasecmp ("123", "423", 1);
-       if (n != -3)
-               return FAILED ("Should have been -3, got %d", n);
-
-       n = g_ascii_strncasecmp ("1", "1", 10);
-       if (n != 0)
-               return FAILED ("Should have been 0, got %d", n);
-       return OK;
-}
-
-RESULT
-test_ascii_strdown ()
-{
-       const gchar *a = "~09+AaBcDeFzZ$0909EmPAbCdEEEEEZZZZAAA";
-       const gchar *b = "~09+aabcdefzz$0909empabcdeeeeezzzzaaa";
-       gchar *c;
-       gint n, l;
-
-       l = (gint)strlen (b);
-       c = g_ascii_strdown (a, l);
-       n = g_ascii_strncasecmp (b, c, l);
-
-       if (n != 0) {
-               g_free (c);
-               return FAILED ("Should have been 0, got %d", n);
-       }
-
-       g_free (c);
-       return OK;
-}
-
-RESULT
-test_strdupv ()
-{
-       gchar **one;
-       gchar **two;
-       gint len;
-
-       one = g_strdupv (NULL);
-       if (one)
-               return FAILED ("Should have been NULL");
-
-       one = g_malloc (sizeof (gchar *));
-       *one = NULL;
-       two = g_strdupv (one);
-       if (!two)
-               FAILED ("Should have been not NULL");
-       len = g_strv_length (two);
-       if (len)
-               FAILED ("Should have been 0");
-       g_strfreev (two);
-       g_strfreev (one);
-       return NULL;
-}
-
-static Test strutil_tests [] = {
-       {"g_strfreev", test_strfreev},
-       {"g_strconcat", test_concat},
-       {"g_strsplit", test_split},
-       {"g_strsplit_set", test_split_set},
-       {"g_strreverse", test_strreverse},
-       {"g_strjoin", test_strjoin},
-       {"g_strchug", test_strchug},
-       {"g_strchomp", test_strchomp},
-       {"g_strstrip", test_strstrip},
-       {"g_filename_to_uri", test_filename_to_uri},
-       {"g_filename_from_uri", test_filename_from_uri},
-       {"g_ascii_xdigit_value", test_ascii_xdigit_value},
-       {"g_strdelimit", test_strdelimit},
-       {"g_strlcpy", test_strlcpy},
-       {"g_strescape", test_strescape},
-       {"g_ascii_strncasecmp", test_ascii_strncasecmp },
-       {"g_ascii_strdown", test_ascii_strdown },
-       {"g_strdupv", test_strdupv },
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(strutil_tests_init, strutil_tests)
-
-
diff --git a/eglib/test/string.c b/eglib/test/string.c
deleted file mode 100644 (file)
index 02ad0ad..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-#include <glib.h>
-#include <string.h>
-#include <stdio.h>
-#include "test.h"
-
-#define sfail(k,p) if (s->str [p] != k) { g_string_free (s,TRUE); return FAILED("Got %s, Failed at %d, expected '%c'", s->str, p, k);}
-
-RESULT
-test_append_speed()
-{
-       GString *s = g_string_new("");
-       gint i;
-       
-       for(i = 0; i < 1024; i++) {
-               g_string_append(s, "x");
-       }
-       
-       if(strlen (s->str) != 1024) {
-               return FAILED("Incorrect string size, got: %s %d", 
-                       s->str, strlen(s->str));
-       }
-       
-       g_string_free (s, TRUE);
-
-       return OK;
-}
-
-RESULT
-test_append_c_speed()
-{
-       GString *s = g_string_new("");
-       gint i;
-       
-       for(i = 0; i < 1024; i++) {
-               g_string_append_c(s, 'x');
-       }
-       
-       if(strlen(s->str) != 1024) {
-               return FAILED("Incorrect string size, got: %s %d", s->str, 
-                       strlen(s->str));
-       }
-       
-       g_string_free(s, TRUE);
-
-       return OK;
-}
-
-RESULT
-test_gstring ()
-{
-       GString *s = g_string_new_len ("My stuff", 2);
-       char *ret;
-       int i;
-
-       if (strcmp (s->str, "My") != 0)
-               return "Expected only 'My' on the string";
-       g_string_free (s, TRUE);
-
-       s = g_string_new_len ("My\0\0Rest", 6);
-       if (s->str [2] != 0)
-               return "Null was not copied";
-       if (strcmp (s->str+4, "Re") != 0){
-               return "Did not find the 'Re' part";
-       }
-
-       g_string_append (s, "lalalalalalalalalalalalalalalalalalalalalalal");
-       if (s->str [2] != 0)
-               return "Null as not copied";
-       if (strncmp (s->str+4, "Relala", 6) != 0){
-               return FAILED("Did not copy correctly, got: %s", s->str+4);
-       }
-
-       g_string_free (s, TRUE);
-
-       s = g_string_new ("");
-       for (i = 0; i < 1024; i++){
-               g_string_append_c (s, 'x');
-       }
-       if (strlen (s->str) != 1024){
-               return FAILED("Incorrect string size, got: %s %d\n", s->str, strlen (s->str));
-       }
-       g_string_free (s, TRUE);
-
-       s = g_string_new ("hola");
-       g_string_sprintfa (s, "%s%d", ", bola", 5);
-       if (strcmp (s->str, "hola, bola5") != 0){
-               return FAILED("Incorrect data, got: %s\n", s->str);
-       }
-       g_string_free (s, TRUE);
-
-       s = g_string_new ("Hola");
-       g_string_printf (s, "Dingus");
-       
-       /* Test that it does not release it */
-       ret = g_string_free (s, FALSE);
-       g_free (ret);
-
-       s = g_string_new_len ("H" "\000" "H", 3);
-       g_string_append_len (s, "1" "\000" "2", 3);
-       sfail ('H', 0);
-       sfail ( 0, 1);
-       sfail ('H', 2);
-       sfail ('1', 3);
-       sfail ( 0, 4);
-       sfail ('2', 5);
-       g_string_free (s, TRUE);
-       
-       return OK;
-}
-
-RESULT
-test_sized ()
-{
-       GString *s = g_string_sized_new (20);
-
-       if (s->str [0] != 0)
-               return FAILED ("Expected an empty string");
-       if (s->len != 0)
-               return FAILED ("Expected an empty len");
-
-       g_string_free (s, TRUE);
-       
-       return NULL;
-}
-
-RESULT
-test_truncate ()
-{
-       GString *s = g_string_new ("0123456789");
-       g_string_truncate (s, 3);
-
-       if (strlen (s->str) != 3)
-               return FAILED ("size of string should have been 3, instead it is [%s]\n", s->str);
-       g_string_free (s, TRUE);
-       
-       s = g_string_new ("a");
-       s = g_string_truncate (s, 10);
-       if (strlen (s->str) != 1)
-               return FAILED ("The size is not 1");
-       g_string_truncate (s, (gsize)-1);
-       if (strlen (s->str) != 1)
-               return FAILED ("The size is not 1");
-       g_string_truncate (s, 0);
-       if (strlen (s->str) != 0)
-               return FAILED ("The size is not 0");
-       
-       g_string_free (s, TRUE);
-
-       return NULL;
-}
-
-RESULT
-test_prepend ()
-{
-       GString *s = g_string_new ("dingus");
-       g_string_prepend (s, "one");
-
-       if (strcmp (s->str, "onedingus") != 0)
-               return FAILED ("Failed, expected onedingus, got [%s]", s->str);
-
-       g_string_free (s, TRUE);
-
-       /* This is to force the code that where stuff does not fit in the allocated block */
-       s = g_string_sized_new (1);
-       g_string_prepend (s, "one");
-       if (strcmp (s->str, "one") != 0)
-               return FAILED ("Got erroneous result, expected [one] got [%s]", s->str);
-       g_string_free (s, TRUE);
-
-       /* This is to force the path where things fit */
-       s = g_string_new ("123123123123123123123123");
-       g_string_truncate (s, 1);
-       if (strcmp (s->str, "1") != 0)
-               return FAILED ("Expected [1] string, got [%s]", s->str);
-
-       g_string_prepend (s, "pre");
-       if (strcmp (s->str, "pre1") != 0)
-               return FAILED ("Expected [pre1], got [%s]", s->str);
-       g_string_free (s, TRUE);
-       
-       return NULL;
-}
-
-RESULT
-test_appendlen ()
-{
-       GString *s = g_string_new ("");
-
-       g_string_append_len (s, "boo\000x", 0);
-       if (s->len != 0)
-               return FAILED ("The length is not zero %d", s->len);
-       g_string_append_len (s, "boo\000x", 5);
-       if (s->len != 5)
-               return FAILED ("The length is not five %d", s->len);
-       g_string_append_len (s, "ha", -1);
-       if (s->len != 7)
-               return FAILED ("The length is not seven %d", s->len);
-               
-       g_string_free (s, TRUE);
-
-       return NULL;
-}
-
-RESULT
-test_macros ()
-{
-       char *s = g_strdup (G_STRLOC);
-       char *p = strchr (s + 2, ':');
-       int n;
-       
-       if (p == NULL)
-               return FAILED ("Did not find a separator");
-       n = atoi (p+1);
-       if (n <= 0)
-               return FAILED ("did not find a valid line number");
-
-       *p = 0;
-       if (strcmp (s + strlen(s) - 8 , "string.c") != 0)
-               return FAILED ("This did not store the filename on G_STRLOC");
-       
-       g_free (s);
-       return NULL;
-}
-
-static Test string_tests [] = {
-       {"append-speed", test_append_speed},
-       {"append_c-speed", test_append_c_speed},
-       {"ctor+append", test_gstring },
-       {"ctor+sized", test_sized },
-       {"truncate", test_truncate },
-       {"prepend", test_prepend },
-       {"append_len", test_appendlen },
-       {"macros", test_macros },
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(string_tests_init, string_tests)
diff --git a/eglib/test/test-both b/eglib/test/test-both
deleted file mode 100755 (executable)
index 038c927..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh
-
-for arg in $@; do 
-       if [ "x$arg" = "x--help" ]; then
-               echo "Usage: $0 [OPTION]... [ITERATIONS] [TESTGROUP]..."
-               echo ""
-               echo "Works the same as test-eglib or test-glib with the following"
-               echo "exception. Run test-eglib --help for details on normal testing"
-               echo ""
-               echo "If the first OPTION is --speed-compare, the following is"
-               echo "applicable to this program:"
-               echo ""
-               echo "  --speed-compare    run drivers in -qtni mode and report"
-               echo "                     speed comparison information"
-               echo ""
-               echo "After --speed-compare, the number of iterations "
-               echo "(optional, default is 100000) can be specified, followed "
-               echo "by specific tests to run (or none to run all)"
-               echo ""
-               echo "If --speed-compare is not the first argument, all arguments are"
-               echo "passed on directly to each driver"
-               echo ""
-               exit 1
-       fi
-done
-
-if [ ! -x "./test-glib" -o ! -x "./test-eglib" ]; then
-       make
-fi
-
-if [ "x$1" = "x--speed-compare" ]; then
-       ITERATIONS=100000
-       if [ ! -z "$2" ]; then
-               case $2 in
-                       *[0-9]*) ITERATIONS=$2; break;
-               esac
-       fi      
-
-       OPTIONS="-qnti $ITERATIONS"
-
-       for arg in $@; do
-               if [ "x$arg" = "x--speed-compare" ]; then       
-                       continue;
-               elif [ "$arg" = "$ITERATIONS" ]; then
-                       continue;
-               fi
-
-               OPTIONS="$OPTIONS $arg"
-       done
-       
-       echo "Running tests with $OPTIONS..."
-       
-       GLIB=`./test-glib $OPTIONS`
-       EGLIB=`./test-eglib $OPTIONS`
-
-       # this blows
-       FASTER_NAME=`echo "$GLIB GLib $EGLIB EGlib" | awk '{ if($1 < $3) print $2; else print $4 }'`
-       FASTER_SPEED=`echo "$GLIB $EGLIB" | awk '{ if($1 < $2) print $1; else print $2 }'`
-       SLOWER_NAME=`echo "$GLIB GLib $EGLIB EGlib" | awk '{ if($1 > $3) print $2; else print $4 }'`
-       SLOWER_SPEED=`echo "$GLIB $EGLIB" | awk '{ if($1 > $2) print $1; else print $2 }'`
-
-       FASTER_PERCENTAGE=`echo "$SLOWER_SPEED $FASTER_SPEED" | awk '{ print ($1 / $2) * 100 }'`
-
-       echo "$FASTER_NAME $FASTER_SPEED"
-       echo "$SLOWER_NAME $SLOWER_SPEED"
-       echo "------------------------------------------------"
-       echo "$FASTER_NAME is $FASTER_PERCENTAGE% faster than $SLOWER_NAME"
-       
-       exit 0;
-fi
-
-./test-eglib $@
-./test-glib $@
-
diff --git a/eglib/test/test.c b/eglib/test/test.c
deleted file mode 100644 (file)
index 7c870e9..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * EGLib Unit Group/Test Runners
- *
- * Author:
- *   Aaron Bockover (abockover@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include <config.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <glib.h>
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef G_OS_WIN32
-#include <winsock2.h>
-#endif
-
-#include "test.h"
-
-extern gint global_passed, global_tests;
-static gchar *last_result = NULL;
-
-gboolean 
-run_test(Test *test, gchar **result_out)
-{
-       gchar *result; 
-
-       if((result = test->handler()) == NULL) {
-               *result_out = NULL;
-               return TRUE;
-       } else {
-               *result_out = result;   
-               return FALSE;
-       }
-}
-
-gboolean
-run_group(Group *group, gint iterations, gboolean quiet, 
-       gboolean time, gchar *tests_to_run_s)
-{
-       Test *tests = group->handler();
-       gint i, j, passed = 0, total = 0;
-       gdouble start_time_group, start_time_test;
-       gchar **tests_to_run = NULL;
-
-       if(!quiet) {
-               if(iterations > 1) {
-                       printf("[%s] (%dx)\n", group->name, iterations);
-               } else {
-                       printf("[%s]\n", group->name);
-               }
-       }
-
-       if(tests_to_run_s != NULL) {
-               tests_to_run = eg_strsplit(tests_to_run_s, ",", -1);
-       }
-
-       start_time_group = get_timestamp();
-
-       for(i = 0; tests[i].name != NULL; i++) {
-               gchar *result = "";
-               gboolean iter_pass, run;
-       
-               iter_pass = FALSE;
-               if(tests_to_run != NULL) {
-                       gint j;
-                       run = FALSE;
-                       for(j = 0; tests_to_run[j] != NULL; j++) {
-                               if(strcmp(tests_to_run[j], tests[i].name) == 0) {
-                                       run = TRUE;
-                                       break;
-                               }
-                       }
-               } else {
-                       run = TRUE;
-               }
-
-               if(!run) {
-                       continue;
-               }
-       
-               total++;
-       
-               if(!quiet) {
-                       printf("  %s: ", tests[i].name);
-               }
-
-               start_time_test = get_timestamp();
-               
-               for(j = 0; j < iterations; j++) {
-                       iter_pass = run_test(&(tests[i]), &result);
-                       if(!iter_pass) {
-                               break;
-                       }
-               }
-
-               if(iter_pass) {
-                       passed++;
-                       if(!quiet) {
-                               if(time) {
-                                       printf("OK (%g)\n", get_timestamp() - start_time_test);
-                               } else {
-                                       printf("OK\n");
-                               }
-                       }
-               } else  {                       
-                       if(!quiet) {
-                               printf("FAILED (%s)\n", result);
-                       }
-                       
-                       if(last_result == result) {
-                               last_result = NULL;
-                               g_free(result);
-                       }
-               }
-       }
-
-       global_passed += passed;
-       global_tests += total;
-
-       if(!quiet) {
-               gdouble pass_percentage = ((gdouble)passed / (gdouble)total) * 100.0;
-               if(time) {
-                       printf("  %d / %d (%g%%, %g)\n", passed, total,
-                               pass_percentage, get_timestamp() - start_time_group);
-               } else {
-                       printf("  %d / %d (%g%%)\n", passed, total, pass_percentage);
-               }
-       }
-
-       if(tests_to_run != NULL) {
-               eg_strfreev(tests_to_run);
-       }
-
-       return passed == total;
-}
-
-RESULT
-FAILED(const gchar *format, ...)
-{
-       gchar *ret;
-       va_list args;
-       gint n;
-
-#if !defined(HAVE_VASPRINTF) && !defined(_EGLIB_MAJOR)
-       /* We are linked against the real glib, no vasprintf */
-       g_assert_not_reached ();
-       return NULL;
-#else
-       va_start(args, format);
-       n = g_vasprintf(&ret, format, args);
-       va_end(args);
-
-       if(n == -1) {
-               last_result = NULL;
-               return NULL;
-       }
-
-       last_result = ret;
-       return ret;
-#endif
-}
-
-gdouble
-get_timestamp()
-{
-       /* FIXME: We should use g_get_current_time here */
-       GTimeVal res;
-       g_get_current_time (&res);
-       return res.tv_sec + (1.e-6) * res.tv_usec;
-}
-
-/* 
- * Duplicating code here from EGlib to avoid g_strsplit skew between
- * EGLib and GLib
- */
-gchar ** 
-eg_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens)
-{
-       gchar *string_c;
-       gchar *strtok_save, **vector;
-       gchar *token, *token_c;
-       gint size = 1;
-       size_t token_length;
-
-       g_return_val_if_fail(string != NULL, NULL);
-       g_return_val_if_fail(delimiter != NULL, NULL);
-       g_return_val_if_fail(delimiter[0] != 0, NULL);
-       
-       token_length = strlen(string);
-       string_c = (gchar *)g_malloc(token_length + 1);
-       memcpy(string_c, string, token_length);
-       string_c[token_length] = 0;
-       
-       vector = NULL;
-       token = (gchar *)strtok_r(string_c, delimiter, &strtok_save);
-
-       while(token != NULL) {
-               token_length = strlen(token);
-               token_c = (gchar *)g_malloc(token_length + 1);
-               memcpy(token_c, token, token_length);
-               token_c[token_length] = 0;
-
-               vector = vector == NULL ? 
-                       (gchar **)g_malloc(2 * sizeof(vector)) :
-                       (gchar **)g_realloc(vector, (size + 1) * sizeof(vector));
-       
-               vector[size - 1] = token_c;     
-               size++;
-
-               if(max_tokens > 0 && size >= max_tokens) {
-                       if(size > max_tokens) {
-                               break;
-                       }
-
-                       token = strtok_save;
-               } else {
-                       token = (gchar *)strtok_r(NULL, delimiter, &strtok_save);
-               }
-       }
-
-       if(vector != NULL && size > 0) {
-               vector[size - 1] = NULL;
-       }
-       
-       g_free(string_c);
-       string_c = NULL;
-
-       return vector;
-}
-
-void
-eg_strfreev (gchar **str_array)
-{
-       gchar **orig = str_array;
-       if (str_array == NULL)
-               return;
-       while (*str_array != NULL){
-               g_free (*str_array);
-               str_array++;
-       }
-       g_free (orig);
-}
-
-
-
diff --git a/eglib/test/test.h b/eglib/test/test.h
deleted file mode 100644 (file)
index 5c7275e..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * EGLib Unit Group/Test Runners
- *
- * Author:
- *   Aaron Bockover (abockover@novell.com)
- *
- * (C) 2006 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#ifndef _TEST_H
-#define _TEST_H
-
-#include <config.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-
-#ifdef _MSC_VER
-/* disable the following warnings 
- * C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored. 
- * C4127: conditional expression is constant (test macros produce a lot of these)
-*/
-#pragma warning(disable:4100 4127)
-#endif
-
-typedef gchar * RESULT;
-
-typedef struct _Test Test;
-typedef struct _Group Group;
-
-typedef gchar * (* RunTestHandler)();
-typedef Test * (* LoadGroupHandler)();
-
-struct _Test {
-       const gchar *name;
-       RunTestHandler handler;
-};
-
-struct _Group {
-       const gchar *name;
-       LoadGroupHandler handler;
-};
-
-gboolean run_group(Group *group, gint iterations, gboolean quiet, 
-       gboolean time, gchar *tests);
-#undef FAILED
-RESULT FAILED(const gchar *format, ...);
-gdouble get_timestamp();
-gchar ** eg_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens);
-void eg_strfreev (gchar **str_array);
-
-#define OK NULL
-
-#define DEFINE_TEST_GROUP_INIT(name, table) \
-       Test * (name)() { return table; }
-
-#define DEFINE_TEST_GROUP_INIT_H(name) \
-       Test * (name)();
-
-#endif /* _TEST_H */
-
-
diff --git a/eglib/test/tests.h b/eglib/test/tests.h
deleted file mode 100644 (file)
index fdca395..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "test.h"
-
-DEFINE_TEST_GROUP_INIT_H(string_tests_init);
-DEFINE_TEST_GROUP_INIT_H(strutil_tests_init);
-DEFINE_TEST_GROUP_INIT_H(slist_tests_init);
-DEFINE_TEST_GROUP_INIT_H(list_tests_init);
-DEFINE_TEST_GROUP_INIT_H(hashtable_tests_init);
-DEFINE_TEST_GROUP_INIT_H(ptrarray_tests_init);
-DEFINE_TEST_GROUP_INIT_H(size_tests_init);
-DEFINE_TEST_GROUP_INIT_H(fake_tests_init);
-DEFINE_TEST_GROUP_INIT_H(array_tests_init);
-DEFINE_TEST_GROUP_INIT_H(queue_tests_init);
-DEFINE_TEST_GROUP_INIT_H(path_tests_init);
-DEFINE_TEST_GROUP_INIT_H(shell_tests_init);
-DEFINE_TEST_GROUP_INIT_H(spawn_tests_init);
-DEFINE_TEST_GROUP_INIT_H(timer_tests_init);
-DEFINE_TEST_GROUP_INIT_H(file_tests_init);
-DEFINE_TEST_GROUP_INIT_H(pattern_tests_init);
-DEFINE_TEST_GROUP_INIT_H(dir_tests_init);
-DEFINE_TEST_GROUP_INIT_H(markup_tests_init);
-DEFINE_TEST_GROUP_INIT_H(unicode_tests_init);
-DEFINE_TEST_GROUP_INIT_H(utf8_tests_init);
-DEFINE_TEST_GROUP_INIT_H(endian_tests_init);
-DEFINE_TEST_GROUP_INIT_H(module_tests_init);
-DEFINE_TEST_GROUP_INIT_H(memory_tests_init);
-
-static Group test_groups [] = {        
-       {"string",    string_tests_init}, 
-       {"strutil",   strutil_tests_init},
-       {"ptrarray",  ptrarray_tests_init},
-       {"slist",     slist_tests_init},
-       {"list",      list_tests_init},
-       {"hashtable", hashtable_tests_init},
-       {"sizes",     size_tests_init},
-       {"fake",      fake_tests_init},
-       {"array",     array_tests_init},
-       {"queue",     queue_tests_init},
-       {"path",      path_tests_init},
-       {"shell",     shell_tests_init},
-       {"markup",    markup_tests_init},
-#if !DISABLE_PROCESS_TESTS 
-       {"spawn",     spawn_tests_init},
-       {"module",    module_tests_init},
-#endif
-#if !DISABLE_FILESYSTEM_TESTS
-       {"file",      file_tests_init},
-#endif
-       {"timer",     timer_tests_init},
-       {"pattern",   pattern_tests_init},
-       {"dir",       dir_tests_init},
-       {"unicode",   unicode_tests_init},
-       {"utf8",      utf8_tests_init},
-       {"endian",    endian_tests_init},
-       {"memory",    memory_tests_init},
-       {NULL, NULL}
-};
-
diff --git a/eglib/test/timer.c b/eglib/test/timer.c
deleted file mode 100644 (file)
index 7b41f80..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#include <config.h>
-#include <glib.h>
-#include <string.h>
-#include <math.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <stdlib.h>
-#include <stdio.h>
-
-#ifdef G_OS_WIN32
-#include <windows.h>
-#define sleep(t)                 Sleep((t) * 1000)
-#endif
-
-#include "test.h"
-
-RESULT
-test_timer ()
-{
-       GTimer *timer;
-       gdouble elapsed1, elapsed2;
-       gulong usec = 0;
-
-       timer = g_timer_new ();
-       sleep (1);
-       elapsed1 = g_timer_elapsed (timer, NULL);
-       if ((elapsed1 + 0.1) < 1.0)
-               return FAILED ("Elapsed time should be around 1s and was %f", elapsed1);
-
-       g_timer_stop (timer);
-       elapsed1 = g_timer_elapsed (timer, NULL);
-       elapsed2 = g_timer_elapsed (timer, &usec);
-       if (fabs (elapsed1 - elapsed2) > 0.000001)
-               return FAILED ("The elapsed times are not equal %f - %f.", elapsed1, elapsed2);
-
-       elapsed2 *= 1000000;
-       while (elapsed2 > 1000000)
-               elapsed2 -= 1000000;
-
-       if (fabs (usec - elapsed2) > 100.0)
-               return FAILED ("usecs are wrong.");
-
-       g_timer_destroy (timer);
-       return OK;
-}
-
-static Test timer_tests [] = {
-       {"g_timer", test_timer},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(timer_tests_init, timer_tests)
-
-
diff --git a/eglib/test/unicode.c b/eglib/test/unicode.c
deleted file mode 100644 (file)
index c1c3402..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#include "test.h"
-
-/*
- * g_unichar_type
- */
-RESULT
-test_g_unichar_type ()
-{
-       if (g_unichar_type ('A') != G_UNICODE_UPPERCASE_LETTER)
-               return FAILED ("#1");
-       if (g_unichar_type ('a') != G_UNICODE_LOWERCASE_LETTER)
-               return FAILED ("#2");
-       if (g_unichar_type ('1') != G_UNICODE_DECIMAL_NUMBER)
-               return FAILED ("#3");
-       if (g_unichar_type (0xA3) != G_UNICODE_CURRENCY_SYMBOL)
-               return FAILED ("#4");
-       return NULL;
-}
-
-/*
- * g_unichar_toupper
- */
-RESULT
-test_g_unichar_toupper ()
-{
-       if (g_unichar_toupper (0) != 0)
-               return FAILED ("#0");
-       if (g_unichar_toupper ('a') != 'A')
-               return FAILED ("#1");
-       if (g_unichar_toupper ('1') != '1')
-               return FAILED ("#2");
-       if (g_unichar_toupper (0x1C4) != 0x1C4)
-               return FAILED ("#3");
-       if (g_unichar_toupper (0x1F2) != 0x1F1)
-               return FAILED ("#4");
-       if (g_unichar_toupper (0x1F3) != 0x1F1)
-               return FAILED ("#5");
-       if (g_unichar_toupper (0xFFFF) != 0xFFFF)
-               return FAILED ("#6");
-       if (g_unichar_toupper (0x10428) != 0x10400)
-               return FAILED ("#7");
-       return NULL;
-}
-
-/*
- * g_unichar_tolower
- */
-RESULT
-test_g_unichar_tolower ()
-{
-       if (g_unichar_tolower (0) != 0)
-               return FAILED ("#0");
-       if (g_unichar_tolower ('A') != 'a')
-               return FAILED ("#1");
-       if (g_unichar_tolower ('1') != '1')
-               return FAILED ("#2");
-       if (g_unichar_tolower (0x1C5) != 0x1C6)
-               return FAILED ("#3");
-       if (g_unichar_tolower (0x1F1) != 0x1F3)
-               return FAILED ("#4");
-       if (g_unichar_tolower (0x1F2) != 0x1F3)
-               return FAILED ("#5");
-       if (g_unichar_tolower (0xFFFF) != 0xFFFF)
-               return FAILED ("#6");
-       return NULL;
-}
-
-/*
- * g_unichar_totitle
- */
-RESULT
-test_g_unichar_totitle ()
-{
-       if (g_unichar_toupper (0) != 0)
-               return FAILED ("#0");
-       if (g_unichar_totitle ('a') != 'A')
-               return FAILED ("#1");
-       if (g_unichar_totitle ('1') != '1')
-               return FAILED ("#2");
-       if (g_unichar_totitle (0x1C4) != 0x1C5)
-               return FAILED ("#3");
-       if (g_unichar_totitle (0x1F2) != 0x1F2)
-               return FAILED ("#4");
-       if (g_unichar_totitle (0x1F3) != 0x1F2)
-               return FAILED ("#5");
-       if (g_unichar_toupper (0xFFFF) != 0xFFFF)
-               return FAILED ("#6");
-       return NULL;
-}
-
-static Test unicode_tests [] = {
-       {"g_unichar_type", test_g_unichar_type},
-       {"g_unichar_toupper", test_g_unichar_toupper},
-       {"g_unichar_tolower", test_g_unichar_tolower},
-       {"g_unichar_totitle", test_g_unichar_totitle},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(unicode_tests_init, unicode_tests)
diff --git a/eglib/test/utf8.c b/eglib/test/utf8.c
deleted file mode 100644 (file)
index a924902..0000000
+++ /dev/null
@@ -1,935 +0,0 @@
-#include <stdlib.h>
-
-#include "test.h"
-
-/*
- * g_utf16_to_utf8
- */
-
-glong
-compare_strings_utf8_pos (const gchar *expected, const gchar *actual, glong size)
-{
-       int i;
-       for (i = 0; i < size; i++)
-               if (expected [i] != actual [i])
-                       return i;
-       return -1;
-}
-
-RESULT
-compare_strings_utf8_RESULT (const gchar *expected, const gchar *actual, glong size)
-{
-       glong ret;
-
-       ret = compare_strings_utf8_pos (expected, actual, size);
-       if (ret < 0)
-               return OK;
-       return FAILED ("Incorrect output: expected '%s' but was '%s', differ at %d\n", expected, actual, ret);
-}
-
-void
-gchar_to_gunichar2 (gunichar2 ret[], const gchar *src)
-{
-       int i;
-
-       for (i = 0; src [i]; i++)
-               ret [i] = src [i];
-       ret [i] = 0;
-}
-
-RESULT
-compare_utf16_to_utf8_explicit (const gchar *expected, const gunichar2 *utf16, glong len_in, glong len_out, glong size_spec)
-{
-       GError *error;
-       gchar* ret;
-       RESULT result;
-       glong in_read, out_read;
-
-       result = NULL;
-
-       error = NULL;
-       ret = g_utf16_to_utf8 (utf16, size_spec, &in_read, &out_read, &error);
-       if (error) {
-               result = FAILED ("The error is %d %s\n", (error)->code, (error)->message);
-               g_error_free (error);
-               if (ret)
-                       g_free (ret);
-               return result;
-       }
-       if (in_read != len_in)
-               result = FAILED ("Read size is incorrect: expected %d but was %d\n", len_in, in_read);
-       else if (out_read != len_out)
-               result = FAILED ("Converted size is incorrect: expected %d but was %d\n", len_out, out_read);
-       else
-               result = compare_strings_utf8_RESULT (expected, ret, len_out);
-
-       g_free (ret);
-       if (result)
-               return result;
-
-       return OK;
-}
-
-RESULT
-compare_utf16_to_utf8 (const gchar *expected, const gunichar2 *utf16, glong len_in, glong len_out)
-{
-       RESULT result;
-
-       result = compare_utf16_to_utf8_explicit (expected, utf16, len_in, len_out, -1);
-       if (result != OK)
-               return result;
-       return compare_utf16_to_utf8_explicit (expected, utf16, len_in, len_out, len_in);
-}
-
-RESULT
-test_utf16_to_utf8 ()
-{
-       const gchar *src0 = "", *src1 = "ABCDE", *src2 = "\xE5\xB9\xB4\x27", *src3 = "\xEF\xBC\xA1", *src4 = "\xEF\xBD\x81", *src5 = "\xF0\x90\x90\x80";
-       gunichar2 str0 [] = {0}, str1 [6], str2 [] = {0x5E74, 39, 0}, str3 [] = {0xFF21, 0}, str4 [] = {0xFF41, 0}, str5 [] = {0xD801, 0xDC00, 0};
-       RESULT result;
-
-       gchar_to_gunichar2 (str1, src1);
-
-       /* empty string */
-       result = compare_utf16_to_utf8 (src0, str0, 0, 0);
-       if (result != OK)
-               return result;
-
-       result = compare_utf16_to_utf8 (src1, str1, 5, 5);
-       if (result != OK)
-               return result;
-       result = compare_utf16_to_utf8 (src2, str2, 2, 4);
-       if (result != OK)
-               return result;
-       result = compare_utf16_to_utf8 (src3, str3, 1, 3);
-       if (result != OK)
-               return result;
-       result = compare_utf16_to_utf8 (src4, str4, 1, 3);
-       if (result != OK)
-               return result;
-       result = compare_utf16_to_utf8 (src5, str5, 2, 4);
-       if (result != OK)
-               return result;
-
-       return OK;
-}
-
-/*
- * g_utf8_to_utf16 
- */
-
-glong
-compare_strings_utf16_pos (const gunichar2 *expected, const gunichar2 *actual, glong size)
-{
-       int i;
-       for (i = 0; i < size; i++)
-               if (expected [i] != actual [i])
-                       return i;
-       return -1;
-}
-
-RESULT
-compare_strings_utf16_RESULT (const gunichar2 *expected, const gunichar2 *actual, glong size)
-{
-       glong ret;
-
-       ret = compare_strings_utf16_pos (expected, actual, size);
-       if (ret < 0)
-               return OK;
-       return FAILED ("Incorrect output: expected '%s' but was '%s', differ at %d ('%c' x '%c')\n", expected, actual, ret, expected [ret], actual [ret]);
-}
-
-#if !defined(EGLIB_TESTS)
-#define eg_utf8_to_utf16_with_nuls g_utf8_to_utf16
-#endif
-
-RESULT
-compare_utf8_to_utf16_explicit (const gunichar2 *expected, const gchar *utf8, glong len_in, glong len_out, glong size_spec, gboolean include_nuls)
-{
-       GError *error;
-       gunichar2* ret;
-       RESULT result;
-       glong in_read, out_read;
-
-       result = NULL;
-
-       error = NULL;
-       if (include_nuls)
-               ret = eg_utf8_to_utf16_with_nuls (utf8, size_spec, &in_read, &out_read, &error);
-       else
-               ret = g_utf8_to_utf16 (utf8, size_spec, &in_read, &out_read, &error);
-
-       if (error) {
-               result = FAILED ("The error is %d %s\n", (error)->code, (error)->message);
-               g_error_free (error);
-               if (ret)
-                       g_free (ret);
-               return result;
-       }
-       if (in_read != len_in)
-               result = FAILED ("Read size is incorrect: expected %d but was %d\n", len_in, in_read);
-       else if (out_read != len_out)
-               result = FAILED ("Converted size is incorrect: expected %d but was %d\n", len_out, out_read);
-       else
-               result = compare_strings_utf16_RESULT (expected, ret, len_out);
-
-       g_free (ret);
-       if (result)
-               return result;
-
-       return OK;
-}
-
-RESULT
-compare_utf8_to_utf16_general (const gunichar2 *expected, const gchar *utf8, glong len_in, glong len_out, gboolean include_nuls)
-{
-       RESULT result;
-
-       result = compare_utf8_to_utf16_explicit (expected, utf8, len_in, len_out, -1, include_nuls);
-       if (result != OK)
-               return result;
-       return compare_utf8_to_utf16_explicit (expected, utf8, len_in, len_out, len_in, include_nuls);
-}
-
-RESULT
-compare_utf8_to_utf16 (const gunichar2 *expected, const gchar *utf8, glong len_in, glong len_out)
-{
-       return compare_utf8_to_utf16_general (expected, utf8, len_in, len_out, FALSE);
-}
-
-RESULT
-compare_utf8_to_utf16_with_nuls (const gunichar2 *expected, const gchar *utf8, glong len_in, glong len_out)
-{
-       return compare_utf8_to_utf16_explicit (expected, utf8, len_in, len_out, len_in, TRUE);
-}
-
-
-RESULT
-test_utf8_seq ()
-{
-       const gchar *src = "\xE5\xB9\xB4\x27";
-       glong in_read, out_read;
-       //gunichar2 expected [6];
-       GError *error = NULL;
-       gunichar2 *dst;
-
-       //printf ("got: %s\n", src);
-       dst = g_utf8_to_utf16 (src, (glong)strlen (src), &in_read, &out_read, &error);
-       if (error != NULL){
-               return error->message;
-       }
-
-       if (in_read != 4) {
-               return FAILED ("in_read is expected to be 4 but was %d\n", in_read);
-       }
-       if (out_read != 2) {
-               return FAILED ("out_read is expected to be 2 but was %d\n", out_read);
-       }
-       g_free (dst);
-
-       return OK;
-}
-
-RESULT
-test_utf8_to_utf16 ()
-{
-       const gchar *src0 = "", *src1 = "ABCDE", *src2 = "\xE5\xB9\xB4\x27", *src3 = "\xEF\xBC\xA1", *src4 = "\xEF\xBD\x81";
-       gunichar2 str0 [] = {0}, str1 [6], str2 [] = {0x5E74, 39, 0}, str3 [] = {0xFF21, 0}, str4 [] = {0xFF41, 0};
-       RESULT result;
-
-       gchar_to_gunichar2 (str1, src1);
-
-       /* empty string */
-       result = compare_utf8_to_utf16 (str0, src0, 0, 0);
-       if (result != OK)
-               return result;
-
-       result = compare_utf8_to_utf16 (str1, src1, 5, 5);
-       if (result != OK)
-               return result;
-       result = compare_utf8_to_utf16 (str2, src2, 4, 2);
-       if (result != OK)
-               return result;
-       result = compare_utf8_to_utf16 (str3, src3, 3, 1);
-       if (result != OK)
-               return result;
-       result = compare_utf8_to_utf16 (str4, src4, 3, 1);
-       if (result != OK)
-               return result;
-
-       return OK;
-}
-
-RESULT
-test_utf8_to_utf16_with_nuls ()
-{
-       const gchar *src0 = "", *src1 = "AB\0DE", *src2 = "\xE5\xB9\xB4\x27", *src3 = "\xEF\xBC\xA1", *src4 = "\xEF\xBD\x81";
-       gunichar2 str0 [] = {0}, str1 [] = {'A', 'B', 0, 'D', 'E', 0}, str2 [] = {0x5E74, 39, 0}, str3 [] = {0xFF21, 0}, str4 [] = {0xFF41, 0};
-       RESULT result;
-
-#if !defined(EGLIB_TESTS)
-       return OK;
-#endif
-
-       /* implicit length is forbidden */
-               if (eg_utf8_to_utf16_with_nuls (src1, -1, NULL, NULL, NULL) != NULL)
-               return FAILED ("explicit nulls must fail with -1 length\n");
-
-       /* empty string */
-       result = compare_utf8_to_utf16_with_nuls (str0, src0, 0, 0);
-       if (result != OK)
-               return result;
-
-       result = compare_utf8_to_utf16_with_nuls  (str1, src1, 5, 5);
-       if (result != OK)
-               return result;
-       result = compare_utf8_to_utf16_with_nuls  (str2, src2, 4, 2);
-       if (result != OK)
-               return result;
-       result = compare_utf8_to_utf16_with_nuls  (str3, src3, 3, 1);
-       if (result != OK)
-               return result;
-       result = compare_utf8_to_utf16_with_nuls  (str4, src4, 3, 1);
-       if (result != OK)
-               return result;
-
-       return OK;
-}
-
-typedef struct {
-       char *content;
-       size_t length;
-} convert_result_t;
-
-RESULT
-test_convert ()
-{
-       static const char *charsets[] = { "UTF-8", "UTF-16LE", "UTF-16BE", "UTF-32LE", "UTF-32BE" };
-       gsize length, converted_length, n;
-       char *content, *converted, *path;
-       convert_result_t **expected;
-       GError *err = NULL;
-       const char *srcdir;
-       gboolean loaded;
-       guint i, j, k;
-       char c;
-       
-       if (!(srcdir = getenv ("srcdir")) && !(srcdir = getenv ("PWD")))
-               return FAILED ("srcdir not defined!");
-       
-       expected = g_malloc (sizeof (convert_result_t *) * G_N_ELEMENTS (charsets));
-       
-       /* first load all our test samples... */
-       for (i = 0; i < G_N_ELEMENTS (charsets); i++) {
-               path = g_strdup_printf ("%s%c%s.txt", srcdir, G_DIR_SEPARATOR, charsets[i]);
-               loaded = g_file_get_contents (path, &content, &length, &err);
-               g_free (path);
-               
-               if (!loaded) {
-                       for (j = 0; j < i; j++) {
-                               g_free (expected[j]->content);
-                               g_free (expected[j]);
-                       }
-                       
-                       g_free (expected);
-                       
-                       return FAILED ("Failed to load content for %s: %s", charsets[i], err->message);
-               }
-               
-               expected[i] = g_malloc (sizeof (convert_result_t));
-               expected[i]->content = content;
-               expected[i]->length = length;
-       }
-       
-       /* test conversion from every charset to every other charset */
-       for (i = 0; i < G_N_ELEMENTS (charsets); i++) {
-               for (j = 0; j < G_N_ELEMENTS (charsets); j++) {
-                       converted = g_convert (expected[i]->content, expected[i]->length, charsets[j],
-                                              charsets[i], NULL, &converted_length, NULL);
-                       
-                       if (converted == NULL) {
-                               for (k = 0; k < G_N_ELEMENTS (charsets); k++) {
-                                       g_free (expected[k]->content);
-                                       g_free (expected[k]);
-                               }
-                               
-                               g_free (expected);
-                               
-                               return FAILED ("Failed to convert from %s to %s: NULL", charsets[i], charsets[j]);
-                       }
-                       
-                       if (converted_length != expected[j]->length) {
-                               length = expected[j]->length;
-                               
-                               for (k = 0; k < G_N_ELEMENTS (charsets); k++) {
-                                       g_free (expected[k]->content);
-                                       g_free (expected[k]);
-                               }
-                               
-                               g_free (converted);
-                               g_free (expected);
-                               
-                               return FAILED ("Failed to convert from %s to %s: expected %u bytes, got %u",
-                                              charsets[i], charsets[j], length, converted_length);
-                       }
-                       
-                       for (n = 0; n < converted_length; n++) {
-                               if (converted[n] != expected[j]->content[n]) {
-                                       c = expected[j]->content[n];
-                                       
-                                       for (k = 0; k < G_N_ELEMENTS (charsets); k++) {
-                                               g_free (expected[k]->content);
-                                               g_free (expected[k]);
-                                       }
-                                       
-                                       g_free (converted);
-                                       g_free (expected);
-                                       
-                                       return FAILED ("Failed to convert from %s to %s: expected 0x%x at offset %u, got 0x%x",
-                                                      charsets[i], charsets[j], c, n, converted[n]);
-                               }
-                       }
-                       
-                       g_free (converted);
-               }
-       }
-       
-       for (k = 0; k < G_N_ELEMENTS (charsets); k++) {
-               g_free (expected[k]->content);
-               g_free (expected[k]);
-       }
-       
-       g_free (expected);
-       
-       return OK;
-}
-
-
-RESULT
-test_xdigit ()
-{
-       static char test_chars[] = {
-               '0', '1', '2', '3', '4', 
-               '5', '6', '7', '8', '9', 
-               'a', 'b', 'c', 'd', 'e', 'f', 'g',
-               'A', 'B', 'C', 'D', 'E', 'F', 'G'};
-       static gint32 test_values[] = {
-               0, 1, 2, 3, 4, 
-               5, 6, 7, 8, 9, 
-               10, 11, 12, 13, 14, 15, -1,
-               10, 11, 12, 13, 14, 15, -1};
-
-               int i =0;
-
-               for (i = 0; i < sizeof(test_chars); i++)
-                       if (g_unichar_xdigit_value ((gunichar)test_chars[i]) != test_values[i])
-                               return FAILED("Incorrect value %d at index %d", test_values[i], i);
-
-               return OK;
-}
-
-static RESULT
-ucs4_to_utf16_check_result (const gunichar2 *result_str, const gunichar2 *expected_str,
-                           glong result_items_read, glong expected_items_read,
-                           glong result_items_written, glong expected_items_written,
-                           GError* result_error, gboolean expect_error)
-{
-       glong i;
-       if (result_items_read != expected_items_read)
-               return FAILED("Incorrect number of items read; expected %d, got %d", expected_items_read, result_items_read);
-       if (result_items_written != expected_items_written)
-               return FAILED("Incorrect number of items written; expected %d, got %d", expected_items_written, result_items_written);
-       if (result_error && !expect_error)
-               return FAILED("There should not be an error code.");
-       if (!result_error && expect_error)
-               return FAILED("Unexpected error object.");
-       if (expect_error && result_str)
-               return FAILED("NULL should be returned when an error occurs.");
-       if (!expect_error && !result_str)
-               return FAILED("When no error occurs NULL should not be returned.");
-       for (i=0; i<expected_items_written;i++) {
-               if (result_str [i] != expected_str [i])
-                       return FAILED("Incorrect value %d at index %d", result_str [i], i);
-       }
-       if (result_str && result_str[expected_items_written] != '\0') 
-               return FAILED("Null termination not found at the end of the string.");
-       
-       return OK;
-}
-
-RESULT
-test_ucs4_to_utf16 ()
-{
-       static gunichar str1[12] = {'H','e','l','l','o',' ','W','o','r','l','d','\0'};
-       static gunichar2 exp1[12] = {'H','e','l','l','o',' ','W','o','r','l','d','\0'};
-       static gunichar str2[3] = {'h',0x80000000,'\0'};
-       static gunichar2 exp2[2] = {'h','\0'};
-       static gunichar str3[3] = {'h',0xDA00,'\0'};
-       static gunichar str4[3] = {'h',0x10FFFF,'\0'};
-       static gunichar2 exp4[4] = {'h',0xdbff,0xdfff,'\0'};
-       static gunichar str5[7] = {0xD7FF,0xD800,0xDFFF,0xE000,0x110000,0x10FFFF,'\0'};
-       static gunichar2 exp5[5] = {0xD7FF,0xE000,0xdbff,0xdfff,'\0'};
-       static gunichar str6[2] = {0x10400, '\0'};
-       static gunichar2 exp6[3] = {0xD801, 0xDC00, '\0'};
-       static glong read_write[12] = {1,1,0,0,0,0,1,1,0,0,1,2};
-       gunichar2* res;
-       glong items_read, items_written, current_write_index;
-       GError* err=0;
-       RESULT check_result;
-       glong i;
-       
-       res = g_ucs4_to_utf16 (str1, 12, &items_read, &items_written, &err);
-       check_result = ucs4_to_utf16_check_result (res, exp1, items_read, 11, items_written, 11, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-
-       items_read = items_written = 0;
-       res = g_ucs4_to_utf16 (str2, 0, &items_read, &items_written, &err);
-       check_result = ucs4_to_utf16_check_result (res, exp2, items_read, 0, items_written, 0, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-
-       items_read = items_written = 0;
-       res = g_ucs4_to_utf16 (str2, 1, &items_read, &items_written, &err);
-       check_result = ucs4_to_utf16_check_result (res, exp2, items_read, 1, items_written, 1, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-
-       items_read = items_written = 0;
-       res = g_ucs4_to_utf16 (str2, 2, &items_read, &items_written, &err);
-       check_result = ucs4_to_utf16_check_result (res, 0, items_read, 1, items_written, 0, err, TRUE);
-       g_free (res);
-       if (check_result) return check_result;
-
-       items_read = items_written = 0;
-       err = 0;
-       res = g_ucs4_to_utf16 (str3, 2, &items_read, &items_written, &err);
-       check_result = ucs4_to_utf16_check_result (res, 0, items_read, 1, items_written, 0, err, TRUE);
-       if (check_result) return check_result;
-       g_free (res);
-
-       items_read = items_written = 0;
-       err = 0;
-       res = g_ucs4_to_utf16 (str4, 5, &items_read, &items_written, &err);
-       check_result = ucs4_to_utf16_check_result (res, exp4, items_read, 2, items_written, 3, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-
-       // This loop tests the bounds of the conversion algorithm
-       current_write_index = 0;
-       for (i=0;i<6;i++) {
-               items_read = items_written = 0;
-               err = 0;
-               res = g_ucs4_to_utf16 (&str5[i], 1, &items_read, &items_written, &err);
-               check_result = ucs4_to_utf16_check_result (res, &exp5[current_write_index], 
-                                       items_read, read_write[i*2], items_written, read_write[(i*2)+1], err, !read_write[(i*2)+1]);
-               if (check_result) return check_result;
-               g_free (res);
-               current_write_index += items_written;
-       }
-
-       items_read = items_written = 0;
-       err = 0;
-       res = g_ucs4_to_utf16 (str6, 1, &items_read, &items_written, &err);
-       check_result = ucs4_to_utf16_check_result (res, exp6, items_read, 1, items_written, 2, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-
-       return OK;
-}
-
-static RESULT
-utf16_to_ucs4_check_result (const gunichar *result_str, const gunichar *expected_str,
-                           glong result_items_read, glong expected_items_read,
-                           glong result_items_written, glong expected_items_written,
-                           GError* result_error, gboolean expect_error)
-{
-       glong i;
-       if (result_items_read != expected_items_read)
-               return FAILED("Incorrect number of items read; expected %d, got %d", expected_items_read, result_items_read);
-       if (result_items_written != expected_items_written)
-               return FAILED("Incorrect number of items written; expected %d, got %d", expected_items_written, result_items_written);
-       if (result_error && !expect_error)
-               return FAILED("There should not be an error code.");
-       if (!result_error && expect_error)
-               return FAILED("Unexpected error object.");
-       if (expect_error && result_str)
-               return FAILED("NULL should be returned when an error occurs.");
-       if (!expect_error && !result_str)
-               return FAILED("When no error occurs NULL should not be returned.");
-       for (i=0; i<expected_items_written;i++) {
-               if (result_str [i] != expected_str [i])
-                       return FAILED("Incorrect value %d at index %d", result_str [i], i);
-       }
-       if (result_str && result_str[expected_items_written] != '\0') 
-               return FAILED("Null termination not found at the end of the string.");
-       
-       return OK;
-}
-
-RESULT
-test_utf16_to_ucs4 ()
-{
-       static gunichar2 str1[12] = {'H','e','l','l','o',' ','W','o','r','l','d','\0'};
-       static gunichar exp1[12] = {'H','e','l','l','o',' ','W','o','r','l','d','\0'};
-       static gunichar2 str2[7] = {'H', 0xD800, 0xDC01,0xD800,0xDBFF,'l','\0'};
-       static gunichar exp2[3] = {'H',0x00010001,'\0'};
-       static gunichar2 str3[4] = {'H', 0xDC00 ,'l','\0'};
-       static gunichar exp3[2] = {'H','\0'};
-       static gunichar2 str4[20] = {0xDC00,0xDFFF,0xDFF,0xD800,0xDBFF,0xD800,0xDC00,0xD800,0xDFFF,
-                                    0xD800,0xE000,0xDBFF,0xDBFF,0xDBFF,0xDC00,0xDBFF,0xDFFF,0xDBFF,0xE000,'\0'};
-       static gunichar exp4[6] = {0xDFF,0x10000,0x103ff,0x10fc00,0x10FFFF,'\0'};
-       static gunichar2 str5[3] = {0xD801, 0xDC00, 0};
-       static gunichar exp5[2] = {0x10400, 0};
-       static glong read_write[33] = {1,0,0,1,0,0,1,1,1,2,1,0,2,2,1,2,2,1,2,1,0,2,1,0,2,2,1,2,2,1,2,1,0};
-       gunichar* res;
-       glong items_read, items_written, current_read_index,current_write_index;
-       GError* err=0;
-       RESULT check_result;
-       glong i;
-       
-       res = g_utf16_to_ucs4 (str1, 12, &items_read, &items_written, &err);
-       check_result = utf16_to_ucs4_check_result (res, exp1, items_read, 11, items_written, 11, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-       
-       items_read = items_written = 0;
-       res = g_utf16_to_ucs4 (str2, 0, &items_read, &items_written, &err);
-       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 0, items_written, 0, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-       
-       items_read = items_written = 0;
-       res = g_utf16_to_ucs4 (str2, 1, &items_read, &items_written, &err);
-       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 1, items_written, 1, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-       
-       items_read = items_written = 0;
-       res = g_utf16_to_ucs4 (str2, 2, &items_read, &items_written, &err);
-       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 1, items_written, 1, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-       
-       items_read = items_written = 0;
-       res = g_utf16_to_ucs4 (str2, 3, &items_read, &items_written, &err);
-       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 3, items_written, 2, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-       
-       items_read = items_written = 0;
-       res = g_utf16_to_ucs4 (str2, 4, &items_read, &items_written, &err);
-       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 3, items_written, 2, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-       
-       items_read = items_written = 0;
-       res = g_utf16_to_ucs4 (str2, 5, &items_read, &items_written, &err);
-       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 4, items_written, 0, err, TRUE);
-       if (check_result) return check_result;
-       g_free (res);
-       
-       items_read = items_written = 0;
-       err = 0;
-       res = g_utf16_to_ucs4 (str3, 5, &items_read, &items_written, &err);
-       check_result = utf16_to_ucs4_check_result (res, exp3, items_read, 1, items_written, 0, err, TRUE);
-       if (check_result) return check_result;
-       g_free (res);
-       
-       // This loop tests the bounds of the conversion algorithm
-       current_read_index = current_write_index = 0;
-       for (i=0;i<11;i++) {
-               items_read = items_written = 0;
-               err = 0;
-               res = g_utf16_to_ucs4 (&str4[current_read_index], read_write[i*3], &items_read, &items_written, &err);
-               check_result = utf16_to_ucs4_check_result (res, &exp4[current_write_index], items_read, 
-                                            read_write[(i*3)+1], items_written, read_write[(i*3)+2], err, 
-                                            !read_write[(i*3)+2]);
-               if (check_result) return check_result;
-               g_free (res);
-               current_read_index += read_write[i*3];
-               current_write_index += items_written;
-       }
-
-       items_read = items_written = 0;
-       err = 0;
-       res = g_utf16_to_ucs4 (str5, 2, &items_read, &items_written, &err);
-       check_result = utf16_to_ucs4_check_result (res, exp5, items_read, 2, items_written, 1, err, FALSE);
-       if (check_result) return check_result;
-       g_free (res);
-
-       return OK;
-}
-RESULT
-test_utf8_strlen ()
-{
-       gchar word1 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'};//Valid, len = 5
-       gchar word2 [] = {0xF1, 0x82, 0x82, 0x82,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'};//Valid, len = 5
-       gchar word3 [] = {'h','e',0xC2, 0x82,0x45,'\0'};                                                                                //Valid, len = 4
-       gchar word4 [] = {0x62,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'};                                     //Valid, len = 5
-       
-       glong len = 0;
-       
-       //Test word1
-       len = g_utf8_strlen (word1,-1);
-       if (len != 5)
-               return FAILED ("Word1 expected length of 5, but was %i", len);
-       //Do tests with different values for max parameter.
-       len = g_utf8_strlen (word1,1);
-       if (len != 0)
-               return FAILED ("Word1, max = 1, expected length of 0, but was %i", len);
-       len = g_utf8_strlen (word1,2);
-       if (len != 1)
-               return FAILED ("Word1, max = 1, expected length of 1, but was %i", len);
-       len = g_utf8_strlen (word1,3);
-       if (len != 2)
-               return FAILED ("Word1, max = 2, expected length of 2, but was %i", len);
-               
-       //Test word2
-       len = g_utf8_strlen (word2,-1);
-       if (len != 5)
-               return FAILED ("Word2 expected length of 5, but was %i", len);
-               
-       //Test word3
-       len = g_utf8_strlen (word3,-1);
-       if (len != 4)
-               return FAILED ("Word3 expected length of 4, but was %i", len);
-               
-       //Test word4
-       len = g_utf8_strlen (word4,-1);
-       if (len != 5)
-               return FAILED ("Word4 expected length of 5, but was %i", len);
-               
-       //Test null case
-       len = g_utf8_strlen(NULL,0);
-       if (len != 0)
-               return FAILED ("Expected passing null to result in a length of 0");
-       return OK;
-}
-
-RESULT
-test_utf8_get_char()
-{
-       gchar word1 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'}; //Valid, len = 5
-
-       gunichar value = g_utf8_get_char (&word1 [0]);
-       if (value != 0x82UL)
-               return FAILED ("Expected value of 0x82, but was %x", value);
-       value = g_utf8_get_char (&word1 [2]);
-       if (value != 0x45UL)
-               return FAILED ("Expected value of 0x45, but was %x", value);
-       value = g_utf8_get_char (&word1 [3]);
-       if (value != 0x1043UL)
-               return FAILED ("Expected value of 0x1043, but was %x", value);
-       value = g_utf8_get_char (&word1 [6]);
-       if (value != 0x58UL)
-               return FAILED ("Expected value of 0x58, but was %x", value);
-       value = g_utf8_get_char (&word1 [7]);
-       if (value != 0x42082UL)
-               return FAILED ("Expected value of 0x42082, but was %x", value);
-
-       return OK;
-}
-
-RESULT
-test_utf8_next_char()
-{
-       gchar word1 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'}; //Valid, len = 5
-       gchar word2 [] = {0xF1, 0x82, 0x82, 0x82,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'}; //Valid, len = 5
-       gchar word1ExpectedValues [] = {0xC2, 0x45,0xE1, 0x58, 0xF1};
-       gchar word2ExpectedValues [] = {0xF1, 0xC2, 0x45, 0xE1, 0x58};
-       
-       gchar* ptr = word1;
-       gint count = 0;
-       //Test word1
-       while (*ptr != 0) {
-               if (count > 4)
-                       return FAILED ("Word1 has gone past its expected length");
-               if (*ptr != word1ExpectedValues[count])
-                       return FAILED ("Word1 has an incorrect next_char at index %i", count);
-               ptr = g_utf8_next_char (ptr);
-               count++;
-       }
-       
-       //Test word2
-       count = 0;
-       ptr = word2;
-       while (*ptr != 0) {
-               if (count > 4)
-                       return FAILED ("Word2 has gone past its expected length");
-               if (*ptr != word2ExpectedValues[count])
-                       return FAILED ("Word2 has an incorrect next_char at index %i", count);
-               ptr = g_utf8_next_char (ptr);
-               count++;
-       }
-       
-       return OK;
-}
-
-RESULT
-test_utf8_validate()
-{
-       gchar invalidWord1 [] = {0xC3, 0x82, 0xC1,0x90,'\0'}; //Invalid, 1nd oct Can't be 0xC0 or 0xC1
-       gchar invalidWord2 [] = {0xC1, 0x89, 0x60, '\0'}; //Invalid, 1st oct can not be 0xC1
-       gchar invalidWord3 [] = {0xC2, 0x45,0xE1, 0x81, 0x83,0x58,'\0'}; //Invalid, oct after 0xC2 must be > 0x80
-
-       gchar validWord1 [] = {0xC2, 0x82, 0xC3,0xA0,'\0'}; //Valid
-       gchar validWord2 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'}; //Valid
-       
-       const gchar* end;
-       gboolean retVal = g_utf8_validate (invalidWord1, -1, &end);
-       if (retVal != FALSE)
-               return FAILED ("Expected invalidWord1 to be invalid");
-       if (end != &invalidWord1 [2])
-               return FAILED ("Expected end parameter to be pointing to invalidWord1[2]");
-
-       end = NULL;
-       retVal = g_utf8_validate (invalidWord2, -1, &end);
-       if (retVal != FALSE)
-               return FAILED ("Expected invalidWord2 to be invalid");
-       if (end != &invalidWord2 [0])
-               return FAILED ("Expected end parameter to be pointing to invalidWord2[0]");
-
-       end = NULL;
-       retVal = g_utf8_validate (invalidWord3, -1, &end);
-       if (retVal != FALSE)
-               return FAILED ("Expected invalidWord3 to be invalid");
-       if (end != &invalidWord3 [0])
-               return FAILED ("Expected end parameter to be pointing to invalidWord3[1]");
-
-       end = NULL;
-       retVal = g_utf8_validate (validWord1, -1, &end);
-       if (retVal != TRUE)
-               return FAILED ("Expected validWord1 to be valid");
-       if (end != &validWord1 [4])
-               return FAILED ("Expected end parameter to be pointing to validWord1[4]");
-
-       end = NULL;
-       retVal = g_utf8_validate (validWord2, -1, &end);
-       if (retVal != TRUE)
-               return FAILED ("Expected validWord2 to be valid");
-       if (end != &validWord2 [11])
-               return FAILED ("Expected end parameter to be pointing to validWord2[11]");
-       return OK;
-}
-
-glong
-utf8_byteslen (const gchar *src)
-{
-       int i = 0;
-       do {
-               if (src [i] == '\0')
-                       return i;
-               i++;
-       } while (TRUE);
-}
-
-RESULT
-test_utf8_strcase_each (const gchar *src, const gchar *expected, gboolean strup)
-{
-       gchar *tmp;
-       glong len, len2;
-       RESULT r;
-
-       len = utf8_byteslen (src);
-       tmp = strup ? g_utf8_strup (src, len) : g_utf8_strdown (src, len);
-       len2 = utf8_byteslen (tmp);
-       r = compare_strings_utf8_RESULT (expected, tmp, len < len2 ? len2 : len);
-       g_free (tmp);
-       return r;
-}
-
-RESULT
-test_utf8_strup_each (const gchar *src, const gchar *expected)
-{
-       return test_utf8_strcase_each (src, expected, TRUE);
-}
-
-RESULT
-test_utf8_strdown_each (const gchar *src, const gchar *expected)
-{
-       return test_utf8_strcase_each (src, expected, FALSE);
-}
-
-/*
- * g_utf8_strup
- */
-RESULT
-test_utf8_strup ()
-{
-       RESULT r;
-
-       if ((r = test_utf8_strup_each ("aBc", "ABC")) != OK)
-               return r;
-       if ((r = test_utf8_strup_each ("x86-64", "X86-64")) != OK)
-               return r;
-       // U+3B1 U+392 -> U+391 U+392
-       if ((r = test_utf8_strup_each ("\xCE\xB1\xCE\x92", "\xCE\x91\xCE\x92")) != OK)
-               return r;
-       // U+FF21 -> U+FF21
-       if ((r = test_utf8_strup_each ("\xEF\xBC\xA1", "\xEF\xBC\xA1")) != OK)
-               return r;
-       // U+FF41 -> U+FF21
-       if ((r = test_utf8_strup_each ("\xEF\xBD\x81", "\xEF\xBC\xA1")) != OK)
-               return r;
-       // U+10428 -> U+10400
-       if ((r = test_utf8_strup_each ("\xF0\x90\x90\xA8", "\xF0\x90\x90\x80")) != OK)
-               return r;
-
-       return OK;
-}
-
-/*
- * g_utf8_strdown
- */
-RESULT
-test_utf8_strdown ()
-{
-       RESULT r;
-
-       if ((r = test_utf8_strdown_each ("aBc", "abc")) != OK)
-               return r;
-       if ((r = test_utf8_strdown_each ("X86-64", "x86-64")) != OK)
-               return r;
-       // U+391 U+3B2 -> U+3B1 U+3B2
-       if ((r = test_utf8_strdown_each ("\xCE\x91\xCE\xB2", "\xCE\xB1\xCE\xB2")) != OK)
-               return r;
-/*
-       // U+FF41 -> U+FF41
-       if ((r = test_utf8_strdown_each ("\xEF\xBC\x81", "\xEF\xBC\x81")) != OK)
-               return r;
-       // U+FF21 -> U+FF41
-       if ((r = test_utf8_strdown_each ("\xEF\xBC\xA1", "\xEF\xBD\x81")) != OK)
-               return r;
-       // U+10400 -> U+10428
-       if ((r = test_utf8_strdown_each ("\xF0\x90\x90\x80", "\xF0\x90\x90\xA8")) != OK)
-               return r;
-*/
-       return OK;
-}
-
-/*
- * test initialization
- */
-
-static Test utf8_tests [] = {
-       {"g_utf16_to_utf8", test_utf16_to_utf8},
-       {"g_utf8_to_utf16", test_utf8_to_utf16},
-       {"g_utf8_to_utf16_with_nuls", test_utf8_to_utf16_with_nuls},
-       {"g_utf8_seq", test_utf8_seq},
-       {"g_convert", test_convert },
-       {"g_unichar_xdigit_value", test_xdigit },
-       {"g_ucs4_to_utf16", test_ucs4_to_utf16 },
-       {"g_utf16_to_ucs4", test_utf16_to_ucs4 },
-       {"g_utf8_strlen", test_utf8_strlen },
-       {"g_utf8_get_char", test_utf8_get_char },
-       {"g_utf8_next_char", test_utf8_next_char },
-       {"g_utf8_validate", test_utf8_validate },
-       {"g_utf8_strup", test_utf8_strup},
-       {"g_utf8_strdown", test_utf8_strdown},
-       {NULL, NULL}
-};
-
-DEFINE_TEST_GROUP_INIT(utf8_tests_init, utf8_tests)
-
-
diff --git a/eglib/test/whats-implemented b/eglib/test/whats-implemented
deleted file mode 100755 (executable)
index 8a11357..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/bash
-
-# Author: Aaron Bockover
-# Licensed under MIT/X11
-# (C) 2006 Novell
-
-if [ "x$1" = "x--help" ]; then
-       echo "Usage: $0 [--show-only-mono]"
-       echo ""
-       echo "This script prints a sorted list of GLib functions used in Mono"
-       echo "that have not yet been implemented in EGlib."
-       echo ""
-       echo "If --show-only-mono is passed, then the script will print all"
-       echo "GLib functions used in Mono, whether or not they have been"
-       echo "implemented in EGlib yet."
-       echo ""
-       echo "This script relies on the MONO_CHECKOUT environment variable."
-       echo "MONO_CHECKOUT should be set to the location of a mono checkout."
-       echo ""
-       exit 1
-fi
-
-IGNORE_FUNCTIONS="g_hash_table_lookup_node g_hash_table_foreach_remove_or_steal  g_hash_table_resize"
-
-if [ -z $MONO_CHECKOUT ]; then
-       if [ -e ../../mono.pc.in ]; then
-               MONO_CHECKOUT=../..
-       else
-               MONO_CHECKOUT=~/cvs/mono/mono
-       fi
-fi
-
-if [ ! -d $MONO_CHECKOUT ]; then 
-       echo "Cannot find mono checkout; set MONO_CHECKOUT"
-       exit 1
-fi
-
-MONO_CHECKOUT="$MONO_CHECKOUT/mono"
-RESULTS_FILE=.results
-
-(for i in `find $MONO_CHECKOUT -iregex \.*.c$`; do 
-       grep -oP "[ \t\(\)]+g_[a-z_]+[ ]{0,1}\([A-Za-z_\&\*\,\(\) ]+\)" $i | 
-               awk 'BEGIN { FS="(" } { print $1 }' |
-               sed -e 's/[^A-Za-z_]//g' 
-       done
-) > $RESULTS_FILE
-
-if [ ! "x$1" = "x--show-only-mono" ]; then
-       IMPLEMENTED_FUNCTIONS=`grep -oP "g_[a-z_]+[ ]{0,1}" ../src/glib.h | awk 'BEGIN { FS="(" } { print $1 }'`
-
-       rm -f $RESULTS_FILE.tmp
-
-       for mono_function in `cat $RESULTS_FILE`; do
-               matched="no"
-               for implemented_function in $IMPLEMENTED_FUNCTIONS; do
-                       if [ "x$mono_function" = "x$implemented_function" ]; then
-                               matched="yes"
-                               break
-                       fi
-               done
-
-               for ignore_function in $IGNORE_FUNCTIONS; do
-                       if [ "x$ignore_function" = "x$mono_function" ]; then
-                               matched="yes"
-                               break
-                       fi
-               done
-
-               if [ "x$matched" = "xno" ]; then
-                       echo $mono_function >> $RESULTS_FILE.tmp
-               fi
-       done
-
-       mv $RESULTS_FILE.tmp $RESULTS_FILE
-fi
-
-(for i in `cat $RESULTS_FILE | sort -u`; do 
-               echo "`grep -c $i $RESULTS_FILE` $i"; 
-       done;
-) | sort -nr
-
-rm $RESULTS_FILE
-
diff --git a/eglib/winconfig.h b/eglib/winconfig.h
deleted file mode 100755 (executable)
index 31bbf89..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/* config.h.  Generated by configure.  */
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-#ifndef _MSC_VER
-#include "cygconfig.h"
-#else
-
-#ifndef HAVE_WINAPI_FAMILY_SUPPORT
-
-#define HAVE_WINAPI_FAMILY_SUPPORT
-
-/* WIN API Family support */
-#include <winapifamily.h>
-
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-       #define HAVE_CLASSIC_WINAPI_SUPPORT 1
-       #define HAVE_UWP_WINAPI_SUPPORT 0
-#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
-       #define HAVE_CLASSIC_WINAPI_SUPPORT 0
-       #define HAVE_UWP_WINAPI_SUPPORT 1
-#ifndef HAVE_EXTERN_DEFINED_WINAPI_SUPPORT
-       #error Unsupported WINAPI family
-#endif
-#else
-       #define HAVE_CLASSIC_WINAPI_SUPPORT 0
-       #define HAVE_UWP_WINAPI_SUPPORT 0
-#ifndef HAVE_EXTERN_DEFINED_WINAPI_SUPPORT
-       #error Unsupported WINAPI family
-#endif
-#endif
-
-#endif
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <pwd.h> header file. */
-/* #undef HAVE_PWD_H 1 */
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the `strlcpy' function. */
-/* #undef HAVE_STRLCPY */
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-/* #undef HAVE_SYS_TIME_H */
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-/* #undef HAVE_SYS_WAIT_H */
-
-/* Define to 1 if you have the <unistd.h> header file. */
-/* #undef HAVE_UNISTD_H */
-
-/* Name of package */
-#define PACKAGE "eglib"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME ""
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING ""
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION ""
-
-/* The size of a `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* The size of a `void *', as computed by sizeof. */
-#define SIZEOF_VOID_P 4
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-#define VERSION "0.1"
-
-#define HAVE_STRTOK_R 1
-#endif
index 1cd7cc5a141a737ee717505923c08d28f5f63c3d..2563306d41f7f7fa30421c629d0f3b60b08b1169 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 1cd7cc5a141a737ee717505923c08d28f5f63c3d
+Subproject commit 2563306d41f7f7fa30421c629d0f3b60b08b1169
index 4ae08e8dd6425fa0936aa43d95966539359b5081..47f82456814a05b077e31b58d66c1e4c640aac79 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 4ae08e8dd6425fa0936aa43d95966539359b5081
+Subproject commit 47f82456814a05b077e31b58d66c1e4c640aac79
index c76ba7b410447fa37093150cb7bc772cba28a0ae..14e17dfbebf5651b5ce70c7fb317e388f8a3a271 160000 (submodule)
@@ -1 +1 @@
-Subproject commit c76ba7b410447fa37093150cb7bc772cba28a0ae
+Subproject commit 14e17dfbebf5651b5ce70c7fb317e388f8a3a271
index 7e70a4e9236104c350e7d9ca3505225755065569..cb1b049c95227465c1791b857cb5ba86385d9f29 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 7e70a4e9236104c350e7d9ca3505225755065569
+Subproject commit cb1b049c95227465c1791b857cb5ba86385d9f29
index 1d7d43603791e0236b56d076578657bee44fef6b..3aef9cdd6013fc0620a1817f0b11d8fb90ed2e0f 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 1d7d43603791e0236b56d076578657bee44fef6b
+Subproject commit 3aef9cdd6013fc0620a1817f0b11d8fb90ed2e0f
index 21e445c26c69ac3a2e1441befa02d0bd105ff849..305e0f60533d164676099c918fa4dd09c718017b 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 21e445c26c69ac3a2e1441befa02d0bd105ff849
+Subproject commit 305e0f60533d164676099c918fa4dd09c718017b
index dcb0a0534d5104eaf945d3d1f319dc33044b7bbe..80b86f340b7f6fb7afe84443214e1cbd7ff70620 160000 (submodule)
@@ -1 +1 @@
-Subproject commit dcb0a0534d5104eaf945d3d1f319dc33044b7bbe
+Subproject commit 80b86f340b7f6fb7afe84443214e1cbd7ff70620
index 7b1460a888ae20f5756aa3e8ad71781094541ffd..e7929918ad0bb9df8d12b07a7803f660a8a3244f 100644 (file)
@@ -93,7 +93,6 @@ GC_API GC_PTR (*GC_oom_fn) GC_PROTO((size_t bytes_requested));
                        /* pointer to a previously allocated heap       */
                        /* object.                                      */
 
-// Keep somewhat in sync with mono/metadata/profiler.h:enum MonoGCEvent
 typedef enum {
        GC_EVENT_START,
        GC_EVENT_MARK_START,
index f19a02aa14ea8679cda72518cc466f57ee5a4ad8..56663251bf8e0066c83fd9f700eb835d724a2ff2 100644 (file)
@@ -146,6 +146,9 @@ instruction pointer.
 This is equivalent to the value \[lq]100\[rq].
 A value of zero for \f[I]FREQ\f[] effectively disables sampling.
 .IP \[bu] 2
+\f[I]heapshot-on-shutdown\f[]: collect heap shot data when the runtime
+shuts down.
+.IP \[bu] 2
 \f[I]maxframes=NUM\f[]: when a stack trace needs to be performed,
 collect \f[I]NUM\f[] frames at the most.
 The default is 32.
@@ -180,16 +183,15 @@ with the current process id and \f[I]%t\f[] with the current date
 and time, then do according to \f[I]OUTSPEC\f[]:
 .RS 2
 .IP \[bu] 2
-if \f[I]OUTSPEC\f[] begins with a \f[I]|\f[] character, execute the
-rest as a program and feed the data to its standard input
+If \f[I]OUTSPEC\f[] begins with a \f[I]|\f[] character, execute the
+rest as a program and feed the data to its standard input.
 .IP \[bu] 2
-if \f[I]OUTSPEC\f[] begins with a \f[I]-\f[] character, use the
-rest of OUTSPEC as the filename, but force overwrite any existing
-file by that name
+If \f[I]OUTSPEC\f[] begins with a \f[I]#\f[] character, parse the
+rest as a file descriptor number, and feed the data to this file
+descriptor.
 .IP \[bu] 2
 otherwise write the data the the named file: note that is a file by
-that name already exists, a warning is issued and profiling is
-disabled.
+that name already exists, it is truncated.
 .RE
 .IP \[bu] 2
 \f[I]report\f[]: the profiling data is sent to mprof-report, which
@@ -214,10 +216,6 @@ counters, which is normally done every 1 second.
 .IP \[bu] 2
 \f[I]coverage\f[]: collect code coverage data. This implies enabling
 the \f[I]calls\f[] option.
-.IP \[bu] 2
-\f[I]onlycoverage\f[]: can only be used with \f[I]coverage\f[]. This
-disables most other events so that the profiler mostly only collects
-coverage data.
 .RE
 .SS Analyzing the profile data
 .PP
index 307d85dee44c15b73b07decadfa2ed5d53b606db..d1cfcb2995826b9b0d9606b2c57c1b61649f6822 100644 (file)
@@ -42,7 +42,7 @@ class X {
 
                Version min_mono_version;
 #if __MonoCS__
-               min_mono_version = new Version (5, 4);
+               min_mono_version = new Version (5, 5);
 #else
                min_mono_version = new Version (4, 9);
 #endif
index 902697219b4e6b84bb791bc4a74fab9239f32e6f..020609b26a4c5cf4197089ea9cca5c776e04e1b6 100644 (file)
@@ -45,6 +45,10 @@ makefrag = $(depsdir)/$(PROFILE)_$(base_prog).makefrag
 MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS))
 MCS_REFERENCES += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.exe,$(EXE_REFS))
 
+ifdef KEYFILE
+LIB_MCS_FLAGS += /keyfile:$(KEYFILE)
+endif
+
 ifndef NO_BUILD
 all-local: $(the_lib) $(PROGRAM_config)
 endif
index 6f3e0a8c2d2a4f460a8ba4669874d98068726a01..3fe7d92233873d9fc9f5563722a532898f05a994 100644 (file)
@@ -26,6 +26,10 @@ LIB_REFS_ALIAS = $(filter-out $(LIB_REFS_FULL),$(LIB_REFS))
 LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/%.dll,$(LIB_REFS_FULL))
 LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/class/lib/$(PROFILE_DIRECTORY)/,$(LIB_REFS_ALIAS)))
 
+ifdef KEYFILE
+KEYFILE_MCS_FLAGS += /keyfile:$(KEYFILE)
+endif
+
 ifndef LIBRARY_NAME
 LIBRARY_NAME = $(LIBRARY)
 endif
@@ -104,7 +108,7 @@ csproj-library:
        case "$(thisdir)" in *"Facades"*) config_file=Facades_$$config_file;; *"legacy"*) config_file=legacy_$$config_file;; esac; \
        echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
        (echo $(is_boot); \
-       echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
+       echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) $(KEYFILE_MCS_FLAGS); \
        echo $(LIBRARY_NAME); \
        echo $(BUILT_SOURCES_cmdline); \
        echo $(build_lib); \
@@ -308,7 +312,7 @@ endif
 ifndef NO_BUILD
 
 $(build_lib): $(response) $(sn) $(BUILT_SOURCES) $(build_libdir)/.stamp $(GEN_RESOURCE_DEPS)
-       $(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) $(GEN_RESOURCE_FLAGS) -target:library -out:$@ $(BUILT_SOURCES_cmdline) @$(response)
+       $(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) $(KEYFILE_MCS_FLAGS) $(GEN_RESOURCE_FLAGS) -target:library -out:$@ $(BUILT_SOURCES_cmdline) @$(response)
 ifdef RESOURCE_STRINGS_FILES
        $(Q) $(STRING_REPLACER) $(RESOURCE_STRINGS_FILES) $@
 endif
index ef393d92d0309bb5ebd7b36944b07d07d804ab76..a76de22836f059a3a5a1d7b286f78571036a907e 100644 (file)
@@ -34,7 +34,7 @@ PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_B
 NO_SIGN_ASSEMBLY = yes
 NO_TEST = yes
 NO_INSTALL = yes
-FRAMEWORK_VERSION = 4.0
+FRAMEWORK_VERSION = 4.5
 
 # Compiler all using same bootstrap compiler
 LIBRARY_COMPILE = $(BOOT_COMPILE)
index 8874b32326aa3f87550a5ff3a863a1e5d5fd6b04..8ffa784a23aeff1661c912461451be8e75a5445e 100644 (file)
@@ -104,7 +104,7 @@ test-local: $(test_assemblies)
 run-test-local: run-test-lib
 run-test-ondotnet-local: run-test-ondotnet-lib
 
-TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotWorking,ValueAdd,CAS,InetAccess
+TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotWorking,CAS
 TEST_HARNESS_EXCLUDES_ONDOTNET = /exclude:$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotDotNet,CAS
 
 NOSHADOW_FLAG =
index 728f8cd33eb814a86c57c4bb3e69b67771c29ea2..184dd24b546e052710d77889b82fe761132586ec 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Accessibility</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 2b7c5494fedc7896af7c5cdb1a97158188dfa9c7..9b481a9029447b18bc292dcc8fcb77ea9396d13e 100644 (file)
@@ -56,7 +56,6 @@ using System.Runtime.InteropServices;
 [assembly: AllowPartiallyTrustedCallers]
 
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: ImportedFromTypeLib ("Accessibility")]
 
index 8700935681bd7b9038775d2d58304eb83be90ec2..435a3c7b044b1945f09be8a985ea2553e43ffd54 100644 (file)
@@ -3,6 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = Accessibility.dll
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 NO_TEST = yes
 
index d0a7fa24bec91b5411437e831cea519f67968949..368de21261efa6a79cfb9e100f800b69212fbe00 100644 (file)
@@ -44,5 +44,4 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
 
index f9de9c35763ada23f8b118390b3b9f0cddfaafd4..b49d7010751b6b614bac61cef63b786a78f8d836 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Commons.Xml.Relaxng</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index d63e7af0565267712121ff183e65084bf9ef92b0..1febae4eb1e942a62495986846adafdb9123bd12 100644 (file)
@@ -8,6 +8,7 @@ OTHER_RES = $(RESOURCE_FILES)
 
 LIBRARY = Commons.Xml.Relaxng.dll
 LIB_REFS = System System.Xml
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = \
        $(foreach r, $(OTHER_RES), /resource:$(r),$(notdir $(r)))
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
index 6cb9fb392a3f8a4c665be15384b7e2e03bafdbf8..be6b32da09a3ec27f4feded277c13acbd317de34 100644 (file)
@@ -50,4 +50,3 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyVersion("2.6.0.0")]\r
 \r
 [assembly: AssemblyDelaySign(true)]\r
-[assembly: AssemblyKeyFile ("SharpZipLib.pub")]\r
index 74debbe57e66c8e91a2587a24e111aa2b826f924..fd6ced25e83d2155bc47f0b9b850cae056904d74 100644 (file)
@@ -8,6 +8,7 @@ LIBRARY_COMPAT = yes
 LIBRARY_SNK = SharpZipLib.key
 
 LIB_REFS = System System.Xml
+KEYFILE = SharpZipLib.pub
 LIB_MCS_FLAGS =
 NO_TEST = yes
 EXTRA_DISTFILES = SharpZipLib.pub $(LIBRARY_SNK)
index 1150e8257f82d648fc7155071c09900e9d109519..cf0fdf4084bfad9918e4144c3c6259fa96776bf5 100644 (file)
@@ -45,7 +45,6 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: AssemblyTitle ("cscompmgd.dll")]
 [assembly: AssemblyDefaultAlias ("cscompmgd.dll")]
index 43cffde41f7eb58fee93925d37c377b2b34d9163..1a3ace6659d1ab0f2a4b85fda0d84dd6b95540c1 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>cscompmgd</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 54ff581cee0b50832f0065c1d6f68a8cfd840820..8f52ee52cf7812b67fc1b188a133d4d099d2b099 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Cscompmgd.dll
 LIB_REFS = System
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
 LIBRARY_NAME = cscompmgd.dll
index 0f297530ca6be427ad175f132e3aa526f0142cf1..70f5c461101041ac0e97b6c1909579d88a87cc00 100644 (file)
@@ -39,7 +39,6 @@ using System.Runtime.InteropServices;
 [assembly: NeutralResourcesLanguage ("en-US")]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: AssemblyTitle ("CustomMarshalers.dll")]
 [assembly: AssemblyDescription ("CustomMarshalers.dll")]
index 6ba6b5eef5c57952db87f0a164c21715fca377d0..4d8050eee986e531d2a78d2ee44014fcfaefd0b4 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>CustomMarshalers</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 366921c583ffa6a658be493402581d2ac40a06c7..96da1f60b2239cdc821b61c6561dc66171b090c7 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = CustomMarshalers.dll
 LIB_REFS = System
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 NO_TEST = yes
 
index 9f51659b224772935283a64be2f1a46f754b62cf..74a03527842dd96b41e753fa12ca70fb85c63032 100644 (file)
     <AssemblyName>Microsoft.Win32.Primitives</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index d1b93730000cfeb9d7a940589a9551dd045769e6..0c97f371a8fff4573d89157aea47451c3f5c76a3 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = Microsoft.Win32.Primitives.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index e740423e097fe5b5d486925b4379b4f097fd5c56..de874d1a08efab22fe4ae4978a3a9464d847de42 100644 (file)
     <AssemblyName>Microsoft.Win32.Registry.AccessControl</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 4197137c95ee1093c968bb85209da78202287b9a..6f39a8b55c0692589fbf08788788af235c15ad25 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = Microsoft.Win32.Registry.AccessControl.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 2e241c6428b4dd09b40d70edd3d64770688aaa76..0e137b9cdc1eb1357b9854e3cab665f954c592f4 100644 (file)
     <AssemblyName>Microsoft.Win32.Registry</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 5f1030b7c72c610cf09e6c850a32935ca7874590..e4919fa9e9ad2a7dcb1bedafc95c440929c3c525 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = Microsoft.Win32.Registry.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 18075e571a701c395451b0d862578ac8e4d6de33..166f38f7b071771e24860236e4a2db6faf43b436 100644 (file)
     <AssemblyName>System.AppContext</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 9170d927e04e6a6100557b4bd0eabadc421dd750..8ae9028aa4174b1f0e597e83a07865d06be0771b 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.AppContext.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index a813846e79e21330fe2a12270894e7560c720e0c..5245963a9cd6a57dbc5861f6e32835507ab78726 100644 (file)
     <AssemblyName>System.Collections.Concurrent</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index d94e5d55dd2aa4ad2de702786f5ad8e7835bec6e..2fd47eb37c860fea2fde60c0e2a843b9affbcf06 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Collections.Concurrent.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
diff --git a/mcs/class/Facades/System.Collections.Concurrent/_Makefile b/mcs/class/Facades/System.Collections.Concurrent/_Makefile
deleted file mode 100644 (file)
index 4eeef25..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-MCS_BUILD_DIR = ../../../build
-
-thisdir = class/Facades/System.Collections.Concurrent
-SUBDIRS = 
-include $(MCS_BUILD_DIR)/rules.make
-
-LIBRARY_SUBDIR = Facades
-LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
-
-LIBRARY = System.Collections.Concurrent.dll
-
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib
-
-PLATFORM_DEBUG_FLAGS =
-
-NO_TEST = yes
-
-include $(MCS_BUILD_DIR)/library.make
-
-
index 04e738fe929beef14f8f684062c42b9dab302d98..9d34a904b52166e253c570400844f22a47039b42 100644 (file)
     <AssemblyName>System.Collections.NonGeneric</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index f2f3cdb4772de684efb7216f3b876b12a3abb2f9..c186c06955c9da695fb23f394d22ea2adbfebd20 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Collections.NonGeneric.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 5c8115185283ae5156e5240ed37bf07c0ce78577..802f18a8ab4faad10381264822110e25ac47659c 100644 (file)
     <AssemblyName>System.Collections.Specialized</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index d391fa9ac5190ed4715718989e3ae3d0b0213ef3..f5cf8f675908db9ddeded6b9af80fefc816839d5 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Collections.Specialized.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 677f5a0e88db3a197139d4d836b4c42ad699e395..c3043b33b8ef2682729da7b2ef1d12e9146357f7 100644 (file)
     <AssemblyName>System.Collections</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index dc6dca0073a2334fa85a0aa17e1017c539d8d556..a75dbb70dc83aae94fceaf7a3c7d5ad55506e677 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Collections.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index fa4826a4c051454d83152f253718d24940119208..ccc830c7cdf7809e4f039274c6906e16c8320471 100644 (file)
     <AssemblyName>System.ComponentModel.Annotations</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index a4f1cc41c4d0305260e88acd5defefb4817be0e9..ff94c07db1bb7f8191b9a345e4943f941aad2182 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ComponentModel.Annotations.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.ComponentModel.DataAnnotations
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 4388ab992816e365375b10de43f875c3fdaeb347..83a16b0a3a5603536b21009b01a69432999cfe9c 100644 (file)
     <AssemblyName>System.ComponentModel.EventBasedAsync</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 48a6b9c11e617451abde35a362f117b433457a89..2def8432572c0440c0718f7e4e4aae8622acd387 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ComponentModel.EventBasedAsync.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index f2d094d937e89541b16e64ca3f3a12a1fefabbec..dc22a7cad466f2bdbecbbb5a26716f227fc73b4c 100644 (file)
     <AssemblyName>System.ComponentModel.Primitives</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index dac065757dee333e4ff0d549b12c6223ac8c1f2d..fd01c011f85eef6ea80d01ff2f5eccae04e2db43 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ComponentModel.Primitives.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 79b9060caae0a441319064004ca9a9d6692c9f77..30758b0d57cb98d6a24b2f2183c2f55e021916c9 100644 (file)
     <AssemblyName>System.ComponentModel.TypeConverter</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 6062e304a95bddb5401c33402610baa81e6b1251..7a0a3354d82adf2e0ae8e1b8207357d166e9f549 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ComponentModel.TypeConverter.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 580ad3d1160c71706fa6cc2024f4edf802190d2a..c9680a56d61a6eb6501ffa055decddd9ae5798d7 100644 (file)
     <AssemblyName>System.ComponentModel</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 33b88f9541ee8bbac2b728a5064e1a6ef3dd7e33..f213856470f2ca9c03b0ff7e370992840aa38f7e 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ComponentModel.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index d19bebb1323f8d21764181c3ddcab494ea99cc22..03703bca865ec991777fce060db850cfc5dcbaeb 100644 (file)
     <AssemblyName>System.Console</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index ea7312a4d7060b96f47c03c998097150cc34720f..cc851e10ccc778c42a24a7848030193a21709e0e 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Console.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 81fdd7cb4fefd076b5033f94dcf906c16d26bf39..e8c9494131a7ad7d56a937bf4ed6c780d789552f 100644 (file)
     <AssemblyName>System.Data.Common</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index ff6d03567897533cc1b43a22bd216a4bcecea509..36cc55f5a81a3efd196dd172db012dba2b1c328b 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Data.Common.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Data System.Xml
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 8d170374a41e65112186ae23c829e67fd7c180bf..4019872b113dc883fe6d7fc1f11cddcfe79ae33c 100644 (file)
     <AssemblyName>System.Data.SqlClient</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index f5eb7097fd6366eaad0662aa3f5f809e40fe6874..a2fce4d2d98bd2a9b5e0296a070dd5322dacd0f0 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Data.SqlClient.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Data System.Xml
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index bceed4f1258ddeafa846798b913c5035eb780d80..f7a8d51f60e8323842f773669822d367d3b15853 100644 (file)
     <AssemblyName>System.Diagnostics.Contracts</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 391da57605b41150b50ce48906995e07bea39df2..150500c8465db16fe3b62ab1354a57f31e28d63f 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Diagnostics.Contracts.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index e2589d7c98b11dae88a5d7b9c295bc3a006cacbc..7728b2817724684915d4c7653c9b418f115716bd 100644 (file)
     <AssemblyName>System.Diagnostics.Debug</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 0eccd8767190f9b3a811a712cf0522f6e3a4cef2..2ceeb32a62ba4af92c384e4ba79a32c0bbb4cc1e 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Diagnostics.Debug.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 56dae87d59b7c452a878223d041471e365a9ce42..c2d9a532b22e0cca5f57d5dcc3c9726cdf7b3ae4 100644 (file)
     <AssemblyName>System.Diagnostics.FileVersionInfo</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 1ac2f6cc2a05917d5e5d678a5a348715a75496b2..14fd656d5fc2e15abf63590b1b4d2cd8ec796cd3 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Diagnostics.FileVersionInfo.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 6c18c50411d59a5dca93b64f7a6ebc8982fdda3d..9505eb56c653bee72004d98245abfd67c9101e46 100644 (file)
     <AssemblyName>System.Diagnostics.Process</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 83fd768e25124252caa659b24c03af6afdc7f86c..039455814be9bcb24bd71615effc13f92c7de569 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Diagnostics.Process.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index bf43b62af5a19f024a0243c7985d34c22d206fff..9940a5eb3c6d9cdaf2d290d5532fcabf62396768 100644 (file)
     <AssemblyName>System.Diagnostics.StackTrace</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 4cc9d7f1a3bee21d447328e91d858fef184fcbc3..f7f79d2545cd638c12766866590b600de8e8de80 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Diagnostics.StackTrace.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 2b4b0e6491793aad2ce3116196b325f29419095b..183bf7fa802718ae7078e83075b463c8a44dcbea 100644 (file)
     <AssemblyName>System.Diagnostics.TextWriterTraceListener</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index aa7c6dc119fc4cfa8f0d8ed154b0cfcb4fa4ec9e..e1d059ff25b9220d8989c1e9b52f3dc93e99aae3 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Diagnostics.TextWriterTraceListener.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index b34e0b9d4694316e9d4ec1a832f67fd0d98b46a8..ce904941ca0eaa17b1905643d42cabe0c434e2ca 100644 (file)
     <AssemblyName>System.Diagnostics.Tools</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 3d9b5158255726324e164ef659a6f48d05f977bd..fe925a8d7f5ba3162caf3df63e3d795fe9afe985 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Diagnostics.Tools.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 568df64c2216338aa7791093ce2a8f0052e6f637..30df5a296db39b9d1e3107f14693f53eb73048a7 100644 (file)
     <AssemblyName>System.Diagnostics.TraceEvent</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 342e82dbf4a4288cc8cfa0269205ba1aa6b77de7..89f5a007fd6d3e0fffba49c3ab81c878a9125229 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Diagnostics.TraceEvent.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index bcf11589dccfa9e3ceccb249ce77e7802f62a62f..8ea1bfdbc0ffb8678c564726fd2c192e5e814eaf 100644 (file)
     <AssemblyName>System.Diagnostics.TraceSource</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 3467273f7c9ea984a9a7770ce90dc0e44359ee36..8d3d7c882a1b78d1ed7761503319d428550f7474 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Diagnostics.TraceSource.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 2f185ebf88b186b63b35d46553905b6bc9aac8bd..95945bce18b8d1bc376929f91260d83d72433eb6 100644 (file)
     <AssemblyName>System.Diagnostics.Tracing</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 14b380da866454c7569c53a115dfa4e473422415..9e31fe9431e46f00a5fb3b297309c8a96e2b0c5d 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Diagnostics.Tracing.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 521aef546b3d0410c9c755a3c3a9f78486ac24ad..fc146ae91aaa2c87480855a69ecf07c71a6a996f 100644 (file)
     <AssemblyName>System.Drawing.Primitives</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 0ef7aa55d0cc686a7199733978de835392016da2..d0d4f2dea9f35e8db002cc09eed8e668187fa128 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Drawing.Primitives.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS)
 
index 292a551fc7b46f03ff74e22fdec569508aa1aa49..fec9ddaf01b27b26d993d2a9dc9e4d858c23e591 100644 (file)
     <AssemblyName>System.Dynamic.Runtime</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index a6bcda9f3deddfa3d64379e1b6908a4d1e884fe3..f1502c47b2b6cf9c819cd07d4eefde57260b921c 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Dynamic.Runtime.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Core System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 005853d465eeb091a727ee59c2317b01d42c8374..9851d0f75e16a005a66e4f2033f476c12f4a97c6 100644 (file)
     <AssemblyName>System.Globalization.Calendars</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 5f419e9b635d47e2424ac026cdc42178f821cc79..952194574c236980c0ab97a9d78f9abe64739b7a 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Globalization.Calendars.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 309f627453ac4508b7b4ac4b5ef7c12acfdfce50..2499318dd4f5e650af725ce054b402915f029aed 100644 (file)
     <AssemblyName>System.Globalization.Extensions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 446a41276071919f313a88018b1ef9cb6b6aeb89..8827c291726f5546b514540d845f530a126a9f53 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Globalization.Extensions.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 3c5fe04f335987709d7019325db43b28af7687d3..fa666d31de07f7d496cbdf1110a036ad160e8544 100644 (file)
     <AssemblyName>System.Globalization</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 4f01dfeb76258fc89d9d03cecedd4742bf77d306..3577310f354ec1722cf27a7d2517e2de96892e5c 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Globalization.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 387458c758a381289efe8cb1a1e49e99a419463c..b792acf5a12409f1310ad99d1e112a6f6bb806c5 100644 (file)
     <AssemblyName>System.IO.Compression.ZipFile</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index b4e4896a6295a8936564f4a0539974952652070c..92949d59ddf431704047de4ea6354f0edff10507 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.Compression.ZipFile.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.IO.Compression.FileSystem
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index f9fe478906617f48e37d3305c6c08d2aabd6de40..b11eeda1084533a2fb5bdcf29f085233a8175c28 100644 (file)
     <AssemblyName>System.IO.FileSystem.AccessControl</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 9efb35542bf8ec2e85c7c8d94db0df651674a675..ad10cb9bf1747959403c8bf544b987cafdcb6261 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.FileSystem.AccessControl.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 997d4e7e22f4886f0221c0fb1ea504282a877e16..e6666d22f8c21f482b04c07a53513bbecafb743a 100644 (file)
     <AssemblyName>System.IO.FileSystem.DriveInfo</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 0925c49d1557f854176a41a134cbcd81ad6bf124..61a960476ea9b9b2ab0d90d44f6cd0ae860de9f2 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.FileSystem.DriveInfo.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 3fe7f1c5e1bb137333d9dd173c1c4ed5080d8248..f5792c3118619593e25b9dce77291ba179dc1197 100644 (file)
     <AssemblyName>System.IO.FileSystem.Primitives</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 31b27077e454a42cb23a1d7436d72e0498c6334b..6b2f4ce93cffac9dd6578b0f749b70d0e0d380c5 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.FileSystem.Primitives.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index e042e688f5be73df9654ba77c6f7abc861701b46..49642ca03093eb1bf567f1e1e054705c3c076b98 100644 (file)
     <AssemblyName>System.IO.FileSystem.Watcher</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index caade8a02a0195d34405de7b8659995ef95b0d31..276b8ea4524e4a6d1872d6241b0ed8c877211f23 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.FileSystem.Watcher.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index a01f74a62d05ddfc5249cf2faa90ec9dda91159d..176a7f4a90bb428e72a06e40d082e1c73eb0c9cb 100644 (file)
     <AssemblyName>System.IO.FileSystem</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 178aa60efeaaad5830ac94aaab910a13751441e2..881bb1e004971b5adc764a74d938e1a1d6011710 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.FileSystem.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 6d0433ed274daeff1d94528ee1feb319b7af85fa..5f674f54865a0d55f2ceaf7a73f3bd26fb42bde9 100644 (file)
     <AssemblyName>System.IO.IsolatedStorage</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index be6a315004b208b1c49e37455206199af6e43093..e45aaaaf73482ce64298189ccf7792d2d3797de2 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.IsolatedStorage.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index fc35c5a948607f9a10905113b7ce84e72956894a..c675865fd32d90fa62289b0f29cc0f96bc52a3ea 100644 (file)
     <AssemblyName>System.IO.MemoryMappedFiles</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 656b03cd1262185c1b50734329bc9296795d8515..62b0958b9d6b2c960971ed37c7b508707bfc7be7 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.MemoryMappedFiles.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 9e8246235126ed0d28bd9baaeeefca35a73d6e49..d4305457bdfc0b80908bf43b4a99ee77949853e2 100644 (file)
     <AssemblyName>System.IO.Pipes</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 0d156aafeb131b3bf55145cd637bb68770340e39..690c3b8a387fe38d35f42a6dde0c93cd6d8263f6 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.Pipes.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index a690e0a6bb630c62f24b5476eca35a16368c7e8c..44f204cceb91fa1fba4544e372d19c3dc9b52a49 100644 (file)
     <AssemblyName>System.IO.UnmanagedMemoryStream</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index c1605d9ccf85284ae1fa300fbc17dc35dfb10eb9..867f697ca1f069f40b64b65474c71b975e82ae54 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.UnmanagedMemoryStream.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index efafe2083c53ed3836ec51c0b6d882036d60fc44..f497741d1d2a502fb892eb41699dc2b45ef6aa1a 100644 (file)
     <AssemblyName>System.IO</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 89fc0db09634da4466bd382a6874697d517e21ab..96f2b867bf616b5a5ff1dcca650fb74e0f450f91 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.IO.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 934efe64f00c60a76d0604d66d2387304e9da8fe..dea56bacf611114f2a2cae45091cd8d09e1b811f 100644 (file)
     <AssemblyName>System.Linq.Expressions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index bb78580fb433de302a0fdf8ef84e8abe7532799e..136c8ff63903ff1a2ba4cca648bd30cd347e2ae2 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Linq.Expressions.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 4db714ec7c49d59cccbe011d9fb096d344b12cb9..59d18ab9b3626778703b183764522ce321082b3c 100644 (file)
     <AssemblyName>System.Linq.Parallel</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 7d314bf5e9502836ca18c6ec152739898fba656c..4f5c1170695efb0a08670fcad2e2e80e8ea2e92f 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Linq.Parallel.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 884e9857154835979eed002024399f1d319a126d..4c613cdfb322c58f6b59c412189351467b1afa83 100644 (file)
     <AssemblyName>System.Linq.Queryable</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 6ea4c746ec840f02659775c5a1d330f33bb6c516..835b13ff1412150e153a0f12fb081b617095b41d 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Linq.Queryable.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 42e2c4722da4ca7dafd3e223605de8a12b676ec5..00328d988ca8277c8bf3ce964ed484aa60322fe4 100644 (file)
     <AssemblyName>System.Linq</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index d9778697d4c882d682b44b80d7da16b3a0136284..d2b8243531205827016d1484a5c95d88b0f35174 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Linq.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 176ed3a81d73f4923e258fe24ab698427fa42868..994bf113ad1224cc2725223893fd4316c4001855 100644 (file)
     <AssemblyName>System.Net.AuthenticationManager</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 293f80d25d36c56bcde1dd969c536cd941d29d6b..f8504ec7419d2dc8a5615b239a52fa8df529c9cd 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.AuthenticationManager.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index bb9104dfc2f9c6069b933df62dec1429b7defe17..6fe401ba7ca9363dca0666f542a0e188299ca787 100644 (file)
     <AssemblyName>System.Net.Cache</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index bbdcfce759232bb82559b6705da145b52307792a..54928e09ec06b89f2e051016d7a6c7c63e5e9462 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.Cache.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index fbce2af1dff768827d4727b06fce47d41edd95fd..aa3b4a9d9bda849a5631657ac2b67d3f72967067 100644 (file)
     <AssemblyName>System.Net.HttpListener</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 3109e7076150771cdc3703a58b00258b94b09a77..c603bdeb2b658c2de62d0d0d3eaef52f15143aef 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.HttpListener.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index ca9fa22965e18752dfda1129486ed85b894dce5d..f7b2d1e81aad4472b740e0b2a44b35af585e1607 100644 (file)
     <AssemblyName>System.Net.Mail</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index fe936b17d9141732b41bf59c2e95fe8096f9f23f..6c3ba47a4c953b927700e326da7c624ea9517862 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.Mail.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 8cb2c14b72dbb4b86eb9ccdd759984be34d174af..eca530fdebd77c342ce92fd76e7e0eb1046af980 100644 (file)
     <AssemblyName>System.Net.NameResolution</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 142a303c38e0b9869ff4e7c185efb0d3977661e0..a43cc24df3e0c7f8788c614b87e7865d3681ecc5 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.NameResolution.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 9e16e478401d70739ed98b248a3b25c4feec665e..07fd052df84a3514f719b462f91fa0f1898b058d 100644 (file)
     <AssemblyName>System.Net.NetworkInformation</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index bc2a7ec81660b1daf4d03a1da95c73f02d8202aa..c9f9c1bbe86c99640b96c2842b8e7aa37bb2492f 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.NetworkInformation.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 750ace6943989954cd926c15c119849bf4a9e805..f18b50e7e4c85fb6de7168ef361aae1fd4df3350 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.Ping.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index cff3f7285a8d766cb98cc27a48db05b77d2edae5..184d968d4083b860758f0c971c289bcd878d3b7e 100644 (file)
     <AssemblyName>System.Net.Primitives</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index bc36271325922ee154f7268ad5ccec15fd8069a6..08e719e2bef300bc8d1fdc0700457c97fa361a89 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.Primitives.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index b5d7471d13258885e285ea15fcd2002642d53edf..a4dea5a00de7415dc65f63cf8f872e61b0d5d489 100644 (file)
     <AssemblyName>System.Net.Requests</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 7a8a231bc3b45ac31461994436df5075a7cc81e6..f1e06d28a56be683ff181c578ddbbfda7e95e450 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.Requests.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 6fb444a2ac654c233789d5f425e67635733a59b0..759faff8aceb9b3d2566dc7572fd534dc342916d 100644 (file)
     <AssemblyName>System.Net.Security</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index cdd7db906c94970e9fab160103797a5d2baf446f..dd4a723ab078c134839a076e5526ea93a8f0e28b 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.Security.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 48c656de4eacfe94f95f8050ef426449ed603a89..9ac5b0cc5b33e40a1e821f57b1c88215430007fc 100644 (file)
     <AssemblyName>System.Net.ServicePoint</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index f0d095317dcaeea6f0b93505b3b726053a491f7a..fbb5065de2002b00fd393cee67ee650a8a6ebd59 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.ServicePoint.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index ab2dec5042ef5117c1559b4a80e89b969368177a..4562005c453f7240a1acf1feceddb5ea05cd38d3 100644 (file)
     <AssemblyName>System.Net.Sockets</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index bf60d5fef6be2147d79b9b70e5ab29430dc1f651..3384d7b1cde1c41247297cabe09f17864b89ff6c 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.Sockets.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 46a3df681711293b6bbff460315fe9aba78c32fe..e76e7c16537fa3279a4ece28f58e95b986147bd1 100644 (file)
     <AssemblyName>System.Net.Utilities</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 6f1a5166b8aa215aed0bc604a0f27cd72a06a610..138be5a83cae81f98256e279016ddbea15c1b4fb 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.Utilities.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 858fc1c465b60d1831b5f9a9b238db6db4fe07fd..2cb4d0bfd6ea8e8b0d001cd86202a76651913ff4 100644 (file)
     <AssemblyName>System.Net.WebHeaderCollection</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index f6ec2a06526ec525bee6876f87f7ba7dd9055bdb..1533bb4d1e521a8da934c67038fee33af5b3df47 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.WebHeaderCollection.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 872ad271c7025fe6cce4f886115093f10fefbabb..9b6686cd332992af5f1d39e51968d368825c5634 100644 (file)
     <AssemblyName>System.Net.WebSockets.Client</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 2552b0e0d5b3032027e0b89eb7bf4b6221791a6e..08e44b8c42fe9e0df74753136663c63e2de904c1 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.WebSockets.Client.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 7b15ca03de3b342d9fe006d827be84664491b397..fac0a180763b73a67890c91a051623792219e94c 100644 (file)
     <AssemblyName>System.Net.WebSockets</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index e9fa98fd8b48fd01450122ab9bd74fc0a98b8d1c..ed8a427060af46f46b2818bbe103f0b45ed471c2 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Net.WebSockets.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index b1506e4e2e17a8085db8aeade7245436566bc975..44d449764060d4076f1a3e3aec11210a98655e5e 100644 (file)
     <AssemblyName>System.ObjectModel</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 0838b23d3cfe1e301d46448072fec98ed020cb07..432314520fdb3bf59351183573974f1634dde37f 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ObjectModel.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 0dab068925326b02565cbfdf4de874aa37da112e..3c949251b97fae8b5f4d77367c123be89ddb45e3 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Reflection.DispatchProxy.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) /unsafe
 
index 59a352aec868f22a7f88ed43f72ed7d8a0b2837e..0c9c17e728a301215693798e6f7e63f883394ffc 100644 (file)
     <AssemblyName>System.Reflection.Emit.ILGeneration</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 6ee536f7b71437a4b774e62b45834cde0297142e..8c0e2259b0d95c2ff364f6fd95f594b86ed423aa 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Reflection.Emit.ILGeneration.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 43c1e24eb2f6808098e332597915042d59fac80a..4705b222f38e9084e89370acae6ab93534a9850d 100644 (file)
     <AssemblyName>System.Reflection.Emit.Lightweight</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 93292276ab10e15f578a62e8431405bc2153544c..2144babc9162655907a48db56978a4c920a5f1f5 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Reflection.Emit.Lightweight.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 79b401591b1373fbbd76b1e80500582fe5a068f3..1063e4e2ced9c6be08b6fa77079a438f7e95ddba 100644 (file)
     <AssemblyName>System.Reflection.Emit</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 798d457271e1b199a3d1ade55adb63f526df5eaa..444fd0e2111131591af8579d2dbe088df0db396d 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Reflection.Emit.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 685fd4a2a41d13d222cf3d836c84677ebd35c2bf..58547a03e0756dc74b1a72f397c2b3fd2547e464 100644 (file)
     <AssemblyName>System.Reflection.Extensions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index e1799cc150e5da36dfa74d857f5b85461b302b76..43c598e6777033297388acb80d7c2bfcdafb2125 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Reflection.Extensions.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 544365585de319b73b4d902877400dde19ea86b1..191b1a32775670695ba97816f3c5595cc4dba390 100644 (file)
     <AssemblyName>System.Reflection.Primitives</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index ee500e52ecbdc726ce75a1352b9925cd4d64e5cf..2ddef8d13b8f1726b841fb1c10ea8c57ede8c655 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Reflection.Primitives.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 1538fdc3ab9c86e3d69a7ab33d5acd6bcb5ce046..01fb52b16199d49f5eceaf865619c27d5f45d607 100644 (file)
     <AssemblyName>System.Reflection.TypeExtensions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 155f59caeb1ee9235459c8b9593684b425223b61..bcc4bc697d56333c7907fb681c72e5a81386a230 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Reflection.TypeExtensions.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index d6f014e6235a03d12cfed2125df962111b2e9321..02d3b087f26b8702865d6e9057816ec1709d42b4 100644 (file)
     <AssemblyName>System.Reflection</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 3061a268a236132b4ab3e97479b4cd5a6f55d090..78492b6396754a74ff985fe47f932161c5af7084 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Reflection.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 4bc21f494164b60d42116001e4d16cc5b50e56bc..eb9c2104837f24c487d9a31e0f98ced9ca4f15ad 100644 (file)
     <AssemblyName>System.Resources.ReaderWriter</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index e2795e40f7d39338970d51e1603db8126eb12771..c8c1215b15f1d1971164f46cf5013d70fd6e7b64 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Resources.ReaderWriter.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index b174eb183caf9893b8d481487500cfdf71483fc1..12d69ad137edcade52c1c700372b0f1b36522396 100644 (file)
     <AssemblyName>System.Resources.ResourceManager</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 15f241e4091c0ca1bbc9533964eeec76f904aa8e..a54293846a3c86b4e9d61a0826a61c10e9c107e7 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Resources.ResourceManager.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 10dcc8707091b49bf64f548ecdf3d8939624b2f7..e1b105b8ce734bfb064348430229334cc3dc43e8 100644 (file)
     <AssemblyName>System.Runtime.CompilerServices.VisualC</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 6f7f15c612e98df05db8f54e26515c807767901c..6658273fff46609d799bfc0ac720419efdb92ecd 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.CompilerServices.VisualC.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 7c8fc2cd824dc1d3d5d20e48b09023ebfbf6df01..ce7e1089bbff146a73f42898f5f41d3f2e63988f 100644 (file)
     <AssemblyName>System.Runtime.Extensions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 70fd8c9330577b0c140791d38ccf5a615110ce01..3331d195d56c89d42c4d7b4077f3df87f79a8dc1 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.Extensions.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 4985e3821983bcc5ec8e4eca9a29c1452c9ed76f..98cb44511feb712c01d823e8f7df683f5e381906 100644 (file)
     <AssemblyName>System.Runtime.Handles</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index db800c29abf056babb2ba8c8ee077d8f93a9bf94..f323de6a290876509dcc5f5e011ce3d48ffeddb1 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.Handles.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index c281126d6a5a393d28f7aa678ea0824b0e79c329..194c785659bb0e7d1031c548e8ca8498d0c6be58 100644 (file)
     <AssemblyName>System.Runtime.InteropServices.RuntimeInformation</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index fe76e860baae4b28b3d64e4d1af2e7a2eb99b108..b8d2105de845ef98ccbb718c444e2a8fe3835fbf 100644 (file)
@@ -11,8 +11,8 @@ LIBRARY = System.Runtime.InteropServices.RuntimeInformation.dll
 
 RESX_RESOURCE_STRING = ../../../../external/corefx/src/System.Runtime.InteropServices.RuntimeInformation/src/Resources/Strings.resx
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699,436
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699,436
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) /unsafe
 
index 3b6ca78d08eae5b4c0b9f69f1e08d2e389e0cc1a..ee07679781a7ff872c5834d9fd74f2a807d4de43 100644 (file)
     <AssemblyName>System.Runtime.InteropServices.WindowsRuntime</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 1aaf02e2fc58c6d2334902e8acb610e1df459464..b17d1819e61ee28719471b950a77cd60de92e9fd 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.InteropServices.WindowsRuntime.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 207d7c267c3d29581a2ec2887a401dcd31ab20bf..c405c1849750d2081d0665b0a576242472b45274 100644 (file)
     <AssemblyName>System.Runtime.InteropServices</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index dd20654dcd3a4675f21e4d31e77ab535d64f180b..57253668eb1cfdd3cf1b0e944b67ab51cff0bf2f 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.InteropServices.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 46af65f9f1e8f6712c7b1634ea7d81c9fd1a7bae..6a8f55e93048d8e2e80d11fb2f7ff9e9eea2dcd7 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.Loader.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) /unsafe
 
index a0ea76cee6d7fe44e1a9778951c114f1c15084be..b2a7b570b797305fa072729104127d3c09d14a0d 100644 (file)
     <AssemblyName>System.Runtime.Numerics</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 57867bb26a13f9894d1fe689fb82339f35a94af3..165769dd72ad311f9ce8f79c87e967c77aebb342 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.Numerics.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Numerics
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index a8c237d1da41b47e446ecd30301c0bddca514184..e139de49ce4b4d8b85309110eb0fe2cfd8f282f5 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.Serialization.Formatters.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 61e3f91f4b10af337c131571ca167c6ca992f61e..49cdf197a7cc9a1a0d5d4dfee2be78f8eeda24cc 100644 (file)
     <AssemblyName>System.Runtime.Serialization.Json</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index b5ca5ce40b28333fc7b1d16bc3772b22cdbe537c..a0f4f29a48fd0bd9a1fbd1ae88aecab5914cb4fa 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.Serialization.Json.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Runtime.Serialization
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index f214b0101419ec8485eb8ea66ab19026c53724d7..b7972c920a2f7d899bda3d72fcd7dc354ff99822 100644 (file)
     <AssemblyName>System.Runtime.Serialization.Primitives</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 3a2519549fc638191e38dad30136d69222edbd3a..6b245e862d215c588664b025917cada3755f9262 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.Serialization.Primitives.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Runtime.Serialization
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 51c22d64dbb4f970cbe7d2f3fb2b23282f186ca7..83fe9066784228a010bca2ab53824394e4d2e213 100644 (file)
     <AssemblyName>System.Runtime.Serialization.Xml</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 1314e94f39d484616a65c08ba57297e6246479c9..b1ac8e4fa89501cea6985da2772741a1b41a3aad 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.Serialization.Xml.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Runtime.Serialization System.Xml Facades/System.Runtime.Serialization.Primitives
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index e51e118e0bbffdc6bced46d4a63c9b68c5f3abb8..650a456e26f2fc1653f4dfc2a5741babc4b2db07 100644 (file)
     <AssemblyName>System.Runtime</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index e8ab4049a267a27e87f64c2f7668058c18d67e5b..4add1cf8a8cdf5d79546b8f3f36789ac740ed96d 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Runtime.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.ComponentModel.Composition System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 256460c7750e0ca74a21df98ea61a1eed2022c21..36056b13ea2286a8959609fbedf3fe184cc4fa0a 100644 (file)
     <AssemblyName>System.Security.AccessControl</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 5c6ad1c09ecffa7c0aad056d7828a93449bf3610..ee11a9e1b428665bea3e33da64f2585e558ead1d 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.AccessControl.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 7ee19adfcae255bb4639384e31ea0b4e8e7e4c33..afb96de2c549068f8ae6fb735bd3653689b65385 100644 (file)
     <AssemblyName>System.Security.Claims</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 36ff76137bace6f96b5ca5552a5439e4f57235f6..0878fb2b9e092099beca7fbfc13c1e0cb10b2fa7 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Claims.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 1e9fe3afde347b828f1b606ecf44ed51892fae10..e8b8f94c854e9162532d5b58571f5553d3a3b21e 100644 (file)
     <AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index e65ee83c7ab30a2f44656292ed9f44752a5c7e76..e7340a15c494253ae64ea44c07eb99fcd89fcbe5 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Algorithms.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 4912aa302c08dfdca4b63200d1e21fc697b27449..dbe16f2bc330d6c367dad1f4936631fbd266355b 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Cng.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 91d09321a61e736881d3263a10535a3d15d2d47b..b2de0bab841d332a0ed9aaf9392888d20663444a 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Csp.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index a6c4943908676e23a729b3659ab5b6bf94fe0b17..2cf1134a8c5b7b88f6ec0818c8f9cc6dedfdca01 100644 (file)
     <AssemblyName>System.Security.Cryptography.DeriveBytes</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 4988d34843d478cb1ac0c81001090c141349d195..96f9c3f75d5e0e0deedbfc675418536d6f78e8ee 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.DeriveBytes.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 02bec2c1236529ef85f4658ea85fa3c234600a89..cb176437a12c095ba78f3ebad116b5c1d18a1c8d 100644 (file)
     <AssemblyName>System.Security.Cryptography.Encoding</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 71d37e200e0d5a4f8c55a0f64eb805898bcb2918..48dbf670bb4be748184974319b4976a79f24767f 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Encoding.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 40a840ed0659d864543e1a9fe52ce1137ce914b2..97e0914751414b8aea034c6070e50b0d1a82358a 100644 (file)
     <AssemblyName>System.Security.Cryptography.Encryption.Aes</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 0598a53f1d492c67996b709b6a8fbdf5d423152e..b1aa2c7b69f9f5b3b03e89f98b89d625fef633cb 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Encryption.Aes.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 38aee7588ee9e585bf25c33d0dafca83b4132c5d..8fa87165fb067955e7a2a97d8f1f87a2f5813a5c 100644 (file)
     <AssemblyName>System.Security.Cryptography.Encryption.ECDiffieHellman</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 03e69f1f95ae0e0e097336d9145814392b64978c..5c9fb92bc3430f1be0a4f2ec09837981b78df8b4 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Encryption.ECDiffieHellman.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 0dbd786a0c0c31b9b42ceba0af3952f16c41de24..cd756908e674e96bc574bc4a8c70811682a368a7 100644 (file)
     <AssemblyName>System.Security.Cryptography.Encryption.ECDsa</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 08e99941082c8f1c4bf6531a99da34dfa9b62543..dba6dbf2eadc5cc06e2c1c635ae8405e9cc2735e 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Encryption.ECDsa.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 6c741dad982c14f89f187eae9bf0bcafbbf0188f..49a1749342767bef43f5a03540f5b380f8db1d2b 100644 (file)
     <AssemblyName>System.Security.Cryptography.Encryption</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 0e8b16442809185da2b5cbbd1360e5d6179ef6d7..9b390318385a78dd0f651a9de357437d702803cf 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Encryption.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index b4caca412c7a4ec4016f0912b58163a778b4da2d..78460a0b3dc1887d9e11292240bd20fd60e48520 100644 (file)
     <AssemblyName>System.Security.Cryptography.Hashing.Algorithms</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 45dad5331da23e4452f0c252b3a388870f1eb3c4..3f93566e6ef85bc06e5a92fd346b330ee56340d2 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Hashing.Algorithms.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index ae3ea15a8a1349b7143429c69c0cacd1fc6e15d8..27bc36a040bb9d2e3219535f955b5c34516e7bb6 100644 (file)
     <AssemblyName>System.Security.Cryptography.Hashing</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 9df5800609b98319608e55b58dd3b6579ff61ba9..c93063093a59bbd526eb901737df9092036472ad 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Hashing.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index dd0cdefc6f58c0e3299ff36b06f6b80ad7606dcc..84f6c2d338b8a40d02717a57935387f020a84aa9 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.OpenSsl.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Core Facades/System.Security.Cryptography.Algorithms
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index b98a24269bed13945cde06e29f265df4bd002c63..4c2bd4ec1ac75689c09de2e04ef6dd4a1af47cc2 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Pkcs.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Security
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 33aa42767b971e7b62b5f5a9a1cb6719eb1e3ffe..9587c7efbaa452d3130583e725f8269cb3f5d143 100644 (file)
     <AssemblyName>System.Security.Cryptography.Primitives</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index b4c114a7e1caf0417a82714f2691b65c26aa5c8d..ba7b52bb016b43ccbd0f1bbbdf47cd5d5ead7b31 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.Primitives.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 16db89901e072daf7720b3c6512e0a99f56cc9fb..7a9e6bd36383b08de765d6466edb54ac1ea4999b 100644 (file)
     <AssemblyName>System.Security.Cryptography.ProtectedData</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 1cdbf1de8f3decb38ad50b6f289edf3d0ecdece2..9f883f43a8252950e6973dab3c2c3de1d0a2bb4e 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.ProtectedData.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Security
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index ad4fb101c05c2db302029cee8013aaeb3bb37f2c..1a3ce296391f6a8bb114c24aa1668a858605aa9a 100644 (file)
     <AssemblyName>System.Security.Cryptography.RSA</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index ea7df7a042ad62c9639d3c530aa08f154aeb648d..53cd128022eb6272aec91fcd746817404d8c919d 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.RSA.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index eec3bccff4120d11edd1d1bc0d50a3b52adce044..c30809254d71aa2406083810081e91b7d6dc0e88 100644 (file)
     <AssemblyName>System.Security.Cryptography.RandomNumberGenerator</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 2ffcdbc236f40d94b2eeb61092344223b2c593e0..6eb8586c9b4cf82d9b3b8e08b1af1fa64c1b347b 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.RandomNumberGenerator.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 0b53fe2c0e1f370afaa62dfd14afb10221b96f1e..9bd0764a207caaa7552efe1085c1d3211746ddc1 100644 (file)
     <AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 8b01e585ecba504d93a2d1a4bd423c4c50dacaaf..f68880eb5d1da8865879c9325386d4dc0bdb3869 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Cryptography.X509Certificates.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 1efe852f3b23f1853108159ccdd3126341ca18b3..a532d634c7d098067e3b2fcc6d56f2f46e9311ae 100644 (file)
     <AssemblyName>System.Security.Principal.Windows</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index a287f05cb84ff339c878bdd67fed4c535bcff718..5532e363317d93a600bbdd76103ca7fdff4019cc 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Principal.Windows.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 13fab9c374d46f69e82fdd05af1e1184a360cc07..d0a68fbeb3289c0cf9638b97c2285d21f75cf15b 100644 (file)
     <AssemblyName>System.Security.Principal</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 1a1265a0e0571e49dac2d921ebeb481e2f287253..63c51293e1be7a6c5c4a79c72dd7ae2783b64d9b 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.Principal.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index a454180512f8baf1153771008d45e1700e3a245f..fe27051e21ac7e70d3a532a241457c7fd97ecaf3 100644 (file)
     <AssemblyName>System.Security.SecureString</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 0569f621974fbf469b5148d5f814caefbeb7aea6..c195a70652a4818f13ef34dba1bfe316fc10a4ba 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Security.SecureString.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 2d4865c8e9e1d53e8e3dc3bd8a0ce0a1b64178cd..e3b00882a76e7afbe0ba0519e128dab1ade1fc53 100644 (file)
     <AssemblyName>System.ServiceModel.Duplex</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index a8f568f78b58b0c2fa004f9c5efa73db345a3b76..1d0ba06cb32636338b14efb0fbfdf90317416d81 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ServiceModel.Duplex.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.ServiceModel
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 352f2ba2841c180cb6cbc24c9e9c53266703c207..3a422854b14b5dbfa55a9159be95e15911f0191f 100644 (file)
     <AssemblyName>System.ServiceModel.Http</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 05f7925c2c66740a9ee27f12489d9e2e73fc10a8..260ea217d5888181b293ce7ff85423ce921254ec 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ServiceModel.Http.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.ServiceModel
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 3ca0084a508c0a3e191d687c0725e525392fdd42..be8116c0ef1fa7e46b8f0eed908766b075158da1 100644 (file)
     <AssemblyName>System.ServiceModel.NetTcp</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index f0af8c7dc6088864b77f302a9f60619ba3cb9170..283865ebe99dcc8023f1da43f6e015bbc90dbb80 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ServiceModel.NetTcp.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.ServiceModel
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 1fea3306ae83191df3777ea390ab0ba39f26bde5..050d4f109c7384c582db0f21c19cbe3f3dd85d81 100644 (file)
     <AssemblyName>System.ServiceModel.Primitives</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index dde66a181cf7cce8a18898e4fcec87e71c5ca3bd..14d3275d71743e1761afe4bc2d1a744ec9e86e28 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ServiceModel.Primitives.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.ServiceModel System.Xml System.IdentityModel Facades/System.Security.Cryptography.X509Certificates
 
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
index 85cc67d2406dae34502191259fb548ea0796aadd..ab2adc59efac4da275bdb0cf18f053675d13b710 100644 (file)
     <AssemblyName>System.ServiceModel.Security</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index f68beafd26e7bb4b12b0d47624ee46a3e4babc93..15823300d31d283727bb92f51519c69995700de9 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ServiceModel.Security.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.ServiceModel
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 2f7e92495a3232a5949ff3cff205a5fad5e37a16..49b45c859d1658d6c0405ab8ea0d088f9d5d30c5 100644 (file)
     <AssemblyName>System.ServiceProcess.ServiceController</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index fe6edb861f243350862241c72bc293d517f30973..ecd265aa685f90a5fe29d486ee3bfd734e15693a 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ServiceProcess.ServiceController.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 
 ifneq (2.1, $(FRAMEWORK_VERSION))
index e75b731268873eecb351375f52e97e4caf146182..bb224b784f43ac0559a898d2acd7b374f9839e03 100644 (file)
     <AssemblyName>System.Text.Encoding.CodePages</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 3c678ee54f79b3d041ffb587dd4ab90c7ed5edd9..a6298e86969455a6eb95664d76705e8a3c383af3 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Text.Encoding.CodePages.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 91b881c993ab76b40ba4931d26d48811a2a3cbdb..ebbeac5e1b349e6a83cd9e09d5f5b8abe5974e3c 100644 (file)
     <AssemblyName>System.Text.Encoding.Extensions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index e851968fdb46f4ea5872733d58708af28e99f521..bb30affbf5109f51271be80dcb9d96532ab1ce7e 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Text.Encoding.Extensions.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index b2a9439b4bc4be7b923c43317235de76bfb0ec0e..5794d0667e1fe5d8e8d8618a74293e8191f4b43d 100644 (file)
     <AssemblyName>System.Text.Encoding</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index fdfff71849704bb266a05fbd0132cba0818a7080..d25143a8dc5416ee19a193c61b581d5df1ae77aa 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Text.Encoding.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 3b69d3865013a46b1bc2431885daa331a0b7d073..da65e3f79ad71fbcedbb8f690c555825097ad514 100644 (file)
     <AssemblyName>System.Text.RegularExpressions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index b345b0d5dcd484cb273644a2f97f5527a1e15200..a02563fdacaebe9f33896f3463c47efc0ada91b4 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Text.RegularExpressions.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 92fa1fef1acfa27f3b1375bbc1fbf44295dbde42..1d0492f9a5258877bbcab5333b5dd78b67bbcc89 100644 (file)
     <AssemblyName>System.Threading.AccessControl</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index a5de66c999827fa2f60998ed9448505878d30238..1339538dad0084309adabb009989da28d43000d9 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Threading.AccessControl.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 7f8846bcbbd703ce13e0abcda993b2046e1b9f19..a9dd68dffd51b53c80d62a50b91e8d3c9a943d20 100644 (file)
     <AssemblyName>System.Threading.Overlapped</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 44d534b1843689eeca0caa4251761b63662db264..2d4a6318f0728ace188014edde4fef42042ac7c6 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Threading.Overlapped.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 445460e1b69c6297492dbec8a75132660339d767..84374b1c55cbfad3edb7ea50e5c2902121db2dfb 100644 (file)
     <AssemblyName>System.Threading.Tasks.Parallel</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 7e350f61c2acd2c8ae208c847eb2e76a22427d3d..53d59c867f2b85d8eb249cb3ac0cef7bb6c86a44 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Threading.Tasks.Parallel.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
 PLATFORM_DEBUG_FLAGS =
index 549c992132742a2746381c6c30877c0c3cf8b6ec..17c863709d2b909da583f0ecef8f4a20e2cda301 100644 (file)
     <AssemblyName>System.Threading.Tasks</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index deea2c66a8a2cb9ddec8ba6e75ffeb52203f6af2..953f111a8045c8be9b121289eaaa54c59b91cbbf 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Threading.Tasks.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 7407b4da2f2f411f466c1f76b5a4af3b6e37ef17..36554ee5e12852344c48e47fa29212a94f387d87 100644 (file)
     <AssemblyName>System.Threading.Thread</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index cc0bb96aa06b08bbbfa65e9c5b331bafd5a80571..da4f03883ff9c3aa38d5e1338a3be4fa2c16b19d 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Threading.Thread.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index b5b67e6b3a3aa46634d8856578df810099623e88..2d512f4547982ecdd24b4348601eaba265b5c057 100644 (file)
     <AssemblyName>System.Threading.ThreadPool</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 604a88c87e7065f9427cf4e430610963436abe7e..97bcfb54cb45f9e58454613b5f3d86e56f1d044c 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Threading.ThreadPool.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index dcdd20aaea038cb7ed1512985aecdd55af90766f..7f3f1a1530d0a646652f17a1bd75347e4b108fe7 100644 (file)
     <AssemblyName>System.Threading.Timer</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 5ab3f8409016c7442859ec1cb18d8ebd38b8347e..33e5fb3af3a791fe6ebee263c6d6b342afb8e3f3 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Threading.Timer.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 7bfe5e55b86fa8570b9a3076dbb5ac77a5702b09..67a1cc4aab6ff4ab8dc24fa792054266c50eca85 100644 (file)
     <AssemblyName>System.Threading</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index b6b5c4cd67b94f12e4fe086238d094da6917ff56..7fce19b89a69a8d10ecfd8a79ad22a8e2de7bca1 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Threading.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Core
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 49cd3b9d110ccf04066f65544230bddcce8bc181..59d6ffcbe794b37a8c92002dd4c4947c3cc03117 100644 (file)
     <AssemblyName>System.ValueTuple</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../Open.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index b8c4fda38693a69ddf2c1de1fcd370b1811c186b..7fc177c6aaf19594008d68aa5b85aacdd00d7346 100644 (file)
@@ -9,9 +9,9 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.ValueTuple.dll
 
-KEY_FILE = ../../Open.snk
-LIBRARY_SNK = $(KEY_FILE)
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../Open.snk
+LIBRARY_SNK = $(KEYFILE)
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = 
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 3f39bef0a737d2be6b706e3f39e7c7e8c29d71d4..a55a827a1ab05757bfbc494a1544eb2782aacfeb 100644 (file)
     <AssemblyName>System.Xml.ReaderWriter</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 27f820f582efa014841e2520d00d2bf79d5fdd0d..1a55d74db4d26193d5cac66632a898b3d6a3868b 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Xml.ReaderWriter.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Xml
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index b92554702db0f5b52b28fb19c3a32485b9d31848..d27a4d1e90d28d1916df7372787b405e38009554 100644 (file)
     <AssemblyName>System.Xml.XDocument</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 79eaaf4424997ed36fae1a6e2819ff5f82446db0..92c55d47cf70d289a45f3478485cf19dea3a1228 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Xml.XDocument.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Xml.Linq System.Xml
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 6f5f76880ade02a854dd52899aad9e81e506148c..2ec12c2ad1adc50b344eb9955049805f597aa8f7 100644 (file)
     <AssemblyName>System.Xml.XPath.XDocument</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 36a3de971bd933879a05d8aed0bb6e52e3262dca..90037087ee5e290d79361a6e6156ce1e979ddc8f 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Xml.XPath.XDocument.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Xml System.Xml.Linq
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 38259e63b52a3774b85f50747c0a3f7c57f3f6f7..ec55218d410858441453750747019702c4efa1a5 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Xml.XPath.XmlDocument.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Xml
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 5cd3307de44a06dbca493e5821e4bdf38c379a2a..b0d265fcf72fb5ecbafd25034b2e5576465f56f5 100644 (file)
     <AssemblyName>System.Xml.XPath</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 7a7ebf6de9d82973eadd8dac53399cf398d5630f..201a9057c25ffa88c93be2ddc2bc1e0f8b99aff0 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Xml.XPath.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Xml
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 5008d66c53a925ed3199543357a0f5728562f718..322ab3d58360c87c54235782b92592708658ecc9 100644 (file)
     <AssemblyName>System.Xml.XmlDocument</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 8628579f2f12557479e7a490377ff041f4506371..5322e9bf477f1cb97f572f6fc26070c3dd503673 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Xml.XmlDocument.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Xml
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index fa17b4bd1a51ece5470c5f81c26feba8a48288e1..8313c8cc67baff243843f271f8b4df3f5d9476a4 100644 (file)
     <AssemblyName>System.Xml.XmlSerializer</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index f8c09af8c35d9f2ceaf74aac97f3f9f0c2d6afa1..2be46b395b9fc526decfab8d5004696239e1ab2a 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Xml.XmlSerializer.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System.Xml
 LIB_MCS_FLAGS = $(SIGN_FLAGS) 
 
index 0cfbfe2416cf92b41b40f42581f8b176d76af9a6..41fe59f56e439631aa19493891293139e8eb4cee 100644 (file)
     <AssemblyName>System.Xml.Xsl.Primitives</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index abddd14886e03137b45f4bc0b9b742496446bfcc..11d787512db09e8b3cb370203aaa1904d141f4da 100644 (file)
@@ -9,8 +9,8 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = System.Xml.Xsl.Primitives.dll
 
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+KEYFILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /nowarn:1616,1699
 LIB_REFS = System System.Xml
 LIB_MCS_FLAGS = $(SIGN_FLAGS)
 
index 653422ce248355fec01ed7be147ecada0deb4a89..c4a00306639bb65ff843c28aa618d977f7bef3b0 100644 (file)
     <AssemblyName>netstandard</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../Open.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 1ea58dbfe7ed182399300530df9b25ce8c25db15..d664a0a1c00369a1992bc04918f1365311eeb2c8 100644 (file)
@@ -9,9 +9,9 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
 
 LIBRARY = netstandard.dll
 
-KEY_FILE = ../../Open.snk
-LIBRARY_SNK = $(KEY_FILE)
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 /nowarn:618
+KEYFILE = ../../Open.snk
+LIBRARY_SNK = $(KEYFILE)
+SIGN_FLAGS = /delaysign /nowarn:1616,1699 /nowarn:618
 LIB_REFS = System System.Xml System.Xml.Linq System.Runtime.Serialization System.Core System.Numerics System.Numerics.Vectors System.Net.Http System.Transactions \
 System.IO.Compression System.Data System.ComponentModel.Composition System.IO.Compression.FileSystem Facades/System.Runtime.InteropServices.RuntimeInformation \
 Facades/System.Security.Cryptography.Algorithms Facades/System.Globalization.Extensions Facades/System.Data.Common \
index d27db9ad22c89870ad0b40c15977f3ae47169505..0059c4d71ca40b46c4b870a65300fbd5399de230 100644 (file)
@@ -27,5 +27,4 @@ using System.Runtime.InteropServices;
 */
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../../mono.pub")]
 
index 63383128515be86aa8786ae7c6dd2bc9b3698ac2..eb7fb38ccbd0978b7d7ccc34b3a24a4669389671 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>I18N.CJK</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e5b85c14f00e175c866a1a4669d514a8218accaa..f4edf52eea32ed8acebfb9c933e3584779d47ccd 100644 (file)
@@ -4,6 +4,7 @@ include ../../../build/rules.make
 
 LIBRARY = I18N.CJK.dll
 LIB_REFS = I18N
+KEYFILE = ../../mono.pub
 LOCAL_MCS_FLAGS = /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE
 TEST_LIB_REFS = I18N
 
index 1f0b0ca92fa75f63c4862404b7c29c4e578c9af4..f34db0baf828d23bb91f0cde55ebd878e075ee99 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>I18N</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index b68973bdc26d306d50fbd3015329e547b33519f3..232eff09a5bf8f1054186866c2b6b6ac53c6794c 100644 (file)
@@ -3,6 +3,7 @@ SUBDIRS =
 include ../../../build/rules.make
 
 LIBRARY = I18N.dll
+KEYFILE = ../../mono.pub
 LOCAL_MCS_FLAGS = /unsafe /define:DISABLE_UNSAFE
 NO_TEST = yes
 
index 0f88c4e21f035b5bc7b3f1f53b9768415494c7a8..dfc780c18cec93a66d0545f0929bc9c6d1ecb891 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>I18N.MidEast</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 1872c831e58291d947e74991686bf28cee8764ff..1fa7d0533d3dd676a1656c646e06cea44da2cd7b 100644 (file)
@@ -4,6 +4,7 @@ include ../../../build/rules.make
 
 LIBRARY = I18N.MidEast.dll
 LIB_REFS = I18N
+KEYFILE = ../../mono.pub
 LOCAL_MCS_FLAGS = /unsafe
 TEST_LIB_REFS = I18N
 
index 1ff19d800f4725620069cb9875659e1d88cd2da8..54f9226e215a16ffc83629e0942ead79e3c0695b 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>I18N.Other</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 47fac195ad91e2e7fc8153446f289c74d2aa8260..3107ad6aa8a9b0156753127688902aaeb60b7e30 100644 (file)
@@ -4,6 +4,7 @@ include ../../../build/rules.make
 
 LIBRARY = I18N.Other.dll
 LIB_REFS = I18N
+KEYFILE = ../../mono.pub
 LOCAL_MCS_FLAGS = /unsafe
 NO_TEST = yes
 
index 89a4a6c1cb9acd1fff1e8d1e32974d83191d788a..f87ef9d162042d2ccd4ab1c0f6100a3967247cc0 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>I18N.Rare</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index f558e20e555a7ac67077770c20b82913d4743ef6..acbb6351c2b7d07238d67b85984e93b761e4153c 100644 (file)
@@ -4,6 +4,7 @@ include ../../../build/rules.make
 
 LIBRARY = I18N.Rare.dll
 LIB_REFS = I18N
+KEYFILE = ../../mono.pub
 LOCAL_MCS_FLAGS = /unsafe
 NO_TEST = yes
 
index 6ec89b129ef30475845a9a64b8b935110eed673e..3a394a6eaa5f4f96bea6503215fb5a7a6b0c5ef6 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>I18N.West</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index bc4b2386188478bf070d57a2a90973b2a6b08cc7..1a2e72ea219c115256e13b8f2f220ca10b3224ad 100644 (file)
@@ -4,6 +4,7 @@ include ../../../build/rules.make
 
 LIBRARY = I18N.West.dll
 LIB_REFS = I18N
+KEYFILE = ../../mono.pub
 LOCAL_MCS_FLAGS = /unsafe
 #NO_TEST = yes
 
index 0f1574450253245eea1435f2279956495d690b56..e2710ffa0979218553a105acc03fbd9c25ba28be 100644 (file)
@@ -50,4 +50,3 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyVersion("1.0.0.0")]\r
 \r
 [assembly: AssemblyDelaySign (true)]\r
-[assembly: AssemblyKeyFile ("ibm.pub")]\r
index ef02ea56e178d7016e7d1d67458fc9b551a982a1..a534852df393c4625d367eceda272c797d170b18 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>IBM.Data.DB2</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>ibm.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 630df027785d0286fa1c729208e98a65a39d4a69..f95fea1fd71c3dd3ee787673446703834e1ad48a 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = IBM.Data.DB2.dll
 LIB_REFS = System System.Xml System.Data
+KEYFILE = ibm.pub
 LIB_MCS_FLAGS = /unsafe -warn:1
 NO_TEST = yes
 
index f3842e05b5dc60c504f42a0ea53636a97e9a942b..deb56a6554309e9ed504a288263452f1f5115987 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>ICSharpCode.SharpZipLib</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>SharpZipLib.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e61769c1e8662836a9903d304b42cdc982d3aea8..5de3a1a91f4c652b14ede4da4cefa59fd3862d44 100644 (file)
@@ -51,4 +51,3 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyVersion("4.84.0.0")]\r
 \r
 [assembly: AssemblyDelaySign(true)]\r
-[assembly: AssemblyKeyFile("SharpZipLib.pub")]\r
index bd64d2a4d66c7b991e6609fc8547288ec40a3bd3..c99cde5cbf994d886a7469331732d9f8b3f63b39 100644 (file)
@@ -6,6 +6,7 @@ LIBRARY = ICSharpCode.SharpZipLib.dll
 LIBRARY_SNK = SharpZipLib.key
 
 LIB_REFS = System System.Xml
+KEYFILE = SharpZipLib.pub
 LIB_MCS_FLAGS = -warn:1
 NO_TEST = yes
 EXTRA_DISTFILES = SharpZipLib.pub $(LIBRARY_SNK)
index 52cbf310891daa7c1124bb8fcceb2bab2214cfd6..9cbd593124c3187f489d6005c2546941e6cfadf6 100644 (file)
@@ -53,7 +53,6 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (XBuildConsts.FileVersion)]
 
index 57beae8643223d24f3562a06a326d7d369f0bda0..c8ce9a22816e616fc16821985b2377a69f57c6d4 100644 (file)
@@ -8,6 +8,7 @@ include $(XBUILD_DIR)/xbuild.make
 LIBRARY = Microsoft.Build.Engine.dll
 
 LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES)
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 TEST_MCS_FLAGS =
index a75eed7e3f17d46a2e6b9fad134e34cfa6fec15d..ecdf627658d765d13cb89537eb732bd0b280524b 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Microsoft.Build.Engine</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 2110fd06684c2117966507955dd17d6dcca8af40..24ee297d3cd23fc0498337b02556f8e684062851 100644 (file)
@@ -54,7 +54,6 @@ using System.Runtime.InteropServices;
 [assembly: Guid ("D8A9BA71-4724-481d-9CA7-0DA23A1D615C")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (XBuildConsts.FileVersion)]
 
index edd7cc2e8eb7477e19cadd28edf7e759084d932b..d1b0cd09382f1dd3545a3469ef27ae0ab80cff79 100644 (file)
@@ -8,6 +8,7 @@ include $(XBUILD_DIR)/xbuild.make
 LIBRARY = Microsoft.Build.Framework.dll
 
 LIB_REFS = $(PARENT_PROFILE)System
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 TEST_NUNITLITE_APP_CONFIG_RUNTIME=Test/test-config-file-$(PROFILE)
index d0697d937dface0194d861e6a978a150cb655b17..ef67c352b77b05dcf582ac9d656abe16e27f1908 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Microsoft.Build.Framework</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 172f71e95b97159af3a98418cf69032965ad7514..8e7c07d0e17cfefd359c55dc95092db35b2b9982 100644 (file)
@@ -54,6 +54,5 @@ using System.Runtime.InteropServices;
 [assembly: Guid ("E3D4D3B9-944C-407b-A82E-B19719EA7FB3")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (XBuildConsts.FileVersion)]
index a919129b083e53916526a0ea1316dc6f313f5771..b926ba9ff31ba170b40befddaa10da63bba1c9b0 100644 (file)
@@ -11,6 +11,7 @@ LIBRARY_NAME = Microsoft.Build.Tasks$(NAME_SUFFIX).dll
 
 LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(PARENT_PROFILE)System.Windows.Forms \
                        $(XBUILD_UTILITIES) $(XBUILD_FRAMEWORK) $(XBUILD_ENGINE) $(XBUILD_TASKS)
+KEYFILE = ../msfinal.pub
 
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = $(PARENT_PROFILE)System.Xml $(XBUILD_ENGINE) $(XBUILD_FRAMEWORK) $(XBUILD_TASKS) $(XBUILD_UTILITIES) $(PARENT_PROFILE)System.Core
index ad7ef10f01eb5fe12ba428018a9821b5b5507812..36932f8720ced420dbaf130d09e1ee0f0893f53e 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Microsoft.Build.Tasks.v4.0</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 5fb93ebdece3c440ab8df92eeb7bddf037f64929..2e9b394f1cc0c1cf43d25305bddc7a2f1bf44940 100644 (file)
@@ -54,7 +54,6 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (XBuildConsts.FileVersion)]
 
index 2c644346e2c34c2c75740bf4afe1b75e8a88ec8c..0a3f0d2ed47662454ee613193dc5b4fda871d8dd 100644 (file)
@@ -9,6 +9,7 @@ LIBRARY = Microsoft.Build.Utilities.dll
 LIBRARY_NAME = Microsoft.Build.Utilities$(NAME_SUFFIX).dll
 
 LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(XBUILD_FRAMEWORK)
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 TEST_RESX_RESOURCES = Test/Microsoft.Build.Utilities/Strings.resources
index a83cc152298ab33135eb1b0e72c87bce4f613cce..edc3805fcf30f2fcf04ef2e540be2fe38735f840 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Microsoft.Build.Utilities.v4.0</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e14ad00346ba08c4fba2f5724d6d3252a6f85758..8880058c371937cdfa9e2f288b1319d76609ecbe 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.Versioning;
 [assembly: ComVisible (false)]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (XBuildConsts.FileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index 47e9cf9ad41454df2b1fd684577509b0d82cc6b6..2dcbefdf7f93f09ca75f3d71def9f0fca89aba9f 100644 (file)
@@ -8,6 +8,7 @@ include $(XBUILD_DIR)/xbuild.make
 LIBRARY = Microsoft.Build.dll
 
 LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml Microsoft.Build.Engine Microsoft.Build.Framework
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = \
        /d:MICROSOFT_BUILD_DLL
 
index c6085e35735b7cc26ad04b636e04049ed5c138c4..ad94614138cc6aefb001826cd49f0ed855049f15 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Microsoft.Build</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 1bd8f7cdcbaf88dde996a02dc31fd948d1e134de..2ee7b66d6f6190694058ec84b1982d9c1bc2ce42 100644 (file)
@@ -81,35 +81,29 @@ namespace MonoTests.Microsoft.Build.Execution
                [Test]
                public void EndBuildWaitsForSubmissionCompletion ()
                {
-                       // Windows does not have useful sleep or alternative, so skip it
-                       bool is_windows = true;
-                       switch (Environment.OSVersion.Platform) {
-                       case PlatformID.Unix:
-                       case PlatformID.MacOSX:
-                               is_windows = false;
-                               break;
-                       }
                        string project_xml = string.Format (@"<Project DefaultTargets='Wait1Sec' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
   <Target Name='Wait1Sec'>
     <Exec Command='{0}' />
   </Target>
-</Project>", is_windows ? "powershell -command \"Start-Sleep -s 1\"" : "/bin/sleep 1");
+</Project>", Environment.OSVersion.Platform == PlatformID.Win32NT ? "powershell -command \"Start-Sleep -s 1\"" : "/bin/sleep 1");
                        var xml = XmlReader.Create (new StringReader (project_xml));
                        var root = ProjectRootElement.Create (xml);
                        root.FullPath = "BuildSubmissionTest.EndBuildWaitsForSubmissionCompletion.proj";
                        var proj = new ProjectInstance (root);
                        var bm = new BuildManager ();
                        bm.BeginBuild (new BuildParameters ());
-                       DateTime waitDone = DateTime.MinValue;
-                       DateTime beforeExec = DateTime.UtcNow;
+                       var waitDone = TimeSpan.MinValue;
+                       var sw = System.Diagnostics.Stopwatch.StartNew ();
                        var sub = bm.PendBuildRequest (new BuildRequestData (proj, new string [] { "Wait1Sec" }));
-                       sub.ExecuteAsync (delegate { waitDone = DateTime.UtcNow; }, null);
+                       sub.ExecuteAsync (cb => waitDone = sw.Elapsed, null);
                        bm.EndBuild ();
                        Assert.AreEqual (BuildResultCode.Success, sub.BuildResult.OverallResult, "#1");
-                       DateTime endBuildDone = DateTime.UtcNow;
-                       AssertHelper.GreaterOrEqual (endBuildDone - beforeExec, TimeSpan.FromSeconds (1), "#2");
-                       AssertHelper.GreaterOrEqual (waitDone, beforeExec, "#3");
+                       var endBuildDone = sw.Elapsed;
+                       AssertHelper.GreaterOrEqual (endBuildDone, TimeSpan.FromSeconds (1), "#2");
+                       AssertHelper.GreaterOrEqual (waitDone, TimeSpan.FromSeconds (1), "#3");
                        AssertHelper.GreaterOrEqual (endBuildDone, waitDone, "#4");
+                       AssertHelper.LessOrEqual (endBuildDone, TimeSpan.FromSeconds (2), "#5");
+                       AssertHelper.LessOrEqual (waitDone, TimeSpan.FromSeconds (2), "#6");
                }
                
                [Test]
index 6c7a223682f3bb80972c7f8da736527dde0b8c33..f3bf440699d7bd83b5a372df0f99cef4bc580bac 100644 (file)
@@ -53,7 +53,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: SecurityCritical]
 
index e22eae3e178f473dd09bb49d491bd12578c5a9d0..cb754267a9d2e4b8e6f76d95aba752ddd344e343 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = Microsoft.CSharp.dll
 
 LIB_REFS = System.Core System
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 RESX_RESOURCE_STRING = ../../../external/corefx/src/Microsoft.CSharp/src/Resources/Strings.resx
index 23ae9a50b56611c2076368a4504fef0d1d233ecd..68741561827cf40db724bddb41ff920529ae07b3 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Microsoft.CSharp</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\EXPRExtensions.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ExprFactory.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\EXPRFLAG.cs" />\r
-    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\FileRecord.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\FundamentalTypes.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\GlobalSymbolContext.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinderResult.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs" />\r
-    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\InputFile.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\LangCompiler.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookupResults.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Return.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Statement.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Temporary.cs" />\r
-    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\TypeArguments.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\TypeOf.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UnaryOperator.cs" />\r
-    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UnboundAnonymousFunction.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedConversion.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedLogicalOperator.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExpressionTreeRewriter.cs" />\r
index c8779956f39ef8786d805eb0ebab2c94922c5076..e80529c65344d14996c3ff4232732f6ebb696d67 100644 (file)
@@ -64,13 +64,11 @@ corefx/SR.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/EXPRExtensions.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExprFactory.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/EXPRFLAG.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/FileRecord.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/FundamentalTypes.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GlobalSymbolContext.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinder.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinderResult.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ImplicitConversion.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/InputFile.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/LangCompiler.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookup.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookupResults.cs
@@ -141,10 +139,8 @@ corefx/SR.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Return.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Statement.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Temporary.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/TypeArguments.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/TypeOf.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UnaryOperator.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UnboundAnonymousFunction.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UserDefinedConversion.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UserDefinedLogicalOperator.cs
 ../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Visitors/ExpressionTreeRewriter.cs
index c4b854bfd8f6eb9a9299f71d2162842bdc122c1d..b0889c45c1d4238aad97fef62ca16fa46df8892f 100644 (file)
@@ -12,15 +12,12 @@ partial class SR
        public const string BindPropertyFailedMethodGroup = "The name '{0}' is bound to a method and cannot be used like a property";
        public const string BindPropertyFailedEvent = "The event '{0}' can only appear on the left hand side of +";
        public const string BindInvokeFailedNonDelegate = "Cannot invoke a non-delegate type";
-       public const string BindImplicitConversionRequireOneArgument = "Implicit conversion takes exactly one argument";
-       public const string BindExplicitConversionRequireOneArgument = "Explicit conversion takes exactly one argument";
        public const string BindBinaryAssignmentRequireTwoArguments = "Binary operators cannot be invoked with one argument";
        public const string BindBinaryAssignmentFailedNullReference = "Cannot perform member assignment on a null reference";
        public const string NullReferenceOnMemberException = "Cannot perform runtime binding on a null reference";
        public const string BindCallToConditionalMethod = "Cannot dynamically invoke method '{0}' because it has a Conditional attribute";
        public const string BindToVoidMethodButExpectResult = "Cannot implicitly convert type 'void' to 'object'";
        public const string BadBinaryOps = "Operator '{0}' cannot be applied to operands of type '{1}' and '{2}'";
-       public const string IntDivByZero = "Division by constant zero";
        public const string BadIndexLHS = "Cannot apply indexing with [] to an expression of type '{0}'";
        public const string BadIndexCount = "Wrong number of indices inside []; expected '{0}'";
        public const string BadUnaryOp = "Operator '{0}' cannot be applied to operand of type '{1}'";
@@ -48,19 +45,14 @@ partial class SR
        public const string AssgReadonlyProp = "Property or indexer '{0}' cannot be assigned to -- it is read only";
        public const string AbstractBaseCall = "Cannot call an abstract base member: '{0}'";
        public const string RefProperty = "A property or indexer may not be passed as an out or ref parameter";
-       public const string ManagedAddr = "Cannot take the address of, get the size of, or declare a pointer to a managed type ('{0}')";
-       public const string FixedNotNeeded = "You cannot use the fixed statement to take the address of an already fixed expression";
        public const string UnsafeNeeded = "Dynamic calls cannot be used in conjunction with pointers";
        public const string BadBoolOp = "In order to be applicable as a short circuit operator a user-defined logical operator ('{0}') must have the same return type as the type of its 2 parameters";
        public const string MustHaveOpTF = "The type ('{0}') must contain declarations of operator true and operator false";
-       public const string CheckedOverflow = "The operation overflows at compile time in checked mode";
        public const string ConstOutOfRangeChecked = "Constant value '{0}' cannot be converted to a '{1}' (use 'unchecked' syntax to override)";
        public const string AmbigMember = "Ambiguity between '{0}' and '{1}'";
        public const string SizeofUnsafe = "'{0}' does not have a predefined size, therefore sizeof can only be used in an unsafe context (consider using System.Runtime.InteropServices.Marshal.SizeOf)";
-       public const string FieldInitRefNonstatic = "A field initializer cannot reference the non-static field, method, or property '{0}'";
        public const string CallingFinalizeDepracated = "Destructors and object.Finalize cannot be called directly. Consider calling IDisposable.Dispose if available.";
        public const string CallingBaseFinalizeDeprecated = "Do not directly call your base class Finalize method. It is called automatically from your destructor.";
-       public const string BadCastInFixed = "The right hand side of a fixed statement assignment may not be a cast expression";
        public const string NoImplicitConvCast = "Cannot implicitly convert type '{0}' to '{1}'. An explicit conversion exists (are you missing a cast?)";
        public const string InaccessibleGetter = "The property or indexer '{0}' cannot be used in this context because the get accessor is inaccessible";
        public const string InaccessibleSetter = "The property or indexer '{0}' cannot be used in this context because the set accessor is inaccessible";
@@ -80,18 +72,13 @@ partial class SR
        public const string MethGrpToNonDel = "Cannot convert method group '{0}' to non-delegate type '{1}'. Did you intend to invoke the method?";
        public const string RefConstraintNotSatisfied = "The type '{2}' must be a reference type in order to use it as parameter '{1}' in the generic type or method '{0}'";
        public const string ValConstraintNotSatisfied = "The type '{2}' must be a non-nullable value type in order to use it as parameter '{1}' in the generic type or method '{0}'";
-       public const string CircularConstraint = "Circular constraint dependency involving '{0}' and '{1}'";
-       public const string BaseConstraintConflict = "Type parameter '{0}' inherits conflicting constraints '{1}' and '{2}'";
-       public const string ConWithValCon = "Type parameter '{1}' has the 'struct' constraint so '{1}' cannot be used as a constraint for '{0}'";
        public const string AmbigUDConv = "Ambiguous user defined conversions '{0}' and '{1}' when converting from '{2}' to '{3}'";
        public const string PredefinedTypeNotFound = "Predefined type '{0}' is not defined or imported";
-       public const string PredefinedTypeBadType = "Predefined type '{0}' is declared incorrectly";
        public const string BindToBogus = "'{0}' is not supported by the language";
        public const string CantCallSpecialMethod = "'{0}': cannot explicitly call operator or accessor";
        public const string BogusType = "'{0}' is a type not supported by the language";
        public const string MissingPredefinedMember = "Missing compiler required member '{0}.{1}'";
        public const string LiteralDoubleCast = "Literal of type double cannot be implicitly converted to type '{1}'; use an '{0}' suffix to create a literal of this type";
-       public const string UnifyingInterfaceInstantiations = "'{0}' cannot implement both '{1}' and '{2}' because they may unify for some type parameter substitutions";
        public const string ConvertToStaticClass = "Cannot convert to static type '{0}'";
        public const string GenericArgIsStaticClass = "'{0}': static types cannot be used as type arguments";
        public const string PartialMethodToDelegate = "Cannot create delegate from method '{0}' because it is a partial method without an implementing declaration";
@@ -118,7 +105,6 @@ partial class SR
        public const string RefReadonlyStatic2 = "Fields of static readonly field '{0}' cannot be passed ref or out (except in a static constructor)";
        public const string AssgReadonlyLocalCause = "Cannot assign to '{0}' because it is a '{1}'";
        public const string RefReadonlyLocalCause = "Cannot pass '{0}' as a ref or out argument because it is a '{1}'";
-       public const string ThisStructNotInAnonMeth = "Anonymous methods, lambda expressions, and query expressions inside structs cannot access instance members of 'this'. Consider copying 'this' to a local variable outside the anonymous method, lambda expression or query expression and using the local instead.";
        public const string DelegateOnNullable = "Cannot bind delegate to '{0}' because it is a member of 'System.Nullable<T>'";
        public const string BadCtorArgCount = "'{0}' does not contain a constructor that takes '{1}' arguments";
        public const string BadExtensionArgTypes = "'{0}' does not contain a definition for '{1}' and the best extension method overload '{2}' has some invalid arguments";
@@ -131,4 +117,5 @@ partial class SR
        public const string BadNamedArgumentForDelegateInvoke = "The delegate '{0}' does not have a parameter named '{1}'";
        public const string DuplicateNamedArgument = "Named argument '{0}' cannot be specified multiple times";
        public const string NamedArgumentUsedInPositional = "Named argument '{0}' specifies a parameter for which a positional argument has already been given";
+       public const string TypeArgumentRequiredForStaticCall = "The first argument to dynamically-bound static call must be a Type";
 }
index e95d06e151dcc77d6604eadb3f92b36c296daf7a..c6b2a0b65dbefb578282ee35b92b325bd72bc479 100644 (file)
@@ -48,5 +48,3 @@ using System.Resources;
 */
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
-
index 5d38210947f1d5370be2d19a2b626f56450c890e..26661e4955af37e1f36559dcdcbd1eb9ffb21067 100644 (file)
@@ -4,7 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = Microsoft.VisualC.dll
 LIB_REFS = System
-LIB_MCS_FLAGS =
+KEYFILE = ../msfinal.pub
+
 NO_TEST = yes
 
 include ../../build/library.make
index 672511162a60992afdee7dfc2aec977e2e7ed9f3..29b07b3ae9193f499037cd75e39b51e0a9d32bc5 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Microsoft.VisualC</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 4b6ac0cc4726ba45cdf55fb587f1617de3ba88c8..c2731485dde0c2523801849885d60f3392f133c4 100644 (file)
@@ -48,4 +48,3 @@ using System.Security;
 [assembly: AssemblyTitle ("Microsoft.Web.Infrastructure")]
 [assembly: AssemblyDescription ("")]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../winfx.pub")]
index d02caf9c02f388869a7e75de8ed2e8c216e70c32..edf1ff0755ac78bc171f4d961055232f3cd0bdc7 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Microsoft.Web.Infrastructure.dll
 LIB_REFS = System System.Configuration System.Web
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS =
 
 EXTRA_DISTFILES = $(RESOURCE_FILES)
index a3f15cbac3cc37992d431926bff2b7554ae92b35..1ee471ea376cc249d4811e8ba010d8a9e8bf3e22 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Microsoft.Web.Infrastructure</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 8819cc76d6ad9269638e6b3f1265c03dce8ebd52..699440bf3fc256275fca3b1477e0889362530bd7 100644 (file)
     <AssemblyName>Mono.Btls.Interface</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index b9e028c43328b35dd25a76fee3ac244b26761e06..0ee82c0a990848ec8aed2c38f54fbfcb6af31fab 100644 (file)
@@ -76,6 +76,4 @@ using System;
 //       documentation for more information on this.
 //
 [assembly: AssemblyDelaySign(true)]
-[assembly: AssemblyKeyFile("c5.pub")]
-
 [assembly: CLSCompliant(true)]
index c5f80e37114cd2d05a90a1ff92d7ee561a8d1422..7be812689ec73fdcf970a4ff5d1d66ec9211ec11 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = Mono.C5.dll
 LIBRARY_SNK = c5.snk
 LIB_REFS = System
+KEYFILE = c5.pub
 LIB_MCS_FLAGS = -nowarn:169,219,414,1030,3001,3005,3006
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
 
index fc68a856d2d4d4f4894e283703d3fb4c2db9aff7..adb32867c3ca0c10ccb90916096550a91bf8c0f9 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.C5</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>c5.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 541e803c2ac60c241b65ae768c7de13ed89f6a97..5e4912d0152de07b9f9fe316694929c52a38c089 100644 (file)
@@ -53,7 +53,6 @@ using System.Runtime.InteropServices;
 //[assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile ("../mono.pub")]
 
 [assembly: ComVisible (false)]
 
index 75c6a5309434019e186f6fb5af9e838bdedf4423..7b1986b78e5014ebcb585cec7014d1babe2e7a07 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = Mono.CSharp.dll
 
 LIB_REFS = System.Core System.Xml System
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS =
 
 ifdef AOT_FRIENDLY_PROFILE
index b833cdd0bc006c9bef1e2fcaefad0b3d7184e9ab..b7d2587e54faccf0483b5713ae3a8967bb1f2bca 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.CSharp</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e0a477c14807ad23154aef3c9e5f9665bb5346c8..d13b68d5543198d45e94ab0d65754eedc1734d72 100644 (file)
@@ -10,7 +10,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>\r
     <RootNamespace>Mono.CSharp</RootNamespace>\r
     <AssemblyName>Mono.CSharp</AssemblyName>\r
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
+    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
     <FileUpgradeFlags>\r
     </FileUpgradeFlags>\r
     <Compile Include="..\Mono.CompilerServices.SymbolWriter\SourceMethodBuilder.cs">\r
       <Link>SourceMethodBuilder.cs</Link>\r
     </Compile>\r
+    <Compile Include="..\..\mcs\tuples.cs">\r
+      <Link>tuples.cs</Link>\r
+    </Compile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
   <PropertyGroup>\r
     <PreBuildEvent>"$(ProjectDir)..\..\jay\jay" -cvt &lt; "$(ProjectDir)..\..\jay\skeleton.cs" "$(ProjectDir)..\..\mcs\cs-parser.jay" &gt; "$(ProjectDir)cs-parser.cs"</PreBuildEvent>\r
   </PropertyGroup>\r
-</Project>
+</Project>\r
index 47aee14e4c57d9f357f359f3ce70ca1d1b1a5ec1..97f9e047e6d543afa711984aed41eac9e3260ecb 100644 (file)
@@ -125,5 +125,11 @@ namespace MonoTests.EvaluatorTest
                        object res = Evaluator.Evaluate ("attr.GetType().Name;");
                        Assert.AreEqual ("A", res);
                }
+
+               [Test]
+               public void EnumType ()
+               {
+                       Evaluator.Run ("public class TestClass { private TestEnum _te; public string Get() { return _te.ToString(); } } public enum TestEnum { First, Second }");
+               }
        }
 }
\ No newline at end of file
index d28fb41bb8034bab77b191ff3f624a3072e82776..2a29b82315d004d725a5aa5d87b247fd5c9d127b 100644 (file)
@@ -48,5 +48,4 @@ using System.Runtime.InteropServices;
 */
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
 
index dda9fe920e3d5f909b74422f1d5d14f0090c1f7f..eaad983d6f022e04898bff89e018d056b31da6fb 100644 (file)
@@ -3,6 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = Mono.Cairo.dll
+KEYFILE = ../mono.pub
 #LIB_MCS_FLAGS = -d:CAIRO_1_2
 NO_TEST = yes
 
index 12511cebf7550899c4399b5d9d2228fa7b609e6e..faf57690f4b7590f48c1f02b148420ad0ef54376 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Cairo</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 970bf331e3e275ab03859d763064d5767a3867d8..63cbdbcfbb0ecaa44bbad878193c4ca327175d38 100644 (file)
     <AssemblyName>Mono.Cecil.Mdb</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../mono.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 24ffdf3bef30216631b3d66bdee454317d416a04..9d892bda3080adc426f4faf14d0a4b07800d7134 100644 (file)
     <AssemblyName>Mono.Cecil</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../mono.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 91b1067b15a867865301415cbeb219419ce2ea86..932a54ba64ae8e44b0a14221e5a198cadeb72aac 100644 (file)
@@ -53,4 +53,3 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile ("../mono.pub")]
index af71c42f65cfa62051c5f868ecbfa4101709fa1c..5c2a816ba1e0667b37d27e6c912a984371ca6e07 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = Mono.CodeContracts.dll
 
 LIB_REFS = System System.Core Mono.Cecil Mono.Cecil.Mdb
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = -nowarn:618
 
 TEST_MCS_FLAGS =
index dd6412200e4a63754c4b6cc20ae6294a64c0b754..846f7869a75118e9282c2a05528f39a48c533fa3 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.CodeContracts</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 87b442c59bd806564e016c121c11be9e14fdc592..86d979b29e723a6986213efc1af01bcc6643c69b 100644 (file)
@@ -48,5 +48,4 @@ using System.Runtime.InteropServices;
 */
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
 
index d30779ce7f13af8b685c1f04fa764222a1556c86..0c116da9d19d584ef57a413f2df529b8821398d0 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.CompilerServices.SymbolWriter.dll
 LIB_REFS = System
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS =
 
 NO_TEST = yes
index ea78a73873830cf89f2889641e2ec813657c66c3..40691be6e49d03e6cf3db3c7b5ae7bdaf9f68249 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.CompilerServices.SymbolWriter</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index a1c13b6fbd98cfd10d8014f56b260c86a9c53dc5..30f1b233209dcd16bde4919d880dd584bf04528a 100644 (file)
@@ -57,4 +57,3 @@ using System.Runtime.ConstrainedExecution;
 #endif
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
index 35eb5c1bb817dd6868bb67a56c04783756f440be..bde698a46eec305df0ae49cfc8dfddb7c477c61c 100644 (file)
@@ -11,6 +11,7 @@ PREBUILT = $(RESX_RESOURCES:=.prebuilt)
 
 LIBRARY = Mono.Data.Sqlite.dll
 LIB_REFS = System System.Data System.Transactions System.Xml
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = /unsafe \
        $(RESOURCES:%=-resource:%) -d:SQLITE_STANDARD
 
index fc2106e9f4dac8b79dff09106a7ca13fef35c90d..6ccaf6beb17fe2a938799912d0a2136e9603a258 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Data.Sqlite</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e06154cd236d29f4ae10704010f4cc9a7b63d9cd..0059c4d71ca40b46c4b870a65300fbd5399de230 100644 (file)
@@ -27,5 +27,4 @@ using System.Runtime.InteropServices;
 */
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
 
index f1764c2282bff00b3e63a2fbdf97489cb93e5f22..6a265b8dd965711af7c4af6ba081d8690f263668 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Data.Tds.dll
 LIB_REFS = System System.Xml Mono.Security
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS =
 
 TEST_MCS_FLAGS =
index 596e8f1231b267e4cbc2638abbfeec147092cc18..facf9bd018ddc43cb591379db3c9cbe1edd34126 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Data.Tds</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e2fa98dcebe04e7629af935ed7847e9df90bfd16..5e926275772e8c6cb44d5418ebdecd3dbb75754d 100644 (file)
@@ -5,7 +5,8 @@ LIBRARY = Mono.Debugger.Soft.dll
 LIBRARY_SNK = ../mono.snk
 
 LIB_REFS = System Mono.Cecil System.Core
-LIB_MCS_FLAGS = /unsafe -D:MONO_DATACONVERTER_STATIC_METHODS -keyfile:$(LIBRARY_SNK) /publicsign
+LIB_MCS_FLAGS = /unsafe -D:MONO_DATACONVERTER_STATIC_METHODS /publicsign
+KEYFILE = $(LIBRARY_SNK)
 
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = Mono.Cecil System System.Core
index 335da43a8cb893ec1d985739c6f9219c87e00d46..37889b8b0352b801a7e14ba069396ca2f6e74d80 100644 (file)
     <AssemblyName>Mono.Debugger.Soft</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../mono.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index f4c03dc360cf35100416c045e2a188f2752ce364..96c277d1e61d5ade6a3a6965eed9e04b1b89ce4f 100644 (file)
@@ -41,4 +41,3 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCopyright("(c) 2003 Various Authors")]
 
 [assembly: AssemblyDelaySign(true)]
-[assembly: AssemblyKeyFile("../mono.pub")]
index f3801411afa27024cb3d2cb3624f384c2d951fa8..dd0047afa2a0ad7ea48ead22febcd2b8030cb4bf 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Http.dll
 LIB_REFS = System System.Xml System.Web ICSharpCode.SharpZipLib Mono.Security
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = -nowarn:618
 
 NO_TEST = yes
index 491ba8f8008c80373be0ae00e2c2a20445ed99f6..3c0b06458460a6b09748122025f8fc1dbdfdbfcc 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Http</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 87b442c59bd806564e016c121c11be9e14fdc592..86d979b29e723a6986213efc1af01bcc6643c69b 100644 (file)
@@ -48,5 +48,4 @@ using System.Runtime.InteropServices;
 */
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
 
index 5b7c92c5e4d83a7d3474efdee4fac9bf7e0722e9..4aba679060d76886aab97073feb5215188f11bc4 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = Mono.Management.dll
 
 LIB_REFS = System Mono.Posix
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS =
 NO_TEST = yes
 
index f7622dce595fdd673e238d167c009476935a2f0f..bd2cc206a9c84c47da77ebaf512ddad2b623455a 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Management</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index f167ef96de735d6b81f231d775922cfda0253592..0ac9e258846c0a2e83101079fcf8ebb4d58a764f 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 
 [assembly: CLSCompliant (false)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../mono.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index 67f382812d8c76d0d99be3a27a3070dd84cd578e..9a3b3007f13c7056e0b758df15836858b63d6bf3 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Messaging.RabbitMQ.dll
 LIB_REFS = System System.Messaging Mono.Messaging RabbitMQ.Client
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = -nowarn:618
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
index 853bf41c9d2bb83e1d283bffe27813dbd68494f6..49b38c9bfa4a44b86c9ae111818f555a45325a24 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Messaging.RabbitMQ</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 0f202bfc01126a76442c90f4c1f062b295f26f3c..4e27c0ab23429c78965db62d9a2274c95ad931f4 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../mono.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index 7788dfb60c89ec9946a89124b1f377312d4edd94..7eef3a9aa2a86045f822ab7c61075ab86515dd0b 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = Mono.Messaging.dll
 
 LIB_REFS = System System.Configuration
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS =
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
index 4fd7385a11bfae99e470a7c1235778e5d80d133d..9f678461d37ed0b0bd10a6357d3e6f1d97c0d667 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Messaging</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index fa9c43f3772ba53d9680f444a899db68a8beddc1..16cf07ae5d6b45ff629436f7be37912d2b64fa80 100644 (file)
@@ -48,5 +48,4 @@ using System.Security.Permissions;
 )]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
 
index af1350df5b02c4100d85eb5eedd26bd63daee06d..cf83d944572e67c5456644b9d533ded0968e70b9 100644 (file)
@@ -8,6 +8,7 @@ LIBRARY_PACKAGE = none
 NO_INSTALL = yes
 
 LIB_REFS = System
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS =
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = Mono.Posix System System.Core
index be6a8bf7d93514a617daeeb684b60480abb6a5e2..57ed07325a3fe9035ec75b37c00588fa621b5ffc 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Options</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 83267087b61076ea050e9981f69bd6d1a4d4b33e..c67214a83469e9bde0a296c547a071e5209e64c5 100644 (file)
@@ -15,4 +15,3 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion (Consts.FxVersion)]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
index 75b5aff640be5ba18b2bd66e09a27292166e1f0e..9a97ff305e542c4a876c177e8d7ba6cf097ea8c0 100644 (file)
@@ -2,12 +2,13 @@ thisdir = class/Mono.Parallel
 SUBDIRS = 
 include ../../build/rules.make
 
+LIB_REFS = System.Core System
+LIB_MCS_FLAGS = -d:INSIDE_MONO_PARALLEL
+KEYFILE = ../mono.pub
+
 LIBRARY = Mono.Parallel.dll
 
 include ../../build/library.make
 
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = System.Core
-
-LIB_REFS += System.Core System
-LIB_MCS_FLAGS += -d:INSIDE_MONO_PARALLEL
index 917621cbd2ef52eaa4474873b190d963dd0e78ef..19905379653ea6881398d41ddadf02fea5a41e4a 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Parallel</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index ce6b749678d9c5c296dcef1ea33bf45f7021dfe3..d5e0ea66d786399623428346094234ec33bb936c 100644 (file)
@@ -58,7 +58,6 @@ using System.Security.Permissions;
 #if !MONO_POSIX_NETSTANDARD_BUILD
 // We are using ../Open.snk for MONO_POSIX_NETSTANDARD_BUILD
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
 #endif
 /*
  * TODO:
index 10d14fc45edf0aee2674b538db53dcf7fefb8274..15b9c0cf2dbde8859f81766c1de1f2268de5d630 100644 (file)
@@ -6,6 +6,7 @@ LIBRARY = Mono.Posix.dll
 # Don't warn about [Obsolete] members, as there are now *lots* of [Obsolete]
 # members, generating volumes of output.
 LIB_REFS = System
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = /unsafe /nowarn:0618,612
 TEST_MCS_FLAGS = /unsafe /nowarn:0219,0618
 TEST_LIB_REFS = Mono.Posix System
index 8a186a782d8ae42bfe982e3208990fc314b07f65..19fd6ed12acc9ea090cc4b59934cb060598566ca 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Posix</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 1f860ab0eb4b71852d130766d4313467be9ac6bc..282c92d766516648f8d2eb7337f96e91e734395d 100644 (file)
@@ -5,7 +5,8 @@ LIBRARY = Mono.Profiler.Log.dll
 LIBRARY_SNK = ../mono.snk
 
 LIB_REFS = System System.Core
-LIB_MCS_FLAGS = /unsafe /keyfile:$(LIBRARY_SNK) /publicsign
+KEYFILE = $(LIBRARY_SNK)
+LIB_MCS_FLAGS = /unsafe /publicsign
 
 NO_TEST = yes
 
index 3e6883a1207c54daea18e8645709e582de9dea47..64d0b98530a114aab92c91d46a6ad65f9284fb61 100644 (file)
     <AssemblyName>Mono.Profiler.Log</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../mono.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -67,8 +63,8 @@
     <Compile Include="Mono.Profiler.Log\LogEventVisitor.cs" />\r
     <Compile Include="Mono.Profiler.Log\LogException.cs" />\r
     <Compile Include="Mono.Profiler.Log\LogProcessor.cs" />\r
+    <Compile Include="Mono.Profiler.Log\LogProfiler.cs" />\r
     <Compile Include="Mono.Profiler.Log\LogReader.cs" />\r
-    <Compile Include="Mono.Profiler.Log\LogRuntimeProfiler.cs" />\r
     <Compile Include="Mono.Profiler.Log\LogStream.cs" />\r
     <Compile Include="Mono.Profiler.Log\LogStreamHeader.cs" />\r  </ItemGroup>\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
index bfb0fea4fed677f224858316c34d9385fd981bcf..27b58318f270e2455b5216ce3dcf0c91af7c5bf5 100644 (file)
@@ -8,7 +8,7 @@ Mono.Profiler.Log/LogEventVisitor.cs
 Mono.Profiler.Log/LogEvents.cs
 Mono.Profiler.Log/LogException.cs
 Mono.Profiler.Log/LogProcessor.cs
+Mono.Profiler.Log/LogProfiler.cs
 Mono.Profiler.Log/LogReader.cs
-Mono.Profiler.Log/LogRuntimeProfiler.cs
 Mono.Profiler.Log/LogStream.cs
 Mono.Profiler.Log/LogStreamHeader.cs
index f34cafe07e0965869ac7281573b6059d65f37f14..9772f224ff6cb7c1a9a2915906f3c8ff944e04cc 100644 (file)
@@ -17,7 +17,6 @@ namespace Mono.Profiler.Log {
                Heap = 6,
                Sample = 7,
                Runtime = 8,
-               Coverage = 9,
                Meta = 10,
 
                AllocationNoBacktrace = 0 << 4,
@@ -64,11 +63,6 @@ namespace Mono.Profiler.Log {
 
                RuntimeJitHelper = 1 << 4,
 
-               CoverageAssembly = 0 << 4,
-               CoverageMethod = 1 << 4,
-               CoverageStatement = 2 << 4,
-               CoverageClass = 3 << 4,
-
                MetaSynchronizationPoint = 0 << 4,
        }
 
@@ -171,17 +165,13 @@ namespace Mono.Profiler.Log {
 
        // mono/metadata/profiler.h : MonoProfilerGCEvent
        public enum LogGCEvent {
-               Begin = 0,
-               MarkBegin = 1,
-               MarkEnd = 2,
-               ReclaimBegin = 3,
-               ReclaimEnd = 4,
-               End = 5,
                PreStopWorld = 6,
+               PreStopWorldLocked = 10,
                PostStopWorld = 7,
+               Begin = 0,
+               End = 5,
                PreStartWorld = 8,
                PostStartWorld = 9,
-               PreStopWorldLocked = 10,
                PostStartWorldUnlocked = 11,
        }
 
@@ -199,4 +189,20 @@ namespace Mono.Profiler.Log {
                WorldStop = 1,
                WorldStart = 2,
        }
+
+       // mono/metadata/profiler.h : MonoProfilerSampleMode
+       public enum LogSampleMode {
+               None = 0,
+               Process = 1,
+               Real = 2,
+       }
+
+       // mono/profiler/log.h : MonoProfilerHeapshotMode
+       public enum LogHeapshotMode {
+               None = 0,
+               EveryMajor = 1,
+               OnDemand = 2,
+               Milliseconds = 3,
+               Collections = 4,
+       }
 }
index 129a1284bf3e8c1e7ee6ffd58e217ba14709fe47..b49416cd2c1fa45dedf0bcec699f9949acab177d 100644 (file)
@@ -174,22 +174,6 @@ namespace Mono.Profiler.Log {
                {
                }
 
-               public virtual void Visit (AssemblyCoverageEvent ev)
-               {
-               }
-
-               public virtual void Visit (ClassCoverageEvent ev)
-               {
-               }
-
-               public virtual void Visit (MethodCoverageEvent ev)
-               {
-               }
-
-               public virtual void Visit (StatementCoverageEvent ev)
-               {
-               }
-
                public virtual void Visit (SynchronizationPointEvent ev)
                {
                }
index 8bdd5d7ab59b9adfd721ec97bb574b9c3ec42379..113bf3edc114f13313c3e079d61c7ba78dc18420 100644 (file)
@@ -531,86 +531,6 @@ namespace Mono.Profiler.Log {
                }
        }
 
-       public sealed class AssemblyCoverageEvent : LogEvent {
-
-               public string AssemblyName { get; internal set; }
-
-               public Guid Guid { get; internal set; }
-
-               public string FileName { get; internal set; }
-
-               public long NumberOfMethods { get; internal set; }
-
-               public long FullyCovered { get; internal set; }
-
-               public long PartiallyCovered { get; internal set; }
-
-               internal override void Accept (LogEventVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-
-       public sealed class ClassCoverageEvent : LogEvent {
-
-               public string AssemblyName { get; internal set; }
-
-               public string ClassName { get; internal set; }
-
-               public long NumberOfMethods { get; internal set; }
-
-               public long FullyCovered { get; internal set; }
-
-               public long PartiallyCovered { get; internal set; }
-
-               internal override void Accept (LogEventVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-
-       public sealed class MethodCoverageEvent : LogEvent {
-
-               public string AssemblyName { get; internal set; }
-
-               public string ClassName { get; internal set; }
-
-               public string MethodName { get; internal set; }
-
-               public string MethodSignature { get; internal set; }
-
-               public string FileName { get; internal set; }
-
-               public ulong MetadataToken { get; internal set; }
-
-               public long MethodId { get; internal set; }
-
-               public long NumberOfStatements { get; internal set; }
-
-               internal override void Accept (LogEventVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-
-       public sealed class StatementCoverageEvent : LogEvent {
-
-               public long MethodId { get; internal set; }
-
-               public long RelativeILOffset { get; internal set; }
-
-               public ulong Counter { get; internal set; }
-
-               public long Line { get; internal set; }
-
-               public long Column { get; internal set; }
-
-               internal override void Accept (LogEventVisitor visitor)
-               {
-                       visitor.Visit (this);
-               }
-       }
-
        public sealed class SynchronizationPointEvent : LogEvent {
 
                public LogSynchronizationPoint Type { get; internal set; }
index 09e5dca088f15ab973b868a24e8ff1e795f7dccb..5afdbbeb4eb237e0dc0d0c3ac1bf45558dd991b3 100644 (file)
@@ -483,47 +483,6 @@ namespace Mono.Profiler.Log {
                                default:
                                        throw new LogException ($"Invalid extended event type ({extType}).");
                                }
-                       case LogEventType.Coverage:
-                               switch (extType) {
-                               case LogEventType.CoverageAssembly:
-                                       return new AssemblyCoverageEvent {
-                                               AssemblyName = Reader.ReadCString (),
-                                               Guid = Guid.Parse (Reader.ReadCString ()),
-                                               FileName = Reader.ReadCString (),
-                                               NumberOfMethods = (long) Reader.ReadULeb128 (),
-                                               FullyCovered = (long) Reader.ReadULeb128 (),
-                                               PartiallyCovered = (long) Reader.ReadULeb128 (),
-                                       };
-                               case LogEventType.CoverageMethod:
-                                       return new MethodCoverageEvent {
-                                               AssemblyName = Reader.ReadCString (),
-                                               ClassName = Reader.ReadCString (),
-                                               MethodName = Reader.ReadCString (),
-                                               MethodSignature = Reader.ReadCString (),
-                                               FileName = Reader.ReadCString (),
-                                               MetadataToken = Reader.ReadULeb128 (),
-                                               MethodId = (long) Reader.ReadULeb128 (),
-                                               NumberOfStatements = (long) Reader.ReadULeb128 (),
-                                       };
-                               case LogEventType.CoverageStatement:
-                                       return new StatementCoverageEvent {
-                                               MethodId = (long) Reader.ReadULeb128 (),
-                                               RelativeILOffset = (long) Reader.ReadULeb128 (),
-                                               Counter = Reader.ReadULeb128 (),
-                                               Line = (long) Reader.ReadULeb128 (),
-                                               Column = (long) Reader.ReadULeb128 (),
-                                       };
-                               case LogEventType.CoverageClass:
-                                       return new ClassCoverageEvent {
-                                               AssemblyName = Reader.ReadCString (),
-                                               ClassName = Reader.ReadCString (),
-                                               NumberOfMethods = (long) Reader.ReadULeb128 (),
-                                               FullyCovered = (long) Reader.ReadULeb128 (),
-                                               PartiallyCovered = (long) Reader.ReadULeb128 (),
-                                       };
-                               default:
-                                       throw new LogException ($"Invalid extended event type ({extType}).");
-                               }
                        case LogEventType.Meta:
                                switch (extType) {
                                case LogEventType.MetaSynchronizationPoint:
@@ -547,7 +506,7 @@ namespace Mono.Profiler.Log {
 
                long ReadObject ()
                {
-                       return Reader.ReadSLeb128 () + _bufferHeader.ObjectBase;
+                       return Reader.ReadSLeb128 () + _bufferHeader.ObjectBase << 3;
                }
 
                long ReadMethod ()
diff --git a/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogProfiler.cs b/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogProfiler.cs
new file mode 100644 (file)
index 0000000..688a84b
--- /dev/null
@@ -0,0 +1,262 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security;
+
+namespace Mono.Profiler.Log {
+
+       public static class LogProfiler {
+
+               static bool? _attached;
+
+               public static bool IsAttached {
+                       get {
+                               if (_attached != null)
+                                       return (bool) _attached;
+
+                               try {
+                                       GetMaxStackTraceFrames ();
+                                       return (bool) (_attached = true);
+                               } catch (Exception e) when (e is MissingMethodException || e is SecurityException) {
+                                       return (bool) (_attached = false);
+                               }
+                       }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static int GetMaxStackTraceFrames ();
+
+               public static int MaxStackTraceFrames {
+                       get { return GetMaxStackTraceFrames (); }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static int GetStackTraceFrames ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetStackTraceFrames (int value);
+
+               public static int StackTraceFrames {
+                       get { return GetStackTraceFrames (); }
+                       set {
+                               var max = MaxStackTraceFrames;
+
+                               if (value < 0 || value > max)
+                                       throw new ArgumentOutOfRangeException (nameof (value), value, $"Value must be between 0 and {max}.");
+
+                               SetStackTraceFrames (value);
+                       }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static LogHeapshotMode GetHeapshotMode ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetHeapshotMode (LogHeapshotMode value);
+
+               public static LogHeapshotMode HeapshotMode {
+                       get { return GetHeapshotMode (); }
+                       set {
+                               if (!Enum.IsDefined (typeof (LogHeapshotMode), value))
+                                       throw new ArgumentException ("Invalid heapshot mode.", nameof (value));
+
+                               SetHeapshotMode (value);
+                       }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static int GetHeapshotMillisecondsFrequency ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetHeapshotMillisecondsFrequency (int value);
+
+               public static int HeapshotMillisecondsFrequency {
+                       get { return GetHeapshotMillisecondsFrequency (); }
+                       set {
+                               if (value < 0)
+                                       throw new ArgumentOutOfRangeException (nameof (value), value, "Value must be non-negative.");
+
+                               SetHeapshotMillisecondsFrequency (value);
+                       }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static int GetHeapshotCollectionsFrequency ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetHeapshotCollectionsFrequency (int value);
+
+               public static int HeapshotCollectionsFrequency {
+                       get { return GetHeapshotCollectionsFrequency (); }
+                       set {
+                               if (value < 0)
+                                       throw new ArgumentOutOfRangeException (nameof (value), value, "Value must be non-negative.");
+
+                               SetHeapshotCollectionsFrequency (value);
+                       }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static int GetCallDepth ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetCallDepth (int value);
+
+               public static int CallDepth {
+                       get { return GetCallDepth (); }
+                       set {
+                               if (value < 0)
+                                       throw new ArgumentOutOfRangeException (nameof (value), value, "Value must be non-negative.");
+
+                               SetCallDepth (value);
+                       }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void GetSampleMode (out LogSampleMode mode, out int frequency);
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool SetSampleMode (LogSampleMode value, int frequency);
+
+               public static LogSampleMode SampleMode {
+                       get {
+                               GetSampleMode (out var mode, out var _);
+
+                               return mode;
+                       }
+               }
+
+               public static int SampleFrequency {
+                       get {
+                               GetSampleMode (out var _, out var frequency);
+
+                               return frequency;
+                       }
+               }
+
+               public static bool SetSampleParameters (LogSampleMode mode, int frequency)
+               {
+                       if (!Enum.IsDefined (typeof (LogSampleMode), mode))
+                               throw new ArgumentException ("Invalid sample mode.", nameof (mode));
+
+                       if (frequency < 1)
+                               throw new ArgumentOutOfRangeException (nameof (frequency), frequency, "Frequency must be positive.");
+
+                       return SetSampleMode (mode, frequency);
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool GetExceptionEvents ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetExceptionEvents (bool value);
+
+               public static bool ExceptionEventsEnabled {
+                       get { return GetExceptionEvents (); }
+                       set { SetExceptionEvents (value); }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool GetMonitorEvents ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetMonitorEvents (bool value);
+
+               public static bool MonitorEventsEnabled {
+                       get { return GetMonitorEvents (); }
+                       set { SetMonitorEvents (value); }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool GetGCEvents ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetGCEvents (bool value);
+
+               public static bool GCEventsEnabled {
+                       get { return GetGCEvents (); }
+                       set { SetGCEvents (value); }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool GetGCAllocationEvents ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetGCAllocationEvents (bool value);
+
+               public static bool GCAllocationEventsEnabled {
+                       get { return GetGCAllocationEvents (); }
+                       set { SetGCAllocationEvents (value); }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool GetGCMoveEvents ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetGCMoveEvents (bool value);
+
+               public static bool GCMoveEventsEnabled {
+                       get { return GetGCMoveEvents (); }
+                       set { SetGCMoveEvents (value); }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool GetGCRootEvents ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetGCRootEvents (bool value);
+
+               public static bool GCRootEventsEnabled {
+                       get { return GetGCRootEvents (); }
+                       set { SetGCRootEvents (value); }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool GetGCHandleEvents ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetGCHandleEvents (bool value);
+
+               public static bool GCHandleEventsEnabled {
+                       get { return GetGCHandleEvents (); }
+                       set { SetGCHandleEvents (value); }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool GetGCFinalizationEvents ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetGCFinalizationEvents (bool value);
+
+               public static bool GCFinalizationEventsEnabled {
+                       get { return GetGCFinalizationEvents (); }
+                       set { SetGCFinalizationEvents (value); }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool GetCounterEvents ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetCounterEvents (bool value);
+
+               public static bool CounterEventsEnabled {
+                       get { return GetCounterEvents (); }
+                       set { SetCounterEvents (value); }
+               }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static bool GetJitEvents ();
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void SetJitEvents (bool value);
+
+               public static bool JitEventsEnabled {
+                       get { return GetJitEvents (); }
+                       set { SetJitEvents (value); }
+               }
+       }
+}
diff --git a/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogRuntimeProfiler.cs b/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogRuntimeProfiler.cs
deleted file mode 100644 (file)
index 8ed0993..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.InteropServices;
-
-namespace Mono.Profiler.Log {
-
-       public static class LogRuntimeProfiler {
-
-               // TODO: Runtime profiler interface.
-       }
-}
index aa931ee9db789b334cb89012a555eff52bc07c37..25038b344bf3363f7474bd3f4b2c0ff8cd9ee5cb 100644 (file)
@@ -5,7 +5,6 @@ include ../../build/rules.make
 LIBRARY = Mono.Reactive.Testing.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Reactive.PlatformServices System.Reactive.Providers System.Reactive.Runtime.Remoting System.Reactive.Experimental System.Reactive.Windows.Forms System.Reactive.Windows.Threading System.Reactive.Observable.Aliases System.Windows.Forms WindowsBase nunitlite
 LIB_MCS_FLAGS = \
-               @more_build_args \
                -d:NUNIT -d:MONO -d:DESKTOPCLR
                # NO_PERF is required to disable ObservableMultipleTest.Catch_TailRecursive2 which blocked test execution.
                # disabled -d:HAS_WINFORMS
@@ -21,7 +20,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618
 
-EXTRA_DISTFILES = more_build_args
+EXTRA_DISTFILES =
 
 VALID_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef VALID_PROFILE
diff --git a/mcs/class/Mono.Reactive.Testing/more_build_args b/mcs/class/Mono.Reactive.Testing/more_build_args
deleted file mode 100644 (file)
index e69de29..0000000
index 3e9e490967457f28caf9fe289ac4a51cd771899d..ef215933c133764292d1f5a559090c881dc52fea 100644 (file)
@@ -32,4 +32,3 @@ using System.Runtime.InteropServices;
 
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
index 0797ae27094e7f961088909f458c66cbac20973a..3d44f96a57170513a0bccb98770e3d00c5df7a59 100644 (file)
@@ -3,6 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = Mono.Security.Win32.dll
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = /unsafe
 EXTRA_DISTFILES = README
 
index 89c646078968f6121217eb1cf1c67b56e1a21d14..eecb7af784412b46802fc9a507edb76c9612d432 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Security.Win32</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 0140af6ace88f044a4d032dd168f7d912a828c22..e9c4f87a6f5b9bbf5c8b7c165fa222d1530b0b4e 100644 (file)
@@ -52,7 +52,6 @@ using System.Runtime.InteropServices;
 [assembly: NeutralResourcesLanguage ("en-US")]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
 
 [assembly: InternalsVisibleTo ("System, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
 
index 6d62eca583d7d32776d05e4ac5d33e1458cd8500..abe9fe6ac42e84da92c17a2b4241c6d652dc198d 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = Mono.Security.dll
 LOCAL_MCS_FLAGS =
 LIB_REFS = bare/System
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = -unsafe -nowarn:1030,3009
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:169,219,618,672
 
index f4b4f9fbef94a542911711dc714fc9a2ed223038..3aed1008318cb46e5a3c11fda95fe2bf9de252fb 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Security</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index a1531139e4880db09b8108226dd22715ee78f92b..62b76bfd697988ab41df13aae162536419a4f44a 100644 (file)
@@ -56,4 +56,3 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../mono.pub")]
index 42f1432b07bb825c527f1d5488d6caaf0c6fd725..a0d7a20f575896074f8f202f8e9903d7810bfe4d 100644 (file)
@@ -7,6 +7,7 @@ RESOURCE_FILES = \
 
 LIBRARY = Mono.ServiceModel.IdentitySelectors.dll
 LIB_REFS = System System.Xml System.Configuration System.Security System.Transactions System.Web System.Web.Services Mono.Security
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = \
                /nowarn:414,169,67,3005,436 \
                /unsafe \
index 895aa8c707cb165e77236d48704740dc11b99b55..42591688b83ead6d68e19e83afedb195403beb92 100644 (file)
@@ -45,5 +45,4 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: AssemblyDelaySign(true)]
-[assembly: AssemblyKeyFile("../mono.pub")]
 [assembly: CLSCompliant(true)]
index d8e1e47414107bd6f95da97b4d1cf223d9f810cd..8fda9237ff5ac95824b2abedd1528c81e1f7e5f9 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Simd.dll
 LIB_REFS = System.Core
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = /unsafe
 
 NO_TEST = yes
index ad1dbdb5ca559f3d109fe96d70514f14bcb0f80c..dfa779bded93d6e8eefe03122f64dd3c558d0bff 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Simd</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index a461e90522fa5d0968d28d386d0a99dc9c4bfb62..6f95a487515bf9c7ad8215c03593a882fe991e40 100644 (file)
@@ -27,4 +27,3 @@ using System.Runtime.InteropServices;
 */
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
index 19a6cc1ceedadb434d7cdd26a96c0d514a12ce48..d9940e6ded877359e07959a8b631ffda544cb554 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.Tasklets.dll
 
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS =
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
index 999a173d4331e30a455d1bffe7120f12ac657808..c06082de92af17fa251ac87fe9d5d275b99a384d 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.Tasklets</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index fda8f30a49378ea999eeee66e4de99c8049bb134..f005b9d0076a33834f52241ae87d07933ae32d29 100644 (file)
@@ -15,4 +15,3 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 
 [assembly: AssemblyDelaySign(true)]
-[assembly: AssemblyKeyFile("../mono.snk")]
index d632681cdb089201dfef73752d32b323b6f38094..65b6d44df17dc40c39be6fb34bf5d600f355f574 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = Mono.WebBrowser.dll
 LIB_REFS = System
+KEYFILE = ../mono.snk
 LIB_MCS_FLAGS = -warn:1
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
index b7c3e8363ff47fdc5da534e4caf4901abde970f0..e703853d1e0d6396fa303444a7ae856d75e12ed2 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.WebBrowser</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 3effdb25f8ae376e89b88dfdce46a2b0d827e4f4..aa4123b46ad058c3ab728c1a7610354b0af0425e 100644 (file)
@@ -48,6 +48,5 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../mono.pub")]
 
 [assembly: AssemblyFileVersion (XBuildConsts.FileVersion)]
index 11f7b791c432538d4dfaff4ee48fd22745c6fe20..476b57f198232d3bf2cac113ee451c9471a5872c 100644 (file)
@@ -8,6 +8,7 @@ include $(XBUILD_DIR)/xbuild.make
 LIBRARY = Mono.XBuild.Tasks.dll
 
 LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Xml
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS =
 
 TEST_NUNITLITE_APP_CONFIG_RUNTIME=Test/test-config-file-$(PROFILE)
index 4263441391d220bcec72e147a857dc187372902d..a2b913f2ac813d3e0db428efc53cb5f3223208de 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Mono.XBuild.Tasks</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 30ef7fd99f7837a3ba90506c00ece0deb8b5ba70..0644fe75c268ad0d3871eaaad85888790e9b50f5 100644 (file)
@@ -56,4 +56,3 @@ using System.Runtime.InteropServices;
 [assembly: AllowPartiallyTrustedCallers]
 
 [assembly: AssemblyDelaySign(true)]
-[assembly: AssemblyKeyFile("../ecma.pub")]
index e7ac06790fb53969ee5264f120f45abf95affe33..dc49f816feeba56235a832c860389863722d57f0 100644 (file)
@@ -11,6 +11,7 @@ SCARY_LIB=/lib:$(prefix)/lib
 endif
 
 LIB_REFS = System System.Xml
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = $(SCARY_LIB) /unsafe
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
index 4f24b424a7f0f35cb1cc605534aacd209577b7ce..e7ffb40774ed7d4d40f17184359c2d1627056fa9 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = Novell.Directory.Ldap.dll
 
 LIB_REFS = System Mono.Security
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = -warn:1 -nowarn:612 
 
 RESOURCE_DEFS = ResultCodeMessages,Novell.Directory.Ldap.Utilclass/ResultCodeMessages.txt
index e37426a7250d3988099279b985a89e575941752e..294428a63a5c00c23a83406eccd5b83e7c06e4d5 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>Novell.Directory.Ldap</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index cba8084028dd5f008553d48ab2faa9f657fac88b..a524d953f335b689354a36e88b41535f3016b8cb 100644 (file)
@@ -64,5 +64,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion (Consts.FxVersion)]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
 
index a461e90522fa5d0968d28d386d0a99dc9c4bfb62..6f95a487515bf9c7ad8215c03593a882fe991e40 100644 (file)
@@ -27,4 +27,3 @@ using System.Runtime.InteropServices;
 */
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
index f303415ba6ddae5b83ededf702d4c221c01dd489..1a1c4cd83e630503de9eeb60d6e22280841723f5 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = PEAPI.dll
 LIB_REFS = System
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS = -nowarn:414,618
 NO_TEST = yes
 
index 3be35f6deb1d6e3541f89e589f51693bf0ec5380..be03c4c190ace344610de2670c60c54ecf2762bb 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>PEAPI</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 20dd16b85b7648db324be565597e90e816b0d033..8dcf85f974ba02c1a33f85abf43945193ef7170d 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>RabbitMQ.Client.Apigen</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e575e78b1fa92f9b9c281f01a21a6631f739dce8..645cb4ae8f48a98101185af33942b83fd0f6c376 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 
 //[assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../../../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index be9e284a176098b92388754523542f2deef630d3..82873f0983e6e4392161452b9f32ef83a77fefcf 100644 (file)
@@ -4,6 +4,7 @@ include ../../../../build/rules.make
 
 LIBRARY = RabbitMQ.Client.dll
 LIB_REFS = System System.Xml
+KEYFILE = ../../../msfinal.pub
 LIB_MCS_FLAGS = -nowarn:618
 NO_TEST = yes
 
index 6058fc91d76ddf5ffa1c4c321f2ae3a79f306a62..fc55f08b72b4c79c4f0262dd410a194568eda01f 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>RabbitMQ.Client</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../../../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index cc4970402d40d359f63a155d76cfc469b3348116..cf18876f4f1d9d5c0336d81eb8b4ed547181683f 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>SMDiagnostics</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index b5c914f72b1d4bcd136e50139a79607ff2857fa8..2ced9882dae0724423c086223251ab9bbdda7ec6 100644 (file)
@@ -10,6 +10,7 @@ ifndef NO_RESGEN
   RESOURCE_DEFS = Microsoft.Internal.Strings,src/ComponentModel/Strings.resx
 endif
 
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = -d:CLR40 -d:USE_ECMA_KEY,FEATURE_REFLECTIONCONTEXT,FEATURE_REFLECTIONFILEIO,FEATURE_SERIALIZATION,FEATURE_SLIMLOCK -nowarn:219,414 -nowarn:436
 
 
index cfcdae8e1d3c933d55e7970929d3fed17615287f..c4c2cf627f5e7720d4adf4cdcd094a857f61ea4f 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.ComponentModel.Composition</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index a1cceccbcd32a5a0ef45a4c04a37dc60011c8c2d..85e91c4f565e0453b9c095b33e261a8ac40d78d5 100644 (file)
@@ -53,7 +53,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile ("../ecma.pub")]
 
 [assembly: SecurityCritical]
 [assembly: AllowPartiallyTrustedCallers]
index 38ca8af332c3bba875bc9b1e18ac06cee80f7e74..b2d658bf3a4ffcd9d0b4c48e02b45fac034c51ba 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../winfx.pub")]
 
 [assembly: ComVisible (false)]
 [assembly: AllowPartiallyTrustedCallers]
index dacf6d719f780c98d515ab05d7ad5b2d991a5ede..53519907a9c81fe758911f3b815d13972109d04b 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.ComponentModel.DataAnnotations.dll
 LIB_REFS = System System.Core System.Data System.Xml
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS = -nowarn:414
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
index 1e8b64f12025f5d872ce6c71a81cb232b7510286..a1006040598618b2de413220731feb2da5a8ea02 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index c0b4d2807f1b93448cad8202addd2928d94168da..cc8817f8c11f335127e5cd039192dbb3bc5fbbe5 100644 (file)
@@ -56,7 +56,6 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: ComCompatibleVersion (1, 0, 3300, 0)]
index cc8b4f8e95c096df78e66cd908d2ec93d242a37a..612aa9cb9b27e10e425f050b815aed8d58e25169 100644 (file)
@@ -3,6 +3,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Configuration.Install.dll
 LIB_REFS = System System.Xml
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 NO_TEST = yes
index 704f78b48958bed4c60d8bd091cd04449188ed51..5ab112c541fc2faeea0cdf63728bb1fa46dc87f2 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Configuration.Install</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 49025b78c0939a5fbddfeb9b0260b666777e22a1..a850786fa2155dae12a77ac7fce09790a16194fb 100644 (file)
@@ -57,7 +57,6 @@ using System.Runtime.InteropServices;
 [assembly: AllowPartiallyTrustedCallers]
 
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: InternalsVisibleTo ("System.Web, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
index e6f48050a99ed2acf322ac2d6d3ce25cb37d1eab..918a4e9325e835d056617a4e91f2a16c8b0deac3 100644 (file)
@@ -7,6 +7,7 @@ LIBRARY = System.Configuration.dll
 
 LOCAL_MCS_FLAGS = 
 LIB_REFS = secxml/System bare/System.Xml System.Security
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = -nowarn:618
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = System.Xml System
index 1493011fb73a5731ed651efcb394c05722c9a654..5f2afcbbc6d8481f1aefc6df27a946280f032573 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Configuration</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index ac79cff1623b5bbdfb8b26248207ad598f7a864f..7ac0624eafbb769e621f89c5c99683a689c85782 100644 (file)
@@ -34,12 +34,10 @@ LIB_MCS_FLAGS += -d:FULL_AOT_RUNTIME
 endif
 
 ifneq (basic, $(PROFILE))
-CLR_PROFILE := $(filter 2.0 4.0 4.5, $(FRAMEWORK_VERSION))
-endif
-
-ifdef CLR_PROFILE
+ifneq (2.1, $(FRAMEWORK_VERSION))
 LIB_REFS += Mono.Posix
 endif
+endif
 
 CC_PROFILE := $(filter monotouch% xammac, $(PROFILE))
 ifdef CC_PROFILE
index 815237b62cf6c1bdc46a380e1bffe59048192d81..1e149ad2300ccc373c9e9d52125c7e95eb06f9fa 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System.Core</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 81c303bd09135b7184ab1f67e1af9c63e1dcde17..a61b9f66ca21450c3e4ead664da3f09cf0a5d7cf 100644 (file)
 
 namespace System.Security.Cryptography.X509Certificates
 {
-       public static class RSACertificateExtensions
+#if SYSTEM_SECURITY_DLL
+       internal
+#else
+       public
+#endif
+       static class RSACertificateExtensions
        {
                public static RSA GetRSAPrivateKey(this X509Certificate2 certificate)
                {
index 2d977b1dceb7f0dc826a913366142e1e3de72c2f..7fa4eb790eb13b399c6854b2e924e86caeaca182 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../ecma.pub")]
 
 [assembly: ComVisible (false)]
 [assembly: AllowPartiallyTrustedCallers]
index 9ece8d9c3bae6a11a03c7adb633312392641c2af..0e92b9ee3b4f6864edaeab170e22016ac3abe273 100644 (file)
@@ -7,6 +7,7 @@ LIBRARY = System.Data.DataSetExtensions.dll
 TXT_RESOURCE_STRINGS = ../referencesource/System.Data.DataSetExtensions/System.Data.DataSetExtensions.txt
 
 LIB_REFS = System.Core System System.Data System.Xml
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = -nowarn:436
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml)  -nowarn:219 -nowarn:169 $(NUNIT_RESOURCE_FILES:%=/resource:%)
index 7b365f29f24acc20991af351b103eb1f84d9712a..cc0e368b3257814d15785dc644cc6848c5ba3820 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Data.DataSetExtensions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 84393c411db6c485422fce22d2c2d595381bd45f..91b0367a88d6a4eeecbda1f1fad82d5154d53bb6 100644 (file)
@@ -61,7 +61,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile ("../ecma.pub")]
 
 [assembly: ComVisible (false)]
 
index b011913994e78e30479140cd4b0d202d5e258ebd..59e87ccac24335b448e58f3407a8d79e8fca5812 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Data.Entity.dll
 LIB_REFS = System System.Core System.Data System.Xml System.Xml.Linq System.Transactions System.Runtime.Serialization System.ComponentModel.DataAnnotations System.Configuration
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = -warn:2
 
 TXT_RESOURCE_STRINGS = ../referencesource/System.Data.Entity/System.Data.Entity.txt
index 0ee2c9fcae3140f515848f68ea823f57202f6f65..677eca3aeace02216d7db1201ce8975fed04e52b 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Data.Entity</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 15a844302220191ab9f40559dc756fa481bd7bc0..b55cdb9e3c5d44515cfa79c2a4cd18b328bc9eae 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Data.Linq.dll
 LIB_REFS = System System.Core System.Xml System.Data System.Runtime.Serialization
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = \
                /resource:./src/DbLinq/Schema/Dbml/DbmlSchema.xsd,DbLinq.Schema.Dbml.DbmlSchema.xsd \
                /d:MONO_STRICT /d:MONO_DEPLOY -warn:1
index 1d1d58e7658cae7eea13fc8409aff9148b8da403..872c8d77e77bfa28df819489bf6a5025dcefbc7a 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Data.Linq</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 04a391d4dfc3bc7e2437bdf97d637ec3824e18d5..16668d8ba8538de3cc01bc152ad34a8635411b83 100644 (file)
@@ -57,7 +57,6 @@ using DbLinq.Factory;
 [assembly: NeutralResourcesLanguage ("en-US")]\r
 [assembly: CLSCompliant (true)]\r
 [assembly: AssemblyDelaySign (true)]\r
-[assembly: AssemblyKeyFile ("../ecma.pub")]\r
 #endif\r
 \r
 [assembly: ComVisible (false)]\r
index befed69def888579578b8f6a8ca49aa3cf1e7b48..13bea782425e2c83a3db6fda2de69dc449bdbb38 100644 (file)
@@ -4,13 +4,9 @@ include ../../build/rules.make
 
 LIBRARY = System.Data.Linq.dll
 LIB_REFS = System System.Core System.Data System.Transactions System.Xml
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS =
 
 NO_TEST = yes
 
-ifeq (2.0, $(FRAMEWORK_VERSION))
-# This is a .NET 3.5 only assembly, but built during the 2.0 build
-LIB_MCS_FLAGS += -d:NET_3_5
-endif
-
 include ../../build/library.make
index ae6d540857f86f84a0d2c2dc5b4574054ac44491..ee792bac6f359d3e64cabe88fb15ff26cd4c9da6 100644 (file)
@@ -34,7 +34,6 @@ using System.Runtime.InteropServices;
 
        [assembly: CLSCompliant (true)]
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile ("../ecma.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: AllowPartiallyTrustedCallers]
index 2a70299375e2d0b0945dab6dde31376765b61d0b..66fbba349712d74cb3b57bb2ad5a724dd5503cc8 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Data.OracleClient.dll
 LIB_REFS = System System.Xml System.Data System.EnterpriseServices System.Drawing
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS =
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /nowarn:618
index c025c251fffd91032d31028b00b773ed28a8fb96..003c82ac85c485e7d6d9b40439183bd99f81f666 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Data.OracleClient</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index b5d9b925392f6108a7404fc3842136b1784ade37..da69def72bd207fc96db4faa5a4e38984f34f49b 100644 (file)
@@ -41,7 +41,6 @@ using System.Runtime.InteropServices;
 using System.Runtime.Versioning;
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../ecma.pub")]
 
 [assembly: System.Security.SecurityCritical]
 [assembly: ComVisible(false)]
index f635e808fc329658af874cfc435ce89e38f985b1..73c724a151c04a5ff84f287462d61df0dbd9945c 100644 (file)
@@ -7,6 +7,7 @@ LIBRARY = System.Data.Services.Client.dll
 RESOURCE_DEFS = System.Data.Services.Client,Client/System.Data.Services.Client.txt
 
 LIB_REFS = System System.Core System.Xml.Linq System.Data System.Xml
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = \
        -d:NET_3_5      \
        -warn:2
index ebfff34602945c3efd14682a4105f1ee3c84cdcf..4764ab684f0df27e22ac3561401bca532c1f7582 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Data.Services.Client</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 64ce7b2bb4744cbbed1b4fa2db551f7ed7da1f78..fcec6633d3e276085589bbe3099dfca35523f962 100644 (file)
@@ -21,7 +21,6 @@ using System.Security;
 [assembly: NeutralResourcesLanguage ("en-US")]\r
 \r
 [assembly: AssemblyDelaySign (true)]\r
-[assembly: AssemblyKeyFile ("../ecma.pub")]\r
 \r
 [assembly: ComVisible (false)]\r
 [assembly: CLSCompliant (true)]\r
index b5fb3cb6fdd43622e5dcbd4664aa43b53329969f..c1cb788e6483a26e097cdce8c5438ce26b39d960 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Data.Services.dll
 
 LIB_REFS = System System.Core System.ServiceModel System.ServiceModel.Web System.Data.Services.Client
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = -d:NET_3_5
 
 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
index ec22b9734c3a0e8766217033211654b6c6af1c9c..5b2af612e8aff179f430dda3ac628dcdad5785e9 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Data.Services</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 55252a3c447e72929a69a6ec485f9675554d4d8a..accfd22f258622b489a4f33c3551a670002d3068 100644 (file)
@@ -58,7 +58,6 @@ using System.Runtime.InteropServices;
 [assembly: AllowPartiallyTrustedCallers]
 
 [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile("../ecma.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: InternalsVisibleTo ("System.Data.DataSetExtensions, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
index 992f970601ba62333fbe760f8f9f5b3677895aec..f24fe8932aaffbd19851c2b5cc341b2773a1a32c 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Data.dll
 
 LIB_REFS = System System.Xml System.Core System.Numerics
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = \
        -nowarn:219,414,649 \
        -d:COREFX       \
index 55adbfa28da3b642b5d7789919afdae603a02045..7d211cad142cf7035126bcfc4663de42c0e67cb1 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Data</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 78b36424e2f4cba696b1ae379fc93559cc823954..2b4ff5a7bb683e1da67d502b7fab876af72e8261 100644 (file)
     <AssemblyName>System.Deployment</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 80e434ea1b9657800c8acb5ee4943f56d98df312..5ac82993dec3280690db3135707f1f1dee8f29a4 100644 (file)
@@ -56,7 +56,6 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: ComCompatibleVersion (1, 0, 3300, 0)]
index 2272546a83c1a4d7df863d84f262f28ff5538012..4ff4c5e8c4f088a84c2abc92ebdf2792f195c227 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Design.dll
 
 LIB_REFS = System System.Xml plainweb/System.Web System.Windows.Forms System.Drawing Accessibility System.Data System.Configuration
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = -nowarn:436 -nowarn:612,618,649,67,672
 
 TEST_LIB_REFS = System System.Drawing System.Windows.Forms
@@ -18,5 +19,6 @@ csproj-local:
 
 $(the_libdir_base)plaindesign/System.Design.dll:
        $(MAKE) intermediate=plaindesign/ $(the_libdir_base)plaindesign/System.Design.dll
+
 endif
 
index 0dee61abec72c2d020369b62dd3d5f4b20a12f5f..6421cc7663cca10246486bb9a89d8d6af075f4d5 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Design</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index bd6157c13e0340ad15e0311aaa5ca971f38a722a..04f030a734d9c1d4823b19a2e7cab624771a5d22 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Design</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index a633fe836e4ea6997183f9087e3a8c771baacb39..b75c0508b7947a842a808bb0efb9f4f91375b438 100644 (file)
@@ -33,7 +33,6 @@ using System.Runtime.InteropServices;
 
        [assembly: CLSCompliant (true)]
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: AllowPartiallyTrustedCallers]
index 693e1b273fd27ecad161f812bd4c4fdda47585e2..4fa33aba1af3fe5eff7b11a906bf25e9dfec1968 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.DirectoryServices.Protocols.dll
 LIB_REFS = System System.DirectoryServices System.Xml
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 NO_TEST = yes
index 72a04828ecac25c552138815e967ee718cb07563..998f764aa23a1134a3eca4f29756b6cb5e093cee 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.DirectoryServices.Protocols</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index eda06fb8885b7d660b4bfb68f2f3484edaba231f..fa22aa74a1dd5d6a9a38edf725fbec3f3ee4b4d8 100644 (file)
@@ -33,7 +33,6 @@ using System.Runtime.InteropServices;
 
        [assembly: CLSCompliant (true)]
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: AllowPartiallyTrustedCallers]
index 7eccfe87a4e731d6cac7f8f7ae98709cebd1463a..44058ce5db1abca55ff64947958765ce1e9d8521 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.DirectoryServices.dll
 LIB_REFS = System Novell.Directory.Ldap
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
 
index 43c7e028822a9c72ead596abeb47b4bb2e423e3f..72768debbe672d4c704a4d3ae32ccc8014cda3e1 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.DirectoryServices</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index cecbc7e1fb0892054bb2788948f99a3974380b27..330a8d8a5e728bdb8ab00348d703a38f52a3385f 100644 (file)
@@ -13,7 +13,6 @@ using System.DirectoryServices;
 namespace MonoTests.System.DirectoryServices \r
 {\r
        [TestFixture]\r
-       [Category ("InetAccess")]\r
        public class DirectoryServicesDirectoryEntryTest\r
        {\r
                #region Fields\r
@@ -30,6 +29,9 @@ namespace MonoTests.System.DirectoryServices
                {\r
                        de = null;\r
                        configuration = new TestConfiguration ();\r
+\r
+                       if (String.IsNullOrEmpty (configuration.ConnectionString))\r
+                               Assert.Ignore ("No configuration");\r
                }\r
 \r
 \r
index 2775fcb7b4e2af125128843eb69d1a041551d821..95ce2662c54a5b5fbe1b9642e54ce748951e5e26 100644 (file)
@@ -15,7 +15,6 @@ using System.Threading;
 namespace MonoTests.System.DirectoryServices \r
 {\r
        [TestFixture]\r
-       [Category ("InetAccess")]\r
        public class DirectoryServicesDirectorySearcherTest\r
        {\r
                #region Fields\r
@@ -33,6 +32,9 @@ namespace MonoTests.System.DirectoryServices
                {\r
                        de = null;                      \r
                        configuration = new TestConfiguration ();\r
+\r
+                       if (String.IsNullOrEmpty (configuration.ConnectionString))\r
+                               Assert.Ignore ("No configuration");\r
                }\r
 \r
 \r
index 87f69ad7d0ff138216d1991b421ab9fa1ec73f4d..21aa253301b5a73722d6a4fa817cd9516535528e 100644 (file)
@@ -13,7 +13,6 @@ using System.DirectoryServices;
 namespace MonoTests.System.DirectoryServices \r
 {\r
        [TestFixture]\r
-       [Category ("InetAccess")]\r
        public class DirectoryServicesSearchResultTest\r
        {\r
                #region Fields\r
@@ -31,6 +30,9 @@ namespace MonoTests.System.DirectoryServices
                {\r
                        de = null;\r
                        configuration = new TestConfiguration ();\r
+\r
+                       if (String.IsNullOrEmpty (configuration.ConnectionString))\r
+                               Assert.Ignore ("No configuration");\r
                }\r
 \r
 \r
index adfcac1097ba0158145f29ae235fc955ca6a3bd0..9f8ea58c4e019c5bfa9898cc128fc0f4c7d8f635 100644 (file)
@@ -54,7 +54,6 @@ using System.Diagnostics;
 
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index 7abb4b3f3aed433d4ad2975c59cdb8016af1414e..79c4f90dd386ca2ece41995b09dd6bc1f5cd3430 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Drawing.Design.dll
 LIB_REFS = System System.Drawing System.Windows.Forms
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 NO_TEST = yes
 
index 0c98f3fbe7714bbcbc57788add4158269a62cb2b..e99794a211fbd349effda617deb0189a897d3ab9 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Drawing.Design</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index c036603b98a977a8a56d2b59c7b16d13974e3625..508c578f9db8cdffa6b3354d8dace8f097bc92fb 100644 (file)
@@ -54,11 +54,8 @@ using System.Runtime.InteropServices;
 [assembly: ComCompatibleVersion (1, 0, 3300, 0)]
 [assembly: AllowPartiallyTrustedCallers]
 
-       [assembly: CLSCompliant (true)]
-       [assembly: AssemblyDelaySign (true)]
-#if !MOBILE
-       [assembly: AssemblyKeyFile("../msfinal.pub")]
-#endif
+[assembly: CLSCompliant (true)]
+[assembly: AssemblyDelaySign (true)]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index 685b8fb6d80bfaa817f1b9616f30ac4d8db55cc1..62d3ac085e120ce33034e05d628d0aadaa19ed1b 100644 (file)
@@ -5,6 +5,7 @@ SUBDIRS =
 LIBRARY = System.Drawing.dll
 
 LIB_REFS = System
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = /unsafe \
        -resource:Assembly/Mono.ico,Mono.ico -resource:Assembly/Information.ico,Information.ico \
        -resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico \
@@ -12,11 +13,7 @@ LIB_MCS_FLAGS = /unsafe \
 
 RESX_RESOURCE_STRING = ../../../external/corefx/src/System.Drawing.Common/src/Resources/Strings.resx
 
-MOBILE_LIKE := $(filter winaot orbis unreal, $(PROFILE))
-
-ifdef MOBILE_LIKE
-LIB_MCS_FLAGS += /keyfile:../msfinal.pub
-else
+ifndef MOBILE_PROFILE
 LIB_MCS_FLAGS += -d:FEATURE_TYPECONVERTER,SUPPORTS_WINDOWS_COLORS
 endif
 
index 89eaad966b3edf7a0931a48a2901b7cb8dcad200..7d156a4a4af5560951cdf9a6f093c31f4a130fac 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Drawing</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\AssemblyRef.cs" />\r
-    <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\misc\ClientUtils.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\misc\HandleCollector.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\BitmapSuffixInSameAssemblyAttribute.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\BitmapSuffixInSatelliteAssemblyAttribute.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Brush.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\ClientUtils.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\DashCap.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Design\CategoryNameCollection.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Design\IPropertyValueUIService.cs" />\r
index 281ba3ef64ccc1b518e5a4eae055072cc9221135..18e12edb898da2c47d1990f25950687fc4c23a49 100755 (executable)
@@ -3,7 +3,7 @@ System.Drawing/SR.cs
 Assembly/AssemblyInfo.cs
 ../../build/common/Consts.cs
 ../../build/common/Locale.cs
-../../../external/corefx/src/System.Drawing.Common/src/misc/ClientUtils.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/ClientUtils.cs
 ../../../external/corefx/src/System.Drawing.Common/src/misc/HandleCollector.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Gdiplus.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/NativeMethods.cs
index 314ff860f0ea794f47cb6548195b2db194d56712..6eb80aae50ac54f021b5f859e0e5c903206f851c 100644 (file)
@@ -53,7 +53,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile ("../ecma.pub")]
 
 [assembly: SecurityCritical]
 
index 5956e751d0c7e537ef93001ccd16660a07d3d8cd..b4706f3d03fc3f8ba96b502b820709438691d065 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Dynamic.dll
 
 LIB_REFS = System.Core System
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = -unsafe -d:CODEPLEX_40 -nowarn:414,169
 
 # This is a .NET 4.0+ only assembly
index b52c1ea7c1f65bb7e86e067c73a39449975c9837..7b164e131874bd22962a3e527ee6a106ef8d208e 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Dynamic</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index fa68aa7a7eb3cb2eec8299af0d3dc9888712a5a9..cf00a4b0439076b5ba274325cb0952c2a19091d1 100644 (file)
@@ -58,7 +58,6 @@ using System.EnterpriseServices;
 
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
index 90f38e9fc9ade77d12212d6d6ceffb38a063ab2d..c2e327221c8020be851fa3393416879a2e62decd 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.EnterpriseServices.dll
 LIB_REFS = System.Transactions
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = /nowarn:0168 /nowarn:0162
 NO_TEST = yes
 
index eed0a3a060619ea7743aca42d263646ff545aa6a..4bb39d0aae70feee665b90d5910dc0915c64d101 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.EnterpriseServices</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index fa0af8e06edd70097666d4053923478bfeed3927..26a4b510054923adf0469d44ece878d263c56852 100644 (file)
@@ -36,4 +36,3 @@ using System.Reflection;
 [assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../ecma.pub")]
index 9e7a4b0efcc25d7ac07cbfb3d7a525e870c76371..bb28e11d66e2564d476943d3124f6889ce15a09b 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.IO.Compression.FileSystem.dll
 LIB_REFS = System System.IO.Compression
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = -unsafe
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = System System.Core System.IO.Compression
index 82fbf539d414e2886610b8d28a709e3c52b4f9e4..5c0d8fc6060ab2e9745859edad600d87f7616849 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.IO.Compression.FileSystem</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index b173b20da517fd137bd0e614779f7a458bec6780..d89e9e473bda93d027f1a0f571298f9bd5c676b1 100644 (file)
@@ -36,4 +36,3 @@ using System.Reflection;
 [assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../ecma.pub")]
index 327f7e0b1cd9980dda34a2808f22240c2a2256c3..738e9be17a23f45e4a0a6931da67927a594ebb23 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.IO.Compression.dll
 LIB_REFS = System
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS =
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = System System.Core
index 2160b91987e319311baf489285c51e83c2889e4d..7fc2b92eb909641d16a9de5370e24a09046a90e7 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.IO.Compression</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index f221823bdf763ca3134fe3928f080c55d7c92041..b3f7b278f35f9ed115a0d78c4fdc776cb263c14d 100644 (file)
@@ -56,6 +56,5 @@ using System.Runtime.InteropServices;
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../ecma.pub")]
 
 [assembly: ComVisible (false)]
index bb7ade20bbc02b3d0b697292a0d74fe2f85eeeae..cb72dfddcb118685ac58d95c1b26d17d805ca54a 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.IdentityModel.Selectors.dll
 LIB_REFS = System System.Xml System.Security System.Runtime.Serialization System.IdentityModel
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = /d:NET_3_0
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
index 5ec91411ebbe67ce8d2ea6b514e3e0932f731740..b64955547ab6d86b66de384f1743632e78c174fd 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.IdentityModel.Selectors</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 0b98df20420097218f37b5da5b635066723fe1f5..eef8acc5a63c01f30d5ce56cd219274a734d956f 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../ecma.pub")]
 
 [assembly: ComVisible (false)]
 [assembly: ComCompatibleVersion (1, 0, 3300, 0)]
index 29bb7acd6ee63617f77795f248bccf18f87da3ff..aad3b05831f44dd5b595f33c61fd7d1d776ca24f 100644 (file)
@@ -8,6 +8,7 @@ endif
 
 LIBRARY = System.IdentityModel.dll
 LIB_REFS = System System.Xml System.Security $(MONO_SECURITY) System.Runtime.Serialization
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = \
                /d:NET_3_0      \
                $(OTHER_LIB_MCS_FLAGS)
index ecbd0cc80e20044b12596fd858ca0ecae3cde045..af6ccf8ab475d71da27f7bf6a3573020b28cf8c5 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.IdentityModel</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 5813d31276b6e8ed22d1ca84b29e7c572ff00250..074236261cd078686e18b3e5b33331ba0edd7aaf 100644 (file)
@@ -4,7 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Interactive.Async.dll
 LIB_REFS = System System.Core
-LIB_MCS_FLAGS = @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT
@@ -17,7 +18,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args
+EXTRA_DISTFILES =
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
diff --git a/mcs/class/System.Interactive.Async/more_build_args b/mcs/class/System.Interactive.Async/more_build_args
deleted file mode 100644 (file)
index a53ee7b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
index 71d92cbd728fe0fa0de8d44dc6b3af9054a37ba7..45ff7df72b9c7a17830992790c1c0ad204be134b 100644 (file)
@@ -4,7 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Interactive.Providers.dll
 LIB_REFS = System System.Core System.Interactive
-LIB_MCS_FLAGS = @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT
@@ -17,7 +18,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args
+EXTRA_DISTFILES =
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
diff --git a/mcs/class/System.Interactive.Providers/more_build_args b/mcs/class/System.Interactive.Providers/more_build_args
deleted file mode 100644 (file)
index a53ee7b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
index 83def3c2ea594b55e99e703e640fbe41593f5a87..64318f072774b64240ed4f14209075a4fb0a606c 100644 (file)
@@ -4,7 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Interactive.dll
 LIB_REFS = System System.Core
-LIB_MCS_FLAGS = @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT
@@ -17,7 +18,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args
+EXTRA_DISTFILES =
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
diff --git a/mcs/class/System.Interactive/more_build_args b/mcs/class/System.Interactive/more_build_args
deleted file mode 100644 (file)
index a53ee7b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
index 43f1c55a868e478da6f7efadfeda3027688da582..d249b19fd4646c23d205bbacc88a5072bdd79ccd 100644 (file)
     <AssemblyName>System.Json.Microsoft</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index b8c49cd952bd53eac4e7967132dddbb9b7d678c5..b01d482984f68ed428ae6cc04728eac5d61ab97b 100755 (executable)
@@ -51,7 +51,6 @@ using System.Runtime.InteropServices;
 
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../winfx.pub")]
 
 [assembly: ComVisible (false)]
 
index 4a4b5c80e6807943bf0eb33b140b8804e515eb37..b515027edca3a92ed981ee043914847b47cedb34 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Json.dll
 LIB_REFS = System System.Xml System.Core
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS =
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
index dcc18a224cdca1780ec822e17296dc87a7c0ea31..7670a0c6f2a2a5d561de67c79a36353b5f9d5c7e 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Json</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 7f5675a5b1e2447f3c57e115a28221ebc1423f97..be7bd784564899fd0ed2291fa1249f229274e667 100644 (file)
@@ -53,7 +53,6 @@ using System.Runtime.InteropServices;
 
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index df76cf43bc2b085e3bc3c690db46e0ccaa0b00f2..c5d34b9393152a11dd343909fd4eea60bd1fbfd8 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Management.dll
 LIB_REFS = System System.Configuration.Install
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 NO_TEST = yes
 
index e974715f9ed102e61310df90bb0d3d4cf73781ca..cc88b18e25b3420eebc8407334743a759f2ca6c8 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Management</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 7c1947b99507573e1a9d8d47be973c37922cec69..9b52cb178abb46bdb09fd936e383d1f9d7927de0 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index 0412ea01555cf6bbcf44cb375c526bc75b3406bd..3d0c23e4d8950186ecb95f37a5b0a914cf0913c0 100644 (file)
@@ -9,6 +9,7 @@ ifndef NO_SYSTEM_DRAWING_DEPENDENCY
 LIB_REFS += System.Drawing
 endif
 
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = /resource:System.Messaging/MessageQueue.resx
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
 TEST_LIB_REFS = nunit.mocks
index 08485c436dd8cc4081cdc72312d997c17406ae25..f61c3950175bdf682d18e0387c0a71a7cadf3647 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Messaging</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 09992bba913e84704f4400db79700bced6cb695a..9f79472b2e36a76bb68b2d0ef80412378163722a 100644 (file)
     <AssemblyName>System.Net.Http.Formatting</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index f646f54ef7752e619ea9c7ae4558ee3c87812312..929d9c4da8139d95bb601d68e85f07b51813162a 100644 (file)
@@ -52,7 +52,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: ComVisible (false)]
 
index b0d8e7a1a87879a4ee0431abe256ec6ab3538128..20b890747f58a5992809d3faebd120c3d8257268 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Net.Http.WebRequest.dll
 
 LIB_REFS = System.Net.Http System
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 TEST_MCS_FLAGS =
index 0eca3bb9bbb1f83f0a04b68875c1f2379d186b77..f24cb4e1336ca242eea2ad22891a7ddbc888156c 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Net.Http.WebRequest</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index d477aee4490aa9ad5a8542adb83aec44ee7477a7..0222314c486de04581e1150b0f3b6efd8878a28c 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: SecurityCritical]
 
index 55b07ffdd63b7a0ca77400713d47c04314f74930..026c4644a46540e463648ea4af0c666c27baef32 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Net.Http.WinHttpHandler.dll
 LIB_REFS = System System.Net.Http
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 NO_TEST = yes
index 6aa0c9d0b8b28e9149b4c613a41069f9ddf1fc31..7cd48a91baa1e2d853364705f06f5a7ad16b480b 100644 (file)
@@ -61,7 +61,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: ComVisible (false)]
 
index 9abcf2e80f62071ca0cf14a470dfaed396b3596a..6f7f878ff7fbfb09bd59e2d0150ad695130f2378 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Net.Http.dll
 
 LIB_REFS = System.Core System
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = $(EXTRA_LIB_MCS_FLAGS)
 ifeq (monodroid,$(PROFILE))
 LIB_MCS_FLAGS += -d:XAMARIN_MODERN
index f358d34db90019db8a044c1139d351b4c0059e4e..9fc881ffd2e7a11b607092381899378d9f2c5242 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Net.Http</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 4aeaf50cd931ec9a513c0d4da69bb30f1bfe1e15..8ea06b162bc4fd841e3be8a83440ca836763553a 100644 (file)
@@ -375,8 +375,9 @@ namespace System.Net.Http
 
                                                wrequest.ResendContentFactory = content.CopyTo;
 
-                                               var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false);
-                                               await request.Content.CopyToAsync (stream).ConfigureAwait (false);
+                                               using (var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false)) {
+                                                       await request.Content.CopyToAsync (stream).ConfigureAwait (false);
+                                               }
                                        } else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) {
                                                // Explicitly set this to make sure we're sending a "Content-Length: 0" header.
                                                // This fixes the issue that's been reported on the forums:
index 4831f8fe788d3f0eb3b32ded5c539f3f64f7d6c5..676add57b65462ceb7a8452381f1d5b3dedd37c9 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System.Net</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index f2d3b307d324559665e99d87ffab3f0270f9bcc1..140938dd025912a4e5733ee8b44b460389f8f044 100644 (file)
@@ -53,7 +53,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: SecurityCritical]
 
index 6500f93995c7232321dbd9b379e026d053040e8d..e816423aae5c4cfcf1380144a9bf2643cbafbabc 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Numerics.Vectors.dll
 LIB_REFS = System System.Numerics
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = -unsafe
 
 RESX_RESOURCE_STRING = ../../../external/corefx/src/System.Numerics.Vectors/src/Resources/Strings.resx
index fdf2ee284da59d232bb2130b2a77e778107d4dcb..cf78a442bdb08d19709c22db3fdeb010c9aa79b2 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Numerics.Vectors</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 44dd55384058ba4f01573e8c30d4f56d01937318..89775699f0323b7c885d6a62cb592046a41067d5 100644 (file)
@@ -53,7 +53,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile ("../ecma.pub")]
 
 [assembly: SecurityCritical]
 
index 1e05c08cfebc4e65d6d910e50613ac59a086b5a0..a7b25f1b1409b18075f10b582f9c73d815ab4110 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Numerics.dll
 LIB_REFS = System
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = /unsafe
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 XTEST_LIB_REFS = System Facades/System.Threading.Tasks Facades/System.Runtime.InteropServices.RuntimeInformation System.Core System.Numerics.Vectors Microsoft.CSharp
index cdccb1291e6f24759d6bbb290c95ec75a82e36cf..33f0f821f84e48591b5d76ff95e0f63208eedc6c 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Numerics</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
@@ -53,8 +54,8 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="..\..\..\external\corefx\src\Common\src\System\Globalization\FormatProvider.Number.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\MathF.netstandard.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\Common\src\System\Numerics\Hashing\HashHelpers.cs" />\r
-    <Compile Include="..\..\..\external\corefx\src\System.Numerics.Vectors\src\System\MathF.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Numerics.Vectors\src\System\Numerics\JitIntrinsicAttribute.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Numerics.Vectors\src\System\Numerics\Matrix3x2.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Numerics.Vectors\src\System\Numerics\Matrix4x4.cs" />\r
index 4a50c42d7f362ca31cba282c9fc7c3ed178dd4f5..919debfb8420e469ef0c0c8f2a8057496bb535bd 100644 (file)
@@ -21,7 +21,7 @@ corefx/Vector.cs
 ../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/Complex.cs
 ../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/NumericsHelpers.cs
 
-../../../external/corefx/src/System.Numerics.Vectors/src/System/MathF.cs
+../../../external/corefx/src/Common/src/System/MathF.netstandard.cs
 
 ../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/JitIntrinsicAttribute.cs
 ../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Matrix3x2.cs
index 2ef111be9161a9cece92a570ca6f2de20145f72f..af912498a73184f74aee4da718c18f7f0ffe44cc 100644 (file)
@@ -1,5 +1,6 @@
-../../../external/corefx/src/Common/tests/System/AssertExtensions.cs
+../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs
 ../../../external/corefx/src/Common/tests/System/PlatformDetection.cs
+../../../external/corefx/src/Common/src/System/MathF.netstandard.cs
 
 # ../../../external/corefx/src/System.Runtime.Numerics/tests/*.cs
 ../../../external/corefx/src/System.Runtime.Numerics/tests/BigInteger/*.cs
index fc666baf51ca53b437ad7b1eb98e476efcad6f5b..819b9adb9d345e92572efb1a70e0b2d90abb6954 100644 (file)
@@ -4,8 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.Core.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces
-LIB_MCS_FLAGS = \
-               @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign -resource:Strings_Core.resources,System.Reactive.Strings_Core.resources
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
@@ -31,7 +31,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
+EXTRA_DISTFILES = $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index c7bc3be2988d56fada21e3149815dfb69e6bc868..7e1a30f7a237f23c08400a04c23c6bbdc4926747 100644 (file)
     <AssemblyName>System.Reactive.Core</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.Core/more_build_args b/mcs/class/System.Reactive.Core/more_build_args
deleted file mode 100644 (file)
index f832406..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
--resource:Strings_Core.resources,System.Reactive.Strings_Core.resources
index f616cad1f09f94dc43db9d12cfc0865c3f2789a5..ef54db5c923a60bb3cdc8e772c47009a7a1fdded 100644 (file)
@@ -4,7 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.Debugger.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
-LIB_MCS_FLAGS = @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT
@@ -17,7 +18,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args
+EXTRA_DISTFILES =
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index 69e179f7b7998ae5e898dac09b2a3e944c876947..f1a770ce14a0b857e5bb336a3b133da3155d885e 100644 (file)
     <AssemblyName>System.Reactive.Debugger</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.Debugger/more_build_args b/mcs/class/System.Reactive.Debugger/more_build_args
deleted file mode 100644 (file)
index a53ee7b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
index 9bc8b3e07acfffdbe63aa1a87eb025ca2030f4d3..7a7a65c028c1f4cccb65085bb5b7910300f20f19 100644 (file)
@@ -4,7 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.Experimental.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
-LIB_MCS_FLAGS = @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT
@@ -17,7 +18,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args
+EXTRA_DISTFILES =
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index 155e2d27458bc460b206bf6a3d9c3f2bd0260061..a6fff28b73e9cd88cd25607859e8636c053c6a26 100644 (file)
     <AssemblyName>System.Reactive.Experimental</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.Experimental/more_build_args b/mcs/class/System.Reactive.Experimental/more_build_args
deleted file mode 100644 (file)
index a53ee7b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
index 2752ff281271d47a255ecbeabcb04182531c64a7..9edbd350a13fb4da429e85fbf6db51b1067082f7 100644 (file)
@@ -4,7 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.Interfaces.dll
 LIB_REFS = System System.Core
-LIB_MCS_FLAGS = @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT
@@ -17,7 +18,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args
+EXTRA_DISTFILES =
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index 5762d45c16c4dbc7607acc2458c281a880fb3979..e8079c10984301d26cf235ae789c027e3b6be4f1 100644 (file)
     <AssemblyName>System.Reactive.Interfaces</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.Interfaces/more_build_args b/mcs/class/System.Reactive.Interfaces/more_build_args
deleted file mode 100644 (file)
index a53ee7b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
index f7f8f44e195f2eab4d452a18f622827a8a0742bd..071bd7c24517c63741d5e9e9bbbda2e77a25418b 100644 (file)
@@ -4,8 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.Linq.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core
-LIB_MCS_FLAGS = \
-               @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign -resource:Strings_Linq.resources,System.Reactive.Strings_Linq.resources
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
@@ -31,7 +31,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
+EXTRA_DISTFILES = $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index 593c2d6e3d804a32bf9ca0a7bc15e691789a2ecd..9da3834794aa0d943ead2b1efbddcd6339b9edb9 100644 (file)
     <AssemblyName>System.Reactive.Linq</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.Linq/more_build_args b/mcs/class/System.Reactive.Linq/more_build_args
deleted file mode 100644 (file)
index d2c11c8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
--resource:Strings_Linq.resources,System.Reactive.Strings_Linq.resources
index 0db9de14052ca03748e8ce734006ee299325b53f..04c0101248da57aee1f17fa39ba55a48a7afbf6d 100644 (file)
@@ -4,8 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.Observable.Aliases.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Reactive.Providers
-LIB_MCS_FLAGS = \
-               @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
@@ -28,7 +28,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
+EXTRA_DISTFILES = $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index 4e2894d3b5947a29d6364530887da4feee027a35..0d9aeb111f91e7970b45a72f87c06244f05d8de4 100644 (file)
     <AssemblyName>System.Reactive.Observable.Aliases</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.Observable.Aliases/more_build_args b/mcs/class/System.Reactive.Observable.Aliases/more_build_args
deleted file mode 100644 (file)
index a53ee7b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
index 0333c27f2e74bd531e34c5af1666da5275c76ed4..43addad7f8fb90a1db2ef81e6094fdc427582c74 100644 (file)
@@ -4,8 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.PlatformServices.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
-LIB_MCS_FLAGS = \
-               @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign -resource:Strings_PlatformServices.resources,System.Reactive.Strings_PlatformServices.resources
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
@@ -37,7 +37,7 @@ endif
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 TEST_LIB_REFS = Mono.Reactive.Tests
 
-EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
+EXTRA_DISTFILES = $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index 4902cfc65e862a4db20c8d601f2451e2b37e416c..ebbf6a330524d82a2d7ddfa8987e268dc4512150 100644 (file)
     <AssemblyName>System.Reactive.PlatformServices</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.PlatformServices/more_build_args b/mcs/class/System.Reactive.PlatformServices/more_build_args
deleted file mode 100644 (file)
index 630b370..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
--resource:Strings_PlatformServices.resources,System.Reactive.Strings_PlatformServices.resources
index ab1f274d1503cf65d124a5069e797bedbc72cc65..019b9ed8e49534ba7eedf48b805a638c2f72adc1 100644 (file)
@@ -4,8 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.Providers.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
-LIB_MCS_FLAGS = \
-               @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign -resource:Strings_Providers.resources,System.Reactive.Strings_Providers.resources
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
@@ -31,7 +31,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
+EXTRA_DISTFILES = $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index 57cabc568b682299b20323983817b9bfc4802980..e0415dc170a507eff2d28d70b891471b1ace1510 100644 (file)
     <AssemblyName>System.Reactive.Providers</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.Providers/more_build_args b/mcs/class/System.Reactive.Providers/more_build_args
deleted file mode 100644 (file)
index 264c0c0..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
--resource:Strings_Providers.resources,System.Reactive.Strings_Providers.resources
index 1834e7aaa259e9de7bb25255053d6ad27feb0825..d3178b70df504a0cbc0a43def70e2fc077f220a9 100644 (file)
@@ -4,8 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.Runtime.Remoting.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
-LIB_MCS_FLAGS = \
-               @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY
@@ -18,7 +18,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args
+EXTRA_DISTFILES =
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index 32d45839a5a31344fc397991dbd083d7c4bdd3f9..31baf38541f7b1ac7bf7387eac93e5e52e64b57e 100644 (file)
     <AssemblyName>System.Reactive.Runtime.Remoting</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.Runtime.Remoting/more_build_args b/mcs/class/System.Reactive.Runtime.Remoting/more_build_args
deleted file mode 100644 (file)
index a53ee7b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
index ef3327d3e3e3dd39af41698bb97d9b7ef7d9d372..9967af9ebca58c7d06465a2d30a5f8f651c83734 100644 (file)
@@ -4,8 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.Windows.Forms.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Windows.Forms
-LIB_MCS_FLAGS = \
-               @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT
@@ -18,7 +18,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args
+EXTRA_DISTFILES =
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index 4c8a1c124dd3a3e8c038540ebef1493c88829ceb..f6f8490390eef23552b32b1b264ef9d907fd221d 100644 (file)
     <AssemblyName>System.Reactive.Windows.Forms</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.Windows.Forms/more_build_args b/mcs/class/System.Reactive.Windows.Forms/more_build_args
deleted file mode 100644 (file)
index a53ee7b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
index 66a3ff14f6c6518b55254691c13c1d65fd52e02e..e2ff9614e06b98137f894e1e657b4cb7c87c242c 100644 (file)
@@ -4,8 +4,8 @@ include ../../build/rules.make
 
 LIBRARY = System.Reactive.Windows.Threading.dll
 LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq WindowsBase
-LIB_MCS_FLAGS = \
-               @more_build_args
+KEYFILE = ../reactive.pub
+LIB_MCS_FLAGS = -d:SIGNED -delaysign -resource:Strings_WindowsThreading.resources,System.Reactive.Strings_WindowsThreading.resources
 
 ifeq (true, $(GENERATE_RESOURCES))
 LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
@@ -31,7 +31,7 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
+EXTRA_DISTFILES = $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
 
 INSTALL_PROFILE := $(filter net_4_x, $(PROFILE))
 ifndef INSTALL_PROFILE
index 71810a72eba08341195040f8ef0d5806b204f415..88b1b2c2ec95aab643aef2493e65b83f25681f6d 100644 (file)
     <AssemblyName>System.Reactive.Windows.Threading</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../reactive.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
@@ -38,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -46,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SIGNED;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reactive.Windows.Threading/more_build_args b/mcs/class/System.Reactive.Windows.Threading/more_build_args
deleted file mode 100644 (file)
index aa3becf..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
--d:SIGNED
--delaysign
--keyfile:../reactive.pub
--resource:Strings_WindowsThreading.resources,System.Reactive.Strings_WindowsThreading.resources
index 67d49125ac92a4e232e7753fd86ada02dc5da0e4..ffb8818a1ae39e88242b86dc8bd22b681b2baaf9 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: SecurityCritical]
 
index 73bee9e345ea16f8b5ffb142c9214beaa650dd24..1961066c52343f1117ece321ee098921891331a3 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Reflection.Context.dll
 LIB_REFS = System
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 NO_TEST = yes
index 2486a7463cf65ba80875a409e6cb2afb6705ed68..8d5d859ec277b77d2182e5427d29ba4a60437be9 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Reflection.Context</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 9583a2495b5f5a6a749f15631176b83725460a8f..ad85823218d15e56e0a809b22cd471603aa0f740 100644 (file)
@@ -58,7 +58,6 @@ using System.Runtime.Versioning;
 
 [assembly: ComVisible (false)]
 
-[assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: AllowPartiallyTrustedCallers]
 [assembly: SecurityRules (SecurityRuleSet.Level2, SkipVerificationInFullTrust=true)]
index 380b02e3e798976bd9e4372114f5a50772200ac6..957426406165ff238275407fa2f356050b5fec81 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Runtime.Caching.dll
 LIB_REFS = System System.Data System.Configuration System.Core
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = -nowarn:414
 
 RESX_RESOURCE_STRING = \
index 72f1144107c316ff77fe10ed2efb05ab0d82bb2d..ea284aa57ffd71ebf52c09440231ea76702403cf 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Runtime.Caching</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 3b6de7e3067a95c8a33a230a8717630f66162617..04271f11748d45990844840c111c9bc11150cc8a 100644 (file)
@@ -55,10 +55,7 @@ using System.Runtime.InteropServices;
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-#if MOBILE
-[assembly: AssemblyKeyFile ("../silverlight.pub")]
-#else
-[assembly: AssemblyKeyFile ("../winfx.pub")]
+#if !MOBILE
 [assembly: AllowPartiallyTrustedCallers]
 [assembly: ComCompatibleVersion (1, 0, 3300, 0)]
 #endif
index 3db6eeb9c154442353bc23bbada7950be1cbbfb2..e3369f2d139995fac4a685c691ebfbbbe7a4221d 100644 (file)
@@ -6,12 +6,17 @@ LIBRARY = System.Runtime.DurableInstancing.dll
 LIB_REFS = System System.Xml System.Core System.Xml.Linq System.Transactions System.ServiceModel.Internals System.Runtime.Serialization
 LIB_MCS_FLAGS =
 
+ifdef MOBILE_PROFILE
+KEYFILE = ../silverlight.pub
+else
+KEYFILE = ../winfx.pub
+endif
+
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
 EXTRA_DISTFILES = $(RESOURCE_FILES)
 
-VALID_PROFILE := $(filter 2.0 4.0 4.5, $(FRAMEWORK_VERSION))
-ifndef VALID_PROFILE
+ifneq (4.5, $(FRAMEWORK_VERSION))
 LIBRARY_NAME = dummy-System.Runtime.DurableInstancing.dll
 NO_INSTALL = yes
 NO_SIGN_ASSEMBLY = yes
index c7b016a4b19207b9066c0faa51142598f8016503..2f7f0e9fd94e3c43503c956e733ba42740a2f697 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Runtime.DurableInstancing</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e87df2644960e8f7936db75e6259af933a9d076a..53638b23099d903b60440dcb6e1714377621653e 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 [assembly: ComCompatibleVersion (1, 0, 3300, 0)]
 
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile("../ecma.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CLSCompliant (false)]
index 323d4241eb5ce80ee8106733b36fce329cd1cdc6..25d474679f9508a1f1766d09ed4aa9de96fa4fb7 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Runtime.Remoting.dll
 
 LIB_REFS = System System.Xml System.Runtime.Serialization.Formatters.Soap
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS =
 
 ifndef NO_SYSTEM_WEB_DEPENDENCY
index 091fed11bc21bf92038137b494f01579171f1506..9bc8cb571d0edc03f7ad73d03713d9d0ba34bbe6 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Runtime.Remoting</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 45f76791b7cf6841752a917937f876b03e70b52e..6dbb89f2d58b56a8d6b8cfecb301feb5bbae7d0e 100644 (file)
@@ -28,7 +28,6 @@ namespace MonoTests.Remoting
                }
 
                [Test]
-               [Ignore ("https://bugzilla.xamarin.com/show_bug.cgi?id=36634")]
                public void Bug609381 ()
                {
                        string portName = "ipc" + Guid.NewGuid ().ToString ("N");
index 645e25adde19375e7038aa7b25ce17c3b0ba11cc..caffdb5111e8c4d363bb5fb1db6f952590204a14 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 
        [assembly: CLSCompliant (true)]
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: ComVisible (true)]
index 7a673f01fa3b3245627fb9114f3f97446c6ca515..930a7908affe95ce7341c167ed0afc327cedbd27 100644 (file)
@@ -6,6 +6,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Runtime.Serialization.Formatters.Soap.dll
 LIB_REFS = System.Xml
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 TEST_LIB_REFS = System
index 2a06f285e37e9ca34f5085a92340e1d557a5b68c..26a5cce0de418da6e9ae359d42d43fe5edafa3b0 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Runtime.Serialization.Formatters.Soap</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index f11d44fdf8e2946bfe964f3619118dc3c3b7a732..78b388c5f2ed40277ed9e7a077285ed8f21b24ab 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System.Runtime.Serialization</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 8e95096faaf7cd63344496f48b23210e81f4084d..35601febd2666686b887bb17fa0140af21dd0451 100644 (file)
@@ -47,7 +47,6 @@ using System.Security.Permissions;
 [assembly: NeutralResourcesLanguage ("en-US")]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../msfinal.pub")]
 
 [assembly: AssemblyDefaultAlias ("System.Security.dll")]
 [assembly: AssemblyDescription ("System.Security.dll")]
index 8602d8ff40a137e2acdefca3b2a680759e2291ac..ae2de1a637046792e606012f5a547294f48ade72 100644 (file)
@@ -9,9 +9,10 @@ endif
 
 LIBRARY = System.Security.dll
 LIB_REFS = secxml/System bare/System.Xml $(MONO_SECURITY)
-LIB_MCS_FLAGS = -nowarn:618 \
-       -d:SECURITY_DEP \
-       -nowarn:414
+KEYFILE = ../msfinal.pub
+LIB_MCS_FLAGS = \
+       -nowarn:414,618 \
+       -d:SECURITY_DEP,SYSTEM_SECURITY_DLL
 
 LOCAL_MCS_FLAGS =
 
diff --git a/mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs b/mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs
deleted file mode 100644 (file)
index 8f0ec97..0000000
+++ /dev/null
@@ -1,680 +0,0 @@
-//
-// XmlCanonicalizer.cs - C14N implementation for XML Signature
-// http://www.w3.org/TR/xml-c14n
-//
-// Author:
-//     Aleksey Sanin (aleksey@aleksey.com)
-//
-// (C) 2003 Aleksey Sanin (aleksey@aleksey.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-namespace Mono.Xml { 
-
-       internal class XmlCanonicalizer {
-
-               private enum XmlCanonicalizerState
-               {
-                       BeforeDocElement,
-                       InsideDocElement,
-                       AfterDocElement
-               }
-               
-               // c14n parameters
-               private bool comments;
-               private bool exclusive;
-               string inclusiveNamespacesPrefixList;
-
-               // input/output
-               private XmlNodeList xnl;
-               private StringBuilder res;
-               
-               // namespaces rendering stack
-               private XmlCanonicalizerState state;
-               private ArrayList visibleNamespaces;
-               private int prevVisibleNamespacesStart;
-               private int prevVisibleNamespacesEnd;
-               private Hashtable propagatedNss;
-
-               public XmlCanonicalizer (bool withComments, bool excC14N, Hashtable propagatedNamespaces)
-               {           
-                       res = new StringBuilder ();
-                       comments = withComments;
-                       exclusive = excC14N;
-                       propagatedNss = propagatedNamespaces;
-               }
-               
-               void Initialize ()
-               {
-                       state = XmlCanonicalizerState.BeforeDocElement;
-                       visibleNamespaces = new ArrayList ();
-                       prevVisibleNamespacesStart = 0;
-                       prevVisibleNamespacesEnd = 0;
-                       res.Length = 0;
-               }
-               
-               public Stream Canonicalize (XmlDocument doc)
-               {
-                       if (doc == null)
-                               throw new ArgumentNullException ("doc");
-                       Initialize ();
-                       
-                       FillMissingPrefixes (doc, new XmlNamespaceManager (doc.NameTable), new ArrayList ());
-                       WriteDocumentNode (doc);
-                       
-                       UTF8Encoding utf8 = new UTF8Encoding ();
-                       byte[] data = utf8.GetBytes (res.ToString ());
-                       return new MemoryStream (data);
-               }
-               
-               public Stream Canonicalize (XmlNodeList nodes)
-               {
-                       xnl = nodes;
-                       if (nodes == null || nodes.Count < 1)
-                               return new MemoryStream ();
-                       XmlNode n = nodes [0];
-                       return Canonicalize (n.NodeType == XmlNodeType.Document ? n as XmlDocument : n.OwnerDocument);
-               }               
-
-               // See xml-enc-c14n specification
-               public string InclusiveNamespacesPrefixList {
-                       get { return inclusiveNamespacesPrefixList; }
-                       set { inclusiveNamespacesPrefixList = value; }
-               }
-
-               XmlAttribute CreateXmlns (XmlNode n)
-               {
-                       XmlAttribute a = n.Prefix.Length == 0 ?
-                               n.OwnerDocument.CreateAttribute ("xmlns", "http://www.w3.org/2000/xmlns/") :
-                               n.OwnerDocument.CreateAttribute ("xmlns", n.Prefix, "http://www.w3.org/2000/xmlns/");
-                       a.Value = n.NamespaceURI;
-                       return a;
-               }
-
-               // Note that this must be done *before* filtering nodes out
-               // by context node list.
-               private void FillMissingPrefixes (XmlNode n, XmlNamespaceManager nsmgr, ArrayList tmpList)
-               {
-                       if (n.Prefix.Length == 0 && propagatedNss != null) {
-                               foreach (DictionaryEntry de in propagatedNss)
-                                       if ((string) de.Value == n.NamespaceURI) {
-                                               n.Prefix = (string) de.Key;
-                                               break;
-                                       }
-                       }
-                       
-                       if (n.NodeType == XmlNodeType.Element && ((XmlElement) n).HasAttributes) {
-                               foreach (XmlAttribute a in n.Attributes)
-                                       if (a.NamespaceURI == "http://www.w3.org/2000/xmlns/")
-                                               nsmgr.AddNamespace (a.Prefix.Length == 0 ? String.Empty : a.LocalName, a.Value);
-                               nsmgr.PushScope ();
-                       }
-
-                       if (n.NamespaceURI.Length > 0 && nsmgr.LookupPrefix (n.NamespaceURI) == null)
-                               tmpList.Add (CreateXmlns (n));
-
-                       if (n.NodeType == XmlNodeType.Element && ((XmlElement) n).HasAttributes) {
-                               foreach (XmlAttribute a in n.Attributes)
-                                       if (a.NamespaceURI.Length > 0 && nsmgr.LookupNamespace (a.Prefix) == null)
-                                               tmpList.Add (CreateXmlns (a));
-                       }
-
-                       foreach (XmlAttribute a in tmpList)
-                               ((XmlElement) n).SetAttributeNode (a);
-                       tmpList.Clear ();
-
-                       if (n.HasChildNodes) {
-                               for (XmlNode c = n.FirstChild; c != null; c = c.NextSibling)
-                                       if (c.NodeType == XmlNodeType.Element)
-                                               FillMissingPrefixes (c, nsmgr, tmpList);
-                       }
-                       nsmgr.PopScope ();
-               }
-
-               private void WriteNode (XmlNode node)
-               {
-                       // Console.WriteLine ("C14N Debug: node=" + node.Name);
-
-                       bool visible = IsNodeVisible (node);
-                       switch (node.NodeType) {
-                       case XmlNodeType.Document:
-                       case XmlNodeType.DocumentFragment:
-                               WriteDocumentNode (node);
-                               break;
-                       case XmlNodeType.Element:
-                               WriteElementNode (node, visible);
-                               break;
-                       case XmlNodeType.CDATA:
-                       case XmlNodeType.SignificantWhitespace:
-                       case XmlNodeType.Text:
-                               // CDATA sections are processed as text nodes
-                               WriteTextNode (node, visible);
-                               break;
-                       case XmlNodeType.Whitespace:
-                               if (state == XmlCanonicalizerState.InsideDocElement)
-                                       WriteTextNode (node, visible);
-                               break;
-                       case XmlNodeType.Comment:
-                               WriteCommentNode (node, visible);
-                               break;
-                       case XmlNodeType.ProcessingInstruction:
-                               WriteProcessingInstructionNode (node, visible);
-                               break;
-                       case XmlNodeType.EntityReference:
-                               for (int i = 0; i < node.ChildNodes.Count; i++)
-                                       WriteNode (node.ChildNodes [i]);
-                               break;
-                       case XmlNodeType.Attribute:
-                               throw new XmlException ("Attribute node is impossible here", null);
-                       case XmlNodeType.EndElement:
-                               throw new XmlException ("EndElement node is impossible here", null);
-                       case XmlNodeType.EndEntity:
-                               throw new XmlException ("EndEntity node is impossible here", null);
-                       case XmlNodeType.DocumentType:
-                       case XmlNodeType.Entity:
-                       case XmlNodeType.Notation:
-                       case XmlNodeType.XmlDeclaration:
-                               // just do nothing
-                               break;
-                       }
-               }
-
-               private void WriteDocumentNode (XmlNode node)
-               {
-                       state = XmlCanonicalizerState.BeforeDocElement;
-                       for (XmlNode child = node.FirstChild; child != null; child = child.NextSibling)
-                               WriteNode (child);
-               }
-               
-               // Element Nodes
-               // If the element is not in the node-set, then the result is obtained 
-               // by processing the namespace axis, then the attribute axis, then 
-               // processing the child nodes of the element that are in the node-set 
-               // (in document order). If the element is inthe node-set, then the result 
-               // is an open angle bracket (<), the element QName, the result of 
-               // processing the namespace axis, the result of processing the attribute 
-               // axis, a close angle bracket (>), the result of processing the child 
-               // nodes of the element that are in the node-set (in document order), an 
-               // open angle bracket, a forward slash (/), the element QName, and a close 
-               // angle bracket.
-               private void WriteElementNode (XmlNode node, bool visible)
-               {
-                       // Console.WriteLine ("Debug: element node");
-                   
-                       // remember current state 
-                       int savedPrevVisibleNamespacesStart = prevVisibleNamespacesStart;
-                       int savedPrevVisibleNamespacesEnd = prevVisibleNamespacesEnd;
-                       int savedVisibleNamespacesSize = visibleNamespaces.Count;
-                       XmlCanonicalizerState s = state;
-                       if (visible && state == XmlCanonicalizerState.BeforeDocElement)
-                               state = XmlCanonicalizerState.InsideDocElement;
-                   
-                       // write start tag
-                       if (visible) {
-                               res.Append ("<");
-                               res.Append (node.Name);
-                       }
-                   
-                       // this is odd but you can select namespaces
-                       // and attributes even if node itself is not visible
-                       WriteNamespacesAxis (node, visible);
-                       WriteAttributesAxis (node);                     
-       
-                       if (visible)
-                               res.Append (">");
-
-                       // write children
-                       for (XmlNode child = node.FirstChild; child != null; child = child.NextSibling)
-                               WriteNode (child);
-                                   
-                       // write end tag            
-                       if (visible) {
-                               res.Append ("</");
-                               res.Append (node.Name);
-                               res.Append (">");
-                       }
-                   
-                       // restore state
-                       if (visible && s == XmlCanonicalizerState.BeforeDocElement)
-                               state = XmlCanonicalizerState.AfterDocElement;
-                       prevVisibleNamespacesStart = savedPrevVisibleNamespacesStart;
-                       prevVisibleNamespacesEnd = savedPrevVisibleNamespacesEnd;
-                       if (visibleNamespaces.Count > savedVisibleNamespacesSize) {
-                               visibleNamespaces.RemoveRange (savedVisibleNamespacesSize, 
-                                       visibleNamespaces.Count - savedVisibleNamespacesSize);
-                       }
-               }
-
-               // Namespace Axis
-               // Consider a list L containing only namespace nodes in the 
-               // axis and in the node-set in lexicographic order (ascending). To begin 
-               // processing L, if the first node is not the default namespace node (a node 
-               // with no namespace URI and no local name), then generate a space followed 
-               // by xmlns="" if and only if the following conditions are met:
-               //    - the element E that owns the axis is in the node-set
-               //    - The nearest ancestor element of E in the node-set has a default 
-               //          namespace node in the node-set (default namespace nodes always 
-               //      have non-empty values in XPath)
-               // The latter condition eliminates unnecessary occurrences of xmlns="" in 
-               // the canonical form since an element only receives an xmlns="" if its 
-               // default namespace is empty and if it has an immediate parent in the 
-               // canonical form that has a non-empty default namespace. To finish 
-               // processing  L, simply process every namespace node in L, except omit 
-               // namespace node with local name xml, which defines the xml prefix, 
-               // if its string value is http://www.w3.org/XML/1998/namespace.
-               private void WriteNamespacesAxis (XmlNode node, bool visible)
-               {
-                       // Console.WriteLine ("Debug: namespaces");
-
-                       XmlDocument doc = node.OwnerDocument;    
-                       bool has_empty_namespace = false;
-                       ArrayList list = new ArrayList ();
-                       for (XmlNode cur = node; cur != null && cur != doc; cur = cur.ParentNode) {
-                               foreach (XmlAttribute attribute in cur.Attributes) {            
-                                       if (!IsNamespaceNode (attribute)) 
-                                               continue;
-                               
-                                       // get namespace prefix
-                                       string prefix = string.Empty;
-                                       if (attribute.Prefix == "xmlns") 
-                                               prefix = attribute.LocalName;
-                           
-                                       // check if it is "xml" namespace                           
-                                       if (prefix == "xml" && attribute.Value == "http://www.w3.org/XML/1998/namespace")
-                                               continue;
-                           
-                                       // make sure that this is an active namespace
-                                       // for our node
-                                       string ns = node.GetNamespaceOfPrefix (prefix);
-                                       if (ns != attribute.Value) 
-                                               continue;
-                           
-                                       // check that it is selected with XPath
-                                       if (!IsNodeVisible (attribute)) 
-                                               continue;
-
-                                       // check that we have not rendered it yet
-                                       bool rendered = IsNamespaceRendered (prefix, attribute.Value);
-
-                                       // For exc-c14n, only visibly utilized
-                                       // namespaces are written.
-                                       if (exclusive && !IsVisiblyUtilized (node as XmlElement, attribute))
-                                               continue;
-
-                                       // add to the visible namespaces stack
-                                       if (visible)
-                                               visibleNamespaces.Add (attribute);                            
-                           
-                                       if (!rendered)
-                                               list.Add (attribute);
-                                   
-                                       if (prefix == string.Empty)
-                                               has_empty_namespace = true;
-                               }
-                       }
-
-                       // add empty namespace if needed
-                       if (visible && !has_empty_namespace && !IsNamespaceRendered (string.Empty, string.Empty) && node.NamespaceURI == String.Empty)
-                               res.Append (" xmlns=\"\"");
-                   
-                       list.Sort (new XmlDsigC14NTransformNamespacesComparer ());
-                       foreach (object obj in list) {
-                               XmlNode attribute = (obj as XmlNode);
-                               if (attribute != null) {
-                                       res.Append (" ");
-                                       res.Append (attribute.Name);
-                                       res.Append ("=\"");
-                                       res.Append (attribute.Value);
-                                       res.Append ("\"");
-                               }
-                       }
-                   
-                       // move the rendered namespaces stack
-                       if (visible) {
-                               prevVisibleNamespacesStart = prevVisibleNamespacesEnd;
-                               prevVisibleNamespacesEnd = visibleNamespaces.Count;     
-                       }
-               }
-               
-               // Attribute Axis 
-               // In lexicographic order (ascending), process each node that 
-               // is in the element's attribute axis and in the node-set.
-               // 
-               // The processing of an element node E MUST be modified slightly 
-               // when an XPath node-set is given as input and the element's 
-               // parent is omitted from the node-set.
-               private void WriteAttributesAxis (XmlNode node)
-               {
-                       // Console.WriteLine ("Debug: attributes");
-               
-                       ArrayList list = new ArrayList ();
-                       foreach (XmlNode attribute in node.Attributes) {        
-                               if (!IsNamespaceNode (attribute) && IsNodeVisible (attribute))
-                                       list.Add (attribute);
-                       }
-                    
-                       // Add attributes from "xml" namespace for "inclusive" c14n only:
-                       //
-                       // The method for processing the attribute axis of an element E 
-                       // in the node-set is enhanced. All element nodes along E's 
-                       // ancestor axis are examined for nearest occurrences of 
-                       // attributes in the xml namespace, such as xml:lang and 
-                       // xml:space (whether or not they are in the node-set). 
-                       // From this list of attributes, remove any that are in E's 
-                       // attribute axis (whether or not they are in the node-set). 
-                       // Then, lexicographically merge this attribute list with the 
-                       // nodes of E's attribute axis that are in the node-set. The 
-                       // result of visiting the attribute axis is computed by 
-                       // processing the attribute nodes in this merged attribute list.
-                       if (!exclusive && node.ParentNode != null && node.ParentNode.ParentNode != null && !IsNodeVisible (node.ParentNode.ParentNode)) {
-                               // if we have whole document then the node.ParentNode.ParentNode
-                               // is always visible
-                               for (XmlNode cur = node.ParentNode; cur != null; cur = cur.ParentNode) {
-                                       if (cur.Attributes == null)
-                                               continue;
-                                       foreach (XmlNode attribute in cur.Attributes) {
-                                               // we are looking for "xml:*" attributes
-                                               if (attribute.Prefix != "xml")
-                                                       continue;
-                               
-                                               // exclude ones that are in the node's attributes axis
-                                               if (node.Attributes.GetNamedItem (attribute.LocalName, attribute.NamespaceURI) != null)
-                                                       continue;
-                               
-                                               // finally check that we don't have the same attribute in our list
-                                               bool found = false;
-                                               foreach (object obj in list) {
-                                                       XmlNode n = (obj as XmlNode);
-                                                       if (n.Prefix == "xml" && n.LocalName == attribute.LocalName) {
-                                                               found = true;
-                                                               break;
-                                                       }
-                                               }
-                               
-                                               if (found) 
-                                                       continue;
-                               
-                                               // now we can add this attribute to our list
-                                               list.Add (attribute);
-                                       }
-                               }               
-                       }
-                       
-                       // sort namespaces and write results        
-                       list.Sort (new XmlDsigC14NTransformAttributesComparer ());
-                       foreach (object obj in list) {
-                               XmlNode attribute = (obj as XmlNode);
-                               if (attribute != null) {
-                                       res.Append (" ");
-                                       res.Append (attribute.Name);
-                                       res.Append ("=\"");
-                                       res.Append (NormalizeString (attribute.Value, XmlNodeType.Attribute));
-                                       res.Append ("\"");
-                               }
-                       }
-               }
-
-               // Text Nodes
-               // the string value, except all ampersands are replaced 
-               // by &amp;, all open angle brackets (<) are replaced by &lt;, all closing 
-               // angle brackets (>) are replaced by &gt;, and all #xD characters are 
-               // replaced by &#xD;.
-               private void WriteTextNode (XmlNode node, bool visible)
-               {
-                       // Console.WriteLine ("Debug: text node");
-                       if (visible)
-                               res.Append (NormalizeString (node.Value, node.NodeType));
-//                             res.Append (NormalizeString (node.Value, XmlNodeType.Text));
-               }               
-
-               // Comment Nodes
-               // Nothing if generating canonical XML without comments. For 
-               // canonical XML with comments, generate the opening comment 
-               // symbol (<!--), the string value of the node, and the 
-               // closing comment symbol (-->). Also, a trailing #xA is rendered 
-               // after the closing comment symbol for comment children of the 
-               // root node with a lesser document order than the document 
-               // element, and a leading #xA is rendered before the opening 
-               // comment symbol of comment children of the root node with a 
-               // greater document order than the document element. (Comment 
-               // children of the root node represent comments outside of the 
-               // top-level document element and outside of the document type 
-               // declaration).
-               private void WriteCommentNode (XmlNode node, bool visible)
-               {
-                       // Console.WriteLine ("Debug: comment node");
-                       if (visible && comments) {
-                           if (state == XmlCanonicalizerState.AfterDocElement)
-                                   res.Append ("\x0A<!--");
-                           else
-                                   res.Append ("<!--");
-                       
-                           res.Append (NormalizeString (node.Value, XmlNodeType.Comment));
-                           
-                           if (state == XmlCanonicalizerState.BeforeDocElement)
-                                   res.Append ("-->\x0A");
-                           else
-                                   res.Append ("-->");
-                       }
-               }
-               
-               // Processing Instruction (PI) Nodes- 
-               // The opening PI symbol (<?), the PI target name of the node, 
-               // a leading space and the string value if it is not empty, and 
-               // the closing PI symbol (?>). If the string value is empty, 
-               // then the leading space is not added. Also, a trailing #xA is 
-               // rendered after the closing PI symbol for PI children of the 
-               // root node with a lesser document order than the document 
-               // element, and a leading #xA is rendered before the opening PI 
-               // symbol of PI children of the root node with a greater document 
-               // order than the document element.
-               private void WriteProcessingInstructionNode (XmlNode node, bool visible)
-               {
-                       // Console.WriteLine ("Debug: PI node");
-
-                       if (visible) {
-                               if (state == XmlCanonicalizerState.AfterDocElement)
-                                       res.Append ("\x0A<?");
-                               else
-                                       res.Append ("<?");
-                       
-                               res.Append (node.Name);
-                               if (node.Value.Length > 0) {
-                                       res.Append (" ");
-                                       res.Append (NormalizeString (node.Value, XmlNodeType.ProcessingInstruction));
-                               }
-                       
-                               if (state == XmlCanonicalizerState.BeforeDocElement)
-                                       res.Append ("?>\x0A");
-                               else
-                                       res.Append ("?>");
-                       }
-               }
-
-               // determines whether the node is in the node-set or not.
-               private bool IsNodeVisible (XmlNode node)
-               {
-                       // if node list is empty then we process whole document
-                       if (xnl == null) 
-                               return true;
-                   
-                       // walk thru the list
-                       foreach (XmlNode xn in xnl) {
-                               if (node.Equals (xn)) 
-                                       return true;
-                       }
-                   
-                       return false;
-               }
-               
-               // This method assumes that the namespace node is *not*
-               // rendered yet.
-               private bool IsVisiblyUtilized (XmlElement owner, XmlAttribute ns)
-               {
-                       if (owner == null)
-                               return false;
-
-                       string prefix = ns.LocalName == "xmlns" ? String.Empty : ns.LocalName;
-                       if (owner.Prefix == prefix && owner.NamespaceURI == ns.Value)
-                               return true;
-                       if (!owner.HasAttributes)
-                               return false;
-                       foreach (XmlAttribute a in owner.Attributes) {
-                               if (a.Prefix == String.Empty)
-                                       continue;
-                               if (a.Prefix != prefix || a.NamespaceURI != ns.Value)
-                                       continue;
-                               if (IsNodeVisible (a))
-                                       return true;
-                       }
-                       return false;
-               }
-
-               private bool IsNamespaceRendered (string prefix, string uri)
-               {
-                       // if the default namespace xmlns="" is not re-defined yet
-                       // then we do not want to print it out
-                       bool IsEmptyNs = prefix == string.Empty && uri == string.Empty;
-                       int start = (IsEmptyNs) ? 0 : prevVisibleNamespacesStart;
-                       for (int i = visibleNamespaces.Count - 1; i >= start; i--) {
-                               XmlNode node = (visibleNamespaces[i] as XmlNode);
-                               if (node != null) {
-                                       // get namespace prefix
-                                       string p = string.Empty;
-                                       if (node.Prefix == "xmlns") 
-                                               p = node.LocalName;
-                                       if (p == prefix)
-                                               return node.Value == uri;
-                               }
-                       }
-                   
-                       return IsEmptyNs;
-               }
-               
-               private bool IsNamespaceNode (XmlNode node)
-               {
-                       if (node == null || node.NodeType != XmlNodeType.Attribute) 
-                               return false;
-                       return node.NamespaceURI == "http://www.w3.org/2000/xmlns/";
-               }
-    
-               private bool IsTextNode (XmlNodeType type)
-               {
-                       switch (type) {
-                       case XmlNodeType.Text:
-                       case XmlNodeType.CDATA:
-                       case XmlNodeType.SignificantWhitespace:
-                       case XmlNodeType.Whitespace:
-                               return true;
-                       }
-                       return false;
-               }
-
-               private string NormalizeString (string input, XmlNodeType type)
-               {
-                       StringBuilder sb = new StringBuilder ();
-                       for (int i = 0; i < input.Length; i++) {
-                               char ch = input[i];
-                               if (ch == '<' && (type == XmlNodeType.Attribute || IsTextNode (type)))
-                                       sb.Append ("&lt;");
-                               else if (ch == '>' && IsTextNode (type))
-                                       sb.Append ("&gt;");
-                               else if (ch == '&' && (type == XmlNodeType.Attribute || IsTextNode (type)))
-                                       sb.Append ("&amp;");
-                               else if (ch == '\"' && type == XmlNodeType.Attribute)
-                                       sb.Append ("&quot;");
-                               else if (ch == '\x09' && type == XmlNodeType.Attribute)
-                                       sb.Append ("&#x9;");
-                               else if (ch == '\x0A' && type == XmlNodeType.Attribute)
-                                       sb.Append ("&#xA;");
-                               else if (ch == '\x0D')
-                                       sb.Append ("&#xD;");
-                               else
-                                       sb.Append (ch);
-                       }
-                   
-                       return sb.ToString ();
-               }
-       }
-    
-       internal class XmlDsigC14NTransformAttributesComparer : IComparer
-       {
-               public int Compare (object x, object y)
-               {
-                       XmlNode n1 = (x as XmlNode);
-                       XmlNode n2 = (y as XmlNode);
-               
-                       // simple cases
-                       if (n1 == n2) 
-                               return 0;
-                       else if (n1 == null) 
-                               return -1;
-                       else if (n2 == null) 
-                               return 1;
-                       else if (n1.Prefix == n2.Prefix) 
-                               return string.CompareOrdinal (n1.LocalName, n2.LocalName);
-       
-                       // Attributes in the default namespace are first
-                       // because the default namespace is not applied to
-                       // unqualified attributes
-                       if (n1.Prefix == string.Empty) 
-                               return -1;
-                       else if (n2.Prefix == string.Empty) 
-                               return 1;
-                   
-                       int ret = string.Compare (n1.NamespaceURI, n2.NamespaceURI);
-                       if (ret == 0)
-                               ret = string.Compare (n1.LocalName, n2.LocalName);
-                       return ret;
-               }
-       }
-
-       internal class XmlDsigC14NTransformNamespacesComparer : IComparer
-       {
-               public int Compare (object x, object y)
-               {
-                       XmlNode n1 = (x as XmlNode);
-                       XmlNode n2 = (y as XmlNode);
-               
-                       // simple cases
-                       if (n1 == n2) 
-                               return 0;
-                       else if (n1 == null) 
-                               return -1;
-                       else if (n2 == null) 
-                               return 1;
-                       else if (n1.Prefix == string.Empty) 
-                               return -1;
-                       else if (n2.Prefix == string.Empty) 
-                               return 1;
-                   
-                       return string.Compare (n1.LocalName, n2.LocalName);
-               }
-       }
-}
-
index 1a0022fbc8a16a9dac3dd0d0829069109328ed02..aad71444d75dbf2db49d9bf87a4d0ea2d34151c8 100644 (file)
@@ -8,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{3ED36717-A9D1-4289-8949-9B7F39766DEB}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
-    <NoWarn>1699,618,414</NoWarn>\r
+    <NoWarn>1699,414,618</NoWarn>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>\r
     <AssemblyName>System.Security</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,618,414</NoWarn>\r
+    <NoWarn>1699,414,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SECURITY_DEP</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SECURITY_DEP;SYSTEM_SECURITY_DLL</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
     <DebugType>pdbonly</DebugType>\r
-    <NoWarn>1699,618,414</NoWarn>\r
+    <NoWarn>1699,414,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SECURITY_DEP</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;SECURITY_DEP;SYSTEM_SECURITY_DLL</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\AncestralNamespaceContextManager.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\AttributeSortOrder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\C14NAncestralNamespaceContextManager.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalizationDispatcher.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXml.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlAttribute.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlCDataSection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlComment.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlDocument.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlElement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlEntityReference.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlNodeList.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlProcessingInstruction.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlSignificantWhitespace.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlText.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CanonicalXmlWhitespace.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CertUsageType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\CryptoHelpers.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\DocPosition.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\DSASignatureDescription.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\ExcAncestralNamespaceContextManager.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\ExcCanonicalXml.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\ICanonicalizableNode.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\MyXmlDocument.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\NamespaceFrame.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\NamespaceSortOrder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\Reference.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\ReferenceTargetType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\RSAPKCS1SHA1SignatureDescription.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\RSAPKCS1SHA256SignatureDescription.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\RSAPKCS1SHA384SignatureDescription.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\RSAPKCS1SHA512SignatureDescription.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\RSAPKCS1SignatureDescription.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\SignedXmlDebugLog.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\Transform.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\TransformChain.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\Utils.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\XmlDecryptionTransform.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\XmlDsigBase64Transform.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\XmlDsigC14NTransform.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\XmlDsigC14NWithCommentsTransform.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\XmlDsigEnvelopedSignatureTransform.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\XmlDsigExcC14NTransform.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\XmlDsigExcC14NWithCommentsTransform.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\XmlDsigXPathTransform.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\XmlDsigXsltTransform.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Xml\src\System\Security\Cryptography\Xml\XmlLicenseTransform.cs" />\r
     <Compile Include="..\..\build\common\Consts.cs" />\r
     <Compile Include="..\..\build\common\Locale.cs" />\r
     <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
+    <Compile Include="..\System.Core\System.Security.Cryptography.X509Certificates\RSACertificateExtensions.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
     <Compile Include="corefx\SR.cs" />\r
     <Compile Include="Mono.Security.Cryptography\ManagedProtection.cs" />\r
     <Compile Include="Mono.Security.Cryptography\NativeDapiProtection.cs" />\r
-    <Compile Include="Mono.Xml\XmlCanonicalizer.cs" />\r
     <Compile Include="System.Security.Cryptography.Pkcs\AlgorithmIdentifier.cs" />\r
     <Compile Include="System.Security.Cryptography.Pkcs\CmsRecipient.cs" />\r
     <Compile Include="System.Security.Cryptography.Pkcs\CmsRecipientCollection.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\KeyInfoX509Data.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\KeyReference.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\Manifest.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\Reference.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\ReferenceList.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\RSAKeyValue.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\Signature.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\SignedInfo.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\SignedXml.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\SymmetricKeyWrap.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\Transform.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\TransformChain.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\X509IssuerSerial.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlDecryptionTransform.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlDsigBase64Transform.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlDsigC14NTransform.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlDsigC14NWithCommentsTransform.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlDsigEnvelopedSignatureTransform.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlDsigExcC14NTransform.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlDsigExcC14NWithCommentsTransform.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlDsigNodeList.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlDsigXPathTransform.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlDsigXsltTransform.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\XmlEncryption.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlLicenseTransform.cs" />\r
     <Compile Include="System.Security.Cryptography.Xml\XmlSignature.cs" />\r
-    <Compile Include="System.Security.Cryptography.Xml\XmlSignatureStreamReader.cs" />\r
     <Compile Include="System.Security.Cryptography\CryptographicAttribute.cs" />\r
     <Compile Include="System.Security.Cryptography\CryptographicAttributeCollection.cs" />\r
     <Compile Include="System.Security.Cryptography\CryptographicAttributeEnumerator.cs" />\r
index e748523cbc49855417b2f7e308e61ecc142e1e57..d6ecbe63afdfbe901602b04ee45fd3d6bb4faf7c 100644 (file)
@@ -134,31 +134,31 @@ namespace System.Security.Cryptography.Xml {
                                                foreach (XmlNode xn in ((XmlElement) n).GetElementsByTagName (XmlSignature.ElementNames.Transform, XmlSignature.NamespaceURI)) {
                                                        Transform t = null;
                                                        switch (((XmlElement) xn).Attributes [XmlSignature.AttributeNames.Algorithm].Value) {
-                                                       case XmlSignature.AlgorithmNamespaces.XmlDsigBase64Transform:
+                                                       case SignedXml.XmlDsigBase64TransformUrl:
                                                                t = new XmlDsigBase64Transform ();
                                                                break;
-                                                       case XmlSignature.AlgorithmNamespaces.XmlDsigC14NTransform:
+                                                       case SignedXml.XmlDsigC14NTransformUrl:
                                                                t = new XmlDsigC14NTransform ();
                                                                break;
-                                                       case XmlSignature.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:
+                                                       case SignedXml.XmlDsigC14NWithCommentsTransformUrl:
                                                                t = new XmlDsigC14NWithCommentsTransform ();
                                                                break;
-                                                       case XmlSignature.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:
+                                                       case SignedXml.XmlDsigEnvelopedSignatureTransformUrl:
                                                                t = new XmlDsigEnvelopedSignatureTransform ();
                                                                break;
-                                                       case XmlSignature.AlgorithmNamespaces.XmlDsigXPathTransform:
+                                                       case SignedXml.XmlDsigXPathTransformUrl:
                                                                t = new XmlDsigXPathTransform ();
                                                                break;
-                                                       case XmlSignature.AlgorithmNamespaces.XmlDsigXsltTransform:
+                                                       case SignedXml.XmlDsigXsltTransformUrl:
                                                                t = new XmlDsigXsltTransform ();
                                                                break;
-                                                       case XmlSignature.AlgorithmNamespaces.XmlDsigExcC14NTransform:
+                                                       case SignedXml.XmlDsigExcC14NTransformUrl:
                                                                t = new XmlDsigExcC14NTransform ();
                                                                break;
-                                                       case XmlSignature.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:
+                                                       case SignedXml.XmlDsigExcC14NWithCommentsTransformUrl:
                                                                t = new XmlDsigExcC14NWithCommentsTransform ();
                                                                break;
-                                                       case XmlSignature.AlgorithmNamespaces.XmlDecryptionTransform:
+                                                       case SignedXml.XmlDecryptionTransformUrl:
                                                                t = new XmlDecryptionTransform ();
                                                                break;
                                                        default:
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/Reference.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/Reference.cs
deleted file mode 100644 (file)
index 2376c4e..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-//
-// Reference.cs - Reference implementation for XML Signature
-//
-// Author:
-//     Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Xml;
-
-namespace System.Security.Cryptography.Xml { 
-
-       // http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/Overview.html#sec-Reference
-       public class Reference {
-
-               private TransformChain chain;
-               private string digestMethod;
-               private byte[] digestValue;
-               private string id;
-               private string uri;
-               private string type;
-               private Stream stream;
-               private XmlElement element;
-
-               public Reference () 
-               {
-                       chain = new TransformChain ();
-                       digestMethod = XmlSignature.NamespaceURI + "sha1";
-               }
-
-               [MonoTODO ("There is no description about how it is used.")]
-               public Reference (Stream stream) : this () 
-               {
-                       this.stream = stream;
-               }
-
-               public Reference (string uri) : this ()
-               {
-                       this.uri = uri;
-               }
-
-               // default to SHA1
-               public string DigestMethod {
-                       get { return digestMethod; }
-                       set {
-                               element = null;
-                               digestMethod = value;
-                       }
-               }
-
-               public byte[] DigestValue {
-                       get { return digestValue; }
-                       set {
-                               element = null;
-                               digestValue = value;
-                       }
-               }
-
-               public string Id {
-                       get { return id; }
-                       set {
-                               element = null;
-                               id = value;
-                       }
-               }
-
-               public TransformChain TransformChain {
-                       get { return chain; }
-                       [ComVisible (false)]
-                       set { chain = value; }
-               }
-
-               public string Type {
-                       get { return type; }
-                       set {
-                               element = null;
-                               type = value;
-                       }
-               }
-
-               public string Uri {
-                       get { return uri; }
-                       set {
-                               element = null;
-                               uri = value;
-                       }
-               }
-
-               public void AddTransform (Transform transform) 
-               {
-                       chain.Add (transform);
-               }
-
-               public XmlElement GetXml () 
-               {
-                       if (element != null)
-                               return element;
-
-                       if (digestMethod == null)
-                               throw new CryptographicException ("DigestMethod");
-                       if (digestValue == null)
-                               throw new NullReferenceException ("DigestValue");
-
-                       XmlDocument document = new XmlDocument ();
-                       XmlElement xel = document.CreateElement (XmlSignature.ElementNames.Reference, XmlSignature.NamespaceURI);
-                       if (id != null)
-                               xel.SetAttribute (XmlSignature.AttributeNames.Id, id);
-                       if (uri != null)
-                               xel.SetAttribute (XmlSignature.AttributeNames.URI, uri);
-                       if (type != null)
-                               xel.SetAttribute (XmlSignature.AttributeNames.Type, type);
-
-                       if (chain.Count > 0) {
-                               XmlElement ts = document.CreateElement (XmlSignature.ElementNames.Transforms, XmlSignature.NamespaceURI);
-                               foreach (Transform t in chain) {
-                                       XmlNode xn = t.GetXml ();
-                                       XmlNode newNode = document.ImportNode (xn, true);
-                                       ts.AppendChild (newNode);
-                               }
-                               xel.AppendChild (ts);
-                       }
-
-                       XmlElement dm = document.CreateElement (XmlSignature.ElementNames.DigestMethod, XmlSignature.NamespaceURI);
-                       dm.SetAttribute (XmlSignature.AttributeNames.Algorithm, digestMethod);
-                       xel.AppendChild (dm);
-
-                       XmlElement dv = document.CreateElement (XmlSignature.ElementNames.DigestValue, XmlSignature.NamespaceURI);
-                       dv.InnerText = Convert.ToBase64String (digestValue);
-                       xel.AppendChild (dv);
-
-                       return xel;
-               }
-
-               // note: we do NOT return null -on purpose- if attribute isn't found
-               private string GetAttribute (XmlElement xel, string attribute) 
-               {
-                       XmlAttribute xa = xel.Attributes [attribute];
-                       return ((xa != null) ? xa.InnerText : null);
-               }
-
-               public void LoadXml (XmlElement value) 
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-
-                       if ((value.LocalName != XmlSignature.ElementNames.Reference) || (value.NamespaceURI != XmlSignature.NamespaceURI))
-                               throw new CryptographicException ();
-
-                       id = GetAttribute (value, XmlSignature.AttributeNames.Id);
-                       uri = GetAttribute (value, XmlSignature.AttributeNames.URI);
-                       type = GetAttribute (value, XmlSignature.AttributeNames.Type);
-                       // Note: order is important for validations
-                       XmlNodeList xnl = value.GetElementsByTagName (XmlSignature.ElementNames.Transform, XmlSignature.NamespaceURI);
-                       if ((xnl != null) && (xnl.Count > 0)) {
-                               Transform t = null;
-                               foreach (XmlNode xn in xnl) {
-                                       string a = GetAttribute ((XmlElement)xn, XmlSignature.AttributeNames.Algorithm);
-/*     This code is useful for debugging in VS.NET because using CryptoConfig
-       (from MS mscorlib) would throw InvalidCastException because it's 
-       Transform would come from MS System.Security.dll not Mono's.
-                                       switch (a) {
-                                               case "http://www.w3.org/2000/09/xmldsig#base64":
-                                                       t = new XmlDsigBase64Transform ();
-                                                       break;
-                                               case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315":
-                                                       t = new XmlDsigC14NTransform ();
-                                                       break;
-                                               case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":
-                                                       t = new XmlDsigC14NWithCommentsTransform ();
-                                                       break;
-                                               case "http://www.w3.org/2000/09/xmldsig#enveloped-signature":
-                                                       t = new XmlDsigEnvelopedSignatureTransform ();
-                                                       break;
-                                               case "http://www.w3.org/TR/1999/REC-xpath-19991116":
-                                                       t = new XmlDsigXPathTransform ();
-                                                       break;
-                                               case "http://www.w3.org/TR/1999/REC-xslt-19991116":
-                                                       t = new XmlDsigXsltTransform ();
-                                                       break;
-                                               case "http://www.w3.org/2002/07/decrypt#XML":
-                                                       t = new XmlDecryptionTransform ();
-                                                       break;
-                                               default:
-                                                       throw new NotSupportedException ();
-                                       }
-*/
-                                       t = (Transform) CryptoConfig.CreateFromName (a);
-                                       if (t == null)
-                                               throw new CryptographicException ("Unknown transform {0}.", a);
-
-                                       if (xn.ChildNodes.Count > 0) {
-                                               t.LoadInnerXml (xn.ChildNodes);
-                                       }
-                                       AddTransform (t);
-                               }
-                       }
-                       // get DigestMethod
-                       DigestMethod = XmlSignature.GetAttributeFromElement (value, XmlSignature.AttributeNames.Algorithm, XmlSignature.ElementNames.DigestMethod);
-                       // get DigestValue
-                       XmlElement dig = XmlSignature.GetChildElement (value, XmlSignature.ElementNames.DigestValue, XmlSignature.NamespaceURI);
-                       if (dig != null)
-                               DigestValue = Convert.FromBase64String (dig.InnerText);
-                       element = value;
-               }
-       }
-}
index 2ebec9809470e239cd1a6902fa06ead25ef57bf5..84d13e83c14f5eadd2fc2cbbc3ecbffd57666cc3 100644 (file)
@@ -43,26 +43,36 @@ using System.Security.Cryptography.X509Certificates;
 namespace System.Security.Cryptography.Xml {
 
        public class SignedXml {
-
-               public const string XmlDsigCanonicalizationUrl                  = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
-               public const string XmlDsigCanonicalizationWithCommentsUrl      = XmlDsigCanonicalizationUrl + "#WithComments";
-               public const string XmlDsigDSAUrl                               = XmlDsigNamespaceUrl + "dsa-sha1";
-               public const string XmlDsigHMACSHA1Url                          = XmlDsigNamespaceUrl + "hmac-sha1";
-               public const string XmlDsigMinimalCanonicalizationUrl           = XmlDsigNamespaceUrl + "minimal";
-               public const string XmlDsigNamespaceUrl                         = "http://www.w3.org/2000/09/xmldsig#";
-               public const string XmlDsigRSASHA1Url                           = XmlDsigNamespaceUrl + "rsa-sha1";
-               public const string XmlDsigSHA1Url                              = XmlDsigNamespaceUrl + "sha1";
-
-               public const string XmlDecryptionTransformUrl                   = "http://www.w3.org/2002/07/decrypt#XML";
-               public const string XmlDsigBase64TransformUrl                   = XmlDsigNamespaceUrl + "base64";
-               public const string XmlDsigC14NTransformUrl                     = XmlDsigCanonicalizationUrl;
-               public const string XmlDsigC14NWithCommentsTransformUrl         = XmlDsigCanonicalizationWithCommentsUrl;
-               public const string XmlDsigEnvelopedSignatureTransformUrl       = XmlDsigNamespaceUrl + "enveloped-signature";
-               public const string XmlDsigExcC14NTransformUrl                  = "http://www.w3.org/2001/10/xml-exc-c14n#";
-               public const string XmlDsigExcC14NWithCommentsTransformUrl      = XmlDsigExcC14NTransformUrl + "WithComments";
-               public const string XmlDsigXPathTransformUrl                    = "http://www.w3.org/TR/1999/REC-xpath-19991116";
-               public const string XmlDsigXsltTransformUrl                     = "http://www.w3.org/TR/1999/REC-xslt-19991116";
-               public const string XmlLicenseTransformUrl                      = "urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform";
+               public const string XmlDsigNamespaceUrl = "http://www.w3.org/2000/09/xmldsig#";
+               public const string XmlDsigMinimalCanonicalizationUrl = "http://www.w3.org/2000/09/xmldsig#minimal";
+               public const string XmlDsigCanonicalizationUrl = XmlDsigC14NTransformUrl;
+               public const string XmlDsigCanonicalizationWithCommentsUrl = XmlDsigC14NWithCommentsTransformUrl;
+
+               public const string XmlDsigSHA1Url = "http://www.w3.org/2000/09/xmldsig#sha1";
+               public const string XmlDsigDSAUrl = "http://www.w3.org/2000/09/xmldsig#dsa-sha1";
+               public const string XmlDsigRSASHA1Url = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
+               public const string XmlDsigHMACSHA1Url = "http://www.w3.org/2000/09/xmldsig#hmac-sha1";
+
+               public const string XmlDsigSHA256Url = "http://www.w3.org/2001/04/xmlenc#sha256";
+               public const string XmlDsigRSASHA256Url = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";
+
+               // Yes, SHA384 is in the xmldsig-more namespace even though all the other SHA variants are in xmlenc. That's the standard.
+               public const string XmlDsigSHA384Url = "http://www.w3.org/2001/04/xmldsig-more#sha384";
+               public const string XmlDsigRSASHA384Url = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384";
+
+               public const string XmlDsigSHA512Url = "http://www.w3.org/2001/04/xmlenc#sha512";
+               public const string XmlDsigRSASHA512Url = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";
+
+               public const string XmlDsigC14NTransformUrl = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
+               public const string XmlDsigC14NWithCommentsTransformUrl = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";
+               public const string XmlDsigExcC14NTransformUrl = "http://www.w3.org/2001/10/xml-exc-c14n#";
+               public const string XmlDsigExcC14NWithCommentsTransformUrl = "http://www.w3.org/2001/10/xml-exc-c14n#WithComments";
+               public const string XmlDsigBase64TransformUrl = "http://www.w3.org/2000/09/xmldsig#base64";
+               public const string XmlDsigXPathTransformUrl = "http://www.w3.org/TR/1999/REC-xpath-19991116";
+               public const string XmlDsigXsltTransformUrl = "http://www.w3.org/TR/1999/REC-xslt-19991116";
+               public const string XmlDsigEnvelopedSignatureTransformUrl = "http://www.w3.org/2000/09/xmldsig#enveloped-signature";
+               public const string XmlDecryptionTransformUrl = "http://www.w3.org/2002/07/decrypt#XML";
+               public const string XmlLicenseTransformUrl = "urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform";
 
                private EncryptedXml encryptedXml;
 
@@ -74,7 +84,9 @@ namespace System.Security.Cryptography.Xml {
                private XmlElement signatureElement;
                private Hashtable hashes;
                // FIXME: enable it after CAS implementation
-               private XmlResolver xmlResolver = new XmlUrlResolver ();
+               internal XmlResolver _xmlResolver = new XmlUrlResolver ();
+               private bool _bResolverSet = true;
+               internal XmlElement _context;
                private ArrayList manifests;
                private IEnumerator _x509Enumerator;
 
@@ -85,6 +97,7 @@ namespace System.Security.Cryptography.Xml {
                        m_signature = new Signature ();
                        m_signature.SignedInfo = new SignedInfo ();
                        hashes = new Hashtable (2); // 98% SHA1 for now
+                       _context = null;
                }
 
                public SignedXml (XmlDocument document) : this ()
@@ -92,6 +105,7 @@ namespace System.Security.Cryptography.Xml {
                        if (document == null)
                                throw new ArgumentNullException ("document");
                        envdoc = document;
+                       _context = document.DocumentElement;
                }
 
                public SignedXml (XmlElement elem) : this ()
@@ -99,6 +113,7 @@ namespace System.Security.Cryptography.Xml {
                        if (elem == null)
                                throw new ArgumentNullException ("elem");
                        envdoc = new XmlDocument ();
+                       _context = elem;
                        envdoc.LoadXml (elem.OuterXml);
                }
 
@@ -148,6 +163,22 @@ namespace System.Security.Cryptography.Xml {
                        set { m_strSigningKeyName = value; }
                }
 
+               public XmlResolver Resolver
+               {
+                       // This property only has a setter. The rationale for this is that we don't have a good value
+                       // to return when it has not been explicitely set, as we are using XmlSecureResolver by default
+                       set
+                       {
+                               _xmlResolver = value;
+                               _bResolverSet = true;
+                       }
+               }
+
+               internal bool ResolverSet
+               {
+                       get { return _bResolverSet; }
+               }
+
                public void AddObject (DataObject dataObject) 
                {
                        m_signature.AddObject (dataObject);
@@ -221,9 +252,9 @@ namespace System.Security.Cryptography.Xml {
                                        FixupNamespaceNodes (xel, doc.DocumentElement, false);
                                }
                        }
-                       else if (xmlResolver != null) {
+                       else if (_xmlResolver != null) {
                                // TODO: need testing
-                               Stream s = (Stream) xmlResolver.GetEntity (new Uri (r.Uri), null, typeof (Stream));
+                               Stream s = (Stream) _xmlResolver.GetEntity (new Uri (r.Uri), null, typeof (Stream));
                                doc.Load (s);
                        }
 
@@ -281,12 +312,12 @@ namespace System.Security.Cryptography.Xml {
                                else if (r.Uri [0] == '#') {
                                        objectName = r.Uri.Substring (1);
                                }
-                               else if (xmlResolver != null) {
+                               else if (_xmlResolver != null) {
                                        // TODO: test but doc says that Resolver = null -> no access
                                        try {
                                                // no way to know if valid without throwing an exception
                                                Uri uri = new Uri (r.Uri);
-                                               s = (Stream) xmlResolver.GetEntity (uri, null, typeof (Stream));
+                                               s = (Stream) _xmlResolver.GetEntity (uri, null, typeof (Stream));
                                        }
                                        catch {
                                                // may still be a local file (and maybe not xml)
@@ -763,6 +794,11 @@ namespace System.Security.Cryptography.Xml {
 
                        signatureElement = value;
                        m_signature.LoadXml (value);
+
+                       if (_context == null) {
+                               _context = value;
+                       }
+
                        // Need to give the EncryptedXml object to the 
                        // XmlDecryptionTransform to give it a fighting 
                        // chance at decrypting the document.
@@ -773,10 +809,5 @@ namespace System.Security.Cryptography.Xml {
                                }
                        }
                }
-
-               [ComVisible (false)]
-               public XmlResolver Resolver {
-                       set { xmlResolver = value; }
-               }
        }
 }
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/Transform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/Transform.cs
deleted file mode 100644 (file)
index 80c8923..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// Transform.cs - Transform implementation for XML Signature
-//
-// Author:
-//     Sebastien Pouliot <sebastien@ximian.com>
-//     Atsushi Enomoto <atsushi@ximian.com>
-//      Tim Coleman <tim@timcoleman.com>
-//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) Tim Coleman, 2004
-// Copyright (C) 2004-2006 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Security;
-using System.Security.Policy;
-using System.Xml;
-
-namespace System.Security.Cryptography.Xml { 
-
-       public abstract class Transform {
-
-               private string algo;
-               private XmlResolver xmlResolver;
-               private Hashtable propagated_namespaces = new Hashtable ();
-
-               protected Transform ()
-               {
-                       if (SecurityManager.SecurityEnabled) {
-                               xmlResolver = new XmlSecureResolver (new XmlUrlResolver (), (Evidence) new Evidence ());
-                       } else {
-                               xmlResolver = new XmlUrlResolver ();
-                       }
-               }
-
-               #region Properties
-
-               public string Algorithm {
-                       get { return algo; }
-                       set { algo = value; }
-               }
-
-               public abstract Type[] InputTypes {
-                       get;
-               }
-
-               public abstract Type[] OutputTypes {
-                       get;
-               }
-
-               [ComVisible(false)]
-               public XmlResolver Resolver {
-                       set { xmlResolver = value; }
-               }
-
-               [MonoTODO]
-               [ComVisible (false)]
-               public XmlElement Context {
-                       get { throw new NotImplementedException (); }
-                       set { throw new NotImplementedException (); }
-               }
-
-               [ComVisible (false)]
-               public Hashtable PropagatedNamespaces {
-                       get { return propagated_namespaces; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-               [ComVisible (false)]
-               public virtual byte[] GetDigestedOutput (HashAlgorithm hash)
-               {
-                       // no null check, MS throws a NullReferenceException here
-                       return hash.ComputeHash ((Stream) GetOutput (typeof (Stream)));
-               }
-
-               protected abstract XmlNodeList GetInnerXml ();
-
-               public abstract object GetOutput ();
-
-               public abstract object GetOutput (Type type);
-
-               public XmlElement GetXml () 
-               {
-                       XmlDocument document = new XmlDocument ();
-                       document.XmlResolver = GetResolver ();
-                       XmlElement xel = document.CreateElement (XmlSignature.ElementNames.Transform, XmlSignature.NamespaceURI);
-                       xel.SetAttribute (XmlSignature.AttributeNames.Algorithm, algo);
-                       XmlNodeList xnl = this.GetInnerXml ();
-                       if (xnl != null) {
-                               foreach (XmlNode xn in xnl) {
-                                       XmlNode importedNode = document.ImportNode (xn, true);
-                                       xel.AppendChild (importedNode);
-                               }
-                       }
-                       return xel;
-               }
-
-               public abstract void LoadInnerXml (XmlNodeList nodeList);
-
-               public abstract void LoadInput (object obj);
-
-               internal XmlResolver GetResolver ()
-               {
-                       return xmlResolver;
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/TransformChain.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/TransformChain.cs
deleted file mode 100644 (file)
index 523b348..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// TransformChain.cs - TransformChain implementation for XML Signature
-//
-// Author:
-//     Sebastien Pouliot (spouliot@motus.com)
-//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-
-namespace System.Security.Cryptography.Xml { 
-
-       public class TransformChain {
-
-               private ArrayList chain;
-
-               public TransformChain() 
-               {
-                       chain = new ArrayList ();
-               }
-
-               public int Count {
-                       get { return chain.Count; }
-               }
-
-               public Transform this [int index] {
-                       get { return (Transform) chain [index]; }
-               }
-
-               public void Add (Transform transform) 
-               {
-                       chain.Add (transform);
-               }
-
-               public IEnumerator GetEnumerator () 
-               {
-                       return chain.GetEnumerator ();
-               }
-       }
-}
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDecryptionTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDecryptionTransform.cs
deleted file mode 100644 (file)
index 154061b..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// XmlDecryptionTransform.cs - XmlDecryptionTransform implementation for XML Encryption
-//
-// Author:
-//      Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2004
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Collections;
-using System.IO;
-using System.Xml;
-
-namespace System.Security.Cryptography.Xml {
-
-       public class XmlDecryptionTransform : Transform {
-
-               #region Fields
-
-               EncryptedXml encryptedXml;
-               Type[] inputTypes;
-               Type[] outputTypes;
-               object inputObj;
-               ArrayList exceptUris;
-
-               const string NamespaceUri = "http://www.w3.org/2002/07/decrypt#";
-
-               #endregion // Fields
-
-               #region Constructors
-       
-               public XmlDecryptionTransform ()
-               {
-                       Algorithm = XmlSignature.AlgorithmNamespaces.XmlDecryptionTransform;
-                       encryptedXml = new EncryptedXml ();
-                       exceptUris = new ArrayList ();
-               }
-       
-               #endregion // Constructors
-
-               #region Properties
-
-               public EncryptedXml EncryptedXml {
-                       get { return encryptedXml; }
-                       set { encryptedXml = value; }
-               }
-
-               public override Type[] InputTypes {
-                       get { 
-                               if (inputTypes == null)
-                                       inputTypes = new Type [2] {typeof (System.IO.Stream), typeof (System.Xml.XmlDocument)}; 
-
-                               return inputTypes;
-                       }
-               }
-
-               public override Type[] OutputTypes {
-                       get { 
-                               if (outputTypes == null)
-                                       outputTypes = new Type [1] {typeof (System.Xml.XmlDocument)};
-
-                               return outputTypes;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public void AddExceptUri (string uri)
-               {
-                       exceptUris.Add (uri);
-               }
-
-               private void ClearExceptUris ()
-               {
-                       exceptUris.Clear ();
-               }
-
-               [MonoTODO ("Verify")]
-               protected override XmlNodeList GetInnerXml ()
-               {
-                       XmlDocument doc = new XmlDocument ();
-                       doc.AppendChild (doc.CreateElement ("DecryptionTransform"));
-
-                       foreach (object o in exceptUris) {
-                               XmlElement element = doc.CreateElement ("Except", NamespaceUri);
-                               element.Attributes.Append (doc.CreateAttribute ("URI", NamespaceUri));
-                               element.Attributes ["URI", NamespaceUri].Value = (string) o;
-                               doc.DocumentElement.AppendChild (element);
-                       }
-
-                       return doc.GetElementsByTagName ("Except", NamespaceUri);
-               }
-
-               [MonoTODO ("Verify processing of ExceptURIs")]
-               public override object GetOutput ()
-               {
-                       XmlDocument document;
-                       if (inputObj is Stream) {
-                               document = new XmlDocument ();
-                               document.PreserveWhitespace = true;
-                               document.XmlResolver = GetResolver ();
-                               document.Load (new XmlSignatureStreamReader (
-                                       new StreamReader (inputObj as Stream)));
-                       }
-                       else if (inputObj is XmlDocument) {
-                               document = inputObj as XmlDocument;
-                       }
-                       else
-                               throw new NullReferenceException ();
-
-                       XmlNodeList nodes = document.GetElementsByTagName ("EncryptedData", EncryptedXml.XmlEncNamespaceUrl);
-                       foreach (XmlNode node in nodes) {
-                               if (node == document.DocumentElement && exceptUris.Contains ("#xpointer(/)"))
-                                       break;
-
-                               // Need to exclude based on ExceptURI.  Only accept #id references.
-                               foreach (string uri in exceptUris) 
-                                       if (IsTargetElement ((XmlElement) node, uri.Substring (1)))
-                                               break;
-
-                               EncryptedData encryptedData = new EncryptedData ();
-                               encryptedData.LoadXml ((XmlElement) node);
-                               SymmetricAlgorithm symAlg = EncryptedXml.GetDecryptionKey (encryptedData, encryptedData.EncryptionMethod.KeyAlgorithm);
-                               EncryptedXml.ReplaceData ((XmlElement) node, EncryptedXml.DecryptData (encryptedData, symAlg));
-                       }
-
-                       return document;
-               }
-
-               public override object GetOutput (Type type)
-               {       
-                       if (type == typeof (Stream))
-                               return GetOutput ();
-                       throw new ArgumentException ("type");
-               }
-
-               [MonoTODO ("verify")]
-               protected virtual bool IsTargetElement (XmlElement inputElement, string idValue)
-               {
-                       if ((inputElement == null) || (idValue == null))
-                               return false;
-                       return (inputElement.Attributes ["id"].Value == idValue);
-               }
-
-               [MonoTODO ("This doesn't seem to work in .NET")]
-               public override void LoadInnerXml (XmlNodeList nodeList)
-               {
-                       if (nodeList == null)
-                               throw new NullReferenceException ();
-
-                       ClearExceptUris ();
-                       foreach (XmlNode node in nodeList) {
-                               XmlElement element = node as XmlElement;
-                               if (element.NamespaceURI.Equals (NamespaceUri) && element.LocalName.Equals ("Except")) {
-                                       string uri = element.Attributes ["URI", NamespaceUri].Value;
-                                       if (!uri.StartsWith ("#"))
-                                               throw new CryptographicException ("A Uri attribute is required for a CipherReference element.");
-                                       AddExceptUri (uri);
-                               }
-                       }
-               }
-
-               public override void LoadInput (object obj)
-               {
-                       inputObj = obj;
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigBase64Transform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigBase64Transform.cs
deleted file mode 100644 (file)
index 389c4ba..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// XmlDsigBase64Transform.cs - Base64 Transform implementation for XML Signature
-//
-// Author:
-//     Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.IO;
-using System.Security.Cryptography;
-using System.Text;
-using System.Xml;
-
-namespace System.Security.Cryptography.Xml { 
-
-       // http://www.w3.org/2000/09/xmldsig#base64
-       public class XmlDsigBase64Transform : Transform {
-
-               private CryptoStream cs;
-               private Type[] input;
-               private Type[] output;
-
-               public XmlDsigBase64Transform () 
-               {
-                       Algorithm = XmlSignature.AlgorithmNamespaces.XmlDsigBase64Transform;
-               }
-
-               public override Type[] InputTypes {
-                       get {
-                               if (input == null) {
-                                       input = new Type [3];
-                                       input[0] = typeof (System.IO.Stream);
-                                       input[1] = typeof (System.Xml.XmlDocument);
-                                       input[2] = typeof (System.Xml.XmlNodeList);
-                               }
-                               return input;
-                       }
-               }
-
-               public override Type[] OutputTypes {
-                       get {
-                               if (output == null) {
-                                       output = new Type [1];
-                                       output[0] = typeof (System.IO.Stream);
-                               }
-                               return output;
-                       }
-               }
-
-               protected override XmlNodeList GetInnerXml () 
-               {
-                       return null; // THIS IS DOCUMENTED AS SUCH
-               }
-
-               public override object GetOutput () 
-               {
-                       return (object) cs;
-               }
-
-               public override object GetOutput (Type type) 
-               {
-                       if (type != typeof (System.IO.Stream))
-                               throw new ArgumentException ("type");
-                       return GetOutput ();
-               }
-
-               public override void LoadInnerXml (XmlNodeList nodeList) 
-               {
-                       // documented as not changing the state of the transform
-               }
-
-               public override void LoadInput (object obj) 
-               {
-                       XmlNodeList xnl = null;
-                       Stream stream = null;
-
-                       if (obj is Stream) 
-                               stream = (obj as Stream);
-                       else if (obj is XmlDocument)
-                               xnl = (obj as XmlDocument).SelectNodes ("//.");
-                       else if (obj is XmlNodeList)
-                               xnl = (XmlNodeList) obj;
-
-                       if (xnl != null) {
-                               stream = new MemoryStream ();
-                               StreamWriter sw = new StreamWriter (stream);
-                               foreach (XmlNode xn in xnl) {
-                                       switch (xn.NodeType) {
-                                       case XmlNodeType.Attribute:
-                                       case XmlNodeType.Text:
-                                       case XmlNodeType.CDATA:
-                                       case XmlNodeType.SignificantWhitespace:
-                                       case XmlNodeType.Whitespace:
-                                               sw.Write (xn.Value);
-                                               break;
-                                       }
-                               }
-                               sw.Flush ();
-                               // ready to be re-used
-                               stream.Position = 0;
-                       }
-
-                       if (stream != null)
-                               cs = new CryptoStream (stream, new FromBase64Transform (), CryptoStreamMode.Read);
-                       // note: there is no default are other types won't throw an exception
-               }
-       }
-}
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigC14NTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigC14NTransform.cs
deleted file mode 100644 (file)
index acbf322..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// XmlDsigC14NTransform.cs - C14N Transform implementation for XML Signature
-// http://www.w3.org/TR/xml-c14n
-//
-// Authors:
-//     Sebastien Pouliot <sebastien@ximian.com>
-//     Aleksey Sanin (aleksey@aleksey.com)
-//      Tim Coleman (tim@timcoleman.com)
-//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2003 Aleksey Sanin (aleksey@aleksey.com)
-// Copyright (C) Tim Coleman, 2004
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Xml;
-
-using Mono.Xml;
-
-namespace System.Security.Cryptography.Xml { 
-
-       public class XmlDsigC14NTransform : Transform {
-               private Type[] input;
-               private Type[] output;
-               private XmlCanonicalizer canonicalizer;
-               private Stream s;
-               
-               public XmlDsigC14NTransform () : this (false)
-               {
-               }
-
-               public XmlDsigC14NTransform (bool includeComments) 
-               {
-                       if (includeComments)
-                               Algorithm = XmlSignature.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform;
-                       else
-                               Algorithm = XmlSignature.AlgorithmNamespaces.XmlDsigC14NTransform;
-                       canonicalizer = new XmlCanonicalizer (includeComments, false, PropagatedNamespaces);
-               }
-
-               public override Type[] InputTypes {
-                       get {
-                               if (input == null) {
-                                       input = new Type [3];
-                                       input[0] = typeof (System.IO.Stream);
-                                       input[1] = typeof (System.Xml.XmlDocument);
-                                       input[2] = typeof (System.Xml.XmlNodeList);
-                               }
-                               return input;
-                       }
-               }
-
-               public override Type[] OutputTypes {
-                       get {
-                               if (output == null) {
-                                       output = new Type [1];
-                                       output[0] = typeof (System.IO.Stream);
-                               }
-                               return output;
-                       }
-               }
-
-               protected override XmlNodeList GetInnerXml () 
-               {
-                       return null; // THIS IS DOCUMENTED AS SUCH
-               }
-
-               [ComVisible (false)]
-               public override byte[] GetDigestedOutput (HashAlgorithm hash)
-               {
-                       // no null check, MS throws a NullReferenceException here
-                       return hash.ComputeHash ((Stream) GetOutput ());
-               }
-
-               public override object GetOutput () 
-               {
-                       return (object) s;
-               }
-
-               public override object GetOutput (Type type) 
-               {
-                       if (type == typeof (Stream))
-                               return GetOutput ();
-                       throw new ArgumentException ("type");
-               }
-
-               public override void LoadInnerXml (XmlNodeList nodeList) 
-               {
-                       // documented as not changing the state of the transform
-               }
-
-               public override void LoadInput (object obj) 
-               {
-                       // possible input: Stream, XmlDocument, and XmlNodeList
-                       Stream stream = (obj as Stream);
-                       if (stream != null) {
-                               XmlDocument doc = new XmlDocument ();
-                               doc.PreserveWhitespace = true;  // REALLY IMPORTANT
-                               doc.XmlResolver = GetResolver ();
-                               doc.Load (new XmlSignatureStreamReader (new StreamReader (stream)));
-//                             doc.Load ((Stream) obj);
-                               s = canonicalizer.Canonicalize (doc);
-                               return;
-                       }
-
-                       XmlDocument xd = (obj as XmlDocument);
-                       if (xd != null) {
-                               s = canonicalizer.Canonicalize (xd);
-                               return;
-                       }
-
-                       XmlNodeList nl = (obj as XmlNodeList);
-                       if (nl != null) {
-                               s = canonicalizer.Canonicalize (nl);
-                       }
-                       else
-                               throw new ArgumentException ("obj");
-               }
-       }
-}
-
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigC14NWithCommentsTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigC14NWithCommentsTransform.cs
deleted file mode 100644 (file)
index 7d74479..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// XmlDsigC14NWithCommentsTransform.cs - 
-//     C14N with comments Transform implementation for XML Signature
-//
-// Author:
-//     Sebastien Pouliot (spouliot@motus.com)
-//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.Xml { 
-
-       public class XmlDsigC14NWithCommentsTransform : XmlDsigC14NTransform {
-
-               public XmlDsigC14NWithCommentsTransform() : base (true) 
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigEnvelopedSignatureTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigEnvelopedSignatureTransform.cs
deleted file mode 100644 (file)
index 80f3c0d..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-//
-// XmlDsigEnvelopedSignatureTransform.cs - 
-//     Enveloped Signature Transform implementation for XML Signature
-//
-// Author:
-//     Sebastien Pouliot (spouliot@motus.com)
-//     Atsushi Enomoto (atsushi@ximian.com)
-//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.IO;
-using System.Xml;
-
-namespace System.Security.Cryptography.Xml { 
-
-       public class XmlDsigEnvelopedSignatureTransform : Transform {
-
-               private Type[] input;
-               private Type[] output;
-               private bool comments;
-               private object inputObj;
-
-               public XmlDsigEnvelopedSignatureTransform ()
-                       : this (false)
-               {
-               }
-
-               public XmlDsigEnvelopedSignatureTransform (bool includeComments) 
-               {
-                       Algorithm = XmlSignature.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform;
-                       comments = includeComments;
-               }
-
-               public override Type[] InputTypes {
-                       get {
-                               if (input == null) {
-                                       input = new Type [3];
-                                       input[0] = typeof (System.IO.Stream);
-                                       input[1] = typeof (System.Xml.XmlDocument);
-                                       input[2] = typeof (System.Xml.XmlNodeList);
-                               }
-                               return input;
-                       }
-               }
-
-               public override Type[] OutputTypes {
-                       get {
-                               if (output == null) {
-                                       output = new Type [2];
-                                       output [0] = typeof (System.Xml.XmlDocument);
-                                       output [1] = typeof (System.Xml.XmlNodeList);
-                               }
-                               return output;
-                       }
-               }
-
-               protected override XmlNodeList GetInnerXml () 
-               {
-                       return null; // THIS IS DOCUMENTED AS SUCH
-               }
-
-               // NOTE: This method never supports the requirements written
-               // in xmldsig spec that says its input is canonicalized before
-               // transforming. This method just removes Signature element.
-               // Canonicalization is done in SignedXml.
-               public override object GetOutput ()
-               {
-                       XmlDocument doc = null;
-
-                       // possible input: Stream, XmlDocument, and XmlNodeList
-                       if (inputObj is Stream) {
-                               doc = new XmlDocument ();
-                               doc.PreserveWhitespace = true;
-                               doc.XmlResolver = GetResolver ();
-                               doc.Load (new XmlSignatureStreamReader (
-                                       new StreamReader (inputObj as Stream)));
-                               return GetOutputFromNode (doc, GetNamespaceManager (doc), true);
-                       }
-                       else if (inputObj is XmlDocument) {
-                               doc = inputObj as XmlDocument;
-                               return GetOutputFromNode (doc, GetNamespaceManager (doc), true);
-                       }
-                       else if (inputObj is XmlNodeList) {
-                               ArrayList al = new ArrayList ();
-                               XmlNodeList nl = (XmlNodeList) inputObj;
-                               if (nl.Count > 0) {
-                                       XmlNamespaceManager m = GetNamespaceManager (nl.Item (0));
-                                       ArrayList tmp = new ArrayList ();
-                                       foreach (XmlNode n in nl)
-                                               tmp.Add (n);
-                                       foreach (XmlNode n in tmp)
-                                               if (n.SelectNodes ("ancestor-or-self::dsig:Signature", m).Count == 0)
-                                                       al.Add (GetOutputFromNode (n, m, false));
-                               }
-                               return new XmlDsigNodeList (al);
-                       }
-                       // Note that it is unexpected behavior with related to InputTypes (MS.NET accepts XmlElement)
-                       else if (inputObj is XmlElement) {
-                               XmlElement el = inputObj as XmlElement;
-                               XmlNamespaceManager m = GetNamespaceManager (el);
-                               if (el.SelectNodes ("ancestor-or-self::dsig:Signature", m).Count == 0)
-                                       return GetOutputFromNode (el, m, true);
-                       }
-
-                       throw new NullReferenceException ();
-               }
-
-               private XmlNamespaceManager GetNamespaceManager (XmlNode n)
-               {
-                       XmlDocument doc = ((n is XmlDocument) ? (n as XmlDocument) : n.OwnerDocument);
-                       XmlNamespaceManager nsmgr = new XmlNamespaceManager (doc.NameTable);
-                       nsmgr.AddNamespace ("dsig", XmlSignature.NamespaceURI);
-                       return nsmgr;
-               }
-
-               private XmlNode GetOutputFromNode (XmlNode input, XmlNamespaceManager nsmgr, bool remove)
-               {
-                       if (remove) {
-                               XmlNodeList nl = input.SelectNodes ("descendant-or-self::dsig:Signature", nsmgr);
-                               ArrayList al = new ArrayList ();
-                               foreach (XmlNode n in nl)
-                                       al.Add (n);
-                               foreach (XmlNode n in al)
-                                       n.ParentNode.RemoveChild (n);
-                       }
-                       return input;
-               }
-
-               public override object GetOutput (Type type) 
-               {
-                       if (type == typeof (Stream))
-                               return GetOutput ();
-                       throw new ArgumentException ("type");
-               }
-
-               public override void LoadInnerXml (XmlNodeList nodeList) 
-               {
-                       // NO CHANGE
-               }
-
-               public override void LoadInput (object obj) 
-               {
-                       inputObj = obj;
-               }
-       }
-}
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigExcC14NTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigExcC14NTransform.cs
deleted file mode 100644 (file)
index b724957..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-//
-// XmlDsigExcC14NTransform.cs - ExcC14N Transform implementation for XML Signature
-// http://www.w3.org/TR/xml-c14n
-//
-// Authors:
-//     Sebastien Pouliot <sebastien@ximian.com>
-//     Aleksey Sanin (aleksey@aleksey.com)
-//      Tim Coleman (tim@timcoleman.com)
-//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2003 Aleksey Sanin (aleksey@aleksey.com)
-// Copyright (C) Tim Coleman, 2004
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Xml;
-
-using Mono.Xml;
-
-namespace System.Security.Cryptography.Xml { 
-
-       public class XmlDsigExcC14NTransform : Transform {
-               private Type[] input;
-               private Type[] output;
-               private XmlCanonicalizer canonicalizer;
-               private Stream s;
-               private string inclusiveNamespacesPrefixList;
-               
-               public XmlDsigExcC14NTransform ()       
-                       : this (false, null)
-               {
-               }
-
-               public XmlDsigExcC14NTransform (bool includeComments) 
-                       : this (includeComments, null)
-               {
-               }
-
-               public XmlDsigExcC14NTransform (string inclusiveNamespacesPrefixList)
-                       : this (false, inclusiveNamespacesPrefixList)
-               {
-               }
-
-               public XmlDsigExcC14NTransform (bool includeComments, string inclusiveNamespacesPrefixList)
-               {
-                       if (includeComments)
-                               Algorithm = XmlSignature.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform;
-                       else
-                               Algorithm = XmlSignature.AlgorithmNamespaces.XmlDsigExcC14NTransform;
-                       this.inclusiveNamespacesPrefixList = inclusiveNamespacesPrefixList;
-                       canonicalizer = new XmlCanonicalizer (includeComments, true, PropagatedNamespaces);
-               }
-
-               public string InclusiveNamespacesPrefixList {
-                       get { return inclusiveNamespacesPrefixList; }
-                       set { inclusiveNamespacesPrefixList = value; }
-               }
-
-               public override Type[] InputTypes {
-                       get {
-                               if (input == null) {
-                                       input = new Type [3];
-                                       input[0] = typeof (System.IO.Stream);
-                                       input[1] = typeof (System.Xml.XmlDocument);
-                                       input[2] = typeof (System.Xml.XmlNodeList);
-                               }
-                               return input;
-                       }
-               }
-
-               public override Type[] OutputTypes {
-                       get {
-                               if (output == null) {
-                                       output = new Type [1];
-                                       output[0] = typeof (System.IO.Stream);
-                               }
-                               return output;
-                       }
-               }
-
-               protected override XmlNodeList GetInnerXml () 
-               {
-                       return null; // THIS IS DOCUMENTED AS SUCH
-               }
-
-               public override byte[] GetDigestedOutput (HashAlgorithm hash)
-               {
-                       // no null check, MS throws a NullReferenceException here
-                       return hash.ComputeHash ((Stream) GetOutput ());
-               }
-
-               public override object GetOutput () 
-               {
-                       return (object) s;
-               }
-
-               public override object GetOutput (Type type) 
-               {
-                       if (type == typeof (Stream))
-                               return GetOutput ();
-                       throw new ArgumentException ("type");
-               }
-
-               public override void LoadInnerXml (XmlNodeList nodeList) 
-               {
-                       // documented as not changing the state of the transform
-               }
-
-               public override void LoadInput (object obj) 
-               {
-                       canonicalizer.InclusiveNamespacesPrefixList = InclusiveNamespacesPrefixList;
-                       // possible input: Stream, XmlDocument, and XmlNodeList
-                       Stream stream = (obj as Stream);
-                       if (stream != null) {
-                               XmlDocument doc = new XmlDocument ();
-                               doc.PreserveWhitespace = true;  // REALLY IMPORTANT
-                               doc.XmlResolver = GetResolver ();
-                               doc.Load (new XmlSignatureStreamReader (new StreamReader (stream)));
-//                             doc.Load ((Stream) obj);
-                               s = canonicalizer.Canonicalize (doc);
-                               return;
-                       }
-
-                       XmlDocument xd = (obj as XmlDocument);
-                       if (xd != null) {
-                               s = canonicalizer.Canonicalize (xd);
-                               return;
-                       }
-
-                       XmlNodeList nl = (obj as XmlNodeList);
-                       if (nl != null) {
-                               s = canonicalizer.Canonicalize (nl);
-                       }
-                       else
-                               throw new ArgumentException ("obj");
-               }
-       }
-}
-
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigExcC14NWithCommentsTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigExcC14NWithCommentsTransform.cs
deleted file mode 100644 (file)
index db049af..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// XmlDsigExcC14NWithCommentsTransform.cs - XmlDsigExcC14NWithCommentsTransform implementation for XML Encryption
-//
-// Author:
-//      Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2004
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Security.Cryptography.Xml {
-       public class XmlDsigExcC14NWithCommentsTransform : XmlDsigExcC14NTransform {
-       
-               #region Constructors
-
-               public XmlDsigExcC14NWithCommentsTransform ()
-                       : base (true)
-               {
-               }
-
-               public XmlDsigExcC14NWithCommentsTransform (string inclusiveNamespacesPrefixList)
-                       : base (true, inclusiveNamespacesPrefixList)
-               {
-               }
-
-               #endregion // Constructors
-       }
-}
-
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigNodeList.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigNodeList.cs
deleted file mode 100644 (file)
index ec59a19..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//\r
-// XmlDsigNodeList.cs - derived node list class for dsig\r
-//\r
-// Author:\r
-//     Atsushi Enomoto <atsushi@ximian.com>\r
-//\r
-// (C)2004 Novell Inc.\r
-//\r
-// This class is mostly copied from System.Xml/XmlNodeArrayList.cs\r
-//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-\r
-using System;\r
-using System.Collections;\r
-using System.Xml;\r
-\r
-namespace System.Security.Cryptography.Xml\r
-{\r
-       // Copied from XmlNodeArrayList.cs\r
-       internal class XmlDsigNodeList : XmlNodeList\r
-       {\r
-               ArrayList _rgNodes;\r
-\r
-               public XmlDsigNodeList (ArrayList rgNodes)\r
-               {\r
-                       _rgNodes = rgNodes;\r
-               }\r
-\r
-               public override int Count { get { return _rgNodes.Count; } }\r
-\r
-               public override IEnumerator GetEnumerator ()\r
-               {\r
-                       return _rgNodes.GetEnumerator ();\r
-               }\r
-\r
-               public override XmlNode Item (int index)\r
-               {\r
-                       // Return null if index is out of range. by  DOM design.\r
-                       if (index < 0 || _rgNodes.Count <= index)\r
-                               return null;\r
-\r
-                       return (XmlNode) _rgNodes [index];\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXPathTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXPathTransform.cs
deleted file mode 100644 (file)
index 6b6f04e..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-//
-// XmlDsigXPathTransform.cs - 
-//     XmlDsigXPathTransform implementation for XML Signature
-// http://www.w3.org/TR/1999/REC-xpath-19991116 
-//
-// Author:
-//     Sebastien Pouliot <sebastien@ximian.com>
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.IO;
-using System.Text;
-using System.Xml;
-using System.Xml.XPath;
-using System.Xml.Xsl;
-
-namespace System.Security.Cryptography.Xml 
-{
-
-       // www.w3.org/TR/xmldsig-core/
-       // see Section 6.6.3 of the XMLDSIG specification
-       public class XmlDsigXPathTransform : Transform 
-       {
-
-               private Type [] input;
-               private Type [] output;
-               private XmlNodeList xpath;
-               private XmlDocument doc;
-               private XsltContext ctx;
-
-               public XmlDsigXPathTransform () 
-               {
-                       Algorithm = XmlSignature.AlgorithmNamespaces.XmlDsigXPathTransform;
-               }
-
-               public override Type [] InputTypes {
-                       get {
-                               if (input == null) {
-                                       input = new Type [3];
-                                       input [0] = typeof (System.IO.Stream);
-                                       input [1] = typeof (System.Xml.XmlDocument);
-                                       input [2] = typeof (System.Xml.XmlNodeList);
-                               }
-                               return input;
-                       }
-               }
-
-               public override Type[] OutputTypes {
-                       get {
-                               if (output == null) {
-                                       // this way the result is cached if called multiple time
-                                       output = new Type [1];
-                                       output [0] = typeof (System.Xml.XmlNodeList);
-                               }
-                               return output;
-                       }
-               }
-
-               protected override XmlNodeList GetInnerXml () 
-               {
-                       if (xpath == null) {
-                               // default value
-                               XmlDocument xpdoc = new XmlDocument ();
-                               xpdoc.LoadXml ("<XPath xmlns=\"" + XmlSignature.NamespaceURI + "\"></XPath>");
-                               xpath = xpdoc.ChildNodes;
-                       }
-                       return xpath;
-               }
-
-               [MonoTODO ("Evaluation of extension function here() results in different from MS.NET (is MS.NET really correct??).")]
-               public override object GetOutput () 
-               {
-                       if ((xpath == null) || (doc == null))
-                               return new XmlDsigNodeList (new ArrayList ());
-                       // evaluate every time since input or xpath might have changed.
-                       string x = null;
-                       for (int i = 0; i < xpath.Count; i++) {
-                               switch (xpath [i].NodeType) {
-                               case XmlNodeType.Text:
-                               case XmlNodeType.CDATA:
-                               case XmlNodeType.Element:
-                                       x += xpath [i].InnerText;
-                                       break;
-                               }
-                       }
-
-                       ctx = new XmlDsigXPathContext (doc);
-                       foreach (XmlNode n in xpath) {
-                               XPathNavigator nav = n.CreateNavigator ();
-                               XPathNodeIterator iter = nav.Select ("namespace::*");
-                               while (iter.MoveNext ())
-                                       if (iter.Current.LocalName != "xml")
-                                               ctx.AddNamespace (iter.Current.LocalName, iter.Current.Value);
-                       }
-                       return EvaluateMatch (doc, x);
-               }
-
-               public override object GetOutput (Type type) 
-               {
-                       if (type != typeof (XmlNodeList))
-                               throw new ArgumentException ("type");
-                       return GetOutput ();
-               }
-
-               private XmlDsigNodeList EvaluateMatch (XmlNode n, string xpath)
-               {
-                       ArrayList al = new ArrayList ();
-                       // Strictly to say, document node is explicitly
-                       // excluded by W3C spec (context node is initialized
-                       // to the document root and XPath expression is
-                       // "//. | //@* | //namespace::*)
-                       XPathNavigator nav = n.CreateNavigator ();
-                       XPathExpression exp = nav.Compile (xpath);
-                       exp.SetContext (ctx);
-                       EvaluateMatch (n, exp, al);
-                       return new XmlDsigNodeList (al);
-               }
-
-               private void EvaluateMatch (XmlNode n, XPathExpression exp, ArrayList al)
-               {
-                       if (NodeMatches (n, exp))
-                               al.Add (n);
-                       if (n.Attributes != null)
-                               for (int i = 0; i < n.Attributes.Count; i++)
-                                       if (NodeMatches (n.Attributes [i], exp))
-                                               al.Add (n.Attributes [i]);
-                       for (int i = 0; i < n.ChildNodes.Count; i++)
-                               EvaluateMatch (n.ChildNodes [i], exp, al);
-               }
-
-               private bool NodeMatches (XmlNode n, XPathExpression exp)
-               {
-                       // This looks waste of memory since it creates 
-                       // XPathNavigator every time, but even if we use
-                       //  XPathNodeIterator.Current, it also clones every time.
-                       object ret = n.CreateNavigator ().Evaluate (exp);
-                       if (ret is bool)
-                               return (bool) ret;
-                       if (ret is double) {
-                               double d = (double) ret;
-                               return !(d == 0.0 || Double.IsNaN (d));
-                       }
-                       if (ret is string)
-                               return ((string) ret).Length > 0;
-                       if (ret is XPathNodeIterator) {
-                               XPathNodeIterator retiter = (XPathNodeIterator) ret;
-                               return retiter.Count > 0;
-                       }
-                       return false;
-               }
-
-               public override void LoadInnerXml (XmlNodeList nodeList) 
-               {
-                       if (nodeList == null)
-                               throw new CryptographicException ("nodeList");
-                       xpath = nodeList;
-               }
-
-               public override void LoadInput (object obj) 
-               {
-                       // possible input: Stream, XmlDocument, and XmlNodeList
-                       if (obj is Stream) {
-                               doc = new XmlDocument ();
-                               doc.PreserveWhitespace = true;
-                               doc.XmlResolver = GetResolver ();
-                               doc.Load (new XmlSignatureStreamReader (
-                                       new StreamReader ((Stream) obj)));
-                       }
-                       else if (obj is XmlDocument) {
-                               doc = (obj as XmlDocument);
-                       }
-                       else if (obj is XmlNodeList) {
-                               doc = new XmlDocument ();
-                               doc.XmlResolver = GetResolver ();
-                               foreach (XmlNode xn in (obj as XmlNodeList))  {
-                                       XmlNode importedNode = doc.ImportNode (xn, true);
-                                       doc.AppendChild (importedNode);
-                               }
-                       }
-               }
-
-               // Internal classes to support XPath extension function here()
-
-               internal class XmlDsigXPathContext : XsltContext
-               {
-                       XmlDsigXPathFunctionHere here;
-                       public XmlDsigXPathContext (XmlNode node)
-                       {
-                               here = new XmlDsigXPathFunctionHere (node);
-                       }
-
-                       public override IXsltContextFunction ResolveFunction (
-                               string prefix, string name, XPathResultType [] argType)
-                       {
-                               // Here MS.NET incorrectly allows arbitrary
-                               // name e.g. "heretic()".
-                               if (name == "here" &&
-                                       prefix == String.Empty &&
-                                       argType.Length == 0)
-                                       return here;
-                               else
-                                       return null; // ????
-                       }
-
-                       public override bool Whitespace {
-                               get { return true; }
-                       }
-
-                       public override bool PreserveWhitespace (XPathNavigator node)
-                       {
-                               return true;
-                       }
-
-                       public override int CompareDocument (string s1, string s2)
-                       {
-                               return String.Compare (s1, s2);
-                       }
-
-                       public override IXsltContextVariable ResolveVariable (string prefix, string name)
-                       {
-                               throw new InvalidOperationException ();
-                       }
-               }
-
-               internal class XmlDsigXPathFunctionHere : IXsltContextFunction
-               {
-                       // Static
-
-                       static XPathResultType [] types;
-                       static XmlDsigXPathFunctionHere ()
-                       {
-                               types = new XPathResultType [0];
-                       }
-
-                       // Instance
-
-                       XPathNodeIterator xpathNode;
-
-                       public XmlDsigXPathFunctionHere (XmlNode node)
-                       {
-                               xpathNode = node.CreateNavigator ().Select (".");
-                       }
-
-                       public XPathResultType [] ArgTypes {
-                               get { return types; }
-                       }
-               
-                       public int Maxargs { get { return 0; } }
-               
-                       public int Minargs { get { return 0; } }
-               
-                       public XPathResultType ReturnType {
-                               get { return XPathResultType.NodeSet; }
-                       }
-
-                       public object Invoke (XsltContext ctx, object [] args, XPathNavigator docContext)
-                       {
-                               if (args.Length != 0)
-                                       throw new ArgumentException ("Not allowed arguments for function here().", "args");
-
-                               return xpathNode.Clone ();
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXsltTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDsigXsltTransform.cs
deleted file mode 100644 (file)
index d039bf1..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// XmlDsigEnvelopedSignatureTransform.cs - 
-//     Enveloped Signature Transform implementation for XML Signature
-// http://www.w3.org/TR/1999/REC-xslt-19991116 
-//
-// Author:
-//     Sebastien Pouliot (spouliot@motus.com)
-//     Atsushi Enomoto (atsushi@ximian.com)
-//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.IO;
-using System.Xml;
-using System.Xml.Xsl;
-
-namespace System.Security.Cryptography.Xml 
-{
-
-       public class XmlDsigXsltTransform : Transform 
-       {
-
-               private Type [] input;
-               private Type [] output;
-               private bool comments;
-               private XmlNodeList xnl;
-               private XmlDocument inputDoc;
-
-               public XmlDsigXsltTransform () : this (false)
-               {
-               }
-
-               public XmlDsigXsltTransform (bool includeComments) 
-               {
-                       comments = includeComments;
-                       Algorithm = XmlSignature.AlgorithmNamespaces.XmlDsigXsltTransform;
-               }
-
-               public override Type [] InputTypes {
-                       get {
-                               if (input == null) {
-                                       input = new Type [3];
-                                       input [0] = typeof (System.IO.Stream);
-                                       input [1] = typeof (System.Xml.XmlDocument);
-                                       input [2] = typeof (System.Xml.XmlNodeList);
-                               }
-                               return input;
-                       }
-               }
-
-               public override Type [] OutputTypes {
-                       get {
-                               if (output == null) {
-                                       output = new Type [1];
-                                       output [0] = typeof (System.IO.Stream);
-                               }
-                               return output;
-                       }
-               }
-                       
-               protected override XmlNodeList GetInnerXml () 
-               {
-                       return xnl;
-               }
-
-               public override object GetOutput () 
-               {
-                       if (xnl == null)
-                               throw new ArgumentNullException ("LoadInnerXml before transformation.");
-
-                       XmlResolver resolver = GetResolver ();
-
-                       XslTransform xsl = new XslTransform ();
-                       XmlDocument doc = new XmlDocument ();
-                       doc.XmlResolver = resolver;
-                       foreach (XmlNode n in xnl)
-                               doc.AppendChild (doc.ImportNode (n, true));
-                       xsl.Load (doc, resolver);
-
-                       if (inputDoc == null)
-                               throw new ArgumentNullException ("LoadInput before transformation.");
-
-                       MemoryStream stream = new MemoryStream ();
-                       // only possible output: Stream
-                       xsl.XmlResolver = resolver;
-                       xsl.Transform (inputDoc, null, stream);
-
-                       stream.Seek (0, SeekOrigin.Begin);
-                       return stream;
-               }
-
-               public override object GetOutput (Type type) 
-               {
-                       if (type != typeof (Stream))
-                               throw new ArgumentException ("type");
-                       return GetOutput ();
-               }
-
-               public override void LoadInnerXml (XmlNodeList nodeList) 
-               {
-                       if (nodeList == null)
-                               throw new CryptographicException ("nodeList");
-                       xnl = nodeList;
-               }
-
-               public override void LoadInput (object obj) 
-               {
-                       // possible input: Stream, XmlDocument, and XmlNodeList
-                       Stream s = (obj as Stream);
-                       if (s != null) {
-                               inputDoc = new XmlDocument ();
-                               inputDoc.XmlResolver = GetResolver ();
-//                             inputDoc.Load (obj as Stream);
-                               inputDoc.Load (new XmlSignatureStreamReader (new StreamReader (s)));
-                               return;
-                       }
-
-                       XmlDocument xd = (obj as XmlDocument);
-                       if (xd != null) {
-                               inputDoc = xd;
-                               return;
-                       }
-
-                       XmlNodeList nl = (obj as XmlNodeList);
-                       if (nl != null) {
-                               inputDoc = new XmlDocument ();
-                               inputDoc.XmlResolver = GetResolver ();
-                               for (int i = 0; i < nl.Count; i++)
-                                       inputDoc.AppendChild (inputDoc.ImportNode (nl [i], true));
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlLicenseTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlLicenseTransform.cs
deleted file mode 100644 (file)
index 4cc6e17..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// System.Security.Cryptography.Xml.XmlLicenseTransform class
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Xml;
-
-namespace System.Security.Cryptography.Xml {
-
-       public class XmlLicenseTransform : Transform {
-
-               private IRelDecryptor _decryptor;
-               private Type[] inputTypes;
-               private Type[] outputTypes;
-
-               public XmlLicenseTransform ()
-               {
-                       Algorithm = XmlSignature.AlgorithmNamespaces.XmlLicenseTransform;
-               }
-
-               public IRelDecryptor Decryptor {
-                       get { return _decryptor; }
-                       set { _decryptor = value; }
-               }
-
-               public override Type[] InputTypes {
-                       get { 
-                               if (inputTypes == null)
-                                       inputTypes = new Type [1] { typeof (XmlDocument) };
-
-                               return inputTypes;
-                       }
-               }
-
-               public override Type[] OutputTypes {
-                       get { 
-                               if (outputTypes == null)
-                                       outputTypes = new Type [1] {typeof (XmlDocument)};
-
-                               return outputTypes;
-                       }
-               }
-
-               [MonoTODO]
-               protected override XmlNodeList GetInnerXml ()
-               {
-                       return null;
-               }
-
-               [MonoTODO]
-               public override object GetOutput ()
-               {
-                       return null;
-               }
-
-               public override object GetOutput (Type type)
-               {
-                       if (type != typeof (XmlDocument))
-                               throw new ArgumentException ("type");
-                       return GetOutput ();
-               }
-
-               public override void LoadInnerXml (XmlNodeList nodeList)
-               {
-                       // documented as not supported
-               }
-
-               [MonoTODO]
-               public override void LoadInput (object obj)
-               {
-                       if (_decryptor == null)
-                               throw new CryptographicException (Locale.GetText ("missing decryptor"));
-                       // TODO: check for <issuer> element
-                       // TODO: check for <license> element
-               }
-       }
-}
index 50b1924825d69308d19c63791561bafae3222d0a..1dc64eac1dc419055d24275577dc3b197d2c99fc 100644 (file)
@@ -87,19 +87,6 @@ namespace System.Security.Cryptography.Xml {
                        public AttributeNames () {}
                }
 
-               public class AlgorithmNamespaces {
-                       public const string XmlDsigBase64Transform = "http://www.w3.org/2000/09/xmldsig#base64";
-                       public const string XmlDsigC14NTransform = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
-                       public const string XmlDsigC14NWithCommentsTransform = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";
-                       public const string XmlDsigEnvelopedSignatureTransform = "http://www.w3.org/2000/09/xmldsig#enveloped-signature";
-                       public const string XmlDsigXPathTransform = "http://www.w3.org/TR/1999/REC-xpath-19991116";
-                       public const string XmlDsigXsltTransform =  "http://www.w3.org/TR/1999/REC-xslt-19991116";
-                       public const string XmlDsigExcC14NTransform = "http://www.w3.org/2001/10/xml-exc-c14n#";
-                       public const string XmlDsigExcC14NWithCommentsTransform = "http://www.w3.org/2001/10/xml-exc-c14n#WithComments";
-                       public const string XmlDecryptionTransform = "http://www.w3.org/2002/07/decrypt#XML";
-                       public const string XmlLicenseTransform = "urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform";
-               }
-
                public class Uri {
                        public const string Manifest = "http://www.w3.org/2000/09/xmldsig#Manifest";
                }
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlSignatureStreamReader.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlSignatureStreamReader.cs
deleted file mode 100644 (file)
index 43c7de0..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// XmlSignatureStreamReader.cs: Wrap TextReader and eliminate \r
-//
-// Author:
-//     Atsushi Enomoto (atsushi@ximian.com)
-//
-// (C) 2005 Novell Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-//
-// Use it to distinguish &#xD; and \r. \r is removed, while &#xD; is not.
-//
-//
-
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-
-namespace System.Security.Cryptography.Xml
-{
-       internal class XmlSignatureStreamReader : TextReader
-       {
-               TextReader source;
-               int cache = int.MinValue;
-
-               public XmlSignatureStreamReader (TextReader input)
-               {
-                       source =input;
-               }
-
-               public override void Close ()
-               {
-                       source.Close ();
-               }
-
-               public override int Peek ()
-               {
-                       // If source TextReader does not support Peek(),
-                       // it does not support too. Or it just returns EOF.
-                       if (source.Peek () == -1)
-                               return -1;
-
-                       if (cache != int.MinValue)
-                               return cache;
-                       cache = source.Read ();
-                       if (cache != '\r')
-                               return cache;
-                       // cache must be '\r' here.
-                       if (source.Peek () != '\n')
-                               return '\r';
-                       // Now Peek() returns '\n', so clear cache.
-                       cache = int.MinValue;
-                       return '\n';
-               }
-
-               public override int Read ()
-               {
-                       if (cache != int.MinValue) {
-                               int ret = cache;
-                               cache = int.MinValue;
-                               return ret;
-                       }
-                       int i = source.Read ();
-                       if (i != '\r')
-                               return i;
-                       // read one more char (after '\r')
-                       cache = source.Read ();
-                       if (cache != '\n')
-                               return '\r';
-                       cache = int.MinValue;
-                       return '\n';
-               }
-
-               public override int ReadBlock (
-                       [In, Out] char [] buffer, int index, int count)
-               {
-                       char [] tmp = new char [count];
-                       source.ReadBlock (tmp, 0, count);
-                       int j = index;
-                       for (int i = 0; i < count; j++) {
-                               if (tmp [i] == '\r') {
-                                       if (++i < tmp.Length && tmp [i] == '\n')
-                                               buffer [j] = tmp [i++];
-                                       else
-                                               buffer [j] = '\r';
-                               }
-                               else
-                                       buffer [j] = tmp [i];
-                       }
-                       while (j < count) {
-                               int d = Read ();
-                               if (d < 0)
-                                       break;
-                               buffer [j++] = (char) d;
-                       }
-                       return j;
-               }
-
-               // I have no idea what to do here, but I don't think it 
-               // makes sense.
-               public override string ReadLine ()
-               {
-                       return source.ReadLine ();
-               }
-
-               public override string ReadToEnd ()
-               {
-                       return source.ReadToEnd ().Replace ("\r\n", "\n");
-               }
-       }
-}
index 0beec42df40124230256753d403f70956e215061..b7e3fe65d34148c7d34859d1ddd49b9662660870 100644 (file)
@@ -4,7 +4,6 @@ corefx/SR.cs
 ../../build/common/Locale.cs
 Mono.Security.Cryptography/ManagedProtection.cs
 Mono.Security.Cryptography/NativeDapiProtection.cs
-Mono.Xml/XmlCanonicalizer.cs
 System.Security.Cryptography/CryptographicAttribute.cs
 System.Security.Cryptography/CryptographicAttributeCollection.cs
 System.Security.Cryptography/CryptographicAttributeEnumerator.cs
@@ -41,13 +40,34 @@ System.Security.Cryptography.Pkcs/SubjectIdentifier.cs
 System.Security.Cryptography.Pkcs/SubjectIdentifierOrKey.cs
 System.Security.Cryptography.Pkcs/SubjectIdentifierOrKeyType.cs
 System.Security.Cryptography.Pkcs/SubjectIdentifierType.cs
+../System.Core/System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs
 System.Security.Cryptography.X509Certificates/X509Certificate2UI.cs
 System.Security.Cryptography.X509Certificates/X509SelectionFlag.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/AncestralNamespaceContextManager.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/AttributeSortOrder.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/C14NAncestralNamespaceContextManager.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalizationDispatcher.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXml.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlAttribute.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlCDataSection.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlComment.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlDocument.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlElement.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlEntityReference.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlNodeList.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlProcessingInstruction.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlSignificantWhitespace.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlText.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlWhitespace.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CertUsageType.cs
 System.Security.Cryptography.Xml/CipherData.cs
 System.Security.Cryptography.Xml/CipherReference.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CryptoHelpers.cs
 System.Security.Cryptography.Xml/DataObject.cs
 System.Security.Cryptography.Xml/DataReference.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DocPosition.cs
 System.Security.Cryptography.Xml/DSAKeyValue.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSASignatureDescription.cs
 System.Security.Cryptography.Xml/EncryptedData.cs
 System.Security.Cryptography.Xml/EncryptedKey.cs
 System.Security.Cryptography.Xml/EncryptedReference.cs
@@ -56,6 +76,9 @@ System.Security.Cryptography.Xml/EncryptedXml.cs
 System.Security.Cryptography.Xml/EncryptionMethod.cs
 System.Security.Cryptography.Xml/EncryptionProperties.cs
 System.Security.Cryptography.Xml/EncryptionProperty.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ExcAncestralNamespaceContextManager.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ExcCanonicalXml.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ICanonicalizableNode.cs
 System.Security.Cryptography.Xml/IRelDecryptor.cs
 System.Security.Cryptography.Xml/KeyInfoClause.cs
 System.Security.Cryptography.Xml/KeyInfo.cs
@@ -66,30 +89,39 @@ System.Security.Cryptography.Xml/KeyInfoRetrievalMethod.cs
 System.Security.Cryptography.Xml/KeyInfoX509Data.cs
 System.Security.Cryptography.Xml/KeyReference.cs
 System.Security.Cryptography.Xml/Manifest.cs
-System.Security.Cryptography.Xml/Reference.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/MyXmlDocument.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/NamespaceFrame.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/NamespaceSortOrder.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/Reference.cs
 System.Security.Cryptography.Xml/ReferenceList.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ReferenceTargetType.cs
 System.Security.Cryptography.Xml/RSAKeyValue.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA1SignatureDescription.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA256SignatureDescription.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA384SignatureDescription.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA512SignatureDescription.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SignatureDescription.cs
 System.Security.Cryptography.Xml/Signature.cs
 System.Security.Cryptography.Xml/SignedInfo.cs
 System.Security.Cryptography.Xml/SignedXml.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/SignedXmlDebugLog.cs
 System.Security.Cryptography.Xml/SymmetricKeyWrap.cs
-System.Security.Cryptography.Xml/TransformChain.cs
-System.Security.Cryptography.Xml/Transform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/Transform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/TransformChain.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/Utils.cs
 System.Security.Cryptography.Xml/X509IssuerSerial.cs
-System.Security.Cryptography.Xml/XmlDecryptionTransform.cs
-System.Security.Cryptography.Xml/XmlDsigBase64Transform.cs
-System.Security.Cryptography.Xml/XmlDsigC14NTransform.cs
-System.Security.Cryptography.Xml/XmlDsigC14NWithCommentsTransform.cs
-System.Security.Cryptography.Xml/XmlDsigEnvelopedSignatureTransform.cs
-System.Security.Cryptography.Xml/XmlDsigExcC14NTransform.cs
-System.Security.Cryptography.Xml/XmlDsigExcC14NWithCommentsTransform.cs
-System.Security.Cryptography.Xml/XmlDsigNodeList.cs
-System.Security.Cryptography.Xml/XmlDsigXPathTransform.cs
-System.Security.Cryptography.Xml/XmlDsigXsltTransform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlDecryptionTransform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlDsigBase64Transform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlDsigC14NTransform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlDsigC14NWithCommentsTransform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlDsigEnvelopedSignatureTransform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlDsigExcC14NTransform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlDsigExcC14NWithCommentsTransform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlDsigXPathTransform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlDsigXsltTransform.cs
 System.Security.Cryptography.Xml/XmlEncryption.cs
-System.Security.Cryptography.Xml/XmlLicenseTransform.cs
+../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlLicenseTransform.cs
 System.Security.Cryptography.Xml/XmlSignature.cs
-System.Security.Cryptography.Xml/XmlSignatureStreamReader.cs
 ../../build/common/MonoTODOAttribute.cs
 System.Security.Permissions/DataProtectionPermission.cs
 System.Security.Permissions/DataProtectionPermissionAttribute.cs
index 8920ac3421893f211085588fed061fb88fe3bc70..06dfb70c42f8bef849d1afb9410f9c94e1e461b1 100644 (file)
@@ -33,11 +33,10 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                {
                        Assert.IsNull (reference.Uri, "Uri (null)");
                        Assert.IsNotNull (reference.TransformChain, "TransformChain");
-                       Assert.AreEqual ("System.Security.Cryptography.Xml.Reference", reference.ToString (), "ToString()");
                        // test uri constructor
                        string uri = "uri";
                        reference = new Reference (uri);
-                       Assert.AreEqual ("http://www.w3.org/2000/09/xmldsig#sha1", reference.DigestMethod, "DigestMethod");
+                       Assert.AreEqual (SignedXml.XmlDsigSHA256Url, reference.DigestMethod, "DigestMethod");
                        Assert.IsNull (reference.DigestValue, "DigestValue");
                        Assert.IsNull (reference.Id, "Id");
                        Assert.IsNull (reference.Type, "Type");
@@ -158,17 +157,10 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                }
 
                [Test]
-               [Category ("NotDotNet")]
-               // MS throws a NullReferenceException (reported as FDBK25886) but only when executed in NUnit
-               // http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=3596d1e3-362b-40bd-bca9-2e8be75261ff
                public void AddAllTransforms () 
                {
-                       // adding an empty hash value
-                       byte[] hash = new byte [20];
-                       reference.DigestValue = hash;
-                       XmlElement xel = reference.GetXml ();
-                       // this is the minimal Reference (DigestValue)!
-                       Assert.IsNotNull (xel, "GetXml");
+                       reference.DigestMethod = SignedXml.XmlDsigSHA1Url;
+                       reference.DigestValue = new byte [20];
 
                        reference.AddTransform (new XmlDsigBase64Transform ());
                        reference.AddTransform (new XmlDsigC14NTransform ());
@@ -177,13 +169,8 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                        reference.AddTransform (new XmlDsigXPathTransform ());
                        reference.AddTransform (new XmlDsigXsltTransform ());
 
-                       // MS's results
-                       string test1 = "<Reference xmlns=\"http://www.w3.org/2000/09/xmldsig#\"><Transforms><Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#base64\" /><Transform Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\" /><Transform Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments\" /><Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\" /><Transform Algorithm=\"http://www.w3.org/TR/1999/REC-xpath-19991116\"><XPath></XPath></Transform><Transform Algorithm=\"http://www.w3.org/TR/1999/REC-xslt-19991116\" /></Transforms><DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" /><DigestValue>AAAAAAAAAAAAAAAAAAAAAAAAAAA=</DigestValue></Reference>";
-                       // Mono's result (xml is equivalent but not identical)
-                       string test2 = test1.Replace ("<XPath></XPath>", "<XPath xmlns=\"http://www.w3.org/2000/09/xmldsig#\" />");
-                       string result = reference.GetXml().OuterXml;
-                       Assert.IsTrue (((result == test1) || (result == test2)), result);
-                       // however this value cannot be loaded as it's missing some transform (xslt) parameters
+                       const string expected = "<Reference xmlns=\"http://www.w3.org/2000/09/xmldsig#\"><Transforms><Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#base64\" /><Transform Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\" /><Transform Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments\" /><Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\" /><Transform Algorithm=\"http://www.w3.org/TR/1999/REC-xpath-19991116\"><XPath /></Transform><Transform Algorithm=\"http://www.w3.org/TR/1999/REC-xslt-19991116\" /></Transforms><DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" /><DigestValue>AAAAAAAAAAAAAAAAAAAAAAAAAAA=</DigestValue></Reference>";
+                       Assert.That (reference.GetXml ().OuterXml, Is.EqualTo (expected), "OuterXml");
 
                        // can we add them again ?
                        reference.AddTransform (new XmlDsigBase64Transform ());
index 1c1d7a977724df2da860817edfe6c26e63ad9a19..0a06e23aa70adeb10553c2f108259191089a9607 100644 (file)
@@ -790,6 +790,7 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                        signedXml.SignedInfo.CanonicalizationMethod = SignedXml.XmlDsigExcC14NTransformUrl;
 
                        Reference reference = new Reference ();
+                       reference.DigestMethod = SignedXml.XmlDsigSHA1Url;
                        reference.Uri = "";
 
                        XmlDsigEnvelopedSignatureTransform env = new XmlDsigEnvelopedSignatureTransform ();
index abb64bb34b58103518d7e0e96368544fed94f47f..a21c49630038a948a420c55c168c6404c2e773f6 100644 (file)
@@ -157,7 +157,6 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                }
 
                [Test]
-               [Category ("NotDotNet")]
                // see LoadInputAsXmlNodeList2 description
                public void LoadInputAsXmlNodeList () 
                {
@@ -166,11 +165,10 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                        transform.LoadInput (doc.ChildNodes);
                        Stream s = (Stream) transform.GetOutput ();
                        string output = Stream2String (s);
-                       Assert.AreEqual ("<Test></Test>", output, "XmlChildNodes");
+                       Assert.AreEqual ("<Test xmlns=\"http://www.go-mono.com/\"></Test>", output, "XmlChildNodes");
                }
 
                [Test]
-               [Category ("NotDotNet")]
                // MS has a bug that those namespace declaration nodes in
                // the node-set are written to output. Related spec section is:
                // http://www.w3.org/TR/2001/REC-xml-c14n-20010315#ProcessingModel
@@ -180,7 +178,7 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                        transform.LoadInput (doc.SelectNodes ("//*"));
                        Stream s = (Stream) transform.GetOutput ();
                        string output = Stream2String (s);
-                       string expected = @"<Test><Toto></Toto></Test>";
+                       string expected = "<Test xmlns=\"http://www.go-mono.com/\"><Toto></Toto></Test>";
                        Assert.AreEqual (expected, output, "XmlChildNodes");
                }
 
@@ -507,20 +505,6 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                        Assert.AreEqual (xml, output);
                }
 
-               [Test]
-               public void PrefixlessNamespaceOutput ()
-               {
-                       XmlDocument doc = new XmlDocument ();
-                       doc.AppendChild (doc.CreateElement ("foo", "urn:foo"));
-                       doc.DocumentElement.AppendChild (doc.CreateElement ("bar", "urn:bar"));
-                       Assert.AreEqual (String.Empty, doc.DocumentElement.GetAttribute ("xmlns"), "#1");
-                       XmlDsigC14NTransform t = new XmlDsigC14NTransform ();
-                       t.LoadInput (doc);
-                       Stream s = t.GetOutput () as Stream;
-                       Assert.AreEqual (new StreamReader (s, Encoding.UTF8).ReadToEnd (), "<foo xmlns=\"urn:foo\"><bar xmlns=\"urn:bar\"></bar></foo>");
-                       Assert.AreEqual ("urn:foo", doc.DocumentElement.GetAttribute ("xmlns"), "#2");
-               }
-
                [Test]
                [Ignore ("find out how PropagatedNamespaces returns non-null instance on .NET")]
                public void PropagatedNamespaces ()
index 7b56a240055b784aef0c81f6bd023cde63602d35..d14b5ee2802f7cf076b1e913ff02ae48b03aa315 100644 (file)
@@ -251,7 +251,6 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                }
 
                [Test]
-               [Category ("NotDotNet")]
                // see LoadInputAsXmlNodeList2 description
                public void LoadInputAsXmlNodeList () 
                {
@@ -260,11 +259,10 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                        transform.LoadInput (doc.ChildNodes);
                        Stream s = (Stream) transform.GetOutput ();
                        string output = Stream2String (s);
-                       Assert.AreEqual ("<Test></Test>", output, "XmlChildNodes");
+                       Assert.AreEqual ("<Test xmlns=\"http://www.go-mono.com/\"></Test>", output, "XmlChildNodes");
                }
 
                [Test]
-               [Category ("NotDotNet")]
                // MS has a bug that those namespace declaration nodes in
                // the node-set are written to output. Related spec section is:
                // http://www.w3.org/TR/2001/REC-xml-c14n-20010315#ProcessingModel
@@ -274,7 +272,7 @@ namespace MonoTests.System.Security.Cryptography.Xml {
                        transform.LoadInput (doc.SelectNodes ("//*"));
                        Stream s = (Stream) transform.GetOutput ();
                        string output = Stream2String (s);
-                       string expected = @"<Test><Toto></Toto></Test>";
+                       string expected = "<Test xmlns=\"http://www.go-mono.com/\"><Toto></Toto></Test>";
                        Assert.AreEqual (expected, output, "XmlChildNodes");
                }
 
index 6b6ac476f56dc9f26337083c4b0a141d00e4fd4c..37820522a3a305cc14185dc2aec55d46a1ad76f2 100644 (file)
@@ -21,6 +21,7 @@ partial class SR
        public const string Cryptography_Xml_InvalidReference = "Malformed reference element.";
        public const string Cryptography_Xml_InvalidSignatureLength = "The length of the signature with a MAC should be less than the hash output length.";
        public const string Cryptography_Xml_InvalidSignatureLength2 = "The length in bits of the signature with a MAC should be a multiple of 8.";
+       public const string Cryptography_Xml_InvalidX509IssuerSerialNumber = "X509 issuer serial number is invalid.";
        public const string Cryptography_Xml_KeyInfoRequired = "A KeyInfo element is required to check the signature.";
        public const string Cryptography_Xml_KW_BadKeySize = "The length of the encrypted data in Key Wrap is either 32, 40 or 48 bytes.";
        public const string Cryptography_Xml_LoadKeyFailed = "Signing key is not loaded.";
index f47e879881905b8dcdb51f696d139aa0a4b678a6..23a8b15d3671c5236857bad0ecc6ca3a5915dec4 100644 (file)
@@ -53,8 +53,6 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile("../winfx.pub")]
-
 [assembly: ComVisible (false)]
 
 [assembly: InternalsVisibleTo ("System.ServiceModel, PublicKey=00000000000000000400000000000000")]
index 2be1563c1d7fe3fcd25604e4bbcefd2b6a3489fc..e8c0e953fd276fd6f963590a24c927417e52692d 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.ServiceModel.Activation.dll
 
 LIB_REFS = System.Core System plainservice/System.ServiceModel
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS =
 
 TEST_MCS_FLAGS =
index 03435c29ec61fb2f671618d0c59f22daf930a981..e26830a4f6ab083ca8b2636379d0e2b4a85dcfac 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.ServiceModel.Activation</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 6a9d85f5c70431892b5bf30138af2f4514ab0cd6..bceb2067199a68d6b7f6ff055fd2d275f64aeb9f 100644 (file)
@@ -54,8 +54,3 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 
 [assembly: AssemblyDelaySign (true)]
-#if MOBILE
-[assembly: AssemblyKeyFile ("../silverlight.pub")]
-#else
-[assembly: AssemblyKeyFile("../winfx.pub")]
-#endif
index d46df268454428326dff800cee795250cb365896..a56da1ee8af607e2a49350bca2fc5454dbd3888b 100644 (file)
@@ -11,6 +11,12 @@ LIB_REFS += System.Configuration
 LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0 
 endif
 
+ifdef MOBILE_PROFILE
+KEYFILE = ../silverlight.pub
+else
+KEYFILE = ../winfx.pub
+endif
+
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
 EXTRA_DISTFILES = $(RESOURCE_FILES)
index b6c9e3912a72f224e34cfbd169aa3c02d90f9a3f..ad3a3b2591246b6574093dc8fb955067d67ff2ab 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.ServiceModel.Discovery</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 5b668e43a0529db177b85ab597251bf3bebd2102..398bad350c8dfc2b8339dc9dcd4f9a629ea2b79b 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System.ServiceModel.Internals</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 0202afecb934074fa0089ed2b77ef53d7d4596cf..712a1c5602185315f11cb4ac57156c8aac617371 100644 (file)
@@ -54,8 +54,3 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 
 [assembly: AssemblyDelaySign (true)]
-#if MOBILE
-[assembly: AssemblyKeyFile ("../silverlight.pub")]
-#else
-[assembly: AssemblyKeyFile("../winfx.pub")]
-#endif
index f8d30f60025f57b042f907851c4feef3c5be7019..4c5b0a74817cca5e68285d832236c0b7e7a5371e 100644 (file)
@@ -11,6 +11,12 @@ LIB_REFS += System.Configuration
 LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0
 endif
 
+ifdef MOBILE_PROFILE
+KEYFILE = ../silverlight.pub
+else
+KEYFILE = ../winfx.pub
+endif
+
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
 EXTRA_DISTFILES = $(RESOURCE_FILES)
index befb1ca73aa6e744381e802f9f79f9cb58b2e990..fc1be9b6732ca4e9422b14ac57274a77b7633cf4 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.ServiceModel.Routing</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 2e2baf595ce49623904ffc7704e814c7b510d39c..a53bde8b1b215868bce5c38dc6b63e0f19e9220e 100644 (file)
@@ -53,13 +53,7 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible (false)]
 
 [assembly: AssemblyDelaySign (true)]
-#if MOBILE
 [assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
-[assembly: AssemblyKeyFile ("../silverlight.pub")]
-#else
-[assembly: AssemblyInformationalVersion ("3.5.594.0")]
-[assembly: AssemblyKeyFile("../winfx.pub")]
-#endif
 
 #if MOBILE
 [assembly: InternalsVisibleTo ("System.Json, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
index 8a4a46c755fef5a7a9e47fae4ad240d28f92853a..cc4eaf3524f9630cc573a96d950ab7d7b7952323 100644 (file)
@@ -22,6 +22,12 @@ LIB_REFS += System.ServiceModel.Activation
 endif
 endif
 
+ifdef MOBILE_PROFILE
+KEYFILE = ../silverlight.pub
+else
+KEYFILE = ../winfx.pub
+endif
+
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
 EXTRA_DISTFILES = $(RESOURCE_FILES) \
index 604a267cd47ab03a93c969cdbf8b799b5c0dac5f..1b4dc381ec44bd7f4e96d03c558b1951aa2a20ee 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.ServiceModel.Web</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 6de48be1b1fac9baced64fd3935dd6d8dd327baf..6b31dd5a70b671b3eb2fde7c7b32c1f55ab684cd 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System.ServiceModel</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 03f3de5243565e9f05739e09052fcd81067153f4..1c8f339bf356730930085f04cf9f27bdec293605 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System.ServiceModel</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 2a12209998f6bf6de6eb4e0072751f26e254ed25..2b481d6d8ae6a784198cb7d044da9e42fbeb4ccf 100644 (file)
@@ -68,9 +68,8 @@ namespace System.ServiceModel.Description
                        get { return behaviors; }
                }
 
-               [MonoTODO]
                public KeyedCollection<Type,IEndpointBehavior> EndpointBehaviors {
-                       get { throw new NotImplementedException (); }
+                       get { return behaviors; }
                }
 
                public ContractDescription Contract {
index 2e5c2d833e87857c397e03643fe9206c071090f3..ebdcb1a2206331f12491d1a800543bbe5c80e199 100644 (file)
@@ -54,7 +54,6 @@ using System.Runtime.InteropServices;
 
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index 82de1c3ee28284fa58978023a7856832d2868ad6..8414fa099f534a138f991a4d0f91ef42ba20c5a9 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.ServiceProcess.dll
 LIB_REFS = System System.Configuration.Install System.Windows.Forms
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = /nowarn:0618
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
index 561536018763671c7a258ccbc288c51c879084c8..aa2e532cdb8118c4e0285a9d950e6ba74bbf9665 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.ServiceProcess</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 8edb6b01a7ecef78c77512897ad87d4a7cc73076..e78386a2226acff8d9262f9ba86101b75389f1fa 100644 (file)
@@ -49,6 +49,5 @@ using System.Runtime.InteropServices;
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
 
-[assembly: AssemblyKeyFile ("../ecma.pub")]
 
 [assembly: ComVisible (false)]
index 017f1a880c8a371ee9a228c80fe6c8aaebf9991d..77e279ebb23df90db51f604ec2ed8c6c0658c7ad 100644 (file)
@@ -4,11 +4,12 @@ include ../../build/rules.make
 
 LIBRARY = System.Threading.Tasks.Dataflow.dll
 
-include ../../build/library.make
-
 LIB_REFS += System.Core System
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS += -d:CONCURRENT_COLLECTIONS
 
+include ../../build/library.make
+
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = System.Core System
 
index 507691da5d16beb71cd930345ec69fee210ac701..de5a040ad52060305c7c45027c335b73a181b22e 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Threading.Tasks.Dataflow</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 4b130a9110a7bc42891c2168ba1144dc257d4f61..a205b613243570083e9eb7d187af05a744b66721 100644 (file)
@@ -56,7 +56,6 @@ using System.Security.Permissions;
 
        [assembly: CLSCompliant (true)]
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile("../ecma.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: BestFitMapping (false)]
index 07672c10b06da81802b6a3ac7188edce5129ee90..bc3825dbf95dcb4355e51e6185549425dd8966c2 100644 (file)
@@ -3,6 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = System.Transactions.dll
+KEYFILE = ../ecma.pub
 ifdef MOBILE_PROFILE
 LIB_REFS = System
 LIB_MCS_FLAGS = /define:MOBILE
index 0a072821c8c6ea931595429a075e7308e7dd934a..cb281677b7786f23de49349541f2646c3f3d4452 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Transactions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index b0e5072ddf65c55acea3f6cb799e589c7c7cbab3..bad9f9434dae2d38f9ff22304eaff717e1c63cc3 100644 (file)
@@ -57,7 +57,6 @@ using System.Web;
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../winfx.pub")]
 
 [assembly: ComVisible (false)]
 [assembly: AllowPartiallyTrustedCallers]
index f896d06efaf8f9e2eb03ef0875942577d5b60c0e..76896b0f42a263c21e12b3ef2373caf9538230f0 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Web.Abstractions.dll
 LIB_REFS = System System.Core System.Web
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS =
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
index 1af6adda549d29f9a5e7ffa4aae1eff0141f9d99..9a8e515faf189e2d5f205b9e279f4e15461d91b8 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Web.Abstractions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index c7313e561e06a42ae61b528f61a946a87e9da2a6..7bd833647f321173400dd715a0f8581c1da92b7d 100644 (file)
@@ -58,7 +58,6 @@ using System.Runtime.Versioning;
 
 [assembly: ComVisible (false)]
 
-[assembly: AssemblyKeyFile ("../winfx.pub")]
 [assembly: InternalsVisibleTo ("System.Web, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
 
 [assembly: AllowPartiallyTrustedCallers]
index d7389f43e0d2a98ff28798be97789ff3e3da1969..2a8fb964bf8748ae9e81e14312df6f58562d1039 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Web.ApplicationServices.dll
 LIB_REFS = System System.Configuration
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS = -d:SYSTEM_WEB_APPLICATIONSERVICES
 
 EXTRA_DISTFILES = $(RESOURCE_FILES)
index f2a19a0f916ba1d5311f238e978f04c4c92aeefe..84b0e2d6bf2034398550aefa3144f2974923e459 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Web.ApplicationServices</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index a3aefb7d77474c4d0589d50eeab85a16756a3e3a..3ff8aee3018a02de6de89f1a58219ccc96f1b1f9 100644 (file)
@@ -55,7 +55,6 @@ using System.Runtime.InteropServices;
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../winfx.pub")]
 
 [assembly: ComVisible (false)]
 [assembly: ComCompatibleVersion (1, 0, 3300, 0)]
index df81a3719ca47c816f3937a33d1e1886bae5831d..a256a4f4234670a716ddba35a3cf57ff21b30bbc 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Web.DynamicData.dll
 LIB_REFS = System System.Core System.ComponentModel.DataAnnotations System.Data System.Data.Linq System.Drawing System.Web System.Web.Extensions System.Web.Abstractions System.Web.Routing
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS =
 
 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
index bbae65b714dd522cbfdb26643a2bc8d816cf3c19..b2ae64f9c5d95a4054d835611a1e11e19f0d1323 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Web.DynamicData</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 1157af998de3ddb963f8140b4db234db121865dd..ce69632459dbf435303b4a542b23d26f4d9660e8 100644 (file)
@@ -40,5 +40,4 @@ using MonoTests.Common;
 //[assembly: AssemblyFileVersion ("1.0.0.0")]
 #if !TARGET_DOTNET
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../winfx.pub")]
 #endif
index 50340619e30f2cd9bedf2f11c37fa08ce9f580a0..75ca721f8377e40d0fb775335570c107f67747bc 100644 (file)
@@ -56,7 +56,6 @@ using System.Security;
 #if !(TARGET_DOTNET)
        [assembly: CLSCompliant (true)]
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile ("../winfx.pub")]
 #endif
 
 [assembly: ComVisible (false)]
index 6ea70f5bf6c1465ba05cac3cb3568edc5b2be1e5..38b7c6647ba3248c59f7cd19b62945f1fd266b03 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Web.Extensions.Design.dll
 
 LIB_REFS = System System.Design System.Drawing System.Windows.Forms
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS = -define:NET_3_5
 
 include ../../build/library.make
index 0af1d8e7fd15e0bfcad0bae4ba68848e9681d008..c49d4291f1931e33f6c2413572b8c381dd7e8f34 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Web.Extensions.Design</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 87b059215a3e1fb55e364dfe6971b42b950b9894..f3f56f0e3252dedbb2b73725b90c28b78e201c5a 100644 (file)
@@ -57,7 +57,6 @@ using System.Security.Permissions;
 #if !(TARGET_DOTNET)
        [assembly: CLSCompliant (true)]
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile ("../winfx.pub")]
 
 #endif
 
index 9660692d0db17f64e0ad6b4cc43c76ad8dbbdaae..b2ab6dd8a75663a97c62d038b71cfdcb1e5db70f 100644 (file)
@@ -50,6 +50,7 @@ RUN_STANDALONE += --test=$(TESTNAME)
 endif
 
 LIB_REFS = System System.Core System.Drawing System.Data System.Data.Linq System.Xml System.Web System.Web.Services System.Configuration System.EnterpriseServices System.ServiceModel
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS = \
        -unsafe \
        -define:NET_3_5 -nowarn:436             \
index 90cfae5b56a109aa79b8e67c817a6daf62b2796d..403af8f4fa65e7c5c6ccee8fdebbbf1e9f98cd39 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Web.Extensions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e8edfccdb5d76046e85f58d8205072884a581c42..fd014453b10754cf24dae3fb7b52f74a3f7d7b10 100644 (file)
     <AssemblyName>System.Web.Http.SelfHost</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index fa6d0d76f9481fa66817c013a4b7ff32e6e5b25f..022b334bb22927fbe4dfd1d93cd4e03df50da6c0 100644 (file)
     <AssemblyName>System.Web.Http.WebHost</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 72afa046d2a4cb72959d0a660e53fa8a609fb399..22be8256d9461de9926e2612cacfc6f92c70e1b8 100644 (file)
@@ -8,9 +8,8 @@ RESOURCE_DEFS = \
        System.Web.Http.Properties.CommonWebApiResources,../../../external/aspnetwebstack/src/Common/CommonWebApiResources.resx \
        System.Web.Http.Properties.SRResources,../../../external/aspnetwebstack/src/System.Web.Http/Properties/SRResources.resx
 
-
-
 LIB_REFS = System.Core System System.Xml System.Net.Http System.ComponentModel.DataAnnotations System.Net.Http.Formatting System.Runtime.Caching System.Runtime.Serialization System.Data.Linq
-LIB_MCS_FLAGS = -d:ASPNETMVC -keyfile:../winfx.pub -delaysign 
+KEYFILE = ../winfx.pub
+LIB_MCS_FLAGS = -d:ASPNETMVC -delaysign
 
 include ../../build/library.make
index 6e5cd1dfb9d5582b6c38936b61ef96b6238aa712..264f4e2a4ee1cccd87ef8d718e92a50b7ba4fcbc 100644 (file)
     <AssemblyName>System.Web.Http</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index e2275eb6c7dd88544269396b1837e6fde456f7e6..ac2f935279cde6c7274599b22300df96d1712403 100644 (file)
     <AssemblyName>System.Web.Mobile</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index e5418545d960e1e5593af07891b5a2d961caa933..20b0edc232545317146e55d57abab7cc45df9b1b 100644 (file)
@@ -9,9 +9,9 @@ RESOURCE_DEFS = System.Web.Mvc.Resources.MvcResources,Mvc/Resources/MvcResources
 RESX_DIST =  Mvc/Resources/MvcResources.resx
 
 LIB_REFS = Microsoft.Web.Infrastructure System System.Core System.Configuration System.Data System.Xml System.Web System.Web.Abstractions System.Web.Routing System.Web.Extensions System.ComponentModel.DataAnnotations System.Data.Linq System.Runtime.Caching System.Web.Razor System.Web.WebPages.Razor System.Web.WebPages
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS = \
                /warn:1 \
-               /keyfile:../winfx.pub \
                /d:MONO \
                /delaysign
 
index a7ef0f6ac594063e690c22de99eb72eed2576696..38290c8ed9d1771b7e734b99d2350b2f07a84f84 100644 (file)
     <AssemblyName>System.Web.Mvc</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index e4472a96a0c3d4beb9ec6dae32aeb0c9a29237b9..c329613bdf469a9967065b56f1bd6adc2ce54cb8 100644 (file)
@@ -10,10 +10,10 @@ RESOURCE_DEFS = \
        System.Web.Razor.Resources.RazorResources,../../../external/aspnetwebstack/src/System.Web.Razor/Resources/RazorResources.resx
 
 LIB_REFS = System System.Core
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS = \
                /warn:1 \
-               /keyfile:../winfx.pub -delaysign \
-               /d:ASPNETWEBPAGES 
+               -delaysign \
+           /d:ASPNETWEBPAGES 
 
 include ../../build/library.make
-
index 8ecd2fc747594e6d53782c58ea10f0cff70c603a..1f85a9bf6e2bf87cc401d17d40e8a9c2b7e32aff 100644 (file)
     <AssemblyName>System.Web.Razor</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 64dfce87e9ac59d3e40f2df64bcdba2b1713a407..7b6c517a3852d1ffd573b8534071abb6bb7feb58 100644 (file)
     <AssemblyName>System.Web.RegularExpressions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 5487f687a3e3d7bc9a83931a0578678ffde23a63..4ec637c05d070c4efe0ef5e5082ed8fc68472cc7 100644 (file)
@@ -57,7 +57,6 @@ using System.Web.Routing;
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../winfx.pub")]
 
 [assembly: ComVisible (false)]
 [assembly: AllowPartiallyTrustedCallers]
index 09df4e8819aed3ee0e3516c679a2865d468c1419..7fc38d155aa39f0f4ed1b1ce9931e0b6ab29f06d 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Web.Routing.dll
 LIB_REFS = System System.Core System.Web System.Web.Abstractions
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS = 
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
index 51f61599097f81205b95e032abe8e63596534874..c48f03f9a094af0a010e979630a6e431e162d867 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Web.Routing</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index a40578640639cf89fb28892b1bae88102bd07932..ded3594711dfaf72d330b8bb181724cff0491b3b 100644 (file)
@@ -56,7 +56,6 @@ using System.Runtime.InteropServices;
 
        [assembly: CLSCompliant (true)]
        [assembly: AssemblyDelaySign (true)]
-       [assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index 6120b04b75a1684bf47d3320a80c43b1bb3fc12d..566da23778b79697eefecf19708e613176e5d115 100644 (file)
@@ -3,6 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = System.Web.Services.dll
+KEYFILE = ../msfinal.pub
 ifdef MOBILE_PROFILE
 LIB_REFS = System System.Xml
 LIB_MCS_FLAGS = \
index 5a3e1311d5da474f5791878dd8c9fa5a859bf1d7..bb0a2395a8ed5f9463aa38c9941eb1cb47189439 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Web.Services</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 0525994a43b363497b5723efdd86ab70c1167b57..349b41fe8eaabbf73f894218c4b7ea7a48f43605 100644 (file)
@@ -208,9 +208,12 @@ namespace System.Web.Services.Protocols
                        WebRequest request = GetWebRequest (uri);
                        request.Method = "POST";
                        WebHeaderCollection headers = request.Headers;
-                       if (!message.IsSoap12)
-                               headers.Add ("SOAPAction", "\"" + message.Action + "\"");
                        request.ContentType = message.ContentType + "; charset=utf-8";
+                       if (!message.IsSoap12) {
+                               headers.Add ("SOAPAction", "\"" + message.Action + "\"");
+                       } else {
+                               request.ContentType += "; action=\"" + message.Action + "\"";
+                       }
                        return request;
                }
 
index 4a12ce5b1ea97ecf3111f850f7e9135baa3c52aa..13a357274aecf3e89de65469ed444693a5267593 100644 (file)
@@ -18,7 +18,7 @@ namespace MonoTests.System.Web.Services.Discovery {
        public class DiscoveryClientProtocolTest {
 
                [Test] // Covers #36116
-               [Category ("InetAccess")]
+               [Category ("NotWorking")]
                public void ReadWriteTest ()
                {
                        string directory = Path.Combine (Path.GetTempPath (), Path.GetRandomFileName ());
index 2e704de873419e2038fbadbd36737148590875d1..bb1cd40bfd4e4425a504036816720fcd65d7f949 100644 (file)
@@ -11,9 +11,10 @@ RESOURCE_DEFS = \
 
 
 LIB_REFS = System System.Core System.Configuration System.Web Microsoft.Web.Infrastructure
+KEYFILE=../winfx.pub
 LIB_MCS_FLAGS = \
-               /warn:1 \
-               /keyfile:../winfx.pub -delaysign \
-               /d:ASPNETWEBPAGES 
+                       /warn:1 \
+                       -delaysign \
+                       /d:ASPNETWEBPAGES 
 
 include ../../build/library.make
index 5b81664dfd93cd87375166be5e0e169731921d10..99ec1af6a95f786df78b5fe2fc3766c90b1b74aa 100644 (file)
     <AssemblyName>System.Web.WebPages.Deployment</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 28b0f3f45c16eb89d54e927c7f40cc855dc674a7..b9f7f8f5cc4b5826dee279387a964fbc4f41fd00 100644 (file)
@@ -10,10 +10,10 @@ RESOURCE_DEFS = \
        System.Web.WebPages.Razor.Resources.RazorWebResources,../../../external/aspnetwebstack/src/System.Web.WebPages.Razor/Resources/RazorWebResources.resx
 
 LIB_REFS = System System.Core System.Configuration System.Web System.Web.WebPages System.Web.Razor
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS = \
-               /warn:1 \
-               /keyfile:../winfx.pub \
-               /delaysign \
+                       /warn:1 \
+                       /delaysign \
                /d:ASPNETWEBPAGES
 
 include ../../build/library.make
index 7ad6a6f2a5483c5ffaf58cc0a6b6e02d1189d4b1..e7375fb58adedb2a31009b23d8b7dfd3036ea5aa 100644 (file)
     <AssemblyName>System.Web.WebPages.Razor</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 3e9641f079cfbbcdba3b85c7664794bac1331e48..91e15810c7d829f8455aef378d581a5e72030826 100644 (file)
@@ -11,10 +11,10 @@ RESOURCE_DEFS = \
 
 LIB_REFS = Microsoft.CSharp Microsoft.Web.Infrastructure System System.ComponentModel.DataAnnotations System.Configuration System.Core System.Data.Linq System.Web System.Web.WebPages.Deployment System.Web.Razor System.Xml System.Xml.Linq
 
+KEYFILE=../winfx.pub
 LIB_MCS_FLAGS = \
-               /warn:1 \
-               /keyfile:../winfx.pub \
-               /delaysign \
+                       /warn:1 \
+                       /delaysign \
                /d:ASPNETWEBPAGES 
 
 EXTRA_DISTFILES = $(RESX_DIST)
index 7ee5a7192ee20bdfc7461798373cae6076b29fc2..959f40d093c6f5565cfa59f69637795421d78842 100644 (file)
     <AssemblyName>System.Web.WebPages</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 72eb774c61191e1366e30ee7b29ddb0f494e717d..3b581a77e38fb8fd4df06642c5773550a44bc7a8 100644 (file)
@@ -59,7 +59,6 @@ using System.Web.UI;
 [assembly: TagPrefix("System.Web.UI.WebControls", "asp")]
 #if !(TARGET_DOTNET)
 [assembly: AssemblyDelaySign(true)]
-[assembly: AssemblyKeyFile("../msfinal.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index 21508dad37b8d717380c21dbe722f20d35478430..a7e12930f1583eec9703fb232190f60a74e62b30 100644 (file)
@@ -243,6 +243,7 @@ TXT_RESOURCE_STRINGS = ../referencesource/System.Web/System.Web.txt
 
 LIB_REFS = System System.Core System.Drawing System.Data System.Xml System.EnterpriseServices System.Runtime.Serialization.Formatters.Soap \
        System.ComponentModel.DataAnnotations System.Web.ApplicationServices System.Configuration Mono.Data.Sqlite
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS = \
        -unsafe \
        -nowarn:612,618 \
index 27c0aa4500acbc4c87d5c63d2b7c4d514f6939de..d508f9f53f27f6983cfd316b5e1c8707c638324f 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Web</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 522309d959df785d0867dd32e375c0194feb9097..2ca3e7a337b6575c658a7ce8abc669fed4203a3a 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Web</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 1c82c534157d9c9681ea8b2396e5b1394040f389..b40292afb4874465cd41951bb5eea7a4946629eb 100644 (file)
@@ -24,7 +24,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index 3910e0042044541622d94681506107e649bfb186..7b4716e23dc96ab67fc7840d1a605d14b93279c5 100644 (file)
@@ -13,7 +13,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index cf8e0f5f7436315b6140b24a9fba1d0b393b288a..f83a2bae241c479f586fd62a9dae202eb9a66adf 100644 (file)
@@ -13,7 +13,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index ff0172cd7a46c627e942382ee89d8a9ab30f5bae..ec8ceca2bda88bb0525210a7933c5552fdadae04 100644 (file)
@@ -13,7 +13,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index f9c8780885edc85afc11794dd5d466e738a9626b..b805579fcb6267fe680ddefc11d1b64be9d0266f 100644 (file)
@@ -13,7 +13,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index a1b5012d9a22f717ae7adc175d3127c2b606f0e7..f87fe645151d89347baee268357d268edd24b551 100644 (file)
@@ -13,7 +13,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index 610338580885f72906b064ad59eed6eb13b11bef..b23bc982b3d5cbd2911cc4a1aec6e652fb71c06b 100644 (file)
@@ -13,7 +13,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index ba345317aaf6982e755ddb27f9490819e9e3e931..a41268321363bc01c912becdc7743e31db1582f9 100644 (file)
@@ -13,7 +13,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index 17464eb5c6a05e43297852574e80a9c9afd01908..f0d1399fa1ecff1a4bc1f3385f67e9993fc989eb 100644 (file)
@@ -12,7 +12,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index 5ebdf8d62b2a68d8d255851648db96b495d7d398..267882d694a3ae5a12427106682c56420bd01ddc 100644 (file)
@@ -12,7 +12,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index a1c22ea4a648645d8f09bb994f025cf01b1ccbee..eed4f1273a38d58ad73342a720866c23ff079bd0 100644 (file)
@@ -12,7 +12,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index ed1c11f82a0ab3ffb956805dc2d5501d9194e4e4..8c721a8d73a1242f35047cfdd82cd7bb78c63521 100644 (file)
@@ -12,7 +12,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index 1c62f879d545e64f8e16f09f85c5785e47f203ee..264c7feff452f6662f95b27e955b35493544cdb8 100644 (file)
@@ -12,7 +12,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index 0b88be3c34d822e278c2d83f158cfa204141aa75..a9dc48eb787f7c6caa0c4723343274e8a775e19a 100644 (file)
@@ -12,7 +12,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index d912fce274e92fc63f91e6b431c8ca8f11b6188f..fb0fd1e3410a95e85c23588a6e934d5295084f9f 100644 (file)
@@ -12,7 +12,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index 667e288b3e880196e95dd3623b29083a43940eff..71a45db3a6e9df484cb703b859abadbaedf73f7e 100644 (file)
@@ -12,7 +12,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index 228532c1b45d9aa47aca7d4141523dbfe708c74b..8a259651aaf5080628b6a272b6b7cf093cc150fd 100644 (file)
@@ -12,7 +12,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index 34938ef1d1734b9b9ee0b344ed7318f1cc969429..a75e30d792600f832a501d3187951ed609a2d71e 100644 (file)
@@ -13,7 +13,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index 0809ee737b6e3904f44c77aef225ee33a7148f44..f0452d73e63deba5ae70224b7760453227b54e23 100644 (file)
@@ -14,7 +14,7 @@ APPLICATION_ASSEMBLY_MCS_FLAGS = \
        -debug:full \
        -r:System.Web.dll
 
-VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
+VALID_PROFILE := $(filter 4.5, $(FRAMEWORK_VERSION))
 
 ifndef VALID_PROFILE
 all:
index da73c9fd9c861fa9d44d1ae57a1330e346a6cb0c..512122d8e1b6e0403a7f30dc7b42ed6b34b4c53e 100644 (file)
@@ -50,7 +50,6 @@ using System.Runtime.InteropServices;
 [assembly: NeutralResourcesLanguage ("en-US")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../winfx.pub")]
 
 [assembly: SecurityRules (SecurityRuleSet.Level1)]
 
index e0284d75bf18749bc6549740285195d848c64d0f..ec81308ae52ad13475bf347b74c3cdaa2a334823 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Windows.Forms.DataVisualization.dll
 LIB_REFS = System System.Drawing System.Windows.Forms System.Core System.Data System.Xml
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS = -nowarn:67
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
index d511cca1ad0891b7460c7a8c354b0a1b85b45a55..650b035dda8a1f9f2ef5dd332dff02503283b166 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Windows.Forms.DataVisualization</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 39fc0acfe0ac65491d0877109ad6122dbd7c8f1e..9f94433c9b933608a803c56c62baf6ab59b86e0e 100644 (file)
@@ -35,7 +35,6 @@ using System.Diagnostics;
 [assembly: AllowPartiallyTrustedCallers]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../ecma.pub")]
 
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
index 0e4fb4ef46d1bc097411a2d11d8aa3550585f207..6480c58009bf253b12a6ec52538fc971d9df0c1e 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 LIBRARY = System.Windows.Forms.dll
 
 LIB_REFS = System System.Xml System.Drawing Accessibility System.Data Mono.Posix Mono.WebBrowser System.Configuration System.Runtime.Serialization.Formatters.Soap
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS = /unsafe \
        @System.Windows.Forms.dll.resources \
        -nowarn:618,612,809
@@ -114,7 +115,7 @@ test-local: DummyAssembly.dll
 
 include ../../build/library.make
 
-TEST_HARNESS_EXCLUDES = -exclude=Interactive,NotWorking,ValueAdd,CAS,InetAccess
+TEST_HARNESS_EXCLUDES = -exclude=Interactive,NotWorking,CAS
 TEST_HARNESS_EXCLUDES_ONDOTNET = -exclude=Interactive,NotDotNet,CAS
 
 $(the_lib): $(RESOURCES)
index 19bc48b80d228db4f1023988891fe17de4124e76..8dd887dd24f7c2adf99ad0b57b766b237a887806 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Windows.Forms</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e7b124905a301dad0d09b5bf95769d1ec91f6893..24e90bb8d5c3e17140f8f7fa306297ebba8671fb 100644 (file)
@@ -39,4 +39,3 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../msfinal.pub")]
index c24e79129a6eed918c7744522171eeebeee639e8..de1c0bf5c7fd899b136f9cb2eae5c157b9e0edaa 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Windows.dll
 LIB_REFS = System
+KEYFILE = ../msfinal.pub
 LIB_MCS_FLAGS =
 
 PLATFORM_DEBUG_FLAGS =
index 331044b54f2f751229ea4bf346ac6f8fdae86f4f..1a7d73914035f953c9774f59d16fba1067850b47 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Windows</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../msfinal.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 6d3e21fc78b43e729a5ad423c84cefa9eb78adcb..b8277897a74e28675eec1d420a308893bbad8fd8 100644 (file)
     <AssemblyName>System.Workflow.Activities</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 3f3cd1c1d310c86f434ea83ba9e9ea46912e78a8..605e03dbaa4c0a6c5dfc81e126eb9b05da9c2eaa 100644 (file)
     <AssemblyName>System.Workflow.ComponentModel</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 26c80ddb4b760b8ae131186d7706197de76cea65..bc133eb5897f12c549293217a11d6425ea32cf7b 100644 (file)
     <AssemblyName>System.Workflow.Runtime</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
     <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index c1b0cbea9204bdfe49ef06f874e51ee9fa870dd8..956aab852f8666f957b9a34016da2c640d732597 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System.Xml</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index ac5a10ad2721183ed7c43996badce64d1eb7fd00..f9bc301cb07cbcd196311432ae2c3ca7ed29ce72 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System.Xml</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index aa97e4722bfb513d02126e8f6a12397fd8722fd2..42f562bf2de032463836f07ee974719a301e6515 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System.Xaml</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 274ab36da617fb8b81df715838a3ae117a6bdc63..b9b94858ba691cfa6b845a575222f86a3834cd0c 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System.Xml.Linq</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 67be7c03bdb691dc88184f19d35cfb4f49a6616a..2e0aa9a3eaf228db4090a7669efc3962b323ce9a 100644 (file)
@@ -39,4 +39,3 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
 [assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../ecma.pub")]
index f67cf54e8cc8cdbd4633703c8aca597acda5f7ab..230c5cd25fb259df2a7f398ab86cf9f2e4135af5 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Xml.Serialization.dll
 LIB_REFS = System.Xml System.ServiceModel
+KEYFILE = ../ecma.pub
 LIB_MCS_FLAGS =
 
 PLATFORM_DEBUG_FLAGS =
index a7f75a5dba9fc8cea37863b86c3ab1e4b41a357c..cdf311bffadd6df17b8d61a83caac297ecccc37e 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>System.Xml.Serialization</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../ecma.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 4fa1730df2a10ffc33fc7d9a5a792259737b8db6..563e35f01d15e9f6583699ec2273c4a641919b82 100644 (file)
@@ -44,7 +44,7 @@ namespace Mono.AppleTls
 
                GCHandle handle;
                IntPtr context;
-               IntPtr connectionId;
+
                SslReadFunc readFunc;
                SslWriteFunc writeFunc;
 
@@ -73,8 +73,7 @@ namespace Mono.AppleTls
                        : base (parent, serverMode, targetHost, enabledProtocols,
                                serverCertificate, clientCertificates, askForClientCert)
                {
-                       handle = GCHandle.Alloc (this);
-                       connectionId = GCHandle.ToIntPtr (handle);
+                       handle = GCHandle.Alloc (this, GCHandleType.Weak);
                        readFunc = NativeReadCallback;
                        writeFunc = NativeWriteCallback;
 
@@ -274,7 +273,7 @@ namespace Mono.AppleTls
                        var result = SSLSetIOFuncs (Handle, readFunc, writeFunc);
                        CheckStatusAndThrow (result);
 
-                       result = SSLSetConnection (Handle, connectionId);
+                       result = SSLSetConnection (Handle, GCHandle.ToIntPtr (handle));
                        CheckStatusAndThrow (result);
 
                        if ((EnabledProtocols & SSA.SslProtocols.Tls) != 0)
@@ -684,18 +683,19 @@ namespace Mono.AppleTls
                [Mono.Util.MonoPInvokeCallback (typeof (SslReadFunc))]
                static SslStatus NativeReadCallback (IntPtr ptr, IntPtr data, ref IntPtr dataLength)
                {
-                       var handle = GCHandle.FromIntPtr (ptr);
-                       if (!handle.IsAllocated)
-                               return SslStatus.Internal;
+                       AppleTlsContext context = null;
+                       try {
+                               var weakHandle = GCHandle.FromIntPtr (ptr);
+                               if (!weakHandle.IsAllocated)
+                                       return SslStatus.Internal;
 
-                       var context = (AppleTlsContext) handle.Target;
-                       if (context.disposed)
-                               return SslStatus.ClosedAbort;
+                               context = (AppleTlsContext) weakHandle.Target;
+                               if (context == null || context.disposed)
+                                       return SslStatus.ClosedAbort;
 
-                       try {
                                return context.NativeReadCallback (data, ref dataLength);
                        } catch (Exception ex) {
-                               if (context.lastException == null)
+                               if (context != null && context.lastException == null)
                                        context.lastException = ex;
                                return SslStatus.Internal;
                        }
@@ -704,18 +704,19 @@ namespace Mono.AppleTls
                [Mono.Util.MonoPInvokeCallback (typeof (SslWriteFunc))]
                static SslStatus NativeWriteCallback (IntPtr ptr, IntPtr data, ref IntPtr dataLength)
                {
-                       var handle = GCHandle.FromIntPtr (ptr);
-                       if (!handle.IsAllocated)
-                               return SslStatus.Internal;
+                       AppleTlsContext context = null;
+                       try {
+                               var weakHandle = GCHandle.FromIntPtr (ptr);
+                               if (!weakHandle.IsAllocated)
+                                       return SslStatus.Internal;
 
-                       var context = (AppleTlsContext) handle.Target;
-                       if (context.disposed)
-                               return SslStatus.ClosedAbort;
+                               context = (AppleTlsContext) weakHandle.Target;
+                               if (context == null || context.disposed)
+                                       return SslStatus.ClosedAbort;
 
-                       try {
                                return context.NativeWriteCallback (data, ref dataLength);
                        } catch (Exception ex) {
-                               if (context.lastException == null)
+                               if (context != null && context.lastException == null)
                                        context.lastException = ex;
                                return SslStatus.Internal;
                        }
index b9c83ae438392869f42fe267116e5190ea429c35..29bfb5bbfd1afeab1d6fa49fc47521ba48804562 100644 (file)
@@ -303,6 +303,8 @@ namespace Mono.Btls
                                return PKCS8.PrivateKeyInfo.DecodeRSA (bytes);
                        }
                        set {
+                               if (nativePrivateKey != null)
+                                       nativePrivateKey.Dispose ();
                                nativePrivateKey = null;
                                FallbackImpl.PrivateKey = value;
                        }
@@ -490,6 +492,7 @@ namespace Mono.Btls
                                x509 = null;
                        }
                        if (nativePrivateKey != null) {
+                               nativePrivateKey.Dispose ();
                                nativePrivateKey = null;
                        }
                        subjectName = null;
index 1fce2eab1144d3899423c1d58d0ee8bef3ca1afe..ba6d5197231e63d13c9c732be3ef00a742219d1c 100644 (file)
@@ -94,6 +94,7 @@ namespace Mono.Net.Security
 
                        ChainValidationHelper.Create (provider, ref settings, this);
 #else
+                       status = WebExceptionStatus.SecureChannelFailure;
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
 #endif
                }
index f80d759f63d222ebc29626a9db2e8a5ebbeb9b49..d5b1e3863d6a490fd850c1deae055f0429bdcbda 100644 (file)
@@ -1733,6 +1733,7 @@ namespace System.ComponentModel
                        case 13882: /* ERROR_IPSEC_IKE_MM_LIMIT */ return "IPSEC IKE mm limit";
                        case 13883: /* ERROR_IPSEC_IKE_NEGOTIATION_DISABLED */ return "IPSEC IKE negotiation disabled";
                        case 13884: /* ERROR_IPSEC_IKE_NEG_STATUS_END */ return "IPSEC IKE neg status end";
+                       case 100001: /* WSAENXIO */ return "Device not configured";
 #endif // MOBILE
                        default:
                                return string.Format ("mono-io-layer-error ({0})", error);
index 406e8dcc8c62d2775b24b1d9b81836d64c82af7b..238d4e93b2ddf02c3d97c9872bad2740d5760cd9 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index af65436fa38bca4b608311a31806c0d604185519..a5674f117fd22a2d8d918f7360c0c7982e1dd237 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e00315133378fc0549b390a4309b1e7dec8ffa3f..ba3f462a940ec3e8f9666a2b1a3ca80674e4071a 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>System</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index d19756b6c30013be319b87d94a0747081fc47394..ae92b8d730bb51f7ad2493ae02351ccd90cbfb36 100644 (file)
@@ -2265,6 +2265,9 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError, is_b
 
 #region DuplicateAndClose
 
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               static extern bool Duplicate_internal(IntPtr handle, int targetProcessId, out IntPtr duplicateHandle, out MonoIOError error);
+
                [MonoLimitation ("We do not support passing sockets across processes, we merely allow this API to pass the socket across AppDomains")]
                public SocketInformation DuplicateAndClose (int targetProcessId)
                {
@@ -2275,9 +2278,8 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError, is_b
                                (is_blocking       ? 0 : SocketInformationOptions.NonBlocking) |
                                (useOverlappedIO ? SocketInformationOptions.UseOnlyOverlappedIO : 0);
 
-                       MonoIOError error;
                        IntPtr duplicateHandle;
-                       if (!MonoIO.DuplicateHandle (System.Diagnostics.Process.GetCurrentProcess ().Handle, Handle, new IntPtr (targetProcessId), out duplicateHandle, 0, 0, 0x00000002 /* DUPLICATE_SAME_ACCESS */, out error))
+                       if (!Duplicate_internal (Handle, targetProcessId, out duplicateHandle, out MonoIOError error))
                                throw MonoIO.GetException (error);
 
                        si.ProtocolInformation = Mono.DataConverter.Pack ("iiiil", (int)addressFamily, (int)socketType, (int)protocolType, is_bound ? 1 : 0, (long)duplicateHandle);
index 98200b45b4a01ad613756f7d16839f978ce1e08f..89562a5b4c2e4afdd9627a258c2bae46a2920932 100644 (file)
@@ -69,7 +69,9 @@ namespace System.Net
                                        }
                                }
 #else
+#pragma warning disable 618
                                ConfigurationSettings.GetConfig ("system.net/authenticationModules");
+#pragma warning restore 618
 #endif
                        }
                }
index dac834884441e8ccd8764f846dcea5289ebd073b..5338cd09d012f8490dcc5351ef3ed839b8e2829b 100644 (file)
@@ -320,9 +320,11 @@ namespace System.Net {
                                try {
                                        IPAddress newAddress = IPAddress.Parse(h_addrlist[i]);
 
+#pragma warning disable 618
                                        if( (Socket.SupportsIPv6 && newAddress.AddressFamily == AddressFamily.InterNetworkV6) ||
                                            (Socket.SupportsIPv4 && newAddress.AddressFamily == AddressFamily.InterNetwork) )
                                                addrlist.Add(newAddress);
+#pragma warning restore 618
                                } catch (ArgumentNullException) {
                                        /* Ignore this, as the
                                         * internal call might have
@@ -393,7 +395,9 @@ namespace System.Net {
                        if (hostNameOrAddress.Length > 0 && IPAddress.TryParse (hostNameOrAddress, out addr))
                                return GetHostEntry (addr);
 
+#pragma warning disable 618
                        return GetHostByName (hostNameOrAddress);
+#pragma warning restore 618
                }
 
                public static IPHostEntry GetHostEntry (IPAddress address)
index 2f1658ab113ee155ffbb146e8c69ca85652d8abd..9a103f45cd72898eaec07552c2b693cde4f9816f 100644 (file)
@@ -84,7 +84,9 @@ namespace System.Net {
                                addr = IPAddress.Any;
                        else if (IPAddress.TryParse(host, out addr) == false){
                                try {
+#pragma warning disable 618
                                        IPHostEntry iphost = Dns.GetHostByName(host);
+#pragma warning restore 618
                                        if (iphost != null)
                                                addr = iphost.AddressList[0];
                                        else
index c0ea1b551195e55dd06e5919c44646ee5548dc8e..3121db3d1729daef56a67b3dea4af5fdb49897f0 100644 (file)
@@ -113,7 +113,9 @@ namespace System.Net
                internal FtpWebRequest (Uri uri) 
                {
                        this.requestUri = uri;
+#pragma warning disable 618
                        this.proxy = GlobalProxySelection.Select;
+#pragma warning restore 618
                }
 
                static Exception GetMustImplement ()
index 4f7d1d7d7baf1655780df5aba32bd4b84619f3b3..d05722051f93453ff405de19e8c76bf99fa2d380 100644 (file)
@@ -134,7 +134,9 @@ namespace System.Net
                {
                        defaultMaxResponseHeadersLength = 64 * 1024;
 #if !MOBILE
+#pragma warning disable 618
                        NetConfig config = ConfigurationSettings.GetConfig ("system.net/settings") as NetConfig;
+#pragma warning restore 618
                        if (config != null) {
                                int x = config.MaxResponseHeadersLength;
                                if (x != -1)
index 6747a263a6c966a549438d4989be1961db90cc6b..3e33097d1fc133548088677bc5ab6ccdce8c99f0 100644 (file)
@@ -97,7 +97,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncRead ()
                {
                        message = "AsyncRead";
@@ -136,7 +135,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncWrite ()
                {
                        message = "AsyncWrite";
index 6319d3e7b941976addc7b3462c8ee1c73a497f6a..1b4458c4f137b0bad9a7653468030029bcb49082 100644 (file)
@@ -78,7 +78,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncAccept ()
                {
                        IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 16279);
@@ -118,7 +117,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncConnect ()
                {
                        message = "AsyncConnect";
@@ -152,7 +150,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncReceive ()
                {
                        message = "AsyncReceive";
@@ -191,7 +188,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncReceiveFrom ()
                {
                        message = "AsyncReceiveFrom";
@@ -230,7 +226,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncSend ()
                {
                        message = "AsyncSend";
@@ -265,7 +260,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncSendTo ()
                {
                        message = "AsyncSendTo";
index d46838a9bb220d763682becc4f31d7f148fa8578..9a24b95e1b1642201544691b3af094e39acc17af 100755 (executable)
@@ -87,7 +87,7 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
-               [Category ("InetAccess")]
+               [Category ("NotWorking")]
 #if FEATURE_NO_BSD_SOCKETS
                [ExpectedException (typeof (PlatformNotSupportedException))]
 #endif
index b9f4de5440076d48ee56bc3aaa816e579f493081..fbc08e1f0f56762c7fc39e5c3945e6343e8d3f10 100644 (file)
@@ -50,7 +50,6 @@ namespace MonoCasTests.System.Net.Sockets {
                }
 
                // async tests (for stack propagation)
-/* Oops - not yet implemented in Mono
                private void ConnectCallback (IAsyncResult ar)
                {
                        TcpClient c = (TcpClient)ar.AsyncState;
@@ -71,7 +70,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncConnect_StringIntAsyncCallbackObject ()
                {
                        TcpClient s = new TcpClient ();
@@ -86,7 +84,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncConnect_IPAddressIntAsyncCallbackObject ()
                {
                        IPHostEntry host = Dns.Resolve ("www.google.com");
@@ -102,7 +99,6 @@ namespace MonoCasTests.System.Net.Sockets {
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = "USERNAME")]
-               [Category ("InetAccess")]
                public void AsyncConnect_IPAddressArrayIntAsyncCallbackObject ()
                {
                        IPHostEntry host = Dns.Resolve ("www.google.com");
@@ -115,6 +111,5 @@ namespace MonoCasTests.System.Net.Sockets {
                                Assert.Ignore ("Timeout");
                        Assert.IsNull (message, message);
                }
-*/
        }
 }
index 258e267787dd41137596051c3011569444c64ed2..38359efd4dea398ec4208a18de96c46569ccbac1 100644 (file)
@@ -63,7 +63,6 @@ namespace MonoTests.System.Net
                }
 
                [Test]
-               [Category("InetAccess")]
 #if FEATURE_NO_BSD_SOCKETS
                [ExpectedException (typeof (PlatformNotSupportedException))]
 #endif
@@ -135,7 +134,6 @@ namespace MonoTests.System.Net
                }
 
                [Test]
-               //[Category("InetAccess")]
                [Category ("NotWorking")] // Disabled until a server that meets requirements is found
                public void Cookies1 ()
                {
index c252d21b189bcd75d3c8b9cb2e94f621208fc838..2ed577e5df80d09d71c9fbd9e3329c783d40c56f 100644 (file)
@@ -47,7 +47,7 @@ public class ServicePointManagerTest
        }\r
 \r
         [Test, ExpectedException (typeof (InvalidOperationException))]\r
-               [Category ("InetAccess")]\r
+               [Category ("NotWorking")]\r
         public void MaxServicePointManagers ()\r
         {\r
                Assert.AreEqual (0, ServicePointManager.MaxServicePoints, "#1");\r
index 6171a2fd25587d85a535b496111aa114628536e0..514e27d47795e4279116888144c8caa4c4735dd3 100644 (file)
-//\r
-// ServicePointTest.cs - NUnit Test Cases for System.Net.ServicePoint\r
-//\r
-// Authors:\r
-//   Lawrence Pit (loz@cable.a2000.nl)\r
-//   Martin Willemoes Hansen (mwh@sysrq.dk)\r
-//\r
-// (C) 2003 Martin Willemoes Hansen\r
-//\r
-\r
-using NUnit.Framework;\r
-using System;\r
-using System.Collections;\r
-using System.IO;\r
-using System.Net;\r
-using System.Reflection;\r
-using System.Threading;\r
-\r
-namespace MonoTests.System.Net\r
-{\r
-\r
-[TestFixture]\r
-public class ServicePointTest\r
-{\r
-       static private int max;\r
-\r
-#if !FEATURE_NO_BSD_SOCKETS\r
-       [SetUp]\r
-       public void SaveMax () {\r
-               max = ServicePointManager.MaxServicePoints;\r
-               ServicePointManager.MaxServicePoints = 0;\r
-       }\r
-\r
-       [TearDown]\r
-       public void RestoreMax () {\r
-               ServicePointManager.MaxServicePoints = max;\r
-       }\r
-#endif\r
-\r
-        [Test]\r
-               [Category ("InetAccess")]\r
-        public void All ()\r
-        {\r
-               ServicePoint p = ServicePointManager.FindServicePoint (new Uri ("mailto:xx@yyy.com"));\r
-               //WriteServicePoint ("A servicepoint that isn't really", p);                    \r
-               \r
-               ServicePointManager.MaxServicePoints = 2;\r
-               ServicePoint google = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com"));\r
-               try {                   \r
-                       ServicePoint slashdot = ServicePointManager.FindServicePoint (new Uri ("http://www.slashdot.org"));\r
-                       Assert.Fail ("#1");\r
-               } catch (InvalidOperationException) { }\r
-               ServicePointManager.MaxServicePoints = 0;\r
-               \r
-               //WriteServicePoint ("google before getting a webrequest", google);\r
-               \r
-               HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");\r
-               HttpWebResponse res = (HttpWebResponse) req.GetResponse ();                     \r
-               \r
-#if FOUND_SOME_OTHER_URL\r
-               // URL is no longer found, disabled the test until a more reliable URL is found :P\r
-               //WriteServicePoint ("google after getting a response", google);\r
-               ServicePoint google2 = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com/dilbert.html"));\r
-               Assert.AreEqual (google, google2, "#equals");\r
-               res.Close ();\r
-#endif\r
-               \r
-               // in both instances property CurrentConnections is 0 according to ms.net.\r
-               // let's see what it says when we do async operations...\r
-               \r
-               HttpWebRequest req2 = (HttpWebRequest) WebRequest.Create ("http://www.google.com");\r
-               req2.Method = "PUT";\r
-               IAsyncResult async = req2.BeginGetRequestStream (null, null);\r
-               //WriteServicePoint ("after async BeginGetRequestStream", google);\r
-               // CurrentConnections: 1\r
-               Stream stream2 = req2.EndGetRequestStream (async);\r
-               //WriteServicePoint ("after async EndGetRequestStream", google);\r
-               // CurrentConnections: 1\r
-               stream2.Close ();\r
-               \r
-               req2 = (HttpWebRequest) WebRequest.Create ("http://www.google.com");\r
-               async = req2.BeginGetResponse (null, null);\r
-               //WriteServicePoint ("after async BeginGetResponse", google);\r
-               // CurrentConnections: 2\r
-               WebResponse res2 = req2.EndGetResponse (async);\r
-               //WriteServicePoint ("after async EndGetResponse", google);\r
-               // CurrentConnections: 0                        \r
-               // curious that after you get the webresponse object CurrentConnections is set to 0.\r
-               // you'd think that you'd still be connected until you close the webresponse..\r
-               //Console.WriteLine ("ContentLength: " + res2.ContentLength);\r
-               res2.Close ();\r
-               \r
-               ServicePoint sp2;\r
-#if FOUND_SOME_OTHER_URL\r
-               // unless of course some buffering is taking place.. let's check\r
-               Uri uri2 = new Uri ("http://freedesktop.org/Software/pkgconfig/releases/pkgconfig-0.15.0.tar.gz");\r
-               sp2 = ServicePointManager.FindServicePoint (uri2);\r
-               req2 = (HttpWebRequest) WebRequest.Create (uri2);\r
-               async = req2.BeginGetResponse (null, null);\r
-               //WriteServicePoint ("Large file: after async BeginGetResponse", sp2);\r
-               // CurrentConnections: 1\r
-               res2 = req2.EndGetResponse (async);\r
-               //WriteServicePoint ("Large file: after async EndGetResponse", sp2);\r
-               // CurrentConnections: 1\r
-               // and so it shows\r
-               //Console.WriteLine ("ContentLength: " + res2.ContentLength);\r
-               res2.Close ();\r
-#endif\r
-               \r
-               \r
-               // what's the limit of the cache?\r
-               req2 = (HttpWebRequest) WebRequest.Create ("http://www.apache.org/");\r
-               res2 = req2.GetResponse ();\r
-               sp2 = ServicePointManager.FindServicePoint (new Uri("http://www.apache.org/"));\r
-               //WriteServicePoint ("apache", sp2);\r
-               //Console.WriteLine ("ContentLength: " + res2.ContentLength);\r
-               // CurrentConnections: 1\r
-               res2.Close ();\r
-               // curious other effect: address is actually the full Uri of the previous request\r
-               // anyways, buffer is probably 4096 bytes\r
-       }\r
-\r
-       // try getting the stream to 5 web response objects     \r
-       // while ConnectionLimit equals 2\r
-\r
-       [Test]\r
-       [Category ("InetAccess")]\r
-       public void ConnectionLimit ()\r
-       {               \r
-               // the default is already 2, just in case it isn't..\r
-               ServicePointManager.DefaultConnectionLimit = 5;\r
-               \r
-               Uri uri = new Uri ("http://www.go-mono.com/");\r
-               ServicePoint sp = ServicePointManager.FindServicePoint (uri);                   \r
-               WebResponse [] res = new WebResponse [5];\r
-               for (int i = 0; i < 5; i++) {\r
-                       //Console.WriteLine ("GOT1 : " + i);\r
-                       HttpWebRequest req = (HttpWebRequest) WebRequest.Create (uri);\r
-                       //Console.WriteLine ("GOT2 : " + i);\r
-                       res [i] = req.GetResponse ();\r
-                       //WriteServicePoint ("after getting " + (i + 1) + " web response objects", sp);\r
-               }\r
-               \r
-               for (int i = 0; i < 5; i++) {\r
-                       Stream stream = res [i].GetResponseStream();\r
-                       //Console.WriteLine ("Reading stream: " + i + " : " + stream);\r
-                       int len = 0;\r
-                       while (stream.ReadByte () != -1)\r
-                               len++;\r
-                       //Console.WriteLine ("Finished reading: " + len + " bytes");\r
-               }\r
-               \r
-               for (int i = 0; i < 5; i++) {\r
-                       res [i].Close ();\r
-               }\r
-       }\r
-\r
-       [Test]\r
-       [Category ("InetAccess")]\r
-       [Category ("AndroidNotWorking")] // #A1 fails\r
-       public void EndPointBind ()\r
-       {\r
-               Uri uri = new Uri ("http://www.go-mono.com/");\r
-               ServicePoint sp = ServicePointManager.FindServicePoint (uri);\r
-\r
-               HttpWebRequest req = (HttpWebRequest) WebRequest.Create (uri);\r
-\r
-               bool called = false;\r
-               sp.BindIPEndPointDelegate = delegate {\r
-                       Assert.IsTrue (!called);\r
-                       called = true;\r
-                       return null;\r
-               };\r
-               req.GetResponse ().Close ();\r
-\r
-               Assert.IsTrue (called, "#A1");\r
-\r
-               req = (HttpWebRequest) WebRequest.Create (uri);\r
-               called = false;\r
-               sp.BindIPEndPointDelegate = delegate(ServicePoint point, IPEndPoint remote, int times) {\r
-                       Assert.IsTrue (times < 5);\r
-                       called = true;\r
-                       return new IPEndPoint(IPAddress.Parse("0.0.0.0"), 12345 + times);\r
-               };\r
-               req.GetResponse ().Close ();\r
-\r
-               Assert.IsTrue (called, "#A2");\r
-       }\r
-\r
-       public static void GetRequestStreamCallback (IAsyncResult asynchronousResult)\r
-       {\r
-       }\r
-\r
-       [Test] //Covers #19823\r
-#if FEATURE_NO_BSD_SOCKETS\r
-       // This test uses HttpWebRequest\r
-       [ExpectedException (typeof (PlatformNotSupportedException))]\r
-#endif\r
-       public void CloseConnectionGroupConcurency ()\r
-       {\r
-               // Try with multiple service points\r
-               for (var i = 0; i < 10; i++) {\r
-                       Uri targetUri = new Uri ("http://" + i + ".mono-project.com");\r
-                       var req = (HttpWebRequest) HttpWebRequest.Create (targetUri);\r
-                       req.ContentType = "application/x-www-form-urlencoded";\r
-                       req.Method = "POST";\r
-                       req.ConnectionGroupName = "" + i;\r
-                       req.ServicePoint.MaxIdleTime = 1;\r
-\r
-                       req.BeginGetRequestStream (new AsyncCallback (GetRequestStreamCallback), req);\r
-                       Thread.Sleep (1);\r
-                       req.ServicePoint.CloseConnectionGroup (req.ConnectionGroupName);\r
-               }\r
-       }\r
-\r
-\r
-       [Test]\r
-       [Category ("RequiresBSDSockets")] // Tests internals, so it doesn't make sense to assert that PlatformNotSupportedExceptions are thrown.\r
-       public void DnsRefreshTimeout ()\r
-       {\r
-               const int dnsRefreshTimeout = 2000;\r
-\r
-               ServicePoint sp;\r
-               IPHostEntry host0, host1, host2;\r
-               Uri uri;\r
-               PropertyInfo hostEntryProperty;\r
-\r
-               ServicePointManager.DnsRefreshTimeout = dnsRefreshTimeout;\r
-\r
-               uri = new Uri ("http://localhost/");\r
-               sp = ServicePointManager.FindServicePoint (uri);\r
-\r
-               hostEntryProperty = typeof (ServicePoint).GetProperty ("HostEntry", BindingFlags.NonPublic | BindingFlags.Instance);\r
-\r
-               host0 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;\r
-               host1 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;\r
-\r
-               Assert.AreSame (host0, host1, "HostEntry should result in the same IPHostEntry object.");\r
-\r
-               Thread.Sleep (dnsRefreshTimeout * 2);\r
-               host2 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;\r
-\r
-               Assert.AreNotSame(host0, host2, "HostEntry should result in a new IPHostEntry " +\r
-                               "object when DnsRefreshTimeout is reached.");\r
-       }\r
-\r
-// Debug code not used now, but could be useful later\r
-/*\r
-       private void WriteServicePoint (string label, ServicePoint sp)\r
-       {\r
-               Console.WriteLine ("\n" + label);\r
-               Console.WriteLine ("Address: " + sp.Address);\r
-               Console.WriteLine ("ConnectionLimit: " + sp.ConnectionLimit);\r
-               Console.WriteLine ("ConnectionName: " + sp.ConnectionName);\r
-               Console.WriteLine ("CurrentConnections: " + sp.CurrentConnections);\r
-               Console.WriteLine ("IdleSince: " + sp.IdleSince);\r
-               Console.WriteLine ("MaxIdletime: " + sp.MaxIdleTime);\r
-               Console.WriteLine ("ProtocolVersion: " + sp.ProtocolVersion);\r
-               Console.WriteLine ("SupportsPipelining: " + sp.SupportsPipelining);             \r
-       }\r
-*/\r
-}\r
-}\r
-\r
+//
+// ServicePointTest.cs - NUnit Test Cases for System.Net.ServicePoint
+//
+// Authors:
+//   Lawrence Pit (loz@cable.a2000.nl)
+//   Martin Willemoes Hansen (mwh@sysrq.dk)
+//
+// (C) 2003 Martin Willemoes Hansen
+//
+
+using NUnit.Framework;
+using System;
+using System.Collections;
+using System.IO;
+using System.Net;
+using System.Reflection;
+using System.Threading;
+
+namespace MonoTests.System.Net
+{
+
+[TestFixture]
+public class ServicePointTest
+{
+       static private int max;
+
+#if !FEATURE_NO_BSD_SOCKETS
+       [SetUp]
+       public void SaveMax () {
+               max = ServicePointManager.MaxServicePoints;
+               ServicePointManager.MaxServicePoints = 0;
+       }
+
+       [TearDown]
+       public void RestoreMax () {
+               ServicePointManager.MaxServicePoints = max;
+       }
+#endif
+
+        [Test]
+               [Category ("NotWorking")]
+        public void All ()
+        {
+               ServicePoint p = ServicePointManager.FindServicePoint (new Uri ("mailto:xx@yyy.com"));
+               //WriteServicePoint ("A servicepoint that isn't really", p);                    
+               
+               ServicePointManager.MaxServicePoints = 2;
+               ServicePoint google = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com"));
+               try {                   
+                       ServicePoint slashdot = ServicePointManager.FindServicePoint (new Uri ("http://www.slashdot.org"));
+                       Assert.Fail ("#1");
+               } catch (InvalidOperationException) { }
+               ServicePointManager.MaxServicePoints = 0;
+               
+               //WriteServicePoint ("google before getting a webrequest", google);
+               
+               HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
+               HttpWebResponse res = (HttpWebResponse) req.GetResponse ();                     
+               
+#if FOUND_SOME_OTHER_URL
+               // URL is no longer found, disabled the test until a more reliable URL is found :P
+               //WriteServicePoint ("google after getting a response", google);
+               ServicePoint google2 = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com/dilbert.html"));
+               Assert.AreEqual (google, google2, "#equals");
+               res.Close ();
+#endif
+               
+               // in both instances property CurrentConnections is 0 according to ms.net.
+               // let's see what it says when we do async operations...
+               
+               HttpWebRequest req2 = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
+               req2.Method = "PUT";
+               IAsyncResult async = req2.BeginGetRequestStream (null, null);
+               //WriteServicePoint ("after async BeginGetRequestStream", google);
+               // CurrentConnections: 1
+               Stream stream2 = req2.EndGetRequestStream (async);
+               //WriteServicePoint ("after async EndGetRequestStream", google);
+               // CurrentConnections: 1
+               stream2.Close ();
+               
+               req2 = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
+               async = req2.BeginGetResponse (null, null);
+               //WriteServicePoint ("after async BeginGetResponse", google);
+               // CurrentConnections: 2
+               WebResponse res2 = req2.EndGetResponse (async);
+               //WriteServicePoint ("after async EndGetResponse", google);
+               // CurrentConnections: 0                        
+               // curious that after you get the webresponse object CurrentConnections is set to 0.
+               // you'd think that you'd still be connected until you close the webresponse..
+               //Console.WriteLine ("ContentLength: " + res2.ContentLength);
+               res2.Close ();
+               
+               ServicePoint sp2;
+#if FOUND_SOME_OTHER_URL
+               // unless of course some buffering is taking place.. let's check
+               Uri uri2 = new Uri ("http://freedesktop.org/Software/pkgconfig/releases/pkgconfig-0.15.0.tar.gz");
+               sp2 = ServicePointManager.FindServicePoint (uri2);
+               req2 = (HttpWebRequest) WebRequest.Create (uri2);
+               async = req2.BeginGetResponse (null, null);
+               //WriteServicePoint ("Large file: after async BeginGetResponse", sp2);
+               // CurrentConnections: 1
+               res2 = req2.EndGetResponse (async);
+               //WriteServicePoint ("Large file: after async EndGetResponse", sp2);
+               // CurrentConnections: 1
+               // and so it shows
+               //Console.WriteLine ("ContentLength: " + res2.ContentLength);
+               res2.Close ();
+#endif
+               
+               
+               // what's the limit of the cache?
+               req2 = (HttpWebRequest) WebRequest.Create ("http://www.apache.org/");
+               res2 = req2.GetResponse ();
+               sp2 = ServicePointManager.FindServicePoint (new Uri("http://www.apache.org/"));
+               //WriteServicePoint ("apache", sp2);
+               //Console.WriteLine ("ContentLength: " + res2.ContentLength);
+               // CurrentConnections: 1
+               res2.Close ();
+               // curious other effect: address is actually the full Uri of the previous request
+               // anyways, buffer is probably 4096 bytes
+       }
+
+       // try getting the stream to 5 web response objects     
+       // while ConnectionLimit equals 2
+
+       [Test]
+       [Category ("NotWorking")]
+       public void ConnectionLimit ()
+       {               
+               // the default is already 2, just in case it isn't..
+               ServicePointManager.DefaultConnectionLimit = 5;
+               
+               Uri uri = new Uri ("http://www.go-mono.com/");
+               ServicePoint sp = ServicePointManager.FindServicePoint (uri);                   
+               WebResponse [] res = new WebResponse [5];
+               for (int i = 0; i < 5; i++) {
+                       //Console.WriteLine ("GOT1 : " + i);
+                       HttpWebRequest req = (HttpWebRequest) WebRequest.Create (uri);
+                       //Console.WriteLine ("GOT2 : " + i);
+                       res [i] = req.GetResponse ();
+                       //WriteServicePoint ("after getting " + (i + 1) + " web response objects", sp);
+               }
+               
+               for (int i = 0; i < 5; i++) {
+                       Stream stream = res [i].GetResponseStream();
+                       //Console.WriteLine ("Reading stream: " + i + " : " + stream);
+                       int len = 0;
+                       while (stream.ReadByte () != -1)
+                               len++;
+                       //Console.WriteLine ("Finished reading: " + len + " bytes");
+               }
+               
+               for (int i = 0; i < 5; i++) {
+                       res [i].Close ();
+               }
+       }
+
+       [Test]
+       [Category ("NotWorking")] // #A1 fails
+       public void EndPointBind ()
+       {
+               Uri uri = new Uri ("http://www.go-mono.com/");
+               ServicePoint sp = ServicePointManager.FindServicePoint (uri);
+
+               HttpWebRequest req = (HttpWebRequest) WebRequest.Create (uri);
+
+               bool called = false;
+               sp.BindIPEndPointDelegate = delegate {
+                       Assert.IsTrue (!called);
+                       called = true;
+                       return null;
+               };
+               req.GetResponse ().Close ();
+
+               Assert.IsTrue (called, "#A1");
+
+               req = (HttpWebRequest) WebRequest.Create (uri);
+               called = false;
+               sp.BindIPEndPointDelegate = delegate(ServicePoint point, IPEndPoint remote, int times) {
+                       Assert.IsTrue (times < 5);
+                       called = true;
+                       return new IPEndPoint(IPAddress.Parse("0.0.0.0"), 12345 + times);
+               };
+               req.GetResponse ().Close ();
+
+               Assert.IsTrue (called, "#A2");
+       }
+
+       public static void GetRequestStreamCallback (IAsyncResult asynchronousResult)
+       {
+       }
+
+       [Test] //Covers #19823
+#if FEATURE_NO_BSD_SOCKETS
+       // This test uses HttpWebRequest
+       [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+       public void CloseConnectionGroupConcurency ()
+       {
+               // Try with multiple service points
+               for (var i = 0; i < 10; i++) {
+                       Uri targetUri = new Uri ("http://" + i + ".mono-project.com");
+                       var req = (HttpWebRequest) HttpWebRequest.Create (targetUri);
+                       req.ContentType = "application/x-www-form-urlencoded";
+                       req.Method = "POST";
+                       req.ConnectionGroupName = "" + i;
+                       req.ServicePoint.MaxIdleTime = 1;
+
+                       req.BeginGetRequestStream (new AsyncCallback (GetRequestStreamCallback), req);
+                       Thread.Sleep (1);
+                       req.ServicePoint.CloseConnectionGroup (req.ConnectionGroupName);
+               }
+       }
+
+
+       [Test]
+       [Category ("RequiresBSDSockets")] // Tests internals, so it doesn't make sense to assert that PlatformNotSupportedExceptions are thrown.
+       public void DnsRefreshTimeout ()
+       {
+               const int dnsRefreshTimeout = 2000;
+
+               ServicePoint sp;
+               IPHostEntry host0, host1, host2;
+               Uri uri;
+               PropertyInfo hostEntryProperty;
+
+               ServicePointManager.DnsRefreshTimeout = dnsRefreshTimeout;
+
+               uri = new Uri ("http://localhost/");
+               sp = ServicePointManager.FindServicePoint (uri);
+
+               hostEntryProperty = typeof (ServicePoint).GetProperty ("HostEntry", BindingFlags.NonPublic | BindingFlags.Instance);
+
+               host0 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;
+               host1 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;
+
+               Assert.AreSame (host0, host1, "HostEntry should result in the same IPHostEntry object.");
+
+               Thread.Sleep (dnsRefreshTimeout * 2);
+               host2 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;
+
+               Assert.AreNotSame(host0, host2, "HostEntry should result in a new IPHostEntry " +
+                               "object when DnsRefreshTimeout is reached.");
+       }
+
+// Debug code not used now, but could be useful later
+/*
+       private void WriteServicePoint (string label, ServicePoint sp)
+       {
+               Console.WriteLine ("\n" + label);
+               Console.WriteLine ("Address: " + sp.Address);
+               Console.WriteLine ("ConnectionLimit: " + sp.ConnectionLimit);
+               Console.WriteLine ("ConnectionName: " + sp.ConnectionName);
+               Console.WriteLine ("CurrentConnections: " + sp.CurrentConnections);
+               Console.WriteLine ("IdleSince: " + sp.IdleSince);
+               Console.WriteLine ("MaxIdletime: " + sp.MaxIdleTime);
+               Console.WriteLine ("ProtocolVersion: " + sp.ProtocolVersion);
+               Console.WriteLine ("SupportsPipelining: " + sp.SupportsPipelining);             
+       }
+*/
+}
+}
+
index d1f3180a2262510893243deb3f543919d6fe35b0..697eb82b6fd56ca29bac27cfba10ccdeb3368ad1 100644 (file)
@@ -43,7 +43,6 @@ namespace MonoTests.System.Net
                }
 
                [Test]
-               [Category ("InetAccess")]
                public void DownloadTwice ()
                {
                        WebClient wc = new WebClient();
index 0b404581899f7cdd81bb2421c0ac1f5e537a022d..205cb90a8dd7b3ece5cb9a7bb6d8998efeb32e2f 100644 (file)
@@ -79,7 +79,6 @@ namespace MonoTests.System.Net
                }
 
                [Test]
-               [Category("InetAccess")]
                public void DownloadFileTaskAsync ()
                {
                        WebClient wc = new WebClient ();
@@ -93,8 +92,7 @@ namespace MonoTests.System.Net
                }
 
                [Test]
-               [Category("InetAccess")]
-               [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+               [Category ("NotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
                public void Cancellation ()
                {
                        WebClient wc = new WebClient ();
@@ -121,8 +119,7 @@ namespace MonoTests.System.Net
                }
 
                [Test]
-               [Category("InetAccess")]
-               [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+               [Category ("NotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
                public void DownloadMultiple ()
                {
                        WebClient wc = new WebClient ();
@@ -140,8 +137,7 @@ namespace MonoTests.System.Net
                }
 
                [Test]
-               [Category("InetAccess")]
-               [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+               [Category ("NotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
                public void DownloadMultiple2 ()
                {
                        WebClient wc = new WebClient ();
@@ -153,8 +149,7 @@ namespace MonoTests.System.Net
                }
 
                [Test]
-               [Category("InetAccess")]
-               [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+               [Category ("NotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
                public void DownloadMultiple3 ()
                {
                        WebClient wc = new WebClient ();
index 026cfc2757aff97d39df4cd71631d8be4c5315de..1a3c6fe43ccdcd60018641e29cc3afe7fc843ac4 100644 (file)
@@ -205,7 +205,6 @@ namespace MonoTests.System.Security.Cryptography.X509Certificates {
                }
 
                [Test]
-               [Category ("InetAccess")]
                public void Build_Cert1_X509RevocationMode_Online ()
                {
                        X509Chain c = new X509Chain ();
index 51a924c8275ca5266df4ec6ac40a2468537f022d..83d0a36c2b6ff2e12a6146e81262da40ac0bcf87 100644 (file)
@@ -48,4 +48,3 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyCopyright("(c) 2003 Various Authors")]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../winfx.pub")]
index 6bf2ea3c9d26c12185bf9ed2ffbda763007c8db0..3cfede1ab10b07c1844422e34f523d78a24670f1 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 LIBRARY = SystemWebTestShim.dll
 
 LIB_REFS = System.Web System
+KEYFILE = ../winfx.pub
 LIB_MCS_FLAGS =
 
 NO_INSTALL = yes
index 2a73702f84cd82d902c6e1065c2c71002857a3c4..7d58a25bcbdec149dd939eeebd3a2dd9b8d1485e 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>SystemWebTestShim</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 83267087b61076ea050e9981f69bd6d1a4d4b33e..c67214a83469e9bde0a296c547a071e5209e64c5 100644 (file)
@@ -15,4 +15,3 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion (Consts.FxVersion)]
 
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../mono.pub")]
index 2ee3b170c48f98baddbe1cbbb1e54337f9332648..781ebe75f42355c481e6e359b8434af68747de85 100644 (file)
@@ -5,6 +5,7 @@ include ../../build/rules.make
 LIBRARY = WebMatrix.Data.dll
 
 LIB_REFS = System System.Data System.Core System.Configuration
+KEYFILE = ../mono.pub
 LIB_MCS_FLAGS =
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = System System.Core System.Data Mono.Data.Sqlite Microsoft.CSharp
index d1ce599df7de6661690775b694d72327d2e2502f..51aebaae99d72fa582997eb15323244c69fb34a7 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>WebMatrix.Data</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 02780da33bf225a57be55861d62188518273f79b..0e831d2dd882048f10c07d8ddd45f096cf2106bd 100644 (file)
@@ -47,7 +47,6 @@ using System.Windows.Markup;
 [assembly: NeutralResourcesLanguage ("en")]
 [assembly: CLSCompliant (true)]
 [assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../winfx3.pub")]
 
 [assembly: ComVisible (false)]
 [assembly: AllowPartiallyTrustedCallers]
index 89ff47516df253b328f30092434319120193f9cb..05c2e6e20153622c0bbd36407db280a5556e87ae 100644 (file)
@@ -4,13 +4,11 @@ include ../../build/rules.make
 LIBRARY = WindowsBase.dll
 
 LIB_REFS = System System.Xml
+KEYFILE = ../winfx3.pub
 LIB_MCS_FLAGS = -unsafe -nowarn:67,618
 TEST_MCS_FLAGS = -unsafe
 TEST_LIB_REFS = WindowsBase System System.Xml System.Core System.IO.Compression
 
-ifeq (2.0, $(FRAMEWORK_VERSION))
-LIB_MCS_FLAGS += -d:NET_3_0
-endif
 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
 LIB_REFS += System.Xaml
 TEST_LIB_REFS += System.Xaml
index 280c6628b7964213033484f978c29f94b1fab24a..0a46f1d1e9710cbe798a64e28df4027daddc73a6 100644 (file)
@@ -24,6 +24,8 @@
 //
 
 using System;
+using System.Diagnostics;
+using System.Globalization;
 using System.Windows.Markup;
 
 namespace System.Windows.Converters {
@@ -32,22 +34,26 @@ namespace System.Windows.Converters {
        {
                public override bool CanConvertFromString (string value, IValueSerializerContext context)
                {
-                       throw new NotImplementedException ();
+                       return true;
                }
 
                public override bool CanConvertToString (object value, IValueSerializerContext context)
                {
-                       throw new NotImplementedException ();
+                       return value is Size;
                }
 
                public override object ConvertFromString (string value, IValueSerializerContext context)
                {
-                       throw new NotImplementedException ();
+                       if (value == null)
+                               throw new ArgumentNullException ("value");
+                       return Size.Parse (value);
                }
 
                public override string ConvertToString (object value, IValueSerializerContext context)
                {
-                       throw new NotImplementedException ();
+                       if (value is Size size)
+                               return size.ToString (CultureInfo.InvariantCulture);
+                       return base.ConvertToString (value, context);
                }
        }
 
index 0d039c6416e17546526d1bdbf22fb4e1213f708e..5a7b95133d353e7578d10e2ceecc975b0ab7b961 100644 (file)
@@ -24,6 +24,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Windows.Markup;
 
 namespace System.Windows.Media.Converters {
@@ -32,22 +33,26 @@ namespace System.Windows.Media.Converters {
        {
                public override bool CanConvertFromString (string value, IValueSerializerContext context)
                {
-                       throw new NotImplementedException ();
+                       return true;
                }
 
                public override bool CanConvertToString (object value, IValueSerializerContext context)
                {
-                       throw new NotImplementedException ();
+                       return value is Matrix;
                }
 
                public override object ConvertFromString (string value, IValueSerializerContext context)
                {
-                       throw new NotImplementedException ();
+                       if (value == null)
+                               throw new NotSupportedException ("value != null");
+                       return Matrix.Parse (value);
                }
 
                public override string ConvertToString (object value, IValueSerializerContext context)
                {
-                       throw new NotImplementedException ();
+                       if (value is Matrix matrix)
+                               return matrix.ToString (CultureInfo.InvariantCulture);
+                       return base.ConvertToString (value, context);
                }
        }
 
index 4d0245c3746575153ead243e9585a895028811ae..e9c60b528db3bbaa88eab8cad06d50165b7df2c8 100644 (file)
@@ -25,6 +25,7 @@
 
 using System;
 using System.ComponentModel;
+using System.Globalization;
 using System.Windows.Markup;
 using System.Windows.Media.Converters;
 using System.Windows.Threading;
@@ -109,7 +110,16 @@ namespace System.Windows.Media {
 
                public override int GetHashCode ()
                {
-                       throw new NotImplementedException ();
+                       unchecked
+                       {
+                               var hashCode = _m11.GetHashCode ();
+                               hashCode = (hashCode * 397) ^ _m12.GetHashCode ();
+                               hashCode = (hashCode * 397) ^ _m21.GetHashCode ();
+                               hashCode = (hashCode * 397) ^ _m22.GetHashCode ();
+                               hashCode = (hashCode * 397) ^ _offsetX.GetHashCode ();
+                               hashCode = (hashCode * 397) ^ _offsetY.GetHashCode ();
+                               return hashCode;
+                       }
                }
 
                public void Invert ()
@@ -167,7 +177,39 @@ namespace System.Windows.Media {
 
                public static Matrix Parse (string source)
                {
-                       throw new NotImplementedException ();
+                       if (source == null)
+                               throw new ArgumentNullException ("source");
+                       Matrix value;
+                       if (source.Trim () == "Identity")
+                       {
+                               value = Identity;
+                       }
+                       else
+                       {
+                               var parts = source.Split (',');
+                               if (parts.Length != 6)
+                                       throw new FormatException (string.Format ("Invalid Matrix format: {0}", source));
+                               double m11;
+                               double m12;
+                               double m21;
+                               double m22;
+                               double offsetX;
+                               double offsetY;
+                               if (double.TryParse (parts[0], NumberStyles.Float, CultureInfo.InvariantCulture, out m11)
+                                   && double.TryParse (parts[1], NumberStyles.Float, CultureInfo.InvariantCulture, out m12)
+                                   && double.TryParse (parts[2], NumberStyles.Float, CultureInfo.InvariantCulture, out m21)
+                                   && double.TryParse (parts[3], NumberStyles.Float, CultureInfo.InvariantCulture, out m22)
+                                   && double.TryParse (parts[4], NumberStyles.Float, CultureInfo.InvariantCulture, out offsetX)
+                                   && double.TryParse (parts[5], NumberStyles.Float, CultureInfo.InvariantCulture, out offsetY))
+                               {
+                                       value = new Matrix (m11, m12, m21, m22, offsetX, offsetY);
+                               }
+                               else
+                               {
+                                       throw new FormatException (string.Format ("Invalid Matrix format: {0}", source));
+                               }
+                       }
+                       return value;
                }
 
                public void Prepend (Matrix matrix)
@@ -297,21 +339,19 @@ namespace System.Windows.Media {
                string IFormattable.ToString (string format,
                                              IFormatProvider provider)
                {
-                       throw new NotImplementedException ();
+                       return ToString (provider);
                }
 
                public override string ToString ()
                {
-                       if (IsIdentity)
-                               return "Identity";
-                       else
-                               return string.Format ("{0},{1},{2},{3},{4},{5}",
-                                                     _m11, _m12, _m21, _m22, _offsetX, _offsetY);
+                       return ToString (null);
                }
 
                public string ToString (IFormatProvider provider)
                {
-                       throw new NotImplementedException ();
+                       return IsIdentity
+                               ? "Identity"
+                               : string.Concat (_m11, ",", _m12, ",", _m21, ",", _m22, ",", _offsetX, ",", _offsetY);
                }
 
                public Point Transform (Point point)
index e5ab056a14f95f7c45b2720f5b0fd55cb8f4aca0..596d21199ef2657de3557d3db7ddf536cd42b256 100644 (file)
@@ -33,22 +33,24 @@ namespace System.Windows.Media {
        {
                public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
                {
-                       throw new NotImplementedException ();
+                       return sourceType == typeof (string);
                }
 
                public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
                {
-                       throw new NotImplementedException ();
+                       return destinationType == typeof (string);
                }
 
                public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
                {
-                       throw new NotImplementedException ();
+                       if (!(value is string))
+                               throw new NotSupportedException ("MatrixConverter only supports converting from strings");
+                       return Matrix.Parse ((string)value);
                }
 
                public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
                {
-                       throw new NotImplementedException ();
+                       return ((Matrix)value).ToString (culture);
                }
        }
 
index 729bfd07882a8243f40d72cd9517f2be109e017d..d42beb95b7388ddf4ccaa2307d76d4af27784fcd 100644 (file)
@@ -25,6 +25,7 @@
 
 using System;
 using System.ComponentModel;
+using System.Globalization;
 using System.Windows.Converters;
 using System.Windows.Markup;
 
@@ -64,29 +65,59 @@ namespace System.Windows {
 
                public override int GetHashCode ()
                {
-                       throw new NotImplementedException ();
+                       unchecked
+                       {
+                               return (_width.GetHashCode () * 397) ^ _height.GetHashCode ();
+                       }
                }
 
                public static Size Parse (string source)
                {
-                       throw new NotImplementedException ();
+                       if (source == null)
+                               throw new ArgumentNullException ("source");
+                       Size value;
+                       if (source.Trim () == "Empty")
+                       {
+                               value = Empty;
+                       }
+                       else
+                       {
+                               var parts = source.Split (',');
+                               if (parts.Length != 2)
+                                       throw new FormatException (string.Format ("Invalid Size format: {0}", source));
+                               double width;
+                               double height;
+                               if (double.TryParse (parts[0], NumberStyles.Float, CultureInfo.InvariantCulture, out width)
+                                       && double.TryParse (parts[1], NumberStyles.Float, CultureInfo.InvariantCulture, out height))
+                               {
+                                       value = new Size (width, height);
+                               }
+                               else
+                               {
+                                       throw new FormatException (string.Format ("Invalid Size format: {0}", source));
+                               }
+                       }
+                       return value;
                }
 
                public override string ToString ()
                {
-                       if (IsEmpty)
-                               return "Empty";
-                       return String.Format ("{0},{1}", _width, _height);
+                       return ConvertToString (null);
                }
 
                public string ToString (IFormatProvider provider)
                {
-                       throw new NotImplementedException ();
+                       return ConvertToString (provider);
                }
 
                string IFormattable.ToString (string format, IFormatProvider provider)
                {
-                       throw new NotImplementedException ();
+                       return ConvertToString (provider);
+               }
+
+               private string ConvertToString (IFormatProvider provider)
+               {
+                       return IsEmpty ? "Empty" : string.Concat (_width, ",", _height);
                }
 
                public bool IsEmpty {
diff --git a/mcs/class/WindowsBase/Test/System.Windows.Media/MatrixConverterTest.cs b/mcs/class/WindowsBase/Test/System.Windows.Media/MatrixConverterTest.cs
new file mode 100644 (file)
index 0000000..9134aec
--- /dev/null
@@ -0,0 +1,64 @@
+using NUnit.Framework;
+using System;
+using System.Windows.Media;
+
+namespace MonoTests.System.Windows.Media {
+
+       [TestFixture]
+       public class MatrixConverterTest {
+               const double DELTA = 0.000000001d;
+
+               void CheckMatrix (Matrix expected, Matrix actual)
+               {
+                       Assert.AreEqual (expected.M11, actual.M11, DELTA);
+                       Assert.AreEqual (expected.M12, actual.M12, DELTA);
+                       Assert.AreEqual (expected.M21, actual.M21, DELTA);
+                       Assert.AreEqual (expected.M22, actual.M22, DELTA);
+                       Assert.AreEqual (expected.OffsetX, actual.OffsetX, DELTA);
+                       Assert.AreEqual (expected.OffsetY, actual.OffsetY, DELTA);
+               }
+
+               [Test]
+               public void CanConvertFrom ()
+               {
+                       var conv = new MatrixConverter ();
+                       Assert.IsTrue (conv.CanConvertFrom (typeof (string)));
+                       Assert.IsFalse (conv.CanConvertFrom (typeof (Matrix)));
+               }
+
+               [Test]
+               public void CanConvertTo ()
+               {
+                       var conv = new MatrixConverter ();
+                       Assert.IsTrue (conv.CanConvertTo (typeof (string)));
+                       Assert.IsFalse (conv.CanConvertTo (typeof (Matrix)));
+               }
+
+               [Test]
+               public void ConvertFrom ()
+               {
+                       var conv = new MatrixConverter ();
+                       object obj = conv.ConvertFrom ("1, 2, 3, 4, 5, 6");
+                       Assert.AreEqual (typeof (Matrix), obj.GetType ());
+                       CheckMatrix (new Matrix (1, 2, 3, 4, 5, 6), (Matrix)obj);
+               }
+
+               [Test]
+               [ExpectedException (typeof (NotSupportedException))]
+               public void ConvertFromInvalidType ()
+               {
+                       var conv = new MatrixConverter ();
+                       conv.ConvertFrom (new Matrix (10, 20, 30, 40, 50, 60));
+               }
+
+               [Test]
+               public void ConvertTo ()
+               {
+                       var conv = new MatrixConverter ();
+                       var matrix = new Matrix (1, 2, 3, 4, 5, 6);
+                       object obj = conv.ConvertTo (matrix, typeof (string));
+                       Assert.AreEqual (typeof (string), obj.GetType ());
+                       Assert.AreEqual ("1,2,3,4,5,6", (string)obj);
+               }
+       }
+}
\ No newline at end of file
index ceb99bdfa2da8d4fd45b6e85404fade72ab6dcba..cbccb4339bb10d2facce83d497a179b8f504f779 100644 (file)
@@ -158,7 +158,6 @@ namespace MonoTests.System.Windows.Media {
                }
 
                [Test]
-               [Category ("NotWorking")]
                public void Parse ()
                {
                        CheckMatrix (Matrix.Identity, Matrix.Parse ("Identity"));
diff --git a/mcs/class/WindowsBase/Test/System.Windows.Media/MatrixValueSerializerTest.cs b/mcs/class/WindowsBase/Test/System.Windows.Media/MatrixValueSerializerTest.cs
new file mode 100644 (file)
index 0000000..f8b9a6a
--- /dev/null
@@ -0,0 +1,79 @@
+using NUnit.Framework;
+using System;
+using System.Windows.Media.Converters;
+using System.Windows.Media;
+
+namespace MonoTests.System.Windows.Media {
+
+       [TestFixture]
+       public class MatrixValueSerializerTest {
+               const double DELTA = 0.000000001d;
+
+               void CheckMatrix (Matrix expected, Matrix actual)
+               {
+                       Assert.AreEqual (expected.M11, actual.M11, DELTA);
+                       Assert.AreEqual (expected.M12, actual.M12, DELTA);
+                       Assert.AreEqual (expected.M21, actual.M21, DELTA);
+                       Assert.AreEqual (expected.M22, actual.M22, DELTA);
+                       Assert.AreEqual (expected.OffsetX, actual.OffsetX, DELTA);
+                       Assert.AreEqual (expected.OffsetY, actual.OffsetY, DELTA);
+               }
+
+               [Test]
+               public void CanConvertFromString ()
+               {
+                       var serializer = new MatrixValueSerializer ();
+                       Assert.IsTrue (serializer.CanConvertFromString ("", null));
+               }
+
+               [Test]
+               public void CanConvertToString ()
+               {
+                       var serializer = new MatrixValueSerializer ();
+                       Assert.IsTrue (serializer.CanConvertToString (new Matrix (1, 2, 3, 4, 5 ,6), null));
+                       Assert.IsFalse (serializer.CanConvertToString ("", null));
+               }
+
+               [Test]
+               public void ConvertFromString ()
+               {
+                       var serializer = new MatrixValueSerializer ();
+                       object obj = serializer.ConvertFromString ("1, 2, 3, 4, 5 ,6", null);
+                       Assert.AreEqual (typeof (Matrix), obj.GetType ());
+                       CheckMatrix (new Matrix (1, 2, 3, 4, 5, 6), (Matrix)obj);
+               }
+
+               [Test]
+               public void RoundTripConvert()
+               {
+                       var serializer = new MatrixValueSerializer ();
+                       var matrix = new Matrix (1.1, 2.2, 3.3, 4.4, 5.5, 6.6);
+                       var obj = serializer.ConvertFromString (serializer.ConvertToString (matrix, null), null);
+                       CheckMatrix (matrix, (Matrix)obj);
+               }
+
+               [Test]
+               [ExpectedException (typeof (FormatException))]
+               public void ConvertFromStringShouldThrowExceptionWhenStringHasInvalidFormat ()
+               {
+                       var serializer = new MatrixValueSerializer ();
+                       serializer.ConvertFromString ("a,b,c,d,e,f", null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (NotSupportedException))]
+               public void ConvertFromStringShouldThrowExceptionWhenStringIsNull ()
+               {
+                       var serializer = new MatrixValueSerializer ();
+                       serializer.ConvertFromString (null, null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (NotSupportedException))]
+               public void ConvertToStringShouldThrowExceptionWhenInvalidType ()
+               {
+                       var serializer = new MatrixValueSerializer ();
+                       serializer.ConvertToString (10, null);
+               }
+       }
+}
\ No newline at end of file
index fb559eec9c645fb2b8df00d0ddbd17065cf7bae8..d320100f1a074164c6c944b3ef4d970ba7506ce6 100644 (file)
@@ -52,7 +52,6 @@ namespace MonoTests.System.Windows {
                }
 
                [Test]
-               [Category ("NotWorking")]
                public void ConvertFrom ()
                {
                        SizeConverter r = new SizeConverter ();
@@ -73,7 +72,6 @@ namespace MonoTests.System.Windows {
                }
 
                [Test]
-               [Category ("NotWorking")]
                [ExpectedException (typeof (ArgumentException))]
                public void ConvertFrom_negative ()
                {
@@ -82,7 +80,6 @@ namespace MonoTests.System.Windows {
                }
 
                [Test]
-               [Category ("NotWorking")]
                public void ConvertTo ()
                {
                        SizeConverter r = new SizeConverter ();
index 93150c6a5ce79e2b17a12a9d00375b71e0884f30..6c04fd244d4877230928612956991331737e2277 100644 (file)
@@ -120,10 +120,32 @@ namespace MonoTests.System.Windows {
                }
 
                [Test]
-               [Category ("NotWorking")]
-               public void Parse ()
+               public void ParseWithoutWhiteSpaces ()
                {
-                       Assert.AreEqual (new Size (1, 2), Size.Parse ("1, 2"));
+                       Assert.AreEqual (new Size (1, 2), Size.Parse ("1,2"));
+               }
+
+               [Test]
+               public void ParseWithWhiteSpaces ()
+               {
+                       Assert.AreEqual (new Size (1, 2), Size.Parse (" 1, 2 "));
+               }
+
+               [Test]
+               public void ParseValueWithFloatingPoint ()
+               {
+                       Assert.AreEqual (new Size (1.234, 5.678), Size.Parse ("1.234,5.678"));
+               }
+               [Test]
+               public void ParseEmpty ()
+               {
+                       Assert.AreEqual (Size.Empty, Size.Parse ("Empty"));
+               }
+
+               [Test]
+               public void ParseEmptyWithWhiteSpaces ()
+               {
+                       Assert.AreEqual (Size.Empty, Size.Parse (" Empty "));
                }
 
                [Test]
@@ -136,7 +158,7 @@ namespace MonoTests.System.Windows {
                [Test]
                public void ToStringTest ()
                {
-                       Assert.AreEqual ("1,2", (new Size (1, 2)).ToString());
+                       Assert.AreEqual ("1,2", (new Size (1, 2)).ToString ());
                }
 
                [Test]
diff --git a/mcs/class/WindowsBase/Test/System.Windows/SizeValueSerializerTest.cs b/mcs/class/WindowsBase/Test/System.Windows/SizeValueSerializerTest.cs
new file mode 100644 (file)
index 0000000..003e9fc
--- /dev/null
@@ -0,0 +1,77 @@
+using System;
+using System.Windows;
+using System.Windows.Converters;
+using NUnit.Framework;
+
+namespace MonoTests.System.Windows {
+
+       [TestFixture]
+       public class SizeValueSerializerTest
+       {
+               [Test]
+               public void CanConvertFromString ()
+               {
+                       var serializer = new SizeValueSerializer ();
+                       Assert.IsTrue (serializer.CanConvertFromString ("", null));
+               }
+
+               [Test]
+               public void CanConvertToString ()
+               {
+                       var serializer = new SizeValueSerializer ();
+                       Assert.IsTrue (serializer.CanConvertToString (new Size (0, 0), null));
+                       Assert.IsFalse (serializer.CanConvertToString ("", null));
+               }
+
+               [Test]
+               public void ConvertFromString ()
+               {
+                       var serializer = new SizeValueSerializer ();
+                       object obj = serializer.ConvertFromString ("3,4", null);
+                       Assert.AreEqual (typeof (Size), obj.GetType ());
+                       Assert.AreEqual (new Size (3, 4), obj);
+               }
+
+               [Test]
+               public void RoundTripConvert()
+               {
+                       var serializer = new SizeValueSerializer ();
+                       var size = new Size (1.234, 5.678);
+                       var obj = serializer.ConvertFromString (serializer.ConvertToString (size, null), null);
+                       Assert.AreEqual (size, obj);
+               }
+
+               [Test]
+               [ExpectedException (typeof (FormatException))]
+               public void ConvertFromStringShouldThrowExceptionWhenStringHasInvalidFormat ()
+               {
+                       var serializer = new SizeValueSerializer ();
+                       serializer.ConvertFromString ("a,b", null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void ConvertFromStringShouldThrowExceptionWhenStringIsNull ()
+               {
+                       var serializer = new SizeValueSerializer ();
+                       serializer.ConvertFromString (null, null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (NotSupportedException))]
+               public void ConvertToStringShouldThrowExceptionWhenInvalidType ()
+               {
+                       var serializer = new SizeValueSerializer ();
+                       serializer.ConvertToString (10, null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void ConvertToStringShouldThrowExceptionWhenHeightOrWidthIsNegative ()
+               {
+                       var serializer = new SizeValueSerializer ();
+                       var result = serializer.ConvertFromString ("-1,-4", null);
+               }
+       }
+
+}
index 2f11daff0d9d5bd64d32d53092ed8d1ccbf1f4f9..daf139486885cd34858f23dffb38efdebdcceef1 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>WindowsBase</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../winfx3.pub</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 620b1628eb850d629601e5a21e78704235dde29f..5fba4fc771069f5e0a6d9d4a0e42338e1ab55547 100644 (file)
@@ -32,6 +32,7 @@ System.Windows/RectTest.cs
 System.Windows/RectConverterTest.cs
 System.Windows/SizeTest.cs
 System.Windows/SizeConverterTest.cs
+System.Windows/SizeValueSerializerTest.cs
 System.Windows/VectorTest.cs
 System.Windows/VectorConverterTest.cs
 System.Windows.Markup/ConstructorArgumentAttributeTest.cs
@@ -42,5 +43,7 @@ System.Windows.Markup/DependsOnAttributeTest.cs
 System.Windows.Markup/MarkupExtensionReturnTypeAttributeTest.cs
 System.Windows.Markup/ValueSerializerTest.cs
 System.Windows.Media/MatrixTest.cs
+System.Windows.Media/MatrixConverterTest.cs
+System.Windows.Media/MatrixValueSerializerTest.cs
 System.Windows.Threading/DispatcherTest.cs
 System.Windows.Threading/DispatcherTimerTest.cs
index 19c995bc61a46795301791e790f96cc23f95ea3d..c5028d474238ceaeeee32457d11aaeebdc808b31 100644 (file)
                </type>
 
                <!-- appdomain.c: ves_icall_System_AppDomain_GetAssemblies -->
-               <type fullname="System.Reflection.Assembly" preserve="fields">
-                       <method name="MonoDebugger_GetMethodToken" feature="sre" />
-                       <method name="GetNamespaces" feature="sre" />
-               </type>
+               <type fullname="System.Reflection.Assembly" preserve="fields"/>
+
                <type fullname="System.Reflection.AssemblyName" preserve="fields" />
                <type fullname="System.Reflection.ConstructorInfo" preserve="fields" />
 
index cdaa7c43828437071fa5fcfcca69ee591c8042d2..131443e8c2ed2c8efab728dc5f46080af5bf745a 100644 (file)
@@ -91,6 +91,8 @@ DEFAULT_REFERENCES =
 
 TEST_LIB_REFS = System.Core System
 
+XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks Facades/System.Runtime.InteropServices.RuntimeInformation
+
 ifndef AOT_FRIENDLY_PROFILE
 ifneq ($(PROFILE),testing_aot_hybrid)
 TEST_LIB_REFS += Mono.Posix
index 55a392d38442814419e937fdb4088f2f3bd8b526..7b77a70194e0ba6b535e858fb3bb269108e36d57 100644 (file)
@@ -235,7 +235,10 @@ namespace System.Reflection.Emit {
 
                public ParameterBuilder DefineParameter (int iSequence, ParameterAttributes attributes, string strParamName)
                {
-                       if (iSequence < 1 || iSequence > GetParametersCount ())
+                       // The 0th ParameterBuilder does not correspond to an
+                       // actual parameter, but .NETFramework lets you define
+                       // it anyway. It is not useful.
+                       if (iSequence < 0 || iSequence > GetParametersCount ())
                                throw new ArgumentOutOfRangeException ("iSequence");
                        if (type.is_created)
                                throw not_after_created ();
index f3302e02b9ce491b7e06f8c4dd78eb2f92f13896..0bb724ad8c4814072d58faef503bb278ccf42c91 100644 (file)
@@ -58,9 +58,13 @@ namespace System.Reflection.Emit {
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                static extern byte[] GetBlob(Assembly asmb, ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues, FieldInfo[] namedFields, object[] fieldValues);
                
-               internal CustomAttributeBuilder( ConstructorInfo con, byte[] cdata) {
+               internal CustomAttributeBuilder( ConstructorInfo con, byte[] binaryAttribute) {
+                       if (con == null)
+                               throw new ArgumentNullException ("con");
+                       if (binaryAttribute == null)
+                               throw new ArgumentNullException ("binaryAttribute");
                        ctor = con;
-                       data = (byte[])cdata.Clone ();
+                       data = (byte[])binaryAttribute.Clone ();
                        /* should we check that the user supplied data is correct? */
                }
                
index cba66c11840021f0404590a53fd2c5c2d81c6164..f92c5dd486ca5e5f089cad0f61a6b0bb3948ab64 100644 (file)
@@ -71,6 +71,9 @@ namespace System.Reflection.Emit {
                        return _tb.InternalResolve (); 
                }
 
+               internal override Type RuntimeResolve () {
+                       return _tb.RuntimeResolve ();
+               }
 
                public override Assembly Assembly {
                        get {
index cd6a5a76487627767fbeea600afe85292bf43d6d..23f27ca17c2747c4306705adaa9fec54406872cd 100644 (file)
@@ -156,6 +156,9 @@ namespace System.Reflection.Emit {
                public void SetCustomAttribute (CustomAttributeBuilder customBuilder) {
                        RejectIfCreated ();
 
+                       if (customBuilder == null)
+                               throw new ArgumentNullException ("customBuilder");
+
                        string attrname = customBuilder.Ctor.ReflectedType.FullName;
                        if (attrname == "System.Runtime.InteropServices.FieldOffsetAttribute") {
                                byte[] data = customBuilder.Data;
@@ -202,6 +205,8 @@ namespace System.Reflection.Emit {
 
                public void SetOffset( int iOffset) {
                        RejectIfCreated ();
+                       if (iOffset < 0)
+                               throw new ArgumentException ("Negative field offset is not allowed");
                        offset = iOffset;
                }
 
index 30b6aac80e572f9402afd9b4403a9cf03e23c95b..9bbe8d0d92b32f73ee8976d3aa23780a54250672 100644 (file)
@@ -87,7 +87,7 @@ namespace System.Reflection.Emit
                internal override Type InternalResolve ()
                {
                        if (mbuilder != null)
-                               return MethodBase.GetMethodFromHandle (mbuilder.MethodHandleInternal).GetGenericArguments () [index];
+                               return MethodBase.GetMethodFromHandle (mbuilder.MethodHandleInternal, mbuilder.TypeBuilder.InternalResolve ().TypeHandle).GetGenericArguments () [index];
                        return tbuilder.InternalResolve ().GetGenericArguments () [index];
                }
 
index bf879e8e942f79961b352b37de60b39592e47a5f..eea1d4adfe4f6f6c8e96139db1066208ff04ab54 100644 (file)
@@ -814,7 +814,7 @@ namespace System.Reflection.Emit {
                        make_room (6);
                        ll_emit (opcode);
                        int token = token_gen.GetToken (cls, opcode != OpCodes.Ldtoken);
-                       if (cls is TypeBuilderInstantiation || cls is SymbolType || cls is TypeBuilder || cls is GenericTypeParameterBuilder)
+                       if (cls is TypeBuilderInstantiation || cls is SymbolType || cls is TypeBuilder || cls is GenericTypeParameterBuilder || cls is EnumBuilder)
                                add_token_fixup (cls);
                        emit_int (token);
                }
index 8748f20aba2b1e998f751affb651e45a133172e3..8f09f0262b4435f648ae0fa66289d6c4e68e206b 100644 (file)
@@ -342,7 +342,7 @@ namespace System.Reflection.Emit
                        //
                        // Extension: Mono allows position == 0 for the return attribute
                        //
-                       if ((position < 0) || (position > parameters.Length))
+                       if ((position < 0) || parameters == null || (position > parameters.Length))
                                throw new ArgumentOutOfRangeException ("position");
 
                        ParameterBuilder pb = new ParameterBuilder (this, position, attributes, strParamName);
index 60d78ded37c689b1f56a2b59d01e9d9e0bd84021..f629f8a3861ddc3c34fbde7a97b08d0dfac464a6 100644 (file)
@@ -159,21 +159,28 @@ namespace System.Reflection.Emit {
                        if (data == null)
                                throw new ArgumentNullException ("data");
 
-                       FieldBuilder fb = DefineUninitializedData (name, data.Length, 
-                                                                                                          attributes | FieldAttributes.HasFieldRVA);
+                       var maskedAttributes = attributes & ~FieldAttributes.ReservedMask;
+                       FieldBuilder fb = DefineDataImpl (name, data.Length, maskedAttributes | FieldAttributes.HasFieldRVA);
                        fb.SetRVAData (data);
 
                        return fb;
                }
 
                public FieldBuilder DefineUninitializedData (string name, int size, FieldAttributes attributes)
+               {
+                       return DefineDataImpl (name, size, attributes & ~FieldAttributes.ReservedMask);
+               }
+
+               private FieldBuilder DefineDataImpl (string name, int size, FieldAttributes attributes)
                {
                        if (name == null)
                                throw new ArgumentNullException ("name");
+                       if (name == String.Empty)
+                               throw new ArgumentException ("name cannot be empty", "name");
                        if (global_type_created != null)
                                throw new InvalidOperationException ("global fields already created");
-                       if ((size <= 0) || (size > 0x3f0000))
-                               throw new ArgumentException ("size", "Data size must be > 0 and < 0x3f0000");
+                       if ((size <= 0) || (size >= 0x3f0000))
+                               throw new ArgumentException ("Data size must be > 0 and < 0x3f0000", null as string);
 
                        CreateGlobalType ();
 
@@ -709,8 +716,7 @@ namespace System.Reflection.Emit {
                static int typespec_tokengen =  0x1bffffff;
                static int memberref_tokengen =  0x0affffff;
                static int methoddef_tokengen =  0x06ffffff;
-               Dictionary<MemberInfo, int> inst_tokens = new Dictionary<MemberInfo, int> ();
-               Dictionary<MemberInfo, int> inst_tokens_open = new Dictionary<MemberInfo, int> ();
+               Dictionary<MemberInfo, int> inst_tokens, inst_tokens_open;
 
                //
                // Assign a pseudo token to the various TypeBuilderInst objects, so the runtime
@@ -720,16 +726,20 @@ namespace System.Reflection.Emit {
                // still encounter these objects, it will resolve them by calling their
                // RuntimeResolve () methods.
                //
-               int GetPseudoToken (MemberInfo member, bool create_open_instance) {
+               int GetPseudoToken (MemberInfo member, bool create_open_instance)
+               {
                        int token;
-
-                       if (create_open_instance) {
-                               if (inst_tokens_open.TryGetValue (member, out token))
-                                       return token;
-                       } else {
-                               if (inst_tokens.TryGetValue (member, out token))
-                                       return token;
+                       var dict = create_open_instance ? inst_tokens_open : inst_tokens;
+                       if (dict == null) {
+                               dict = new Dictionary<MemberInfo, int> (ReferenceEqualityComparer<MemberInfo>.Instance);
+                               if (create_open_instance)
+                                       inst_tokens_open = dict;
+                               else
+                                       inst_tokens = dict;
+                       } else if (dict.TryGetValue (member, out token)) {
+                               return token;
                        }
+
                        // Count backwards to avoid collisions with the tokens
                        // allocated by the runtime
                        if (member is TypeBuilderInstantiation || member is SymbolType)
@@ -749,6 +759,11 @@ namespace System.Reflection.Emit {
                                        token = typedef_tokengen --;
                                else
                                        token = typeref_tokengen --;
+                       } else if (member is EnumBuilder) {
+                               token = GetPseudoToken ((member as  EnumBuilder).GetTypeBuilder(), create_open_instance);
+                               dict[member] = token;
+                               // n.b. don't register with the runtime, the TypeBuilder already did it.
+                               return token;
                        } else if (member is ConstructorBuilder) {
                                if (member.Module == this && !(member as ConstructorBuilder).TypeBuilder.ContainsGenericParameters)
                                        token = methoddef_tokengen --;
@@ -764,10 +779,8 @@ namespace System.Reflection.Emit {
                                token = typespec_tokengen --;
                        } else
                                throw new NotImplementedException ();
-                       if (create_open_instance)
-                               inst_tokens_open [member] = token;
-                       else
-                               inst_tokens [member] = token;
+
+                       dict [member] = token;
                        RegisterToken (member, token);
                        return token;
                }
@@ -779,7 +792,8 @@ namespace System.Reflection.Emit {
                }
 
                internal int GetToken (MemberInfo member, bool create_open_instance) {
-                       if (member is TypeBuilderInstantiation || member is FieldOnTypeBuilderInst || member is ConstructorOnTypeBuilderInst || member is MethodOnTypeBuilderInst || member is SymbolType || member is FieldBuilder || member is TypeBuilder || member is ConstructorBuilder || member is MethodBuilder || member is GenericTypeParameterBuilder)
+                       if (member is TypeBuilderInstantiation || member is FieldOnTypeBuilderInst || member is ConstructorOnTypeBuilderInst || member is MethodOnTypeBuilderInst || member is SymbolType || member is FieldBuilder || member is TypeBuilder || member is ConstructorBuilder || member is MethodBuilder || member is GenericTypeParameterBuilder ||
+                           member is EnumBuilder)
                                return GetPseudoToken (member, create_open_instance);
                        return getToken (this, member, create_open_instance);
                }
@@ -872,6 +886,8 @@ namespace System.Reflection.Emit {
                                        finished = (member as FieldBuilder).RuntimeResolve ();
                                } else if (member is TypeBuilder) {
                                        finished = (member as TypeBuilder).RuntimeResolve ();
+                               } else if (member is EnumBuilder) {
+                                       finished = (member as EnumBuilder).RuntimeResolve ();
                                } else if (member is ConstructorBuilder) {
                                        finished = (member as ConstructorBuilder).RuntimeResolve ();
                                } else if (member is MethodBuilder) {
@@ -893,11 +909,14 @@ namespace System.Reflection.Emit {
                //
                // Fixup the pseudo tokens assigned to the various SRE objects
                //
-               void FixupTokens () {
+               void FixupTokens ()
+               {
                        var token_map = new Dictionary<int, int> ();
                        var member_map = new Dictionary<int, MemberInfo> ();
-                       FixupTokens (token_map, member_map, inst_tokens, false);
-                       FixupTokens (token_map, member_map, inst_tokens_open, true);
+                       if (inst_tokens != null)
+                               FixupTokens (token_map, member_map, inst_tokens, false);
+                       if (inst_tokens_open != null)
+                               FixupTokens (token_map, member_map, inst_tokens_open, true);
 
                        // Replace the tokens in the IL stream
                        if (types != null) {
index 03eda1eea084260238e281841151911791733aee..128b8c983b134408a2056bddd9aec8cd09fc2c2e 100644 (file)
@@ -741,7 +741,7 @@ namespace System.Runtime.InteropServices
 #else
                public static bool IsComObject (object o)
                {
-                       throw new PlatformNotSupportedException ();
+                       return false;
                }
 #endif
 
index 4064ed9c90185ac0eec46c390977a61b4340a0f9..120991b2f79a9de061acadac90235eaa9d4b15fc 100644 (file)
@@ -495,8 +495,11 @@ namespace System
 
                public override int GetHashCode ()
                {
-                       /* same implementation as CoreCLR */
-                       return GetType ().GetHashCode ();
+                       MethodInfo m;
+
+                       m = Method;
+
+                       return (m != null ? m.GetHashCode () : GetType ().GetHashCode ()) ^ (m_target != null ? m_target.GetHashCode () : 0);
                }
 
                protected virtual MethodInfo GetMethodImpl ()
index faaa55af818011dc11a4366367aa83c9d24ef25a..57e86fa647ce6d719139ba416d80b0295e0e28f8 100644 (file)
@@ -195,23 +195,20 @@ public class ConstructorBuilderTest
        }
 
        [Test]
-       [Category ("NotDotNet")] // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=341439
        public void DefineParameter_Position_Zero ()
        {
+               // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=341439
+               // https://msdn.microsoft.com/en-us/library/system.reflection.emit.constructorbuilder.defineparameter(v=vs.110).aspx
+               // "If you specify 0 (zero) for iSequence, this method returns
+               // a ParameterBuilder instead of throwing an exception. There
+               // is nothing useful that you can do with this
+               // ParameterBuilder."
+
                ConstructorBuilder cb = genClass.DefineConstructor (
                        0, 0, new Type [2] { typeof (int), typeof (int) });
 
-               try {
-                       cb.DefineParameter (0, ParameterAttributes.In, "param1");
-                       Assert.Fail ("#1");
-               } catch (ArgumentOutOfRangeException ex) {
-                       // Specified argument was out of the range of valid values
-                       Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#2");
-                       Assert.IsNull (ex.ActualValue, "#3");
-                       Assert.IsNull (ex.InnerException, "#4");
-                       Assert.IsNotNull (ex.Message, "#5");
-                       Assert.IsNotNull (ex.ParamName, "#6");
-               }
+               var pb = cb.DefineParameter (0, ParameterAttributes.In, "param1");
+               Assert.IsNotNull (pb);
        }
 
        [Test]
index e4fe1f52e88e6f85f4c5b55d48f273072940c1a5..5432040c5235a340e7e2d813a85e87f26faddc0b 100644 (file)
@@ -41,16 +41,6 @@ namespace MonoTests.System.Reflection.Emit
                        Assert.IsNull (enumBuilder.DeclaringType, "#3");
                        Assert.IsNull (enumBuilder.ReflectedType, "#4");
                        Assert.AreEqual (_enumType, enumBuilder.UnderlyingSystemType, "#5");
-               }
-
-               [Test]
-               [Category ("ValueAdd")]
-               public void TestEnumBuilder_NotInMono ()
-               {
-                       // If we decide to fix this (I dont see why we should),
-                       // move to the routine above
-
-                       EnumBuilder enumBuilder = GenerateEnum ();
                        Assert.IsFalse (enumBuilder.IsSerializable);
                }
 
@@ -187,7 +177,6 @@ namespace MonoTests.System.Reflection.Emit
 
                [Test]
                [ExpectedException (typeof (NotSupportedException))]
-               [Category ("ValueAdd")]
                public void TestFindMembersIncomplete ()
                {
                        EnumBuilder enumBuilder = GenerateEnum ();
@@ -229,7 +218,6 @@ namespace MonoTests.System.Reflection.Emit
 
                [Test]
                [ExpectedException (typeof (NotSupportedException))]
-               [Category ("ValueAdd")]
                public void TestGetConstructorIncomplete ()
                {
                        EnumBuilder enumBuilder = GenerateEnum ();
@@ -328,6 +316,61 @@ namespace MonoTests.System.Reflection.Emit
                                Assert.Fail ("Expected CreateInstance of a broken type to throw TLE");
                }
 
+               [Test]
+               public void TestEnumBuilderTokenUsable () {
+                       // Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=58361
+                       // Create an EnumBuilder and use it in an ILGenerator that consumes its token.
+                       var modBuilder = GenerateModule ();
+                       EnumBuilder enumBuilder = GenerateEnum (modBuilder);
+
+                       var tb = modBuilder.DefineType ("Foo", TypeAttributes.Public);
+
+                       var cb = tb.DefineConstructor (MethodAttributes.Public, CallingConventions.Standard,
+                                                      Type.EmptyTypes);
+
+                       var ilg = cb.GetILGenerator ();
+
+                       ilg.Emit (OpCodes.Ldtoken, enumBuilder);
+                       ilg.Emit (OpCodes.Pop);
+                       ilg.Emit (OpCodes.Ret);
+
+                       var t = tb.CreateType ();
+                       enumBuilder.CreateType ();
+
+                       var ci = t.GetConstructor (Type.EmptyTypes);
+                       var x = ci.Invoke (null);
+                       Assert.IsNotNull (x);
+               }
+
+               [Test]
+               public void TestEnumBuilderTokenUsableCrossAssembly () {
+                       // Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=58361
+                       // Create an EnumBuilder and use it in an ILGenerator that consumes its token in a different assembly.
+                       var modBuilder = GenerateModule ();
+                       var modBuilder2 = GenerateModule ();
+                       EnumBuilder enumBuilder = GenerateEnum (modBuilder2);
+
+                       // N.B. "tb" is in modBuilder but enumBuilder is in modBuilder2
+                       var tb = modBuilder.DefineType ("Foo", TypeAttributes.Public);
+
+                       var cb = tb.DefineConstructor (MethodAttributes.Public, CallingConventions.Standard,
+                                                      Type.EmptyTypes);
+
+                       var ilg = cb.GetILGenerator ();
+
+                       ilg.Emit (OpCodes.Ldtoken, enumBuilder);
+                       ilg.Emit (OpCodes.Pop);
+                       ilg.Emit (OpCodes.Ret);
+
+                       var t = tb.CreateType ();
+                       enumBuilder.CreateType ();
+
+                       var ci = t.GetConstructor (Type.EmptyTypes);
+                       var x = ci.Invoke (null);
+                       Assert.IsNotNull (x);
+               }
+
+
                private static void VerifyType (Type type)
                {
                        Assert.IsNotNull (type.Assembly, "#V1");
index 815c34c5cba9ec72421d19720eee89a0881da33c..cdad1f686bec3bbcd9355a0d4c3e17ca2cf81977 100644 (file)
@@ -353,5 +353,60 @@ namespace MonoTests.System.Reflection.Emit
 
                        Assert.AreEqual (TypeAttributes.Public, gparam.Attributes, "#1");
                }
+
+               [Test]
+               public void ActionConstructorInfoTest ()
+               {
+                       // Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=58454
+                       //
+                       // Need to check that GenericTypeParameterBuilderTest:InternalResolve() passes the declaring type to GetMethodFromHandle()
+                       //
+                       /* Want to generate:
+
+                          public class Store<TState> {
+                          public Action<TSelection> Subscribe<TSelection> (TState state) {
+                               return new Action<TSelection> (Foo<TSelection>);
+                          }
+                          public static void Foo<X> (X x) { }
+                          }
+
+                          ...  and then: new Store<string>().Subscribe<int>("x");
+                       */
+
+                       SetUp (AssemblyBuilderAccess.Run);
+
+                       var tb = module.DefineType ("Store");
+                       var tparsStore = tb.DefineGenericParameters ("TState");
+
+                       tb.DefineDefaultConstructor (MethodAttributes.Public);
+
+                       var methFoo = tb.DefineMethod ("Foo", MethodAttributes.Public | MethodAttributes.Static);
+                       var tparsFoo = methFoo.DefineGenericParameters ("X");
+                       methFoo.SetReturnType (typeof(void));
+                       methFoo.SetParameters (tparsFoo[0]);
+                       methFoo.GetILGenerator().Emit (OpCodes.Ret);
+
+                       var methSub = tb.DefineMethod ("Subscribe", MethodAttributes.Public | MethodAttributes.Static);
+                       var tparsSub = methSub.DefineGenericParameters ("TSelection");
+                       var actOfSel = typeof(Action<>).MakeGenericType (tparsSub[0]); // Action<TSelection>
+                       methSub.SetReturnType  (actOfSel);
+                       methSub.SetParameters (tparsStore[0]); // TState
+                       var ilg = methSub.GetILGenerator ();
+                       ilg.Emit (OpCodes.Ldnull); // instance == null
+                       ilg.Emit (OpCodes.Ldftn, methFoo.MakeGenericMethod (tparsSub[0])); // ldftn void class Store`1<!TState>::Foo<!!0> (!!0)
+                       var aaa = TypeBuilder.GetConstructor (actOfSel, typeof(Action<>).GetConstructors()[0]);
+                       ilg.Emit (OpCodes.Newobj, aaa); // new Action<TSelection> (Foo<TSelection>);
+                       ilg.Emit (OpCodes.Ret);
+
+                       var tgen = tb.CreateType (); // TState`1
+
+                       var t = tgen.MakeGenericType(typeof(string));
+                       var x = t.GetConstructor(Type.EmptyTypes).Invoke (null); // x = new Store<string> ()
+                       var mgen = t.GetMethod("Subscribe");
+                       var m = mgen.MakeGenericMethod (typeof (int)); // Action<int> Store<string>.Subscribe<int> (string)
+                       var y = m.Invoke (x, new object[] {"hello"}); // x.Subscribte<int> ("hello")
+                       Assert.IsNotNull (y);
+               }
+
        }
 }
diff --git a/mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs b/mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs
new file mode 100644 (file)
index 0000000..a8fdcc5
--- /dev/null
@@ -0,0 +1,519 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Runtime.InteropServices;
+using System.Configuration.Assemblies;
+using NUnit.Framework;
+
+namespace MonoTests.System.Reflection.Emit
+{
+
+[TestFixture]
+public class SaveTest
+{
+       // strongname generated using "sn -k unit.snk"
+       static byte[] strongName = { 
+               0x07, 0x02, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x52, 0x53, 0x41, 0x32, 
+               0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x7F, 0x7C, 0xEA, 0x4A, 
+               0x28, 0x33, 0xD8, 0x3C, 0x86, 0x90, 0x86, 0x91, 0x11, 0xBB, 0x30, 0x0D, 
+               0x3D, 0x69, 0x04, 0x4C, 0x48, 0xF5, 0x4F, 0xE7, 0x64, 0xA5, 0x82, 0x72, 
+               0x5A, 0x92, 0xC4, 0x3D, 0xC5, 0x90, 0x93, 0x41, 0xC9, 0x1D, 0x34, 0x16, 
+               0x72, 0x2B, 0x85, 0xC1, 0xF3, 0x99, 0x62, 0x07, 0x32, 0x98, 0xB7, 0xE4, 
+               0xFA, 0x75, 0x81, 0x8D, 0x08, 0xB9, 0xFD, 0xDB, 0x00, 0x25, 0x30, 0xC4, 
+               0x89, 0x13, 0xB6, 0x43, 0xE8, 0xCC, 0xBE, 0x03, 0x2E, 0x1A, 0x6A, 0x4D, 
+               0x36, 0xB1, 0xEB, 0x49, 0x26, 0x6C, 0xAB, 0xC4, 0x29, 0xD7, 0x8F, 0x25, 
+               0x11, 0xA4, 0x7C, 0x81, 0x61, 0x97, 0xCB, 0x44, 0x2D, 0x80, 0x49, 0x93, 
+               0x48, 0xA7, 0xC9, 0xAB, 0xDB, 0xCF, 0xA3, 0x34, 0xCB, 0x6B, 0x86, 0xE0, 
+               0x4D, 0x27, 0xFC, 0xA7, 0x4F, 0x36, 0xCA, 0x13, 0x42, 0xD3, 0x83, 0xC4, 
+               0x06, 0x6E, 0x12, 0xE0, 0xA1, 0x3D, 0x9F, 0xA9, 0xEC, 0xD1, 0xC6, 0x08, 
+               0x1B, 0x3D, 0xF5, 0xDB, 0x4C, 0xD4, 0xF0, 0x2C, 0xAA, 0xFC, 0xBA, 0x18, 
+               0x6F, 0x48, 0x7E, 0xB9, 0x47, 0x68, 0x2E, 0xF6, 0x1E, 0x67, 0x1C, 0x7E, 
+               0x0A, 0xCE, 0x10, 0x07, 0xC0, 0x0C, 0xAD, 0x5E, 0xC1, 0x53, 0x70, 0xD5, 
+               0xE7, 0x25, 0xCA, 0x37, 0x5E, 0x49, 0x59, 0xD0, 0x67, 0x2A, 0xBE, 0x92, 
+               0x36, 0x86, 0x8A, 0xBF, 0x3E, 0x17, 0x04, 0xFB, 0x1F, 0x46, 0xC8, 0x10, 
+               0x5C, 0x93, 0x02, 0x43, 0x14, 0x96, 0x6A, 0xD9, 0x87, 0x17, 0x62, 0x7D, 
+               0x3A, 0x45, 0xBE, 0x35, 0xDE, 0x75, 0x0B, 0x2A, 0xCE, 0x7D, 0xF3, 0x19, 
+               0x85, 0x4B, 0x0D, 0x6F, 0x8D, 0x15, 0xA3, 0x60, 0x61, 0x28, 0x55, 0x46, 
+               0xCE, 0x78, 0x31, 0x04, 0x18, 0x3C, 0x56, 0x4A, 0x3F, 0xA4, 0xC9, 0xB1, 
+               0x41, 0xED, 0x22, 0x80, 0xA1, 0xB3, 0xE2, 0xC7, 0x1B, 0x62, 0x85, 0xE4, 
+               0x81, 0x39, 0xCB, 0x1F, 0x95, 0xCC, 0x61, 0x61, 0xDF, 0xDE, 0xF3, 0x05, 
+               0x68, 0xB9, 0x7D, 0x4F, 0xFF, 0xF3, 0xC0, 0x0A, 0x25, 0x62, 0xD9, 0x8A, 
+               0x8A, 0x9E, 0x99, 0x0B, 0xFB, 0x85, 0x27, 0x8D, 0xF6, 0xD4, 0xE1, 0xB9, 
+               0xDE, 0xB4, 0x16, 0xBD, 0xDF, 0x6A, 0x25, 0x9C, 0xAC, 0xCD, 0x91, 0xF7, 
+               0xCB, 0xC1, 0x81, 0x22, 0x0D, 0xF4, 0x7E, 0xEC, 0x0C, 0x84, 0x13, 0x5A, 
+               0x74, 0x59, 0x3F, 0x3E, 0x61, 0x00, 0xD6, 0xB5, 0x4A, 0xA1, 0x04, 0xB5, 
+               0xA7, 0x1C, 0x29, 0xD0, 0xE1, 0x11, 0x19, 0xD7, 0x80, 0x5C, 0xEE, 0x08, 
+               0x15, 0xEB, 0xC9, 0xA8, 0x98, 0xF5, 0xA0, 0xF0, 0x92, 0x2A, 0xB0, 0xD3, 
+               0xC7, 0x8C, 0x8D, 0xBB, 0x88, 0x96, 0x4F, 0x18, 0xF0, 0x8A, 0xF9, 0x31, 
+               0x9E, 0x44, 0x94, 0x75, 0x6F, 0x78, 0x04, 0x10, 0xEC, 0xF3, 0xB0, 0xCE, 
+               0xA0, 0xBE, 0x7B, 0x25, 0xE1, 0xF7, 0x8A, 0xA8, 0xD4, 0x63, 0xC2, 0x65, 
+               0x47, 0xCC, 0x5C, 0xED, 0x7D, 0x8B, 0x07, 0x4D, 0x76, 0x29, 0x53, 0xAC, 
+               0x27, 0x8F, 0x5D, 0x78, 0x56, 0xFA, 0x99, 0x45, 0xA2, 0xCC, 0x65, 0xC4, 
+               0x54, 0x13, 0x9F, 0x38, 0x41, 0x7A, 0x61, 0x0E, 0x0D, 0x34, 0xBC, 0x11, 
+               0xAF, 0xE2, 0xF1, 0x8B, 0xFA, 0x2B, 0x54, 0x6C, 0xA3, 0x6C, 0x09, 0x1F, 
+               0x0B, 0x43, 0x9B, 0x07, 0x95, 0x83, 0x3F, 0x97, 0x99, 0x89, 0xF5, 0x51, 
+               0x41, 0xF6, 0x8E, 0x5D, 0xEF, 0x6D, 0x24, 0x71, 0x41, 0x7A, 0xAF, 0xBE, 
+               0x81, 0x71, 0xAB, 0x76, 0x2F, 0x1A, 0x5A, 0xBA, 0xF3, 0xA6, 0x65, 0x7A, 
+               0x80, 0x50, 0xCE, 0x23, 0xC3, 0xC7, 0x53, 0xB0, 0x7C, 0x97, 0x77, 0x27, 
+               0x70, 0x98, 0xAE, 0xB5, 0x24, 0x66, 0xE1, 0x60, 0x39, 0x41, 0xDA, 0x54, 
+               0x01, 0x64, 0xFB, 0x10, 0x33, 0xCE, 0x8B, 0xBE, 0x27, 0xD4, 0x21, 0x57, 
+               0xCC, 0x0F, 0x1A, 0xC1, 0x3D, 0xF3, 0xCC, 0x39, 0xF0, 0x2F, 0xAE, 0xF1, 
+               0xC0, 0xCD, 0x3B, 0x23, 0x87, 0x49, 0x7E, 0x40, 0x32, 0x6A, 0xD3, 0x96, 
+               0x4A, 0xE5, 0x5E, 0x6E, 0x26, 0xFD, 0x8A, 0xCF, 0x7E, 0xFC, 0x37, 0xDE, 
+               0x39, 0x0C, 0x53, 0x81, 0x75, 0x08, 0xAF, 0x6B, 0x39, 0x6C, 0xFB, 0xC9, 
+               0x79, 0xC0, 0x9B, 0x5F, 0x34, 0x86, 0xB2, 0xDE, 0xC4, 0x19, 0x84, 0x5F, 
+               0x0E, 0xED, 0x9B, 0xB8, 0xD3, 0x17, 0xDA, 0x78 };
+
+       [Test]
+       public void Save () {
+               // FIXME: Temp dir etc.
+
+               //
+               // Create a test assembly, write it to disk, then read it back
+               //
+               AssemblyName aname = new AssemblyName ("h");
+               // AssemblyName properties
+               aname.ProcessorArchitecture = ProcessorArchitecture.X86;
+               aname.Version = new Version (1, 2, 3, 4);
+               aname.CultureInfo = new CultureInfo ("en");
+               aname.Flags = AssemblyNameFlags.Retargetable;
+               aname.HashAlgorithm = AssemblyHashAlgorithm.SHA256;
+               var ab = AppDomain.CurrentDomain.DefineDynamicAssembly (aname, AssemblyBuilderAccess.RunAndSave);
+
+               string strongfile = "strongname.snk";
+               using (FileStream fs = File.OpenWrite (strongfile)) {
+                       fs.Write (strongName, 0, strongName.Length);
+                       fs.Close ();
+               }
+               ab.SetCustomAttribute (new CustomAttributeBuilder (typeof (AssemblyKeyFileAttribute).GetConstructor (new Type [] { typeof (string) }), new object [] { strongfile }));
+               ab.SetCustomAttribute (new CustomAttributeBuilder (typeof (AssemblyDelaySignAttribute).GetConstructor (new Type [] { typeof (bool) }), new object [] { true }));
+
+               var cattrb = new CustomAttributeBuilder (typeof (AttributeUsageAttribute).GetConstructor (new Type [] { typeof (AttributeTargets) }), new object [] { AttributeTargets.Class },
+                                                                                                new PropertyInfo[] { typeof (AttributeUsageAttribute).GetProperty ("AllowMultiple") },
+                                                                                                new object[] { true },
+                                                                                                new FieldInfo [0], new object [0]);
+               ab.SetCustomAttribute (cattrb);
+
+               var moduleb = ab.DefineDynamicModule ("h.exe", "h.exe");
+               moduleb.SetCustomAttribute (cattrb);
+
+               TypeBuilder iface1 = moduleb.DefineType ("iface1", TypeAttributes.Public|TypeAttributes.Interface, typeof (object));
+               iface1.CreateType ();
+
+               // Interfaces, attributes, class size, packing size
+               TypeBuilder tb1 = moduleb.DefineType ("type1", TypeAttributes.Public|TypeAttributes.SequentialLayout, typeof (object), PackingSize.Size2, 16);
+               tb1.AddInterfaceImplementation (iface1);
+               tb1.AddInterfaceImplementation (typeof (IComparable));
+               tb1.SetCustomAttribute (cattrb);
+               tb1.CreateType ();
+
+               // Nested type
+               TypeBuilder tb_nested = tb1.DefineNestedType ("type_nested", TypeAttributes.NestedPublic, typeof (object));
+               tb_nested.CreateType ();
+
+               // Generics
+               TypeBuilder tbg = moduleb.DefineType ("gtype1", TypeAttributes.Public, typeof (object));
+               var gparams = tbg.DefineGenericParameters ("K", "T");
+               // Constraints
+               gparams [0].SetBaseTypeConstraint (null);
+               gparams [0].SetInterfaceConstraints (new Type [] { typeof (IComparable) });
+               gparams [0].SetCustomAttribute (cattrb);
+               gparams [1].SetBaseTypeConstraint (tbg);
+               // Type param
+               tbg.DefineField ("field_gparam", tbg.GetGenericArguments () [0], FieldAttributes.Public|FieldAttributes.Static);
+               // Open type
+               tbg.DefineField ("field_open", typeof (List<>).MakeGenericType (new Type [] { tbg.GetGenericArguments () [1] }), FieldAttributes.Public|FieldAttributes.Static);
+               tbg.CreateType ();
+
+               TypeBuilder tbg2 = moduleb.DefineType ("gtype2", TypeAttributes.Public, typeof (object));
+               tbg2.DefineGenericParameters ("K", "T");
+               tbg2.CreateType ();
+
+               TypeBuilder tb3 = moduleb.DefineType ("type3", TypeAttributes.Public, typeof (object));
+               // Nested type
+               tb3.DefineField ("field_nested", tb_nested, FieldAttributes.Public|FieldAttributes.Static);
+               // Nested type ref
+               tb3.DefineField ("field_nested_ref", typeof (TimeZoneInfo.AdjustmentRule), FieldAttributes.Public|FieldAttributes.Static);
+               // Primitive types
+               tb3.DefineField ("field_int", typeof (int), FieldAttributes.Public|FieldAttributes.Static);
+               // Typeref array
+               tb3.DefineField ("field_array_typeref", typeof (object[]), FieldAttributes.Public|FieldAttributes.Static);
+               // Type szarray
+               tb3.DefineField ("field_szarray", tb1.MakeArrayType (), FieldAttributes.Public|FieldAttributes.Static);
+               // Multi-dim non szarray
+               tb3.DefineField ("field_non_szarray", Array.CreateInstance (typeof (int), new int [] { 10 }, new int [] { 1 }).GetType (), FieldAttributes.Public|FieldAttributes.Static);
+               // Multi-dim array
+               tb3.DefineField ("field_multi_dim_array", Array.CreateInstance (typeof (int), new int [] { 10, 10 }, new int [] { 1, 1 }).GetType (), FieldAttributes.Public|FieldAttributes.Static);
+               // Type pointer
+               tb3.DefineField ("field_pointer", tb1.MakePointerType (), FieldAttributes.Public|FieldAttributes.Static);
+               // Generic instance
+               tb3.DefineField ("field_ginst", typeof (List<int>), FieldAttributes.Public|FieldAttributes.Static);
+               // Generic instance of tbuilder
+               tb3.DefineField ("field_ginst_tbuilder", tbg2.MakeGenericType (new Type [] { typeof (int), typeof (string) }), FieldAttributes.Public|FieldAttributes.Static);
+               tb3.CreateType ();
+
+               // Fields
+               TypeBuilder tb_fields = moduleb.DefineType ("type4", TypeAttributes.Public, typeof (object));
+               // Field with a constant
+               tb_fields.DefineField ("field_int", typeof (int), FieldAttributes.Public|FieldAttributes.Static|FieldAttributes.HasDefault).SetConstant (42);
+               // Field with an offset
+               tb_fields.DefineField ("field_offset", typeof (int), FieldAttributes.Public|FieldAttributes.Static).SetOffset (64);
+               // Modreq/modopt
+               tb_fields.DefineField ("field_modopt", typeof (int), new Type [] { typeof (int) }, new Type [] { typeof (uint) }, FieldAttributes.Public|FieldAttributes.Static);
+               // Marshal
+               var fb = tb_fields.DefineField ("field_marshal1", typeof (int), FieldAttributes.Public);
+               fb.SetCustomAttribute (new CustomAttributeBuilder (typeof (MarshalAsAttribute).GetConstructor (new Type [] { typeof (UnmanagedType) }), new object [] { UnmanagedType.U4 }));
+               fb = tb_fields.DefineField ("field_marshal_byval_array", typeof (int), FieldAttributes.Public);
+               fb.SetCustomAttribute (new CustomAttributeBuilder (typeof (MarshalAsAttribute).GetConstructor (new Type [] { typeof (UnmanagedType) }), new object [] { UnmanagedType.ByValArray },
+                                                                                                                  new FieldInfo[] { typeof (MarshalAsAttribute).GetField ("SizeConst") },
+                                                                                                                  new object[] { 16 }));
+               fb = tb_fields.DefineField ("field_marshal_byval_tstr", typeof (int), FieldAttributes.Public);
+               fb.SetCustomAttribute (new CustomAttributeBuilder (typeof (MarshalAsAttribute).GetConstructor (new Type [] { typeof (UnmanagedType) }), new object [] { UnmanagedType.ByValTStr },
+                                                                                                                  new FieldInfo[] { typeof (MarshalAsAttribute).GetField ("SizeConst") },
+                                                                                                                  new object[] { 16 }));
+#if false
+               fb = tb_fields.DefineField ("field_marshal_custom", typeof (int), FieldAttributes.Public);
+               fb.SetCustomAttribute (new CustomAttributeBuilder (typeof (MarshalAsAttribute).GetConstructor (new Type [] { typeof (UnmanagedType) }), new object [] { UnmanagedType.CustomMarshaler },
+                                                                                                                  new FieldInfo[] { typeof (MarshalAsAttribute).GetField ("MarshalTypeRef"),
+                                                                                                                                                        typeof (MarshalAsAttribute).GetField ("MarshalCookie") },
+                                                                                                                  new object [] { typeof (object), "Cookie" }));
+#endif
+               // Cattr
+               fb = tb_fields.DefineField ("field_cattr", typeof (int), FieldAttributes.Public|FieldAttributes.Static);
+               fb.SetCustomAttribute (cattrb);
+               tb_fields.CreateType ();
+
+               // Data
+               moduleb.DefineUninitializedData ("data1", 16, FieldAttributes.Public);
+               moduleb.DefineInitializedData ("data2", new byte[] { 1, 2, 3, 4, 5, 6 }, FieldAttributes.Public);
+
+               // Methods and signatures
+               TypeBuilder tb5 = moduleb.DefineType ("type_methods", TypeAttributes.Public, typeof (object));
+               // .ctor
+               var cmods_req_1 = new Type [] { typeof (object) };
+               var cmods_opt_1 = new Type [] { typeof (int) };
+               var ctorb = tb5.DefineConstructor (MethodAttributes.Public, CallingConventions.VarArgs, new Type [] { typeof (int), typeof (object) }, new Type[][] { cmods_req_1, null }, new Type [][] { cmods_opt_1, null });
+               ctorb.SetImplementationFlags (MethodImplAttributes.NoInlining);
+               ctorb.GetILGenerator ().Emit (OpCodes.Ret);
+               // Parameters
+               var paramb = ctorb.DefineParameter (1, ParameterAttributes.None, "param1");
+               paramb.SetConstant (16);
+               paramb.SetCustomAttribute (cattrb);
+               paramb = ctorb.DefineParameter (2, ParameterAttributes.Out, "param2");
+               //paramb.SetCustomAttribute (new CustomAttributeBuilder (typeof (MarshalAsAttribute).GetConstructor (new Type [] { typeof (UnmanagedType) }), new object [] { UnmanagedType.U4 }));
+               // .cctor
+               var ctorb2 = tb5.DefineConstructor (MethodAttributes.Public|MethodAttributes.Static, CallingConventions.Standard, new Type [] { typeof (int), typeof (object) });
+               ctorb2.GetILGenerator ().Emit (OpCodes.Ret);
+               // method
+               var mb = tb5.DefineMethod ("method1", MethodAttributes.Public, CallingConventions.Standard, typeof (int), cmods_req_1, cmods_opt_1, new Type [] { typeof (int), typeof (object) }, new Type [][] { cmods_req_1, null }, new Type [][] { cmods_opt_1, null });
+               mb.SetImplementationFlags (MethodImplAttributes.NoInlining);
+               mb.GetILGenerator ().Emit (OpCodes.Ret);
+               gparams = mb.DefineGenericParameters ("K", "T");
+               // Constraints
+               gparams [0].SetBaseTypeConstraint (null);
+               gparams [0].SetInterfaceConstraints (new Type [] { typeof (IComparable) });
+               paramb = mb.DefineParameter (1, ParameterAttributes.None, "param1");
+               paramb.SetConstant (16);
+               paramb = mb.DefineParameter (2, ParameterAttributes.Out, "param2");
+               //paramb.SetCustomAttribute (new CustomAttributeBuilder (typeof (MarshalAsAttribute).GetConstructor (new Type [] { typeof (UnmanagedType) }), new object [] { UnmanagedType.U4 }));
+               // return value
+               paramb = mb.DefineParameter (0, ParameterAttributes.None, "ret");
+               //paramb.SetCustomAttribute (new CustomAttributeBuilder (typeof (MarshalAsAttribute).GetConstructor (new Type [] { typeof (UnmanagedType) }), new object [] { UnmanagedType.U4 }));
+               paramb.SetCustomAttribute (cattrb);
+               // override method
+               tb5.AddInterfaceImplementation (typeof (IComparable));
+               mb = tb5.DefineMethod ("method_override", MethodAttributes.Public|MethodAttributes.Virtual, CallingConventions.Standard|CallingConventions.HasThis, typeof (int), new Type [] { typeof (object) });
+               mb.GetILGenerator ().Emit (OpCodes.Ret);
+               tb5.DefineMethodOverride (mb, typeof (IComparable).GetMethod ("CompareTo"));
+               tb5.CreateType ();
+
+               // Properties
+               TypeBuilder tb_properties = moduleb.DefineType ("type_properties", TypeAttributes.Public, typeof (object));
+               var mb_get = tb_properties.DefineMethod ("get_method1", MethodAttributes.Public, CallingConventions.Standard, typeof (int), new Type [] { });
+               mb_get.GetILGenerator ().Emit (OpCodes.Ret);
+               var mb_set = tb_properties.DefineMethod ("set_method1", MethodAttributes.Public, CallingConventions.Standard, typeof (int), new Type [] { });
+               mb_set.GetILGenerator ().Emit (OpCodes.Ret);
+               var mb_other = tb_properties.DefineMethod ("other_method1", MethodAttributes.Public, CallingConventions.Standard, typeof (int), new Type [] { });
+               mb_other.GetILGenerator ().Emit (OpCodes.Ret);
+               var propertyb = tb_properties.DefineProperty ("AProperty", PropertyAttributes.HasDefault, typeof (int), new Type[] { typeof (object) });
+               propertyb.SetCustomAttribute (cattrb);
+               propertyb.SetConstant (1);
+               propertyb.SetGetMethod (mb_get);
+               propertyb.SetSetMethod (mb_set);
+               propertyb.AddOtherMethod (mb_other);
+               tb_properties.CreateType ();
+
+               // Events
+               TypeBuilder tb_events = moduleb.DefineType ("type_events", TypeAttributes.Public, typeof (object));
+               var mb_add = tb_events.DefineMethod ("add_method1", MethodAttributes.Public, CallingConventions.Standard, typeof (int), new Type [] { });
+               mb_add.GetILGenerator ().Emit (OpCodes.Ret);
+               var mb_raise = tb_events.DefineMethod ("raise_method1", MethodAttributes.Public, CallingConventions.Standard, typeof (int), new Type [] { });
+               mb_raise.GetILGenerator ().Emit (OpCodes.Ret);
+               var mb_remove = tb_events.DefineMethod ("remove_method1", MethodAttributes.Public, CallingConventions.Standard, typeof (int), new Type [] { });
+               mb_remove.GetILGenerator ().Emit (OpCodes.Ret);
+               var eventb = tb_events.DefineEvent ("Event1", EventAttributes.SpecialName, typeof (int));
+               eventb.SetCustomAttribute (cattrb);
+               eventb.SetAddOnMethod (mb_add);
+               eventb.SetRaiseMethod (mb_raise);
+               eventb.SetRemoveOnMethod (mb_remove);
+               tb_events.CreateType ();
+
+               ab.Save ("h.exe");
+
+               // Read the assembly and check data
+               Assembly a = Assembly.LoadFrom ("h.exe");
+               Assert.IsTrue (a != ab);
+               CheckAssembly (a);
+       }
+
+       void CheckCattr (ICustomAttributeProvider obj) {
+               var cattrs = obj.GetCustomAttributes (typeof (AttributeUsageAttribute), false);
+               Assert.AreEqual (1, cattrs.Length);
+               var cattr = (AttributeUsageAttribute)cattrs [0];
+               Assert.AreEqual (AttributeTargets.Class, cattr.ValidOn);
+               Assert.IsTrue (cattr.AllowMultiple);
+       }
+
+       void CheckAssembly (Assembly a) {
+               // AssemblyName properties
+               var aname = a.GetName (false);
+               Assert.AreEqual (new Version (1, 2, 3, 4), aname.Version);
+               Assert.AreEqual ("en", aname.CultureInfo.Name);
+               Assert.IsTrue ((aname.Flags & AssemblyNameFlags.Retargetable) > 0);
+               //Assert.AreEqual (AssemblyHashAlgorithm.SHA256, aname.HashAlgorithm);
+               CheckCattr (a);
+
+               var iface1 = a.GetType ("iface1");
+               var gtype2 = a.GetType ("gtype2");
+
+               var type1 = a.GetType ("type1");
+               Assert.IsNotNull (type1);
+
+               // Type attributes
+               Assert.AreEqual (TypeAttributes.Public|TypeAttributes.SequentialLayout, type1.Attributes);
+               // Interfaces
+               Assert.AreEqual (2, type1.GetInterfaces ().Length); 
+               Assert.AreEqual (iface1, type1.GetInterfaces () [0]);
+               Assert.AreEqual (typeof (IComparable), type1.GetInterfaces () [1]);
+               CheckCattr (type1);
+               // FIXME: Class size/packing size
+
+               // Nested types
+               var type_nested = a.GetType ("type1/type_nested");
+               Assert.IsNotNull (type_nested);
+
+               // Generics
+               var gtype1 = a.GetType ("gtype1");
+               Assert.IsTrue (gtype1.IsGenericTypeDefinition);
+               // Generic parameters
+               var gparams = gtype1.GetGenericArguments ();
+               Assert.AreEqual (2, gparams.Length);
+               Assert.AreEqual ("K", gparams [0].Name);
+               Assert.AreEqual ("T", gparams [1].Name);
+               var constraints = gparams [0].GetGenericParameterConstraints ();
+               Assert.AreEqual (2, constraints.Length);
+               Assert.AreEqual (typeof (object), constraints [0]);
+               Assert.AreEqual (typeof (IComparable), constraints [1]);
+               CheckCattr (gparams [0]);
+               constraints = gparams [1].GetGenericParameterConstraints ();
+               Assert.AreEqual (1, constraints.Length);
+               Assert.AreEqual (gtype1, constraints [0]);
+               // Type param encoding
+               var field = gtype1.GetField ("field_gparam");
+               Assert.AreEqual (gparams [0], field.FieldType);
+               field = gtype1.GetField ("field_open");
+               Assert.AreEqual (typeof (List<>).MakeGenericType (new Type [] { gparams [1] }), field.FieldType);
+
+               // Type encoding
+               var t = a.GetType ("type3");
+               Assert.AreEqual (type_nested, t.GetField ("field_nested").FieldType);
+               Assert.AreEqual (typeof (TimeZoneInfo.AdjustmentRule), t.GetField ("field_nested_ref").FieldType);
+               Assert.AreEqual (typeof (int), t.GetField ("field_int").FieldType);
+               Assert.AreEqual (typeof (object[]), t.GetField ("field_array_typeref").FieldType);
+               Assert.AreEqual (type1.MakeArrayType (), t.GetField ("field_szarray").FieldType);
+               var arraytype1 = Array.CreateInstance (typeof (int), new int [] { 10 }, new int [] { 1 }).GetType ();
+               // FIXME:
+               //Assert.AreEqual (arraytype1, t.GetField ("field_non_szarray").FieldType);
+               arraytype1 = Array.CreateInstance (typeof (int), new int [] { 10, 10 }, new int [] { 1, 1 }).GetType ();
+               Assert.AreEqual (arraytype1, t.GetField ("field_multi_dim_array").FieldType);
+               Assert.AreEqual (type1.MakePointerType (), t.GetField ("field_pointer").FieldType);
+               Assert.AreEqual (typeof (List<int>), t.GetField ("field_ginst").FieldType);
+               var ginsttype = gtype2.MakeGenericType (new Type [] { typeof (int), typeof (string) });
+               Assert.AreEqual (ginsttype, t.GetField ("field_ginst_tbuilder").FieldType);
+
+               // Field properties
+               var type4 = a.GetType ("type4");
+               // FIXME: constant
+               field = type4.GetField ("field_int");
+               // FIXME: field offset
+               field = type4.GetField ("field_offset");
+               //var attrs = field.GetCustomAttributes (typeof (FieldOffsetAttribute), true);
+               field = type4.GetField ("field_modopt");
+               var cmods = field.GetRequiredCustomModifiers ();
+               Assert.AreEqual (1, cmods.Length);
+               Assert.AreEqual (typeof (int), cmods [0]);
+               cmods = field.GetOptionalCustomModifiers ();
+               Assert.AreEqual (1, cmods.Length);
+               Assert.AreEqual (typeof (uint), cmods [0]);
+               // FIXME: marshal
+               // Simple marshal
+               field = type4.GetField ("field_marshal1");
+               var attrs = field.GetCustomAttributes (typeof (MarshalAsAttribute), true);
+               Assert.AreEqual (1, attrs.Length);
+               var marshal = attrs [0] as MarshalAsAttribute;
+               Assert.AreEqual (UnmanagedType.U4, marshal.Value);
+               // ByValArray
+               field = type4.GetField ("field_marshal_byval_array");
+               attrs = field.GetCustomAttributes (typeof (MarshalAsAttribute), true);
+               Assert.AreEqual (1, attrs.Length);
+               marshal = attrs [0] as MarshalAsAttribute;
+               Assert.AreEqual (UnmanagedType.ByValArray, marshal.Value);
+               Assert.AreEqual (16, marshal.SizeConst);
+               // ByValTStr
+               field = type4.GetField ("field_marshal_byval_tstr");
+               attrs = field.GetCustomAttributes (typeof (MarshalAsAttribute), true);
+               Assert.AreEqual (1, attrs.Length);
+               marshal = attrs [0] as MarshalAsAttribute;
+               Assert.AreEqual (UnmanagedType.ByValTStr, marshal.Value);
+               Assert.AreEqual (16, marshal.SizeConst);
+#if false
+               // Custom marshaler
+               field = type4.GetField ("field_marshal_custom");
+               attrs = field.GetCustomAttributes (typeof (MarshalAsAttribute), true);
+               Assert.AreEqual (1, attrs.Length);
+               marshal = attrs [0] as MarshalAsAttribute;
+               Assert.AreEqual (UnmanagedType.CustomMarshaler, marshal.Value);
+               Assert.AreEqual (typeof (object), marshal.MarshalTypeRef);
+               Assert.AreEqual ("Cookie", marshal.MarshalCookie);
+#endif
+               field = type4.GetField ("field_cattr");
+               CheckCattr (field);
+
+               // Global fields
+               field = a.ManifestModule.GetField ("data1");
+               Assert.IsNotNull (field);
+               field = a.ManifestModule.GetField ("data2");
+               Assert.IsNotNull (field);
+
+               // Methods and signatures
+               var type_methods = a.GetType ("type_methods");
+               var ctors = type_methods.GetConstructors (BindingFlags.Public|BindingFlags.Static|BindingFlags.Instance);
+               Assert.AreEqual (2, ctors.Length);
+               // .ctor
+               var ctor = type_methods.GetConstructor (new Type[] { typeof (int), typeof (object) });
+               Assert.IsNotNull (ctor);
+               Assert.AreEqual (MethodImplAttributes.NoInlining|MethodImplAttributes.IL, ctor.GetMethodImplementationFlags ());
+               //Assert.AreEqual (CallingConventions.VarArgs, ctor.CallingConvention);
+               // .cctor
+               ctors = type_methods.GetConstructors (BindingFlags.Public|BindingFlags.Static);
+               Assert.AreEqual (1, ctors.Length);
+               // parameters
+               ctor = type_methods.GetConstructor (new Type[] { typeof (int), typeof (object) });
+               Assert.IsNotNull (ctor);
+               var parameters = ctor.GetParameters ();
+               Assert.AreEqual (2, parameters.Length);
+               Assert.AreEqual ("param1", parameters [0].Name);
+               Assert.AreEqual (typeof (int), parameters [0].ParameterType);
+               Assert.AreEqual (ParameterAttributes.HasDefault, parameters [0].Attributes);
+               Assert.AreEqual (16, parameters [0].RawDefaultValue);
+               CheckCattr (parameters [0]);
+               cmods = parameters [0].GetRequiredCustomModifiers ();
+               Assert.AreEqual (1, cmods.Length);
+               Assert.AreEqual (typeof (object), cmods [0]);
+               cmods = parameters [0].GetOptionalCustomModifiers ();
+               Assert.AreEqual (1, cmods.Length);
+               Assert.AreEqual (typeof (int), cmods [0]);
+               Assert.AreEqual ("param2", parameters [1].Name);
+#if false
+               Assert.AreEqual (ParameterAttributes.Out|ParameterAttributes.HasFieldMarshal, parameters [1].Attributes);
+               Assert.AreEqual (typeof (object), parameters [1].ParameterType);
+               attrs = parameters [1].GetCustomAttributes (typeof (MarshalAsAttribute), true);
+               Assert.AreEqual (1, attrs.Length);
+               marshal = attrs [0] as MarshalAsAttribute;
+               Assert.AreEqual (UnmanagedType.U4, marshal.Value);
+#endif
+               // methods
+               var method = type_methods.GetMethod ("method1");
+               Assert.IsNotNull (method);
+               Assert.AreEqual (typeof (int), method.ReturnType);
+               Assert.AreEqual (MethodImplAttributes.NoInlining|MethodImplAttributes.IL, method.GetMethodImplementationFlags ());
+               gparams = gtype1.GetGenericArguments ();
+               Assert.AreEqual (2, gparams.Length);
+               Assert.AreEqual ("K", gparams [0].Name);
+               Assert.AreEqual ("T", gparams [1].Name);
+               constraints = gparams [0].GetGenericParameterConstraints ();
+               Assert.AreEqual (2, constraints.Length);
+               Assert.AreEqual (typeof (object), constraints [0]);
+               Assert.AreEqual (typeof (IComparable), constraints [1]);
+               parameters = method.GetParameters ();
+               // method parameters
+               Assert.AreEqual (2, parameters.Length);
+               Assert.AreEqual ("param1", parameters [0].Name);
+               Assert.AreEqual (typeof (int), parameters [0].ParameterType);
+               Assert.AreEqual (ParameterAttributes.HasDefault, parameters [0].Attributes);
+               Assert.AreEqual (16, parameters [0].RawDefaultValue);
+               cmods = parameters [0].GetRequiredCustomModifiers ();
+               Assert.AreEqual (1, cmods.Length);
+               Assert.AreEqual (typeof (object), cmods [0]);
+               cmods = parameters [0].GetOptionalCustomModifiers ();
+               Assert.AreEqual (1, cmods.Length);
+               Assert.AreEqual (typeof (int), cmods [0]);
+               Assert.AreEqual ("param2", parameters [1].Name);
+#if false
+               Assert.AreEqual (ParameterAttributes.Out|ParameterAttributes.HasFieldMarshal, parameters [1].Attributes);
+               Assert.AreEqual (typeof (object), parameters [1].ParameterType);
+               attrs = parameters [1].GetCustomAttributes (typeof (MarshalAsAttribute), true);
+               Assert.AreEqual (1, attrs.Length);
+               marshal = attrs [0] as MarshalAsAttribute;
+               Assert.AreEqual (UnmanagedType.U4, marshal.Value);
+#endif
+               // return type
+               var rparam = method.ReturnParameter;
+               cmods = rparam.GetRequiredCustomModifiers ();
+               Assert.AreEqual (1, cmods.Length);
+               Assert.AreEqual (typeof (object), cmods [0]);
+               cmods = rparam.GetOptionalCustomModifiers ();
+               Assert.AreEqual (1, cmods.Length);
+               Assert.AreEqual (typeof (int), cmods [0]);
+#if false
+               attrs = rparam.GetCustomAttributes (typeof (MarshalAsAttribute), true);
+               Assert.AreEqual (1, attrs.Length);
+               marshal = attrs [0] as MarshalAsAttribute;
+               Assert.AreEqual (UnmanagedType.U4, marshal.Value);
+#endif
+               CheckCattr (rparam);
+
+               // Properties
+               var type_props = a.GetType ("type_properties");
+               var prop = type_props.GetProperty ("AProperty");
+               Assert.IsNotNull (prop);
+               Assert.AreEqual (PropertyAttributes.HasDefault, prop.Attributes);
+               var getter = prop.GetGetMethod ();
+               Assert.IsNotNull (getter);
+               Assert.AreEqual ("get_method1", getter.Name);
+               var setter = prop.GetSetMethod ();
+               Assert.IsNotNull (setter);
+               Assert.AreEqual ("set_method1", setter.Name);
+               CheckCattr (prop);
+
+               // Events
+               var type_events = a.GetType ("type_events");
+               var ev = type_events.GetEvent ("Event1");
+               Assert.IsNotNull (ev);
+               var m = ev.AddMethod;
+               Assert.IsNotNull (m);
+               Assert.AreEqual ("add_method1", m.Name);
+               m = ev.RemoveMethod;
+               Assert.IsNotNull (m);
+               Assert.AreEqual ("remove_method1", m.Name);
+               m = ev.RaiseMethod;
+               Assert.IsNotNull (m);
+               Assert.AreEqual ("raise_method1", m.Name);
+               Assert.AreEqual (EventAttributes.SpecialName, ev.Attributes);
+               CheckCattr (ev);
+       }
+}
+}
index 5386ae2460c82e2ca2bca8bd4ab7596edc7891e9..e4f73aea23f15dae625b30ee994b5e3d7df58d71 100644 (file)
@@ -569,6 +569,40 @@ namespace MonoTests.System.Reflection.Emit
                        }
                }
 
+               [Test]
+               public void TestEnumWithLateUnderlyingField ()
+               {
+                       TypeBuilder enumToCreate = module.DefineType (genTypeName (), TypeAttributes.Public, typeof (Enum));
+                       enumToCreate.DefineField ("value__", typeof (Int32),
+                               FieldAttributes.Public | FieldAttributes.SpecialName | FieldAttributes.RTSpecialName);
+
+                       TypeBuilder enumToCreate2 = module.DefineType (genTypeName (), TypeAttributes.Public, typeof (Enum));
+
+                       TypeBuilder ivTypeBld = module.DefineType (genTypeName (), TypeAttributes.Public);
+
+                       ConstructorBuilder ivCtor = ivTypeBld.DefineConstructor (MethodAttributes.Public, CallingConventions.Standard, Type.EmptyTypes);
+
+                       ILGenerator ctorIL = ivCtor.GetILGenerator ();
+
+                       ctorIL.Emit (OpCodes.Ldtoken, typeof (Object));
+                       ctorIL.Emit (OpCodes.Pop);
+                       ctorIL.Emit (OpCodes.Ldtoken, enumToCreate);
+                       ctorIL.Emit (OpCodes.Pop);
+                       ctorIL.Emit (OpCodes.Ldtoken, enumToCreate2);
+                       ctorIL.Emit (OpCodes.Pop);
+                       ctorIL.Emit (OpCodes.Ret);
+
+                       var ivType = ivTypeBld.CreateType ();
+
+                       enumToCreate2.DefineField ("value__", typeof (Int32), FieldAttributes.Public | FieldAttributes.SpecialName | FieldAttributes.RTSpecialName);
+
+                       FieldBuilder fb = enumToCreate2.DefineField ("A", enumToCreate, FieldAttributes.Public | FieldAttributes.Static | FieldAttributes.Literal);
+                       fb.SetConstant (0);
+
+                       enumToCreate.CreateType ();
+                       enumToCreate2.CreateType ();
+               }
+
                [Test]
                public void TestIsAbstract ()
                {
@@ -11374,5 +11408,39 @@ namespace MonoTests.System.Reflection.Emit
 
                        assembly.Save (ASSEMBLY_NAME + ".dll");
                }
+
+               [Test]
+               public void TwoAssembliesMidFlightTest () {
+                       // Check that one AssemblyBuilder can refer to a TypeBuilder from another AssemblyBuilder.
+                       // Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=58421
+                       var name2 = "MonoTests.System.Reflection.Emit.TypeBuilderTest2";
+                       var assemblyName2 = new AssemblyName (name2);
+                       var assembly2 =
+                               Thread.GetDomain ().DefineDynamicAssembly (
+                                       assemblyName2, AssemblyBuilderAccess.RunAndSave, tempDir);
+
+                       var module2 = assembly2.DefineDynamicModule (name2, name2 + ".dll");
+
+                       var tb = module.DefineType ("Foo", TypeAttributes.Public);
+                       var tb2 = module2.DefineType ("Foo2", TypeAttributes.Public);
+
+                       var cb = tb.DefineConstructor (MethodAttributes.Public, CallingConventions.Standard,
+                                                      Type.EmptyTypes);
+
+                       var ilg = cb.GetILGenerator ();
+
+                       ilg.Emit (OpCodes.Ldtoken, tb2); // N.B. type from the other AssemblyBuilder
+                       ilg.Emit (OpCodes.Pop);
+                       ilg.Emit (OpCodes.Ret);
+
+                       var t = tb.CreateType ();
+                       tb2.CreateType ();
+
+                       var ci = t.GetConstructor (Type.EmptyTypes);
+                       var x = ci.Invoke (null);
+                       assembly.Save (ASSEMBLY_NAME + ".dll");
+                       assembly2.Save (name2 + ".dll");
+               }
+
        }
 }
index 9cc8ca79a413f707d27ad210899583c3fdb03456..d03e4c21f2af694ee1ea2bf45fa97fad43341c19 100644 (file)
@@ -2261,11 +2261,14 @@ namespace MonoTests.System
 
                [Test]
                public void GetGenericMethodDefinitionOverInflatedMethodOnGTD () {
+                       var s = new List<int> () { 1, 2, 3 }.ConvertAll ( i => i.ToString () );
+                       Assert.AreEqual (3, s.Count);
                        var l = typeof (List<>);
                        var m = l.GetMethod ("ConvertAll");
                        var infl = m.MakeGenericMethod (typeof (int));
                        var res = m.GetGenericMethodDefinition ();
                        Assert.AreEqual (m, res, "#1");
+                       Assert.AreEqual (1, infl.GetGenericArguments().Length, "#2");
                }
 
                [Test]
index 9c41ec0103c0ba9848d7d9657d08639f7c6a6252..dbd11dbe3f969ac51cc2a14aa7e69d030b40c43e 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mscorlib</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
@@ -52,6 +52,7 @@
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\Collections\Generic\ReferenceEqualityComparer.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Collections.Concurrent\src\System\Collections\Concurrent\CDSCollectionETWBCLProvider.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Collections.Concurrent\src\System\Collections\Concurrent\ConcurrentDictionary.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Collections.Concurrent\src\System\Collections\Concurrent\ConcurrentQueue.cs" />\r
index 9b245081069acf75ec49ec7942b32ac00137b1f1..89d190cbaeae41fb5cdd8c672c57ed75046ac038 100644 (file)
@@ -1660,6 +1660,8 @@ corert/ThreadPoolBoundHandle.cs
 
 corefx/SR.cs
 
+../../../external/corefx/src/Common/src/System/Collections/Generic/ReferenceEqualityComparer.cs
+
 ../../../external/corefx/src/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs
 
 ../../../external/corefx/src/System.Collections.Concurrent/src/System/Collections/Concurrent/CDSCollectionETWBCLProvider.cs
index 79658b44c651b6b5b1c9e3f1f82b1a2b5834d8a4..1f8fe1b01681b2255dc7b26bf99fb7468e123b2d 100644 (file)
@@ -175,6 +175,7 @@ System.Reflection.Emit/ParameterBuilderTest.cs
 System.Reflection.Emit/PropertyBuilderTest.cs
 System.Reflection.Emit/SignatureHelperTest.cs
 System.Reflection.Emit/TypeBuilderTest.cs
+System.Reflection.Emit/SaveTest.cs
 System.Reflection/ModuleTest.cs
 System.Reflection/StrongNameKeyPairTest.cs
 System/ResolveEventArgsTest.cs
diff --git a/mcs/class/corlib/corlib_xtest.dll.sources b/mcs/class/corlib/corlib_xtest.dll.sources
new file mode 100644 (file)
index 0000000..88d9315
--- /dev/null
@@ -0,0 +1,119 @@
+../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs
+../../../external/corefx/src/Common/tests/System/PlatformDetection.cs
+
+../../../external/corefx/src/System.Reflection.Emit/tests/Utilities.cs
+
+#TODO: audit the commented out tests and fix or disable
+
+#../../../external/corefx/src/System.Reflection.Emit/tests/AssemblyBuilderTests.cs
+# ../../../external/corefx/src/System.Reflection.Emit/tests/
+
+../../../external/corefx/src/System.Reflection.Emit/tests/ConstructorBuilder/ConstructorBuilderDefineParameter.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/ConstructorBuilder/ConstructorBuilderGetILGenerator.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/ConstructorBuilder/ConstructorBuilderInitLocals.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/ConstructorBuilder/ConstructorBuilderSetCustomAttribute.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/ConstructorBuilder/ConstructorBuilderSetImplementationFlags.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/ConstructorBuilder/ConstructorBuilderToString.cs
+
+#../../../external/corefx/src/System.Reflection.Emit/tests/EnumBuilder/EnumBuilder.Methods.Tests.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/EnumBuilder/EnumBuilder.Properties.Tests.cs
+
+../../../external/corefx/src/System.Reflection.Emit/tests/EventBuilder/EventBuilderAddOtherMethod.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/EventBuilder/EventBuilderSetAddOnMethod.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/EventBuilder/EventBuilderSetCustomAttribute.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/EventBuilder/EventBuilderSetRaiseMethod.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/EventBuilder/EventBuilderSetRemoveOnMethod.cs
+
+../../../external/corefx/src/System.Reflection.Emit/tests/FieldBuilder/FieldBuilderGetValue.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/FieldBuilder/FieldBuilderSetConstant.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/FieldBuilder/FieldBuilderSetCustomAttribute.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/FieldBuilder/FieldBuilderSetOffset.cs
+
+../../../external/corefx/src/System.Reflection.Emit/tests/GenericTypeParameterBuilder/GenericTyepParameterBuilderSetBaseTypeConstraint.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/GenericTypeParameterBuilder/GenericTypeParameterBuilderGUID.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/GenericTypeParameterBuilder/GenericTypeParameterBuilderMakeArrayType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/GenericTypeParameterBuilder/GenericTypeParameterBuilderMakeByRefType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/GenericTypeParameterBuilder/GenericTypeParameterBuilderMakeGenericType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/GenericTypeParameterBuilder/GenericTypeParameterBuilderMakePointerType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/GenericTypeParameterBuilder/GenericTypeParameterBuilderSetCustomAttribute.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/GenericTypeParameterBuilder/GenericTypeParameterBuilderSetGenericParameterAttributes.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/GenericTypeParameterBuilder/GenericTypeParameterBuilderSetInterfaceConstraints.cs
+
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderContainsGenericParameters.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderDefineGenericParameters.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderDefineParameter.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderEquals.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderGetGenericArguments.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderGetGenericMethodDefinition.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderGetHashCode.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderGetILGenerator.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderInitLocals.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderIsGenericMethod.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderMakeGenericMethod.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderReturnParameter.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderSetCustomAttribute.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderSetImplementationFlags.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderSetParameters.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderSetReturnType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderSetSignature.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderToString.cs
+
+../../../external/corefx/src/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderCreateGlobalFunctions.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineEnum.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineInitializedData.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineUninitializedData.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderGetArrayMethod.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderSetCustomAttribute.cs
+
+#../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderAddOtherMethod.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderAttributes.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderCanRead.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderCanWrite.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderDeclaringType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderGetIndexParameters.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderGetValue.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderSetConstant.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderSetCustomAttribute.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderSetGetMethod.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderSetSetMethod.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderSetValue.cs
+
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderAddInterfaceImplementaion.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderAssemblyQualifiedName.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderCreateType.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderCreateTypeInfo.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDeclaringMethod.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineConstructor.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineDefaultConstructor.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineEvent.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineField.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineGenericParameters.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineMethod.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineMethodOverride.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineNestedType.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineProperty.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineTypeInitializer.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderGUID.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderGenericParameterAttributes.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderGenericParameterPosition.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderGetConstructor.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderGetElementType.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderGetField.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderGetGenericTypeDefinition.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderGetMethod.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderIsGenericParameter.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderIsGenericType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderIsGenericTypeDefinition.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderMakeArrayType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderMakeByRefType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderMakeGenericType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderMakePointerType.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderName.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderNamespace.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderPackingSize.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderSetCustomAttribute.cs
+#../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderSetParent.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderSize.cs
+../../../external/corefx/src/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderToString.cs
+
index eb17a105b756a488a5db1163f5319005c9e5710b..0b368fe3531598ba19cb259b31e939a6098e6677 100644 (file)
@@ -30,6 +30,7 @@ System.Reflection.Emit/ParameterBuilderTest.cs
 System.Reflection.Emit/PropertyBuilderTest.cs
 System.Reflection.Emit/SignatureHelperTest.cs
 System.Reflection.Emit/TypeBuilderTest.cs
+System.Reflection.Emit/SaveTest.cs
 System.Runtime.Remoting/ContextTest.cs
 System.Runtime.Remoting/RemotingConfigurationTest.cs
 System.Runtime.Remoting/RemotingServicesTest.cs
index 294f6958c58e21afdea426808df780731752bf88..133c4965191dfe511fb3f55c5fe549d0c117e507 100644 (file)
     <AssemblyName>Mono.Cecil</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../mono.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 4b39ca9bc2811006f8f11ed79735af39bf068bd6..a6253e9eabc163f6295a123511cdd82779ad6b0b 100644 (file)
@@ -3,4 +3,3 @@ using System.Runtime.CompilerServices;
 
 [assembly:AssemblyVersion("1.0.0.0")]
 [assembly:AssemblyDelaySign(true)]
-[assembly:AssemblyKeyFile("../../class/mono.snk")]
index d84f7a1ac3e6bd6303a69a6810bb446aea8de8de..90ce49077ec17530edad71d4949728e256cc9160 100644 (file)
@@ -4,6 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = monodoc.dll
 LIBRARY_PACKAGE = monodoc
+KEYFILE = ../../class/mono.snk
 # Remove a bunch of "obsolete"-type warning for Lucene.NET
 # also activate legacy mode to compile old monodoc.dll api
 LOCAL_MCS_FLAGS = /nowarn:618,612,672,809,414,649 /define:LEGACY_MODE
index 8a6cb3be2e094562440b96e2f7cdedff7c96ed04..ec63cc31b688ae6c62c88dfb92fb4b09f0a8530e 100644 (file)
@@ -25,8 +25,9 @@
     <AssemblyName>monodoc</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>../../class/mono.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index f7d606e22efe102ac5bb2830e0c426e5fca9306c..44210ced5e3fa942d43c94a0c5854fbd637814fa 100644 (file)
@@ -997,8 +997,12 @@ namespace System.Collections.Generic {
             Contract.EndContractBlock();
 
             if( _size > 0) {
+#if MONO
+                ArraySortHelper<T>.Sort(_items, 0, _size, comparison);
+#else
                 IComparer<T> comparer = new Array.FunctorComparer<T>(comparison);
                 Array.Sort(_items, 0, _size, comparer);
+#endif
             }
         }
 
index 77ffc4c02c8eb4d3574dceafad466db792dd28ed..7d31bda158c8478b08750514dc6aad113f499e43 100644 (file)
@@ -47,10 +47,11 @@ namespace System.Runtime.ExceptionServices {
             // Copy over the details we need to save.
             m_Exception = exception;
 #if MONO
-                       var count = exception.captured_traces == null ? 0 : exception.captured_traces.Length;
+                       var traces = exception.captured_traces;
+                       var count = traces == null ? 0 : traces.Length;
                        var stack_traces = new System.Diagnostics.StackTrace [count + 1];
                        if (count != 0)
-                               Array.Copy (exception.captured_traces, 0, stack_traces, 0, count);
+                               Array.Copy (traces, 0, stack_traces, 0, count);
 
                        stack_traces [count] = new System.Diagnostics.StackTrace (exception, 0, true);
                        m_stackTrace = stack_traces;
index fcb63961d23eaa7a64e09ba4c7bc835ea05214ac..7ebc1fc9c1512b54e5bf808c6ebde1908f659fac 100644 (file)
@@ -6,17 +6,25 @@ namespace MonoTests.Helpers {
 
        public static class NetworkHelpers
        {
+               static Random rndPort = new Random ();
+
                public static int FindFreePort ()
                {
-                       TcpListener l = new TcpListener(IPAddress.Loopback, 0);
-                       l.Start();
-                       int port = ((IPEndPoint)l.LocalEndpoint).Port;
-                       l.Stop();
-                       return port;
+                       return LocalEphemeralEndPoint ().Port;
                }
+
                public static IPEndPoint LocalEphemeralEndPoint ()
                {
-                       return new IPEndPoint (IPAddress.Loopback, FindFreePort());
+                       while (true) {
+                               var ep = new IPEndPoint (IPAddress.Loopback, rndPort.Next (10000, 60000));
+                               var socket = new Socket (ep.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
+
+                               try {
+                                       socket.Bind (ep);
+                                       socket.Close ();
+                                       return ep;
+                               } catch (SocketException) { }
+                       }
                }
        }
 }
index 20ea722a1551791e8dfc5c61379586f400157650..93f29727f99dbcb37a28135dcf43c8619e86f0f8 100644 (file)
@@ -124,6 +124,21 @@ namespace NUnit.Framework
                        Assert.That(arg1, Is.LessThanOrEqualTo(arg2), message, args);
                }
 
+               public static void LessOrEqual(long arg1, long arg2, string message = null, params object[] args)
+               {
+                       Assert.That(arg1, Is.LessThanOrEqualTo(arg2), message, args);
+               }
+
+               public static void LessOrEqual(System.DateTime arg1, System.DateTime arg2, string message = null, params object[] args)
+               {
+                       Assert.That(arg1, Is.LessThanOrEqualTo(arg2), message, args);
+               }
+
+               public static void LessOrEqual(System.TimeSpan arg1, System.TimeSpan arg2, string message = null, params object[] args)
+               {
+                       Assert.That(arg1, Is.LessThanOrEqualTo(arg2), message, args);
+               }
+
                public static void IsNotInstanceOfType(System.Type expected, object actual, string message, params object[] args )
                {
                        Assert.IsFalse (actual.GetType ().IsInstanceOfType (expected), message, args);
index de5b54e81e0e4c8fca57be7b244ee367e1443871..e2933f6f860623f8179f2b20eadc02b2474d8335 100644 (file)
@@ -38,8 +38,8 @@ TEST_SUPPORT_FILES = \
        CS7069-lib.dll \
        CS8009-lib.dll \
        CSFriendAssembly-lib.dll \
-       dlls/first/CS1703-lib.dll dlls/first/CS1704-lib.dll \
-       dlls/second/CS1703-lib.dll dlls/second/CS1704-lib.dll
+       dlls/first/CS1704-lib.dll \
+       dlls/second/CS1704-lib.dll
 
 -include $(mcs_topdir)/build/config.make
 
index 8a97e05efb17d661c307723d41b8d7a9424a36ce..aa5ffc64e486a002b8d36427f830c9e9a4e05120 100644 (file)
@@ -1,4 +1,4 @@
-// CS1525: Unexpected symbol `public', expecting `:', `;', or `{'
+// CS1525: Unexpected symbol `public', expecting `:', `;', `{', or `=>'
 // Line: 5
 
 class TorrentEditor {
diff --git a/mcs/errors/cs1621-2.cs b/mcs/errors/cs1621-2.cs
new file mode 100644 (file)
index 0000000..fca7c67
--- /dev/null
@@ -0,0 +1,21 @@
+// CS1621: The yield statement cannot be used inside anonymous method blocks
+// Line: 12
+
+using System;
+using System.Collections;
+
+public class Test
+{
+       public IEnumerator Foo ()
+       {
+               Call (() => {
+                       yield break;
+               });
+
+               yield break;
+       }
+
+       void Call (Action a)
+       {
+       }
+}
\ No newline at end of file
index 8aa99e8dbc1eaa2a36adcc5ccefc4b94f3d7eafd..5269513cf8045516776135d7f987e25f91f6c111 100644 (file)
@@ -1,4 +1,4 @@
 // CS1703: An assembly `System' with the same identity has already been imported. Consider removing one of the references
 // Line: 0
-// Compiler options: -r:../class/lib/build/System.dll
+// Compiler options: -r:../../external/binary-reference-assemblies/v2.0/System.dll
 
diff --git a/mcs/errors/cs1703.cs b/mcs/errors/cs1703.cs
deleted file mode 100644 (file)
index aa57349..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-// CS1703: An assembly `CS1703-lib' with the same identity has already been imported. Consider removing one of the references
-// Line: 0
-// Compiler options: -r:dlls/first/CS1703-lib.dll -r:dlls/second/CS1703-lib.dll
-
diff --git a/mcs/errors/dlls/first/CS1703-lib.cs b/mcs/errors/dlls/first/CS1703-lib.cs
deleted file mode 100644 (file)
index bb26663..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-[assembly:System.Reflection.AssemblyVersionAttribute ("1.1.1.0")]
-
-public class A
-{
-}
diff --git a/mcs/errors/dlls/second/CS1703-lib.cs b/mcs/errors/dlls/second/CS1703-lib.cs
deleted file mode 100644 (file)
index 62675d9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-[assembly:System.Reflection.AssemblyVersionAttribute ("1.2.1.0")]
-
-public class A
-{
-}
index 2925a978d24ba9fb192b7fa5c9ea6611c50256f6..97015868b99fcd6f42de791f4b6b4f5c7feee23e 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>ilasm</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 6cec0e1da6dc57513c0af368e3ec08a8f5ac6848..3ce9b0c9f199189c703238261602f52d1acb5e33 100644 (file)
@@ -839,6 +839,11 @@ namespace Mono.CSharp {
                {
                        GetFieldExpression (ec).EmitAssign (ec, source, leave_copy, false);
                }
+
+               public void EmitAssignFromStack (EmitContext ec)
+               {
+                       GetFieldExpression (ec).EmitAssignFromStack (ec);
+               }
        }
 
        public class HoistedParameter : HoistedVariable
index 702ace629c3f3e4fb23802345b31a97428eca232..00fd56d8a64a23743451fc6b829f07abe77f3cec 100644 (file)
@@ -473,6 +473,13 @@ namespace Mono.CSharp
                        Emit (ec, false, false);
                }
 
+               public void EmitPrepare (EmitContext ec)
+               {
+                       foreach (var a in args) {
+                               a.Expr.EmitPrepare (ec);
+                       }
+               }
+
                //
                // if `dup_args' is true or any of arguments contains await.
                // A copy of all arguments will be returned to the caller
index a99e3fde628b60061aae8448ab3621c23a7fad9c..8fe0e2026ca5842fdc286d456bf41a536f79456b 100644 (file)
@@ -736,8 +736,6 @@ namespace Mono.CSharp {
                        var tupleLiteralElements = (source as TupleLiteral)?.Elements;
 
                        for (int i = 0; i < targetType.Arity; ++i) {
-                               var elementType = srcTypeArgument [i];
-
                                if (tupleLiteralElements != null) {
                                        if (!ImplicitStandardConversionExists (tupleLiteralElements[i].Expr, targetTypeArgument [i])) {
                                                return false;
index 64652ccfcdad7e6f15f700c97b393608e04acad9..5f885a77763b8ccebc07be47fb643c310be926f5 100644 (file)
@@ -1337,7 +1337,7 @@ method_declaration
 
                // Was added earlier in the case of body being eof for full ast
          }
-         method_body_expression_block
+         method_body
          {
                Method method = (Method) $1;
                method.Block = (ToplevelBlock) $3;
@@ -1492,16 +1492,38 @@ method_header
          }
        ;
 
-method_body_expression_block
-       : method_body
-       | expression_block
-       ;
-
 method_body
        : block
+       | expression_block
        | SEMICOLON             { $$ = null; }
        ;
 
+destructor_body
+       : method_body
+       ;
+
+constructor_body
+       : block_prepared
+       | SEMICOLON             { current_block = null; $$ = null; }
+       | ARROW
+        {
+               if (lang_version < LanguageVersion.V_7) {
+                       FeatureIsNotAvailable (GetLocation ($1), "expression body constructor");
+               }
+
+               ++lexer.parsing_block;
+        }
+        expression SEMICOLON
+        {
+               lexer.parsing_block = 0;
+               current_block.AddStatement (new ContextualReturn ((Expression) $3));
+               var b = end_block (GetLocation ($4));
+               b.IsCompilerGenerated = true;
+               $$ = b;
+               current_block = null;
+        }
+       ;
+
 expression_block
        : ARROW
         {
@@ -2197,7 +2219,7 @@ operator_declaration
        : opt_attributes opt_modifiers operator_declarator 
          {
          }
-         method_body_expression_block
+         method_body
          {
                OperatorDeclaration decl = (OperatorDeclaration) $3;
                if (decl != null) {
@@ -2464,11 +2486,6 @@ constructor_declarator
          }
        ;
 
-constructor_body
-       : block_prepared
-       | SEMICOLON             { current_block = null; $$ = null; }
-       ;
-
 opt_constructor_initializer
        : /* Empty */
        | constructor_initializer
@@ -2518,7 +2535,7 @@ destructor_declaration
                
                current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;
          }
-         IDENTIFIER OPEN_PARENS CLOSE_PARENS method_body
+         IDENTIFIER OPEN_PARENS CLOSE_PARENS destructor_body
          {
                var lt = (LocatedToken) $5;
                if (lt.Value != current_container.MemberName.Name){
@@ -4547,7 +4564,7 @@ additive_expression
          }
        | additive_expression IS pattern_type_expr opt_identifier
          {
-               var is_expr = new Is ((Expression) $1, (Expression) $3, GetLocation ($2));
+               var is_expr = new Is ((Expression) $1, ((FullNamedExpression) $3), GetLocation ($2));
                if ($4 != null) {
                        if (lang_version < LanguageVersion.V_7)
                                FeatureIsNotAvailable (GetLocation ($4), "pattern matching");
@@ -6194,6 +6211,18 @@ switch_label
                lbag.AddLocation ($$, GetLocation ($3));
          }
 */
+
+       | CASE pattern_type_expr IDENTIFIER COLON
+         {
+               if (lang_version < LanguageVersion.V_7)
+                       FeatureIsNotAvailable (GetLocation ($1), "pattern matching");
+
+//             $$ = new SwitchLabel ((FullNamedExpression) $2), GetLocation ($1)) {
+//                     PatternMatching = true
+//             };
+
+               throw new NotImplementedException ("type pattern matching");
+         }
        | DEFAULT_COLON
          {
                $$ = new SwitchLabel (null, GetLocation ($1));
index d15fbe5e34f6e9592987a466ff17580e9a95fbb9..9486475305452e2ab5c326d264e3f0954e58a661 100644 (file)
@@ -2429,7 +2429,12 @@ namespace Mono.CSharp {
 
                public override void FlowAnalysis (FlowAnalysisContext fc)
                {
-                       expr.FlowAnalysis (fc);
+                       orig_expr.FlowAnalysis (fc);
+               }
+
+               public override void FlowAnalysisConditional (FlowAnalysisContext fc)
+               {
+                       orig_expr.FlowAnalysisConditional (fc);
                }
 
                public override SLE.Expression MakeExpression (BuilderContext ctx)
@@ -4054,6 +4059,11 @@ namespace Mono.CSharp {
                        throw new NotSupportedException ();
                }
 
+               public override void EmitPrepare (EmitContext ec)
+               {
+                       InstanceExpression?.EmitPrepare (ec);
+               }
+
                public void EmitCall (EmitContext ec, Arguments arguments, bool statement)
                {
                        var call = new CallEmitter ();
index 3e1c3fc653091cd47f86df6b839d92c96a296127..f124338ba558812c20521b9db4c026baf61b9a0a 100644 (file)
@@ -22,10 +22,35 @@ using MetaType = System.Type;
 using System.Reflection;
 #endif
 
-namespace Mono.CSharp {
+namespace Mono.CSharp
+{
 
        public class EnumMember : Const
        {
+#if !STATIC
+               class MemberTypeDelegator : TypeDelegator
+               {
+                       Type underlyingType;
+
+                       public MemberTypeDelegator (Type delegatingType, Type underlyingType)
+                               : base (delegatingType)
+                       {
+                               this.underlyingType = underlyingType;
+                       }
+
+                       public override Type GetEnumUnderlyingType ()
+                       {
+                               return underlyingType;
+                       }
+
+                       public override Type UnderlyingSystemType {
+                               get {
+                                       return underlyingType;
+                               }
+                       }
+               }
+#endif
+
                class EnumTypeExpr : TypeExpr
                {
                        public override TypeSpec ResolveAsType (IMemberContext ec, bool allowUnboundTypeArguments)
@@ -85,8 +110,17 @@ namespace Mono.CSharp {
                        if (!ResolveMemberType ())
                                return false;
 
+                       MetaType ftype = MemberType.GetMetaInfo ();
+#if !STATIC
+                       //
+                       // Workaround for .net SRE limitation which cannot define field of unbaked enum type
+                       // which is how all enums are declared
+                       //
+                       ftype = new MemberTypeDelegator (ftype, ((Enum)Parent).UnderlyingType.GetMetaInfo ());
+#endif
+
                        const FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static | FieldAttributes.Literal;
-                       FieldBuilder = Parent.TypeBuilder.DefineField (Name, MemberType.GetMetaInfo (), attr);
+                       FieldBuilder = Parent.TypeBuilder.DefineField (Name, ftype, attr);
                        spec = new ConstSpec (Parent.Definition, this, MemberType, FieldBuilder, ModFlags, initializer);
 
                        Parent.MemberCache.AddMember (spec);
index b9f47b5a361054a9b3675508668144a484c51de8..113ed29910c155493a769098bc9e058a05712a96 100644 (file)
@@ -1687,8 +1687,15 @@ namespace Mono.CSharp
                                ec.Emit (OpCodes.Dup);
                                no_value_label = ec.DefineLabel ();
                                ec.Emit (OpCodes.Brfalse_S, no_value_label);
+
+                               if (Variable.HoistedVariant != null)
+                                       ec.EmitThis ();
+
                                expr_unwrap.Emit (ec);
                        } else {
+                               if (Variable?.HoistedVariant != null)
+                                       ec.EmitThis ();
+
                                expr.Emit (ec);
 
                                // Only to make verifier happy
@@ -1708,19 +1715,29 @@ namespace Mono.CSharp
                                        value_on_stack = false;
                                }
 
-                               //
-                               // It's ok to have variable builder create out of order. It simplified emit
-                               // of statements like while (condition) { }
-                               //
-                               if (!Variable.Created)
-                                       Variable.CreateBuilder (ec);
-                               
-                               Variable.EmitAssign (ec);
+                               if (Variable.HoistedVariant != null) {
+                                       Variable.HoistedVariant.EmitAssignFromStack (ec);
 
-                               if (expr_unwrap != null) {
-                                       ec.MarkLabel (no_value_label);
-                               } else if (!value_on_stack) {
-                                       Variable.Emit (ec);
+                                       if (expr_unwrap != null) {
+                                               ec.MarkLabel (no_value_label);
+                                       } else if (!value_on_stack) {
+                                               Variable.HoistedVariant.Emit (ec);
+                                       }
+                               } else {
+                                       //
+                                       // It's ok to have variable builder created out of order. It simplifies emit
+                                       // of statements like while (condition) { }
+                                       //
+                                       if (!Variable.Created)
+                                               Variable.CreateBuilder (ec);
+
+                                       Variable.EmitAssign (ec);
+
+                                       if (expr_unwrap != null) {
+                                               ec.MarkLabel (no_value_label);
+                                       } else if (!value_on_stack) {
+                                               Variable.Emit (ec);
+                                       }
                                }
                        }
                }
@@ -2599,7 +2616,8 @@ namespace Mono.CSharp
 
                public void AddressOf (EmitContext ec, AddressOp mode)
                {
-                       Variable.CreateBuilder (ec);
+                       if (!Variable.Created)
+                               Variable.CreateBuilder (ec);
 
                        if (Initializer != null) {
                                lvr.EmitAssign (ec, Initializer, false, false);
@@ -2672,6 +2690,11 @@ namespace Mono.CSharp
                {
                        throw new NotImplementedException ();
                }
+
+               public override void EmitPrepare (EmitContext ec)
+               {
+                       Variable.CreateBuilder (ec);
+               }
        }
        
        //
@@ -7370,7 +7393,14 @@ namespace Mono.CSharp
                        else
                                mg.EmitCall (ec, arguments, false);
                }
-               
+
+               public override void EmitPrepare (EmitContext ec)
+               {
+                       mg.EmitPrepare (ec);
+
+                       arguments?.EmitPrepare (ec);
+               }
+
                public override void EmitStatement (EmitContext ec)
                {
                        if (mg.IsConditionallyExcluded)
index 6724f8da5573aecf054d4c6d7a2e97f5770b0995..a2e49f07f70479245979ebdbe9c7934e84f77bfe 100644 (file)
@@ -520,13 +520,23 @@ namespace Mono.CSharp
                                                                        return null;
                                                                }
 
-                                                               if ((an.Flags & AssemblyNameFlags.PublicKey) == (loaded_name.Flags & AssemblyNameFlags.PublicKey)) {
-                                                                       compiler.Report.SymbolRelatedToPreviousError (entry.Item2);
-                                                                       compiler.Report.SymbolRelatedToPreviousError (fileName);
-                                                                       compiler.Report.Error (1703,
-                                                                               "An assembly `{0}' with the same identity has already been imported. Consider removing one of the references",
-                                                                               an.Name);
-                                                                       return null;
+                                                               AssemblyComparisonResult result;
+                                                               if ((an.Flags & AssemblyNameFlags.PublicKey) == (loaded_name.Flags & AssemblyNameFlags.PublicKey) &&
+                                                                   (domain.CompareAssemblyIdentity (an.FullName, false, loaded_name.FullName, false, out result))) {
+
+                                                                       //
+                                                                       // Roslyn is much more lenient than native compiler here
+                                                                       //
+                                                                       switch (result) {
+                                                                       case AssemblyComparisonResult.EquivalentFXUnified:
+                                                                       case AssemblyComparisonResult.EquivalentUnified:
+                                                                               compiler.Report.SymbolRelatedToPreviousError (entry.Item2);
+                                                                               compiler.Report.SymbolRelatedToPreviousError (fileName);
+                                                                               compiler.Report.Error (1703,
+                                                                                       "An assembly `{0}' with the same identity has already been imported. Consider removing one of the references",
+                                                                                       an.Name);
+                                                                               return null;
+                                                                       }
                                                                }
                                                        }
 
index 3afe93ce5ffe1bf89df1833938932a96f7abb294..c0ccf129e74a77fd44b33e4c702b9e69412cd1e6 100644 (file)
@@ -161,7 +161,6 @@ namespace Mono.CSharp
 
                protected override void CloneTo (CloneContext clonectx, Statement target)
                {
-                       throw new NotSupportedException ();
                }
 
                protected override bool DoResolve (BlockContext bc)
index 8cbd623e7c983c2cde76ac3c265b9311db72b61e..5d6576e970d0db362598acb8beac4f0ca2b0c731 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mcs</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 507b937e2c904310786e8798ee2196d2ef52dcb2..1de765fb4ac041eb7926c501e0aeb235c98579ad 100644 (file)
@@ -545,12 +545,15 @@ namespace Mono.CSharp {
 
                                if (new_implementation) {
                                        MemberFilter filter;
-                                       if (mi.Parameters.Count > 1) {
-                                               var indexer_params = mi.Name [0] == 'g' ? mi.Parameters : IndexerSpec.CreateParametersFromSetter (mi, mi.Parameters.Count - 1);
-                                               filter = new MemberFilter (MemberCache.IndexerNameAlias, 0, MemberKind.Indexer, indexer_params, null);
+                                       bool getter = mi.Name [0] == 'g';
+                                       if (mi.Parameters.Count > (getter ? 0 : 1)) {
+                                               var indexer_params = getter ? mi.Parameters : IndexerSpec.CreateParametersFromSetter (mi, mi.Parameters.Count - 1);
+                                               var ptype = getter ? mi.ReturnType : mi.Parameters.Types [mi.Parameters.Count - 1];
+                                               filter = new MemberFilter (MemberCache.IndexerNameAlias, 0, MemberKind.Indexer, indexer_params, ptype);
                                        } else {
                                                var pname = mi.Name.Substring (4);
-                                               filter = MemberFilter.Property (pname, null);
+                                               var ptype = getter ? mi.ReturnType : mi.Parameters.Types [0];
+                                               filter = MemberFilter.Property (pname, ptype);
                                        }
 
                                        var prop = MemberCache.FindMember (container.CurrentType, filter, BindingRestriction.DeclaredOnly | BindingRestriction.InstanceOnly);
index 702d9b96c3aecd8b12d600aabb5459bb15cce36f..882e5a0100c146b132fdd6baddc270aaaa342637 100644 (file)
     <AssemblyName>nunit.util</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../nunit.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index a5eff16a6796e33bd69642c64110ee56d8ce8cd0..226eacb3c59811df2492cb9255b180a22158c71b 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>nunit-console</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index feca1957e1fc01ada4c2727ecdf8173a033bb140..6577524970ee861020fb26d40e366e2a210bb06a 100644 (file)
     <AssemblyName>nunit-console-runner</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../nunit.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 86a5aeec44ba653a0879bcfd55931cef8615c4f8..a6237dff9757613af90cba1c8131af353720430d 100644 (file)
     <AssemblyName>nunit.core</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../nunit.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 2232457724847fa3b755286aa53567ac79878b03..27d7dc3e7b8d831d39225e2344896b20e402bb50 100644 (file)
     <AssemblyName>nunit.core.interfaces</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../nunit.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 39d7725bbd5d2f80b0935f7a217636af0ab624f7..b5fdb4853792ddc0305d3d4695c566cff66f2bcc 100644 (file)
     <AssemblyName>nunit.core.extensions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../nunit.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 707a7b3fc6df9edfd4d4d8a2bf9203dcd537439c..a88088906b26967253907289f2c3f0cb5d79c953 100644 (file)
     <AssemblyName>nunit.framework.extensions</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../nunit.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 75b0ca010da50bfdc8073c2035f9fe8b673450b6..f0d2b576ad7a271a910617b209ed8c71f581f3e3 100644 (file)
     <AssemblyName>nunit.framework</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../nunit.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 4e73cf0f800751f37d23fa7917a7838d194bc312..0f03381a73c6be447b480ff15cd90d80183b25a6 100644 (file)
     <AssemblyName>nunit.mocks</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../nunit.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
diff --git a/mcs/tests/test-947.cs b/mcs/tests/test-947.cs
new file mode 100644 (file)
index 0000000..f2f8cbb
--- /dev/null
@@ -0,0 +1,29 @@
+interface IA
+{
+       int Prop { get; }
+       int this [int arg] { get; }
+}
+
+abstract class B : IA
+{
+    public long Prop => 4;
+
+       int IA.Prop => 1;
+
+       public long this [int arg] => 2;
+
+       int IA.this [int arg] => 4;
+}
+
+class C : B, IA
+{
+       public static void Main ()
+       {
+       }
+
+       public new string Prop {
+               get { return ""; }
+       }
+
+       public new string this [int arg] => "2";
+}
\ No newline at end of file
diff --git a/mcs/tests/test-decl-expr-05.cs b/mcs/tests/test-decl-expr-05.cs
new file mode 100644 (file)
index 0000000..730fd42
--- /dev/null
@@ -0,0 +1,21 @@
+class X
+{
+       void Test (string arg)
+       {
+               while (Call (out string s))
+               {
+                       arg = s.ToString ();
+               }
+       }
+
+       static bool Call (out string s)
+       {
+               s = "";
+               return true;
+       }
+
+       public static void Main ()
+       {
+               Call (out string s);
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-expression-bodied-04.cs b/mcs/tests/test-expression-bodied-04.cs
new file mode 100644 (file)
index 0000000..815eabc
--- /dev/null
@@ -0,0 +1,16 @@
+// Introduced in C#7
+
+class VV
+{
+    VV () => Test ();
+
+    ~VV () => Test ();
+
+    void Test ()
+    {
+    }
+
+    public static void Main ()
+    {
+    }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-pattern-08.cs b/mcs/tests/test-pattern-08.cs
new file mode 100644 (file)
index 0000000..22b7621
--- /dev/null
@@ -0,0 +1,32 @@
+using System.Collections.Generic;
+
+class Expr
+{
+       public int Field;
+       public Expr Next;
+}
+
+static class X
+{
+       public static IEnumerable<int> Test (this Expr expr)
+       {
+               var exprCur = expr;
+               while (exprCur != null)
+               {
+                       if (exprCur is Expr list)
+                       {
+                               yield return list.Field;
+                               exprCur = list.Next;
+                       }
+                       else
+                       {
+                               yield return 2;
+                               yield break;
+                       }
+               }
+       }
+
+       public static void Main ()
+       {
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-pattern-09.cs b/mcs/tests/test-pattern-09.cs
new file mode 100644 (file)
index 0000000..801469e
--- /dev/null
@@ -0,0 +1,33 @@
+using System.Collections.Generic;
+
+class Expr
+{
+       public int Field;
+}
+
+static class X
+{
+       public static IEnumerable<int> Test (Expr expr)
+       {
+               object exprCur = expr;
+               if (exprCur is Expr list) {
+                       yield return list.Field;
+               }
+       }
+
+       public static IEnumerable<string> Test2 (int? expr)
+       {
+               int? exprCur = expr;
+               while (exprCur != null) {
+                       if (exprCur is int list) {
+                               yield return list.ToString ();
+                       }
+               }
+       }       
+
+       public static void Main ()
+       {
+               Test (null);
+               Test2 (3);
+       }
+}
\ No newline at end of file
index 5eac11969e1220f675083b69ce0a2e414135e6e0..d3c5c4ff729670f377698b2044e242d2abcefb1c 100644 (file)
       </method>
     </type>
   </test>
+  <test name="test-947.cs">
+    <type name="B">
+      <method name="Int64 get_Prop()" attrs="2182">
+        <size>10</size>
+      </method>
+      <method name="Int32 IA.get_Prop()" attrs="2529">
+        <size>9</size>
+      </method>
+      <method name="Int64 get_Item(Int32)" attrs="2182">
+        <size>10</size>
+      </method>
+      <method name="Int32 IA.get_Item(Int32)" attrs="2529">
+        <size>9</size>
+      </method>
+      <method name="Void .ctor()" attrs="6276">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="C">
+      <method name="Void Main()" attrs="150">
+        <size>2</size>
+      </method>
+      <method name="System.String get_Prop()" attrs="2182">
+        <size>14</size>
+      </method>
+      <method name="System.String get_Item(Int32)" attrs="2182">
+        <size>13</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-95.cs">
     <type name="X">
       <method name="Int32 Main()" attrs="150">
       </method>
     </type>
   </test>
+  <test name="test-decl-expr-05.cs">
+    <type name="X">
+      <method name="Void Test(System.String)" attrs="129">
+        <size>29</size>
+      </method>
+      <method name="Boolean Call(System.String ByRef)" attrs="145">
+        <size>17</size>
+      </method>
+      <method name="Void Main()" attrs="150">
+        <size>10</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-dictinit-01.cs">
     <type name="Program">
       <method name="Int32 Main()" attrs="145">
       </method>
     </type>
   </test>
+  <test name="test-expression-bodied-04.cs">
+    <type name="VV">
+      <method name="Void Finalize()" attrs="196">
+        <size>19</size>
+      </method>
+      <method name="Void Test()" attrs="129">
+        <size>2</size>
+      </method>
+      <method name="Void Main()" attrs="150">
+        <size>2</size>
+      </method>
+      <method name="Void .ctor()" attrs="6273">
+        <size>13</size>
+      </method>
+    </type>
+  </test>
   <test name="test-externalias-01.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">
       </method>
     </type>
   </test>
+  <test name="test-pattern-08.cs">
+    <type name="Expr">
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="X">
+      <method name="System.Collections.Generic.IEnumerable`1[System.Int32] Test(Expr)" attrs="150">
+        <size>30</size>
+      </method>
+      <method name="Void Main()" attrs="150">
+        <size>2</size>
+      </method>
+    </type>
+    <type name="X+&lt;Test&gt;c__Iterator0">
+      <method name="Boolean MoveNext()" attrs="486">
+        <size>184</size>
+      </method>
+      <method name="Int32 System.Collections.Generic.IEnumerator&lt;int&gt;.get_Current()" attrs="2529">
+        <size>14</size>
+      </method>
+      <method name="System.Object System.Collections.IEnumerator.get_Current()" attrs="2529">
+        <size>19</size>
+      </method>
+      <method name="Void Dispose()" attrs="486">
+        <size>15</size>
+      </method>
+      <method name="Void Reset()" attrs="486">
+        <size>6</size>
+      </method>
+      <method name="System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">
+        <size>14</size>
+      </method>
+      <method name="System.Collections.Generic.IEnumerator`1[System.Int32] System.Collections.Generic.IEnumerable&lt;int&gt;.GetEnumerator()" attrs="481">
+        <size>40</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
+  <test name="test-pattern-09.cs">
+    <type name="Expr">
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="X">
+      <method name="System.Collections.Generic.IEnumerable`1[System.Int32] Test(Expr)" attrs="150">
+        <size>30</size>
+      </method>
+      <method name="System.Collections.Generic.IEnumerable`1[System.String] Test2(System.Nullable`1[System.Int32])" attrs="150">
+        <size>30</size>
+      </method>
+      <method name="Void Main()" attrs="150">
+        <size>21</size>
+      </method>
+    </type>
+    <type name="X+&lt;Test&gt;c__Iterator0">
+      <method name="Boolean MoveNext()" attrs="486">
+        <size>124</size>
+      </method>
+      <method name="Int32 System.Collections.Generic.IEnumerator&lt;int&gt;.get_Current()" attrs="2529">
+        <size>14</size>
+      </method>
+      <method name="System.Object System.Collections.IEnumerator.get_Current()" attrs="2529">
+        <size>19</size>
+      </method>
+      <method name="Void Dispose()" attrs="486">
+        <size>15</size>
+      </method>
+      <method name="Void Reset()" attrs="486">
+        <size>6</size>
+      </method>
+      <method name="System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">
+        <size>14</size>
+      </method>
+      <method name="System.Collections.Generic.IEnumerator`1[System.Int32] System.Collections.Generic.IEnumerable&lt;int&gt;.GetEnumerator()" attrs="481">
+        <size>40</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="X+&lt;Test2&gt;c__Iterator1">
+      <method name="Boolean MoveNext()" attrs="486">
+        <size>161</size>
+      </method>
+      <method name="System.String System.Collections.Generic.IEnumerator&lt;string&gt;.get_Current()" attrs="2529">
+        <size>14</size>
+      </method>
+      <method name="System.Object System.Collections.IEnumerator.get_Current()" attrs="2529">
+        <size>14</size>
+      </method>
+      <method name="Void Dispose()" attrs="486">
+        <size>15</size>
+      </method>
+      <method name="Void Reset()" attrs="486">
+        <size>6</size>
+      </method>
+      <method name="System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">
+        <size>14</size>
+      </method>
+      <method name="System.Collections.Generic.IEnumerator`1[System.String] System.Collections.Generic.IEnumerable&lt;string&gt;.GetEnumerator()" attrs="481">
+        <size>40</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-pragma-unrecognized.cs">
     <type name="C">
       <method name="Void Main()" attrs="150">
index ca9d1dfd03b379fb556aaed8632aac224e35ae95..ec1f2bd2d514a3108a0ac3bff2b5b6b97a0d822e 100644 (file)
@@ -51,7 +51,9 @@ net_4_5_dirs := \
 
 build_SUBDIRS = resgen gacutil security culevel cil-stringreplacer commoncryptogenerator resx2sr linker
 net_4_5_SUBDIRS = gacutil
+net_4_x_SUBDIRS = gacutil
 net_4_5_PARALLEL_SUBDIRS = $(net_4_5_dirs)
+net_4_x_PARALLEL_SUBDIRS = $(net_4_5_dirs)
 
 SUBDIRS = $(build_SUBDIRS) $(net_4_5_dirs)
 
index b68112458eb17bcb53bb9f94cd5105170fff248a..95bb617ec6502e5fc76f283ff1f5b4b2f4a40bc9 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>al</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 61e607eb44219b6cc4ff724123ca352c98d8fbaa..e2c9728406121a29229711d75be7fbf01d75e603 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>browsercaps-updater</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index af99c229d3159a71090744d96340916950a11503..bf308b60e2d816dde8f8cd7b64d37496ad777ea5 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>cccheck</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 08986528e32eaf1add2cf5e8402f3f3918c85385..9e4fd54035d545e1b4e1f8d99c9680715bce00dd 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>ccrewrite</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 0209849afddfa758332cbbf2c6e3f7372d2bf8a8..36dfecd18c72242d888f7ac813257be6c4edc155 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mono-cil-strip</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 7df407f8353897315b7e1a997b7bad965df5b26a..b151c55d2dde24a59ac6f1eed0dd8ec0068f871e 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>compiler-tester</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 176b9e35933404666c7d4b31eae8e4b29bb8cf1e..de99650ca65222e1f99e6ec911416628fbf51130 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mono-api-info</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 52ae83dae5fa380c96ed4249d0df8588d8b30363..b95a7f206050509dd57917522827f45a92227fb2 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>csharp</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 357a6d867a75bb0a6c4ea17965ef7c466bd57cfa..b47384aa387a22d625c0c69c7576d55356814477 100644 (file)
@@ -10,7 +10,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>\r
     <RootNamespace>csharp</RootNamespace>\r
     <AssemblyName>csharp</AssemblyName>\r
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
+    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
     <FileUpgradeFlags>\r
     </FileUpgradeFlags>\r
index 412d6dd0bec7ff086412727d39dda7d43cdff3d1..8df6120ae684308ec614ed13fb55cff9f27dfd48 100644 (file)
@@ -8,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{ED867AC1-079C-4B5E-ADF9-E7722053B360}</ProjectGuid>\r
     <OutputType>Exe</OutputType>\r
-    <NoWarn>1699,1699</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>\r
     <AssemblyName>culevel</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,1699</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
     <DebugType>pdbonly</DebugType>\r
-    <NoWarn>1699,1699</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 602aedd1fcf54826dcc1832321a95c54f3c3ddeb..0eb9e30b64e208d7d77a4f7dbcf498044ba177d9 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>disco</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 4f0f584b0dfb3b66a84b43799659059ea473c2d7..fb9f723b1292e8605ae895d650d598bfc1aeb768 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>dtd2rng</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 4ae96b98786c76edf070e30a57ea55bf344614b0..3fc9cb6add566971781991a3ba934650825e2b8c 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>dtd2xsd</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index afe031c5f7e0ec85a1a7e1c7a29ecafbe99e111e..c3d41355a902f1c1df006d1a78482cef77c8f08b 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>gacutil</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index f564cca6a2d5f7fb8ca24eb471616dc264048b4b..4b14adcbb85bb87f805e2338eb9acdde3a2da54b 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>genxs</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 9205ce133088845cd79793c6e432b2a491cb4a5b..9b451e3a7f550d5fb8884a3feac2adf611b0ec8f 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>ictool</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index be762c87bbc709da8407740e736aa187fa299900..0e477f64e9f2626b1e73bbdb743a74ae2adc12bd 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>ikdasm</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index c3cac6d92e6caaa10dd60e82bacdfc325883ad46..1b4bbdeb031200a9549537d26e22286eaf1234d1 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>installutil</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index a8b3824ab88be891e17d9fa271f15a562a416312..9f41934f76c3bec05f116466ca4ed2b213cd46bd 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>installvst</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index ae5c2d7b4acf8b354b81e19faaeda9a63ba2e313..104b605f46dc4dcd584fc8d544fc009caadda217 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>lc</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 220de2710e9b72dd6d579d4a10004dc86603f7e5..8f94dc99bba1967dd1c3843bcd8fa809e642f42e 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>linkeranalyzer</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index f80636d8747e6fdfb4f8c00929b9c44709030c54..577dceff7d219feba24fd022cd76b6cb831e3f7e 100644 (file)
@@ -8,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{FA920637-C202-4E75-AC0F-1A8DBD631DF1}</ProjectGuid>\r
     <OutputType>Exe</OutputType>\r
-    <NoWarn>1699,1699</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>\r
     <AssemblyName>monolinker</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,1699</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
     <DebugType>pdbonly</DebugType>\r
-    <NoWarn>1699,1699</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 44c33f5c0cc16c5cea904cb869c28a342432c776..b5c3d1353000a46cedd106cd3c5281629542357a 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>macpack</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index a1d9dd19fbaf6b77df843bce25206888cb3966d4..02db5ac808906e6f53c0ba597b736e216f44524a 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mconfig</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 6bc03bec187dc3a518bd00619804191e44bc7f3d..4e076d9690964e27f5dbc4010b5d06c6d8be7319 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mdb2ppdb</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index c04da697acb0847bddbd0213cad0833f9332bc93..6e31fa1783d4d002580b451a428b72f23e78e530 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mdbrebase</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 285a031f5d216538ccc7aacb4e96170a2dcbd6a7..e4bd162730ca1f72810851af9a40176d4c84c2ab 100644 (file)
@@ -55,6 +55,11 @@ DIFF = diff -rupZ
 DIFF_QUIET = diff --brief -Z
 endif
 
+ifdef MCS_MODE
+DIFF = echo "WARNING: running in mcs mode, tests are specific to roslyn and would fail. Skipping diff check."
+DIFF_QUIET = $(DIFF)
+endif
+
 dist-local: dist-default dist-tests
 
 dist-tests:
index ec9d89eed5928f91425d11bed32cbf530879a6b0..a50f444373af17631d94565037f78edcbd1abc5a 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mdoc</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index e26baba2f723d85e2169980c7e226ab11bada7da..0d418c490d8893c4e84f50a55751843cd04c55f4 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mkbundle</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 0c04755f1e7f31b6029900227726e93b6f1bacf2..0e034f63f3e51a2c008909e7482a1a11bdd566dc 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mod</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 2acb5ca3f5ac98c5c743ea4235ce938a46b4ecb9..72eed73390fec879e2d77b51835d648ec50c38d3 100644 (file)
@@ -374,7 +374,7 @@ namespace Xamarin.ApiDiff {
                                                change.Append (paramSourceType);
                                        }
                                        change.Append (" ");
-                                       if (paramSourceName != paramTargetName) {
+                                       if (!State.IgnoreParameterNameChanges && paramSourceName != paramTargetName) {
                                                change.AppendModified (paramSourceName, paramTargetName, true);
                                        } else {
                                                change.Append (paramSourceName);
@@ -404,12 +404,6 @@ namespace Xamarin.ApiDiff {
                        }
 
                        change.Append (")");
-
-                       // Ignore any parameter name changes if requested.
-                       if (State.IgnoreParameterNameChanges && !change.Breaking) {
-                               change.AnyChange = false;
-                               change.HasIgnoredChanges = true;
-                       }
                }
 
                void RenderVTable (MethodAttributes source, MethodAttributes target, ApiChange change)
index 2466357c92f7afc21308570b33ad1ce941da902c..66fac4a9dc40e50e0bef446367dc28791be04328 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mono-api-html</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 253e9d984c959ee2e968c73bb23a71eb9e5aca11..7f9d5367ba37f4d63fefaaae17b21c21885bc003 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mono-configuration-crypto</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 2d2bee4108eb93f20f3beccc6e38a5cf7ee8c4cb..cea2c9f213fe3f51f2c4058b3084362e1f6d7128 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>Mono.Configuration.Crypto</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index b8172b7a56e56df58e13fc9fdfdc1a3fba584da0..3531aaf732ca19e95f93da4aa912cbdcb1c543fa 100644 (file)
     <AssemblyName>mono-service</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../class/mono.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 06d3bec0c89eea9b3d8e9da6f59ccdfb5aed98ee..d85a2208a2899af43c29078734129e2a2b0c8046 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mono-shlib-cop</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index ddc254ec1138a5e495d354fb37b9bef64cabba9a..440dfe9f8e65876bdcd3a44346190982a73832c3 100644 (file)
@@ -35,6 +35,10 @@ CHECK_DIFF = @\
                exit 1; \
        fi
 
+ifdef MCS_MODE
+CHECK_DIFF = @echo "WARNING: running in mcs mode, tests are specific to roslyn and would fail. Skipping diff check."
+endif
+
 PREPARE_OUTDIR = @\
        rm -rf $(OUT_DIR); \
        mkdir -p $(OUT_DIR); \
@@ -45,21 +49,21 @@ COMPILE = \
        $(MONO) $(LIB_PATH)/$(PROGRAM) store-symbols $(MSYM_DIR) $(OUT_DIR); \
        $(MONO) $(LIB_PATH)/$(PROGRAM) store-symbols $(MSYM_DIR) $(LIB_PATH);
 
-check: test-local
+check: run-test
 
 AOT_SUPPORTED = $(shell $(MONO) --aot 2>&1 | grep -q "AOT compilation is not supported" && echo 0 || echo 1)
 
-test-local: test-without-aot test-with-aot test-with-aot-msym
+run-test-local: run-test-without-aot run-test-with-aot run-test-with-aot-msym
 
-test-without-aot: OUT_DIR = Test/without_aot
-test-without-aot: all
+run-test-without-aot: OUT_DIR = Test/without_aot
+run-test-without-aot: all
        @echo "Checking $(TEST_EXE) without AOT in $(OUT_DIR)"
        $(PREPARE_OUTDIR)
        $(COMPILE)
        $(CHECK_DIFF)
 
-test-with-aot: OUT_DIR = Test/with_aot
-test-with-aot: all
+run-test-with-aot: OUT_DIR = Test/with_aot
+run-test-with-aot: all
 ifeq ($(AOT_SUPPORTED), 1)
        @echo "Checking $(TEST_EXE) with AOT in $(OUT_DIR)"
        $(PREPARE_OUTDIR)
@@ -68,8 +72,8 @@ ifeq ($(AOT_SUPPORTED), 1)
        $(CHECK_DIFF)
 endif
 
-test-with-aot-msym: OUT_DIR = Test/with_aot_msym
-test-with-aot-msym: all
+run-test-with-aot-msym: OUT_DIR = Test/with_aot_msym
+run-test-with-aot-msym: all
 ifeq ($(AOT_SUPPORTED), 1)
        @echo "Checking $(TEST_EXE) with AOT (using .msym) in $(OUT_DIR)"
        $(PREPARE_OUTDIR)
index 211d19288967f10aa12d45c8caf7c9018a30b5f6..ee96aa9a68523e03da4a3b9d0451986fbc83c7e9 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mono-symbolicate</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index bcba662bcd29b27dbc6ad1360ac133781c9c0e87..d49ecdb58a1f6ad720b12f70b20cfd6cec07d7d1 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>mono-xmltool</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 434dcc30883f5028813df860e97567db03d7ff45..e28a7c5da980ed9da43c99183306225a9cf8dd04 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>xsd</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 5b9aac048dd0f861d4ba53c391cf74a98a252b16..4d2233b5f12e8b8ffd6c999b720daecfdb2bd81a 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>monop</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index a955c5e28eb51b24cb59a075cedc87927f89430f..ed705fcedb2f8a49f776f9bb3dd0b61b89996aeb 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>nunitreport</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 59666f07836719d515aae5aa3747e8b1bd028c85..5d3e6d0ecbfe54c50b0531535a0c4e4565a44ac3 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>pdb2mdb</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 46cd295aedc706887551616d2fdeed4632539cd4..e52782c3d3cde247d85cbcd41edb207cf4c6abaf 100644 (file)
@@ -8,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}</ProjectGuid>\r
     <OutputType>Exe</OutputType>\r
-    <NoWarn>1699,1699</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>\r
     <HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>\r
     <AssemblyName>resgen</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,1699</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
     <DebugType>pdbonly</DebugType>\r
-    <NoWarn>1699,1699</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 97024606a16180b53b118198a31a0f1fae21dca1..b17553a6cdcf34f30ad24fea61c1191c8e3d64e9 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>sgen</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index dbfb5851ffc0bae21c29edd3579980d89aa97228..0b58412b3972fecbf712af09955e82b29360eebb 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>soapsuds</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 6c34d079f29e22ef25559e0e198963f26e9892bc..9a79fabffd4792854b9eb35f194a75b5568ef1a7 100644 (file)
     <AssemblyName>sqlmetal</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
     <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
     <AssemblyOriginatorKeyFile>../../class/System.Data.Linq/src/DbMetal/../DbLinq.snk</AssemblyOriginatorKeyFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
index 30a2622e6d996aa3e7e03133e99f9d9b47a67cdc..75fec0aaa4435f63fc8df37147066935cec76e58 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>sqlsharp</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 1cc99309f9e3f0a4e5e9f21e36a26764d8cde295..611bbf836866efa49aead76649f02d773ad745a8 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>svcutil</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 4d9f7c0a27bc309b851c6218b5bd2cac846365e8..15de5391981462286aa5d58a81863bf2ae66a9a5 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>wsdl</AssemblyName>\r
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+\r
   </PropertyGroup>\r
-  \r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 93d925ff273209a3a0b07647061c2ad33cf8ece2..406829f8021e462580eb1fbdd272df99a1602f0f 100644 (file)
@@ -14,11 +14,7 @@ include ../../build/executable.make
 XBUILD_DIR=.
 include $(XBUILD_DIR)/xbuild_test.make
 
-ifeq (4.0, $(FRAMEWORK_VERSION))
-install-local: xbuild-net4-fail
-else
 install-local: install-extras
-endif
 
 PORTABLE_TARGETS_SRC:=data/Portable/Targets
 PCL5_FX_SRC:=data/Portable/Frameworks/v5.0
index 4c503c060ac3b432270f45b7367477750751875d..d7488d66411dac1f15bbd594867b2a8ab6e68363 100644 (file)
@@ -6,16 +6,8 @@ export TESTING_MONO=a
 export MSBuildExtensionsPath=$(XBUILD_DATA_DIR)
 export XBUILD_FRAMEWORK_FOLDERS_PATH= $(topdir)/class/Microsoft.Build/xbuild-testing
 
-ifeq (4.0, $(FRAMEWORK_VERSION))
-NO_TEST=true
-else
 test-local: copy-targets Test/test-config-file-$(PROFILE)
 clean-local: clean-targets clean-test-config
-endif
-
-xbuild-net4-fail:
-       @echo "The net_4_0 profile contains reference assemblies only and cannot be installed/tested as an xbuild toolset"
-       @exit 1
 
 Test/test-config-file-$(PROFILE): $(XBUILD_DATA_DIR)/xbuild.exe.config_test.in
        sed -e 's/@ASM_VERSION@/$(XBUILD_ASSEMBLY_VERSION)/g' $(XBUILD_DATA_DIR)/xbuild.exe.config_test.in > Test/test-config-file-$(PROFILE)
index 8c9c2cbac2f6ef09407d2aa29ad319471b20cb44..de46d63aac0608e3b7e829e90bcdf12945cbb928 100644 (file)
@@ -7,10 +7,10 @@ btls_dirs = btls
 endif
 
 if CROSS_COMPILING
-SUBDIRS = $(btls_dirs) arch utils cil metadata $(sgen_dirs) mini dis profiler
+SUBDIRS = $(btls_dirs) eglib arch utils cil metadata $(sgen_dirs) mini dis profiler
 else
 if INSTALL_MONOTOUCH
-SUBDIRS = $(btls_dirs) arch utils metadata $(sgen_dirs) mini profiler
+SUBDIRS = $(btls_dirs) eglib arch utils metadata $(sgen_dirs) mini profiler
 
 monotouch-do-build:
        @list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -34,7 +34,7 @@ monotouch-do-clean:
          (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
     done;
 else
-SUBDIRS = $(btls_dirs) arch utils cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
+SUBDIRS = $(btls_dirs) eglib arch utils cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
 endif
 endif
-DIST_SUBDIRS = btls arch utils cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
+DIST_SUBDIRS = btls eglib arch utils cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
index 9f2365d3e50df411bb759a763f70a8b1f4cd038c..8b9e4eb0cab58941efc00bb0c407b4ec61a4fab4 100644 (file)
@@ -12,6 +12,11 @@ endif()
 enable_language(C)
 enable_language(CXX)
 
+find_program(CCACHE_PROGRAM ccache)
+if(CCACHE_PROGRAM)
+    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
+endif()
+
 # FIXME: cmake's asm detection is broken when using xcrun.
 set (CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}")
 set (CMAKE_ASM_COMPILER_ARG1 "${CMAKE_C_COMPILER_ARG1}")
@@ -31,7 +36,10 @@ set (CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${BTLS_CFLAGS}")
 set (CMAKE_MACOSX_RPATH 1)
 set (MONO_BTLS 1)
 
+set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}")
+set(BUILD_SHARED_LIBS OFF)
 add_subdirectory (${BTLS_ROOT} boringssl)
+set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}")
 
 include_directories (
        ${SRC_DIR}
index 33bfb1f6f73e8934d5e0f8f294c3b74e001cc3b8..713826839958b8dfb9d57f717b50dc6039e8e814 100644 (file)
@@ -40,17 +40,30 @@ EXTRA_DIST = $(MONO_BTLS_SOURCES_FILES)
 
 CMAKE_VERBOSE=$(if $(V),VERBOSE=1,)
 
+if NINJA
+NINJA_ARGS = -G Ninja
+BUILDFILE = build.ninja
+else
+NINJA_ARGS =
+BUILDFILE = Makefile
+endif
+
 CMAKE_ARGS = -D CMAKE_INSTALL_PREFIX:PATH=$(prefix) -D BTLS_ROOT:PATH=$(BTLS_ROOT) \
-       -D SRC_DIR:PATH=$(abs_top_srcdir)/mono/btls -D BTLS_CFLAGS:STRING="$(BTLS_CFLAGS)"
+       -D SRC_DIR:PATH=$(abs_top_srcdir)/mono/btls -D BTLS_CFLAGS:STRING="$(BTLS_CFLAGS)" $(NINJA_ARGS)
 
 all-local: build-shared/libmono-btls-shared$(libsuffix)
 
-build-shared/Makefile:
+build-shared/$(BUILDFILE):
        -mkdir -p build-shared
        (cd build-shared && CC="$(CC)" CXX="$(CXX)" $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) -DBUILD_SHARED_LIBS=1 $(abs_top_srcdir)/mono/btls)
 
-build-shared/libmono-btls-shared$(libsuffix): build-shared/Makefile $(MONO_BTLS_SOURCES_FILES)
+if NINJA
+build-shared/libmono-btls-shared$(libsuffix): build-shared/$(BUILDFILE) $(MONO_BTLS_SOURCES_FILES)
+       ninja -C build-shared $(CMAKE_VERBOSE)
+else
+build-shared/libmono-btls-shared$(libsuffix): build-shared/$(BUILDFILE) $(MONO_BTLS_SOURCES_FILES)
        $(MAKE) -C build-shared $(CMAKE_VERBOSE)
+endif
 
 clean-local:
        -rm -rf build-shared
diff --git a/mono/btls/create-object-library.sh b/mono/btls/create-object-library.sh
deleted file mode 100755 (executable)
index 8ceda08..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-DIR=$1; shift
-FILELIST=$1; shift
-LOFILELIST=$1 ; shift
-TARGET=$1; shift
-STATIC=$1; shift
-AR=$1; shift
-RANLIB=$1; shift
-
-HEADER="# Generated by Martin's tool $0, not libtool"
-
-test -f $TARGET && exit 0
-
-rm -f $FILELIST
-rm -f $LOFILELIST
-
-while [ "$1" != "--" ]; do
-       file=$1; shift
-       filename=`basename $file`
-       LOFILE=$file.lo
-       echo "$HEADER" > $LOFILE
-       if [ "$STATIC" = "static" ]; then
-               echo "non_pic_object='$filename'" >> $LOFILE
-       else
-               echo "pic_object='$filename'" >> $LOFILE
-       fi
-       echo "$DIR/$file " >> $FILELIST
-       echo "$DIR/$LOFILE " >> $LOFILELIST
-done
-
-(cd $DIR && $AR cr $TARGET `cat $FILELIST` && $RANLIB $TARGET)
-
index a994e4603d30214cbfb5d5a40e7fd9d17459d023..f5b64acdd0dab72058234fb16f54291d593a7e47 100755 (executable)
@@ -3143,12 +3143,16 @@ get_method_override (MonoImage *m, guint32 token, MonoGenericContainer *containe
                                g_free (meth_str);
                                return ret;
                        } else {
-                               char *meth_str = get_method_core (m, decl, FALSE, container);
-                               char *ret = g_strdup_printf ("Could not decode method override %s due to %s", meth_str, mono_error_get_message (&error));
+                               if (!mono_error_ok (&error)) {
+                                       char *meth_str = get_method_core (m, decl, FALSE, container);
+                                       char *ret = g_strdup_printf ("Could not decode method override %s due to %s", meth_str, mono_error_get_message (&error));
 
-                               mono_error_cleanup (&error);
-                               g_free (meth_str);
-                               return ret;
+                                       mono_error_cleanup (&error);
+                                       g_free (meth_str);
+                                       return ret;
+                               } else {
+                                       return get_method_core (m, decl, FALSE, container);
+                               }
                        }
                }
        }
diff --git a/mono/eglib/.gitignore b/mono/eglib/.gitignore
new file mode 100644 (file)
index 0000000..6635df1
--- /dev/null
@@ -0,0 +1,11 @@
+/Makefile
+/Makefile.in
+/.libs
+/.deps
+/*.lo
+/*.la
+/*.o
+/semantic.cache
+/.project
+/.cproject
+/eglib-config.h
diff --git a/mono/eglib/Makefile.am b/mono/eglib/Makefile.am
new file mode 100644 (file)
index 0000000..08cf40a
--- /dev/null
@@ -0,0 +1,65 @@
+noinst_LTLIBRARIES = libeglib.la
+
+AM_CFLAGS = $(WERROR_CFLAGS)
+
+win_files  = \
+       eglib-config.hw \
+       gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
+       gmodule-win32.c gmodule-win32-internals.h gtimer-win32.c gunicode-win32.c
+
+unix_files = \
+       gdate-unix.c  gdir-unix.c  gfile-unix.c  gmisc-unix.c   \
+       gmodule-unix.c gtimer-unix.c
+
+if HOST_WIN32
+os_files = $(win_files)
+else
+os_files = $(unix_files)
+endif
+
+libeglib_la_SOURCES = \
+       eglib-remap.h   \
+       sort.frag.h     \
+       glib.h          \
+       garray.c        \
+       gbytearray.c    \
+       gerror.c        \
+       ghashtable.c    \
+       giconv.c        \
+       gmem.c          \
+       gmodule.h       \
+       goutput.c       \
+       gqsort.c        \
+       gstr.c          \
+       gslist.c        \
+       gstring.c       \
+       gptrarray.c     \
+       glist.c         \
+       gqueue.c        \
+       gpath.c         \
+       gshell.c        \
+       gspawn.c        \
+       gfile.c         \
+       gfile-posix.c   \
+       gpattern.c      \
+       gmarkup.c       \
+       gutf8.c         \
+       gunicode.c      \
+       unicode-data.h  \
+       $(os_files)
+
+libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
+
+AM_CPPFLAGS = -I$(srcdir)
+
+if HOST_WIN32
+libeglib_la_LIBADD = -lm $(LIBICONV) -lpsapi
+else
+if PLATFORM_ANDROID
+libeglib_la_LIBADD = -llog
+endif
+endif
+
+MAINTAINERCLEANFILES = Makefile.in
+
+EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files)
diff --git a/mono/eglib/eglib-config.h.in b/mono/eglib/eglib-config.h.in
new file mode 100644 (file)
index 0000000..7179757
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef __EGLIB_CONFIG_H
+#define __EGLIB_CONFIG_H
+
+/*
+ * System-dependent settings
+ */
+#define G_GNUC_PRETTY_FUNCTION   @GNUC_PRETTY@
+#define G_GNUC_UNUSED            @GNUC_UNUSED@
+#define G_BYTE_ORDER             @ORDER@
+#define G_GNUC_NORETURN          @GNUC_NORETURN@
+#define G_SEARCHPATH_SEPARATOR_S "@SEARCHSEP@"
+#define G_SEARCHPATH_SEPARATOR   '@SEARCHSEP@'
+#define G_DIR_SEPARATOR          '@PATHSEP@'
+#define G_DIR_SEPARATOR_S        "@PATHSEP@"
+#define G_BREAKPOINT()           @BREAKPOINT@
+#define G_OS_@OS@
+#define GPOINTER_TO_INT(ptr)   @GPOINTER_TO_INT@
+#define GPOINTER_TO_UINT(ptr)  @GPOINTER_TO_UINT@
+#define GINT_TO_POINTER(v)     @GINT_TO_POINTER@
+#define GUINT_TO_POINTER(v)    @GUINT_TO_POINTER@
+
+#if @HAVE_ALLOCA_H@ == 1
+#define G_HAVE_ALLOCA_H
+#endif
+
+typedef unsigned @GSIZE@ gsize;
+typedef signed   @GSIZE@ gssize;
+
+#define G_GSIZE_FORMAT   @GSIZE_FORMAT@
+
+#if @G_HAVE_ISO_VARARGS@ == 1
+#define G_HAVE_ISO_VARARGS
+#endif
+
+#if defined (HOST_WATCHOS)
+#undef G_BREAKPOINT
+#define G_BREAKPOINT()
+#endif
+
+typedef @PIDTYPE@ GPid;
+
+#endif
diff --git a/mono/eglib/eglib-config.hw b/mono/eglib/eglib-config.hw
new file mode 100644 (file)
index 0000000..cc7bd44
--- /dev/null
@@ -0,0 +1,63 @@
+#ifndef __EGLIB_CONFIG_H
+#define __EGLIB_CONFIG_H
+
+/*
+ * System-dependent settings
+ */
+#define G_OS_WIN32 1
+
+#ifdef _MSC_VER
+
+#include <io.h>
+
+#define G_GNUC_PRETTY_FUNCTION   __FUNCTION__
+#define G_GNUC_UNUSED            
+#define G_BYTE_ORDER             1234
+#define G_GNUC_NORETURN          
+#define G_BREAKPOINT()           __debugbreak()
+#define MAXPATHLEN 242
+
+typedef uintptr_t gsize;
+typedef intptr_t gssize;
+typedef int pid_t;
+
+#define G_DIR_SEPARATOR          '\\'
+#define G_DIR_SEPARATOR_S        "\\"
+#define G_SEARCHPATH_SEPARATOR_S ";"
+#define G_SEARCHPATH_SEPARATOR   ';'
+#define G_GSIZE_FORMAT   "d"
+#define GPOINTER_TO_INT(ptr)   ((gint)(intptr_t) (ptr))
+#define GPOINTER_TO_UINT(ptr)  ((guint)(intptr_t) (ptr))
+#define GINT_TO_POINTER(v)     ((gpointer)(intptr_t) (v))
+#define GUINT_TO_POINTER(v)    ((gpointer)(intptr_t) (v))
+
+#define STDOUT_FILENO (int)(intptr_t)stdout
+#define STDERR_FILENO (int)(intptr_t)stderr
+
+/* FIXME: what should this be ?*/
+#define X_OK 4 /* This is really read */
+#define WNOHANG 1
+#define F_SETFD 1
+#define FD_CLOEXEC 1
+
+#undef inline
+#define inline __inline
+
+#define strtok_r strtok_s
+
+#undef G_HAVE_UNISTD_H
+#undef G_HAVE_SYS_TIME_H
+#undef G_HAVE_SYS_WAIT_H
+#undef G_HAVE_PWD_H
+#undef G_HAVE_STRNDUP
+#define G_HAVE_GETOPT_H 1
+
+/* disable the following warnings 
+ * C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored. 
+ * C4127: conditional expression is constant
+*/
+#pragma warning(disable:4100 4127)
+#endif
+
+typedef void * GPid;
+#endif
diff --git a/mono/eglib/eglib-remap.h b/mono/eglib/eglib-remap.h
new file mode 100644 (file)
index 0000000..311c06a
--- /dev/null
@@ -0,0 +1,288 @@
+#define g_array_append monoeg_g_array_append
+#define g_array_append_vals monoeg_g_array_append_vals
+#define g_array_free monoeg_g_array_free
+#define g_array_insert_vals monoeg_g_array_insert_vals
+#define g_array_new monoeg_g_array_new
+#define g_array_remove_index monoeg_g_array_remove_index
+#define g_array_remove_index_fast monoeg_g_array_remove_index_fast
+#define g_array_set_size monoeg_g_array_set_size
+#define g_array_sized_new monoeg_g_array_sized_new
+#define g_ascii_strdown monoeg_g_ascii_strdown
+#define g_ascii_strncasecmp monoeg_g_ascii_strncasecmp
+#define g_ascii_tolower monoeg_g_ascii_tolower
+#define g_ascii_xdigit_value monoeg_g_ascii_xdigit_value
+#define g_build_path monoeg_g_build_path
+#define g_byte_array_append monoeg_g_byte_array_append
+#define g_byte_array_free monoeg_g_byte_array_free
+#define g_byte_array_new monoeg_g_byte_array_new
+#define g_byte_array_set_size monoeg_g_byte_array_set_size
+#define g_calloc monoeg_g_calloc
+#define g_clear_error monoeg_g_clear_error
+#define g_convert monoeg_g_convert
+#define g_convert_error_quark monoeg_g_convert_error_quark
+#define g_dir_close monoeg_g_dir_close
+#define g_dir_open monoeg_g_dir_open
+#define g_dir_read_name monoeg_g_dir_read_name
+#define g_dir_rewind monoeg_g_dir_rewind
+#define g_mkdir_with_parents monoeg_g_mkdir_with_parents
+#define g_direct_equal monoeg_g_direct_equal
+#define g_direct_hash monoeg_g_direct_hash
+#define g_ensure_directory_exists monoeg_g_ensure_directory_exists
+#define g_error_free monoeg_g_error_free
+#define g_error_new monoeg_g_error_new
+#define g_error_vnew monoeg_g_error_vnew
+#define g_file_error_quark monoeg_g_file_error_quark
+#define g_file_error_from_errno monoeg_g_file_error_from_errno
+#define g_file_get_contents monoeg_g_file_get_contents
+#define g_file_set_contents monoeg_g_file_set_contents
+#define g_file_open_tmp monoeg_g_file_open_tmp
+#define g_file_test monoeg_g_file_test
+#define g_filename_from_uri monoeg_g_filename_from_uri
+#define g_filename_from_utf8 monoeg_g_filename_from_utf8
+#define g_filename_to_uri monoeg_g_filename_to_uri
+#define g_find_program_in_path monoeg_g_find_program_in_path
+#define g_fprintf monoeg_g_fprintf
+#define g_free monoeg_g_free
+#define g_get_charset monoeg_g_get_charset
+#define g_get_current_dir monoeg_g_get_current_dir
+#define g_get_current_time monoeg_g_get_current_time
+#define g_get_home_dir monoeg_g_get_home_dir
+#define g_get_prgname monoeg_g_get_prgname
+#define g_get_tmp_dir monoeg_g_get_tmp_dir
+#define g_get_user_name monoeg_g_get_user_name
+#define g_getenv monoeg_g_getenv
+#define g_hasenv monoeg_g_hasenv
+#define g_hash_table_destroy monoeg_g_hash_table_destroy
+#define g_hash_table_find monoeg_g_hash_table_find
+#define g_hash_table_foreach monoeg_g_hash_table_foreach
+#define g_hash_table_foreach_remove monoeg_g_hash_table_foreach_remove
+#define g_hash_table_foreach_steal monoeg_g_hash_table_foreach_steal
+#define g_hash_table_get_keys monoeg_g_hash_table_get_keys
+#define g_hash_table_get_values monoeg_g_hash_table_get_values
+#define g_hash_table_insert_replace monoeg_g_hash_table_insert_replace
+#define g_hash_table_lookup monoeg_g_hash_table_lookup
+#define g_hash_table_lookup_extended monoeg_g_hash_table_lookup_extended
+#define g_hash_table_new monoeg_g_hash_table_new
+#define g_hash_table_new_full monoeg_g_hash_table_new_full
+#define g_hash_table_remove monoeg_g_hash_table_remove
+#define g_hash_table_steal monoeg_g_hash_table_steal
+#define g_hash_table_size monoeg_g_hash_table_size
+#define g_hash_table_print_stats monoeg_g_hash_table_print_stats
+#define g_hash_table_remove_all monoeg_g_hash_table_remove_all
+#define g_hash_table_iter_init monoeg_g_hash_table_iter_init
+#define g_hash_table_iter_next monoeg_g_hash_table_iter_next
+#define g_iconv monoeg_g_iconv
+#define g_iconv_close monoeg_g_iconv_close
+#define g_iconv_open monoeg_g_iconv_open
+#define g_int_equal monoeg_g_int_equal
+#define g_int_hash monoeg_g_int_hash
+#define g_list_alloc monoeg_g_list_alloc
+#define g_list_append monoeg_g_list_append
+#define g_list_concat monoeg_g_list_concat
+#define g_list_copy monoeg_g_list_copy
+#define g_list_delete_link monoeg_g_list_delete_link
+#define g_list_find monoeg_g_list_find
+#define g_list_find_custom monoeg_g_list_find_custom
+#define g_list_first monoeg_g_list_first
+#define g_list_foreach monoeg_g_list_foreach
+#define g_list_free monoeg_g_list_free
+#define g_list_free_1 monoeg_g_list_free_1
+#define g_list_index monoeg_g_list_index
+#define g_list_insert_before monoeg_g_list_insert_before
+#define g_list_insert_sorted monoeg_g_list_insert_sorted
+#define g_list_last monoeg_g_list_last
+#define g_list_length monoeg_g_list_length
+#define g_list_nth monoeg_g_list_nth
+#define g_list_nth_data monoeg_g_list_nth_data
+#define g_list_prepend monoeg_g_list_prepend
+#define g_list_remove monoeg_g_list_remove
+#define g_list_remove_all monoeg_g_list_remove_all
+#define g_list_remove_link monoeg_g_list_remove_link
+#define g_list_reverse monoeg_g_list_reverse
+#define g_list_sort monoeg_g_list_sort
+#define g_locale_from_utf8 monoeg_g_locale_from_utf8
+#define g_locale_to_utf8 monoeg_g_locale_to_utf8
+#define g_log monoeg_g_log
+#define g_log_set_always_fatal monoeg_g_log_set_always_fatal
+#define g_log_set_fatal_mask monoeg_g_log_set_fatal_mask
+#define g_logv monoeg_g_logv
+#define g_markup_parse_context_end_parse monoeg_g_markup_parse_context_end_parse
+#define g_markup_parse_context_free monoeg_g_markup_parse_context_free
+#define g_markup_parse_context_new monoeg_g_markup_parse_context_new
+#define g_markup_parse_context_parse monoeg_g_markup_parse_context_parse
+#define g_memdup monoeg_g_memdup
+#define g_mem_set_vtable monoeg_g_mem_set_vtable
+#define g_mkdtemp monoeg_g_mkdtemp
+#define g_module_build_path monoeg_g_module_build_path
+#define g_module_close monoeg_g_module_close
+#define g_module_error monoeg_g_module_error
+#define g_module_open monoeg_g_module_open
+#define g_module_symbol monoeg_g_module_symbol
+#define g_path_get_basename monoeg_g_path_get_basename
+#define g_path_get_dirname monoeg_g_path_get_dirname
+#define g_path_is_absolute monoeg_g_path_is_absolute
+#define g_pattern_match_string monoeg_g_pattern_match_string
+#define g_pattern_spec_free monoeg_g_pattern_spec_free
+#define g_pattern_spec_new monoeg_g_pattern_spec_new
+#define g_print monoeg_g_print
+#define g_printf monoeg_g_printf
+#define g_printerr monoeg_g_printerr
+#define g_propagate_error monoeg_g_propagate_error
+#define g_ptr_array_add monoeg_g_ptr_array_add
+#define g_ptr_array_foreach monoeg_g_ptr_array_foreach
+#define g_ptr_array_free monoeg_g_ptr_array_free
+#define g_ptr_array_new monoeg_g_ptr_array_new
+#define g_ptr_array_remove monoeg_g_ptr_array_remove
+#define g_ptr_array_remove_fast monoeg_g_ptr_array_remove_fast
+#define g_ptr_array_remove_index monoeg_g_ptr_array_remove_index
+#define g_ptr_array_remove_index_fast monoeg_g_ptr_array_remove_index_fast
+#define g_ptr_array_set_size monoeg_g_ptr_array_set_size
+#define g_ptr_array_sized_new monoeg_g_ptr_array_sized_new
+#define g_ptr_array_sort monoeg_g_ptr_array_sort
+#define g_ptr_array_sort_with_data monoeg_g_ptr_array_sort_with_data
+#define g_qsort_with_data monoeg_g_qsort_with_data
+#define g_queue_free monoeg_g_queue_free
+#define g_queue_is_empty monoeg_g_queue_is_empty
+#define g_queue_foreach monoeg_g_queue_foreach
+#define g_queue_new monoeg_g_queue_new
+#define g_queue_pop_head monoeg_g_queue_pop_head
+#define g_queue_push_head monoeg_g_queue_push_head
+#define g_queue_push_tail monoeg_g_queue_push_tail
+#define g_set_error monoeg_g_set_error
+#define g_set_prgname monoeg_g_set_prgname
+#define g_setenv monoeg_g_setenv
+#define g_shell_parse_argv monoeg_g_shell_parse_argv
+#define g_shell_quote monoeg_g_shell_quote
+#define g_shell_unquote monoeg_g_shell_unquote
+#define g_slist_alloc monoeg_g_slist_alloc
+#define g_slist_append monoeg_g_slist_append
+#define g_slist_concat monoeg_g_slist_concat
+#define g_slist_copy monoeg_g_slist_copy
+#define g_slist_delete_link monoeg_g_slist_delete_link
+#define g_slist_find monoeg_g_slist_find
+#define g_slist_find_custom monoeg_g_slist_find_custom
+#define g_slist_foreach monoeg_g_slist_foreach
+#define g_slist_free monoeg_g_slist_free
+#define g_slist_free_1 monoeg_g_slist_free_1
+#define g_slist_index monoeg_g_slist_index
+#define g_slist_insert_before monoeg_g_slist_insert_before
+#define g_slist_insert_sorted monoeg_g_slist_insert_sorted
+#define g_slist_last monoeg_g_slist_last
+#define g_slist_length monoeg_g_slist_length
+#define g_slist_nth monoeg_g_slist_nth
+#define g_slist_nth_data monoeg_g_slist_nth_data
+#define g_slist_prepend monoeg_g_slist_prepend
+#define g_slist_remove monoeg_g_slist_remove
+#define g_slist_remove_all monoeg_g_slist_remove_all
+#define g_slist_remove_link monoeg_g_slist_remove_link
+#define g_slist_reverse monoeg_g_slist_reverse
+#define g_slist_sort monoeg_g_slist_sort
+#define g_snprintf monoeg_g_snprintf
+#define g_spaced_primes_closest monoeg_g_spaced_primes_closest
+#define g_spawn_async_with_pipes monoeg_g_spawn_async_with_pipes
+#define g_spawn_command_line_sync monoeg_g_spawn_command_line_sync
+#define g_sprintf monoeg_g_sprintf
+#define g_stpcpy monoeg_g_stpcpy
+#define g_str_equal monoeg_g_str_equal
+#define g_str_has_prefix monoeg_g_str_has_prefix
+#define g_str_has_suffix monoeg_g_str_has_suffix
+#define g_str_hash monoeg_g_str_hash
+#define g_strchomp monoeg_g_strchomp
+#define g_strchug monoeg_g_strchug
+#define g_strconcat monoeg_g_strconcat
+#define g_strdelimit monoeg_g_strdelimit
+#define g_strdown monoeg_g_strdown
+#define g_strdup_printf monoeg_g_strdup_printf
+#define g_strdup_vprintf monoeg_g_strdup_vprintf
+#define g_strerror monoeg_g_strerror
+#define g_strescape monoeg_g_strescape
+#define g_strfreev monoeg_g_strfreev
+#define g_strdupv monoeg_g_strdupv
+#define g_string_append monoeg_g_string_append
+#define g_string_append_c monoeg_g_string_append_c
+#define g_string_append_len monoeg_g_string_append_len
+#define g_string_append_unichar monoeg_g_string_append_unichar
+#define g_string_append_printf monoeg_g_string_append_printf
+#define g_string_append_vprintf monoeg_g_string_append_vprintf
+#define g_string_erase monoeg_g_string_erase
+#define g_string_free monoeg_g_string_free
+#define g_string_insert monoeg_g_string_insert
+#define g_string_new monoeg_g_string_new
+#define g_string_new_len monoeg_g_string_new_len
+#define g_string_prepend monoeg_g_string_prepend
+#define g_string_printf monoeg_g_string_printf
+#define g_string_set_size monoeg_g_string_set_size
+#define g_string_sized_new monoeg_g_string_sized_new
+#define g_string_truncate monoeg_g_string_truncate
+#define g_strjoin monoeg_g_strjoin
+#define g_strjoinv monoeg_g_strjoinv
+#define g_strlcpy monoeg_g_strlcpy
+#define g_strndup monoeg_g_strndup
+#define g_strnfill monoeg_g_strnfill
+#define g_strreverse monoeg_g_strreverse
+#define g_strsplit monoeg_g_strsplit
+#define g_strsplit_set monoeg_g_strsplit_set
+#define g_strv_length monoeg_g_strv_length
+#define g_timer_destroy monoeg_g_timer_destroy
+#define g_timer_elapsed monoeg_g_timer_elapsed
+#define g_timer_new monoeg_g_timer_new
+#define g_timer_start monoeg_g_timer_start
+#define g_timer_stop monoeg_g_timer_stop
+#define g_trailingBytesForUTF8 monoeg_g_trailingBytesForUTF8
+#define g_ucs4_to_utf8 monoeg_g_ucs4_to_utf8
+#define g_ucs4_to_utf16 monoeg_g_ucs4_to_utf16
+#define g_unichar_case monoeg_g_unichar_case
+#define g_unichar_isxdigit monoeg_g_unichar_isxdigit
+#define g_unichar_tolower monoeg_g_unichar_tolower
+#define g_unichar_totitle monoeg_g_unichar_totitle
+#define g_unichar_toupper monoeg_g_unichar_toupper
+#define g_unichar_type monoeg_g_unichar_type
+#define g_unichar_xdigit_value monoeg_g_unichar_xdigit_value
+#define g_unsetenv monoeg_g_unsetenv
+#define g_usleep monoeg_g_usleep
+#define g_utf16_to_ucs4 monoeg_g_utf16_to_ucs4
+#define g_utf16_to_utf8 monoeg_g_utf16_to_utf8
+#define g_utf8_get_char monoeg_g_utf8_get_char
+#define g_utf8_offset_to_pointer monoeg_g_utf8_offset_to_pointer
+#define g_utf8_pointer_to_offset monoeg_g_utf8_pointer_to_offset
+#define g_utf8_strdown monoeg_g_utf8_strdown
+#define g_utf8_strlen monoeg_g_utf8_strlen
+#define g_utf8_strup monoeg_g_utf8_strup
+#define g_utf8_to_ucs4_fast monoeg_g_utf8_to_ucs4_fast
+#define g_utf8_to_utf16 monoeg_g_utf8_to_utf16
+#define g_utf8_validate monoeg_g_utf8_validate
+#define g_unichar_to_utf8 monoeg_g_unichar_to_utf8
+#define g_unichar_is_space monoeg_g_unichar_is_space
+#define g_unicode_break_type monoeg_g_unicode_break_type
+#define g_utf8_offset_to_pointer monoeg_g_utf8_offset_to_pointer
+#define g_utf8_pointer_to_offset monoeg_g_utf8_pointer_to_offset
+#define g_utf8_to_ucs4_fast monoeg_g_utf8_to_ucs4_fast
+#define g_vasprintf monoeg_g_vasprintf
+#define g_win32_getlocale monoeg_g_win32_getlocale
+#define g_assertion_message monoeg_assertion_message
+#define g_malloc monoeg_malloc
+#define g_malloc0 monoeg_malloc0
+#define g_ptr_array_grow monoeg_ptr_array_grow
+#define g_realloc monoeg_realloc
+#define g_try_malloc monoeg_try_malloc
+#define g_try_realloc monoeg_try_realloc
+#define g_strdup monoeg_strdup
+#define g_ucs4_to_utf16_len monoeg_ucs4_to_utf16_len
+#define g_utf16_to_ucs4_len monoeg_utf16_to_ucs4_len
+
+#define g_ascii_strcasecmp monoeg_ascii_strcasecmp
+#define g_ascii_strup monoeg_ascii_strup
+#define g_ascii_toupper monoeg_ascii_toupper
+#define g_unichar_break_type monoeg_unichar_break_type
+#define g_unichar_isspace monoeg_unichar_isspace
+#define g_unichar_to_utf16 monoeg_unichar_to_utf16
+#define g_utf8_find_prev_char monoeg_utf8_find_prev_char
+#define g_utf8_get_char_validated monoeg_utf8_get_char_validated
+#define g_utf8_prev_char monoeg_utf8_prev_char
+#define g_utf8_to_ucs4 monoeg_utf8_to_ucs4
+
+
+#define g_log_default_handler monoeg_log_default_handler
+#define g_log_set_default_handler monoeg_log_set_default_handler
+#define g_set_print_handler monoeg_set_print_handler
+#define g_set_printerr_handler monoeg_set_printerr_handler
diff --git a/mono/eglib/garray.c b/mono/eglib/garray.c
new file mode 100644 (file)
index 0000000..b9844f8
--- /dev/null
@@ -0,0 +1,238 @@
+/*
+ * Arrays
+ *
+ * Author:
+ *   Chris Toshok (toshok@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <glib.h>
+
+#define INITIAL_CAPACITY 16
+
+#define element_offset(p,i) ((p)->array.data + (i) * (p)->element_size)
+#define element_length(p,i) ((i) * (p)->element_size)
+
+typedef struct {
+       GArray array;
+       gboolean clear_;
+       guint element_size;
+       gboolean zero_terminated;
+       guint capacity;
+} GArrayPriv;
+
+static void
+ensure_capacity (GArrayPriv *priv, guint capacity)
+{
+       guint new_capacity;
+       
+       if (capacity <= priv->capacity)
+               return;
+       
+       new_capacity = (capacity + 63) & ~63;
+       
+       priv->array.data = g_realloc (priv->array.data, element_length (priv, new_capacity));
+       
+       if (priv->clear_) {
+               memset (element_offset (priv, priv->capacity),
+                       0,
+                       element_length (priv, new_capacity - priv->capacity));
+       }
+       
+       priv->capacity = new_capacity;
+}
+
+GArray *
+g_array_new (gboolean zero_terminated,
+            gboolean clear_,
+            guint element_size)
+{
+       GArrayPriv *rv = g_new0 (GArrayPriv, 1);
+       rv->zero_terminated = zero_terminated;
+       rv->clear_ = clear_;
+       rv->element_size = element_size;
+
+       ensure_capacity (rv, INITIAL_CAPACITY);
+
+       return (GArray*)rv;
+}
+
+GArray *
+g_array_sized_new (gboolean zero_terminated,
+            gboolean clear_,
+            guint element_size,
+                guint reserved_size)
+{
+       GArrayPriv *rv = g_new0 (GArrayPriv, 1);
+       rv->zero_terminated = zero_terminated;
+       rv->clear_ = clear_;
+       rv->element_size = element_size;
+
+       ensure_capacity (rv, reserved_size);
+
+       return (GArray*)rv;
+}
+
+gchar*
+g_array_free (GArray *array,
+             gboolean free_segment)
+{
+       gchar* rv = NULL;
+
+       g_return_val_if_fail (array != NULL, NULL);
+
+       if (free_segment)
+               g_free (array->data);
+       else
+               rv = array->data;
+
+       g_free (array);
+
+       return rv;
+}
+
+GArray *
+g_array_append_vals (GArray *array,
+                    gconstpointer data,
+                    guint len)
+{
+       GArrayPriv *priv = (GArrayPriv*)array;
+
+       g_return_val_if_fail (array != NULL, NULL);
+
+       ensure_capacity (priv, priv->array.len + len + (priv->zero_terminated ? 1 : 0));
+  
+       memmove (element_offset (priv, priv->array.len),
+                data,
+                element_length (priv, len));
+
+       priv->array.len += len;
+
+       if (priv->zero_terminated) {
+               memset (element_offset (priv, priv->array.len),
+                       0,
+                       priv->element_size);
+       }
+
+       return array;
+}
+
+GArray*
+g_array_insert_vals (GArray *array,
+                    guint index_,
+                    gconstpointer data,
+                    guint len)
+{
+       GArrayPriv *priv = (GArrayPriv*)array;
+       guint extra = (priv->zero_terminated ? 1 : 0);
+
+       g_return_val_if_fail (array != NULL, NULL);
+
+       ensure_capacity (priv, array->len + len + extra);
+  
+       /* first move the existing elements out of the way */
+       memmove (element_offset (priv, index_ + len),
+                element_offset (priv, index_),
+                element_length (priv, array->len - index_));
+
+       /* then copy the new elements into the array */
+       memmove (element_offset (priv, index_),
+                data,
+                element_length (priv, len));
+
+       array->len += len;
+
+       if (priv->zero_terminated) {
+               memset (element_offset (priv, priv->array.len),
+                       0,
+                       priv->element_size);
+       }
+
+       return array;
+}
+
+GArray*
+g_array_remove_index (GArray *array,
+                     guint index_)
+{
+       GArrayPriv *priv = (GArrayPriv*)array;
+
+       g_return_val_if_fail (array != NULL, NULL);
+
+       memmove (element_offset (priv, index_),
+                element_offset (priv, index_ + 1),
+                element_length (priv, array->len - index_));
+
+       array->len --;
+
+       if (priv->zero_terminated) {
+               memset (element_offset (priv, priv->array.len),
+                       0,
+                       priv->element_size);
+       }
+
+       return array;
+}
+
+GArray*
+g_array_remove_index_fast (GArray *array,
+                     guint index_)
+{
+       GArrayPriv *priv = (GArrayPriv*)array;
+
+       g_return_val_if_fail (array != NULL, NULL);
+
+       memmove (element_offset (priv, index_),
+                element_offset (priv, array->len - 1),
+                element_length (priv, 1));
+
+       array->len --;
+
+       if (priv->zero_terminated) {
+               memset (element_offset (priv, priv->array.len),
+                       0,
+                       priv->element_size);
+       }
+
+       return array;
+}
+
+void
+g_array_set_size (GArray *array, gint length)
+{
+       GArrayPriv *priv = (GArrayPriv*)array;
+
+       g_return_if_fail (array != NULL);
+       g_return_if_fail (length >= 0);
+
+       if (length == priv->capacity)
+               return; // nothing to be done
+
+       if (length > priv->capacity) {
+               // grow the array
+               ensure_capacity (priv, length);
+       }
+
+       array->len = length;
+}
diff --git a/mono/eglib/gbytearray.c b/mono/eglib/gbytearray.c
new file mode 100644 (file)
index 0000000..f8231b4
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Arrays
+ *
+ * Author:
+ *   Geoff Norton  (gnorton@novell.com)
+ *
+ * (C) 2010 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <glib.h>
+
+GByteArray *
+g_byte_array_new ()
+{
+       return (GByteArray *) g_array_new (FALSE, TRUE, 1);
+}
+
+guint8*
+g_byte_array_free (GByteArray *array,
+             gboolean free_segment)
+{
+       return (guint8*) g_array_free ((GArray *)array, free_segment);
+}
+
+GByteArray *
+g_byte_array_append (GByteArray *array,
+                    const guint8 *data,
+                    guint len)
+{
+       return (GByteArray *)g_array_append_vals ((GArray *)array, data, len);
+}
+
+void
+g_byte_array_set_size (GByteArray *array, gint length)
+{
+       g_array_set_size ((GArray *)array, length);
+}
+
diff --git a/mono/eglib/gdate-unix.c b/mono/eglib/gdate-unix.c
new file mode 100644 (file)
index 0000000..5573e0d
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * gdate-unix.c: Date and time utility functions.
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdio.h>
+#include <glib.h>
+#include <time.h>
+#include <errno.h>
+#include <sys/time.h>
+
+void
+g_get_current_time (GTimeVal *result)
+{
+       struct timeval tv;
+
+       g_return_if_fail (result != NULL);
+       gettimeofday (&tv, NULL);
+       result->tv_sec = tv.tv_sec;
+       result->tv_usec = tv.tv_usec;
+}
+
+void
+g_usleep (gulong microseconds)
+{
+       struct timespec req, rem;
+
+       req.tv_sec = microseconds / 1000000;
+       req.tv_nsec = (microseconds % 1000000) * 1000;
+       
+       while (nanosleep (&req, &rem) == -1 && errno == EINTR)
+               req = rem;
+}
diff --git a/mono/eglib/gdate-win32.c b/mono/eglib/gdate-win32.c
new file mode 100644 (file)
index 0000000..b00e9b7
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * gdate-win32.c: Date and time utility functions.
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdio.h>
+#include <glib.h>
+
+#include <winsock2.h>
+
+void
+g_get_current_time (GTimeVal *result)
+{
+       long int l;
+
+       g_return_if_fail (result != NULL);
+       l = GetTickCount();
+
+       result->tv_sec = l / 1000;
+       result->tv_usec = (l % 1000) * 1000;
+}
+
+void
+g_usleep (gulong microseconds)
+{
+       Sleep (microseconds/1000);
+}
diff --git a/mono/eglib/gdir-unix.c b/mono/eglib/gdir-unix.c
new file mode 100644 (file)
index 0000000..abca22f
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Directory utility functions.
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <dirent.h>
+
+struct _GDir {
+       DIR *dir;
+#ifndef HAVE_REWINDDIR
+       char *path;
+#endif
+};
+
+GDir *
+g_dir_open (const gchar *path, guint flags, GError **error)
+{
+       GDir *dir;
+
+       g_return_val_if_fail (path != NULL, NULL);
+       g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+       (void) flags; /* this is not used */
+       dir = g_new (GDir, 1);
+       dir->dir = opendir (path);
+       if (dir->dir == NULL) {
+               if (error) {
+                       gint err = errno;
+                       *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
+               }
+               g_free (dir);
+               return NULL;
+       }
+#ifndef HAVE_REWINDDIR
+       dir->path = g_strdup (path);
+#endif
+       return dir;
+}
+
+const gchar *
+g_dir_read_name (GDir *dir)
+{
+       struct dirent *entry;
+
+       g_return_val_if_fail (dir != NULL && dir->dir != NULL, NULL);
+       do {
+               entry = readdir (dir->dir);
+               if (entry == NULL)
+                       return NULL;
+       } while ((strcmp (entry->d_name, ".") == 0) || (strcmp (entry->d_name, "..") == 0));
+
+       return entry->d_name;
+}
+
+void
+g_dir_rewind (GDir *dir)
+{
+       g_return_if_fail (dir != NULL && dir->dir != NULL);
+#ifndef HAVE_REWINDDIR
+       closedir (dir->dir);
+       dir->dir = opendir (dir->path);
+#else
+       rewinddir (dir->dir);
+#endif
+}
+
+void
+g_dir_close (GDir *dir)
+{
+       g_return_if_fail (dir != NULL && dir->dir != 0);
+       closedir (dir->dir);
+#ifndef HAVE_REWINDDIR
+       g_free (dir->path);
+#endif
+       dir->dir = NULL;
+       g_free (dir);
+}
+
+int
+g_mkdir_with_parents (const gchar *pathname, int mode)
+{
+       char *path, *d;
+       int rv;
+       
+       if (!pathname || *pathname == '\0') {
+               errno = EINVAL;
+               return -1;
+       }
+       
+       d = path = g_strdup (pathname);
+       if (*d == '/')
+               d++;
+       
+       while (TRUE) {
+               if (*d == '/' || *d == '\0') {
+                 char orig = *d;
+                 *d = '\0';
+                 rv = mkdir (path, mode);
+                 if (rv == -1 && errno != EEXIST) {
+                       g_free (path);
+                       return -1;
+                 }
+
+                 *d++ = orig;
+                 while (orig == '/' && *d == '/')
+                       d++;
+                 if (orig == '\0')
+                       break;
+               } else {
+                       d++;
+               }
+       }
+       
+       g_free (path);
+       
+       return 0;
+}
diff --git a/mono/eglib/gdir-win32.c b/mono/eglib/gdir-win32.c
new file mode 100644 (file)
index 0000000..0ae3fd4
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Directory utility functions.
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <io.h>
+
+#include <winsock2.h>
+
+struct _GDir {
+       HANDLE handle;
+       gchar* current;
+       gchar* next;
+};
+
+GDir *
+g_dir_open (const gchar *path, guint flags, GError **error)
+{
+       GDir *dir;
+       gunichar2* path_utf16;
+       gunichar2* path_utf16_search;
+       WIN32_FIND_DATAW find_data;
+
+       g_return_val_if_fail (path != NULL, NULL);
+       g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+       dir = g_new0 (GDir, 1);
+       path_utf16 = u8to16 (path);
+       path_utf16_search = g_malloc ((wcslen((wchar_t *) path_utf16) + 3)*sizeof(gunichar2));
+       wcscpy (path_utf16_search, path_utf16);
+       wcscat (path_utf16_search, L"\\*");
+
+       dir->handle = FindFirstFileW (path_utf16_search, &find_data);
+       if (dir->handle == INVALID_HANDLE_VALUE) {
+               if (error) {
+                       gint err = errno;
+                       *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
+               }
+               g_free (path_utf16_search);
+               g_free (path_utf16);
+               g_free (dir);
+               return NULL;
+       }
+       g_free (path_utf16_search);
+       g_free (path_utf16);
+
+       while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0)) {
+               if (!FindNextFileW (dir->handle, &find_data)) {
+                       if (error) {
+                               gint err = errno;
+                               *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
+                       }
+                       g_free (dir);
+                       return NULL;
+               }
+       }
+
+       dir->current = NULL;
+       dir->next = u16to8 (find_data.cFileName);
+       return dir;
+}
+
+const gchar *
+g_dir_read_name (GDir *dir)
+{
+       WIN32_FIND_DATAW find_data;
+
+       g_return_val_if_fail (dir != NULL && dir->handle != 0, NULL);
+
+       if (dir->current)
+               g_free (dir->current);
+       dir->current = NULL;
+
+       dir->current = dir->next;
+
+       if (!dir->current)
+               return NULL;
+
+       dir->next = NULL;
+
+       do {
+               if (!FindNextFileW (dir->handle, &find_data)) {
+                       dir->next = NULL;
+                       return dir->current;
+               }
+       } while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0));
+
+       dir->next = u16to8 (find_data.cFileName);
+       return dir->current;
+}
+
+void
+g_dir_rewind (GDir *dir)
+{
+}
+
+void
+g_dir_close (GDir *dir)
+{
+       g_return_if_fail (dir != NULL && dir->handle != 0);
+       
+       if (dir->current)
+               g_free (dir->current);
+       dir->current = NULL;
+       if (dir->next)
+               g_free (dir->next);
+       dir->next = NULL;
+       FindClose (dir->handle);
+       dir->handle = 0;
+       g_free (dir);
+}
+
+
diff --git a/mono/eglib/gerror.c b/mono/eglib/gerror.c
new file mode 100644 (file)
index 0000000..43fef97
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * gerror.c: Error support.
+ *
+ * Author:
+ *   Miguel de Icaza (miguel@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <config.h>
+#include <glib.h>
+GError *
+g_error_new (gpointer domain, gint code, const char *format, ...)
+{
+       va_list args;
+       GError *err = g_new (GError, 1);
+       
+       err->domain = domain;
+       err->code = code;
+
+       va_start (args, format);
+       if (g_vasprintf (&err->message, format, args) == -1)
+               err->message = g_strdup_printf ("internal: invalid format string %s", format); 
+       va_end (args);
+
+       return err;
+}
+
+static GError *
+g_error_vnew (gpointer domain, gint code, const char *format, va_list ap)
+{
+       GError *err = g_new (GError, 1);
+       
+       err->domain = domain;
+       err->code = code;
+
+       if (g_vasprintf (&err->message, format, ap) == -1)
+               err->message = g_strdup_printf ("internal: invalid format string %s", format); 
+
+       return err;
+}
+
+void
+g_clear_error (GError **error)
+{
+       if (error && *error) {
+               g_error_free (*error);
+               *error = NULL;
+       }
+}
+
+void
+g_error_free (GError *error)
+{
+       g_return_if_fail (error != NULL);
+       
+       g_free (error->message);
+       g_free (error);
+}
+
+void
+g_set_error (GError **err, gpointer domain, gint code, const gchar *format, ...)
+{
+       va_list args;
+
+       if (err) {
+               va_start (args, format);
+               *err = g_error_vnew (domain, code, format, args);
+               va_end (args);
+       }
+}
+
+void
+g_propagate_error (GError **dest, GError *src)
+{
+       if (dest == NULL){
+               if (src)
+                       g_error_free (src);
+       } else {
+               *dest = src;
+       }
+}
diff --git a/mono/eglib/gfile-posix.c b/mono/eglib/gfile-posix.c
new file mode 100644 (file)
index 0000000..48a9192
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * File utility functions.
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <config.h>
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <fcntl.h>
+#include <errno.h>
+
+#ifdef _MSC_VER
+#include <direct.h>
+#endif
+#ifdef G_OS_WIN32
+int mkstemp (char *tmp_template);
+#endif
+
+#ifndef O_LARGEFILE
+#define OPEN_FLAGS (O_RDONLY)
+#else
+#define OPEN_FLAGS (O_RDONLY | O_LARGEFILE)
+#endif
+gboolean
+g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error)
+{
+       gchar *str;
+       int fd;
+       struct stat st;
+       long offset;
+       int nread;
+
+       g_return_val_if_fail (filename != NULL, FALSE);
+       g_return_val_if_fail (contents != NULL, FALSE);
+       g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+       *contents = NULL;
+       if (length)
+               *length = 0;
+
+       fd = open (filename, OPEN_FLAGS);
+       if (fd == -1) {
+               if (error != NULL) {
+                       int err = errno;
+                       *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error opening file");
+               }
+               return FALSE;
+       }
+
+       if (fstat (fd, &st) != 0) {
+               if (error != NULL) {
+                       int err = errno;
+                       *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in fstat()");
+               }
+               close (fd);
+               return FALSE;
+       }
+
+       str = g_malloc (st.st_size + 1);
+       offset = 0;
+       do {
+               nread = read (fd, str + offset, st.st_size - offset);
+               if (nread > 0) {
+                       offset += nread;
+               }
+       } while ((nread > 0 && offset < st.st_size) || (nread == -1 && errno == EINTR));
+
+       close (fd);
+       str [st.st_size] = '\0';
+       if (length) {
+               *length = st.st_size;
+       }
+       *contents = str;
+       return TRUE;
+}
+
+gint
+g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
+{
+       const static gchar *default_tmpl = ".XXXXXX";
+       gchar *t;
+       gint fd;
+       size_t len;
+
+       g_return_val_if_fail (error == NULL || *error == NULL, -1);
+
+       if (tmpl == NULL)
+               tmpl = default_tmpl;
+
+       if (strchr (tmpl, G_DIR_SEPARATOR) != NULL) {
+               if (error) {
+                       *error = g_error_new (G_LOG_DOMAIN, 24, "Template should not have any " G_DIR_SEPARATOR_S);
+               }
+               return -1;
+       }
+
+       len = strlen (tmpl);
+       if (len < 6 || strcmp (tmpl + len - 6, "XXXXXX")) {
+               if (error) {
+                       *error = g_error_new (G_LOG_DOMAIN, 24, "Template should end with XXXXXX");
+               }
+               return -1;
+       }
+
+       t = g_build_filename (g_get_tmp_dir (), tmpl, NULL);
+
+       fd = mkstemp (t);
+
+       if (fd == -1) {
+               if (error) {
+                       int err = errno;
+                       *error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in mkstemp()");
+               }
+               g_free (t);
+               return -1;
+       }
+
+       if (name_used) {
+               *name_used = t;
+       } else {
+               g_free (t);
+       }
+       return fd;
+}
+
+gchar *
+g_get_current_dir (void)
+{
+       int s = 32;
+       char *buffer = NULL, *r;
+       gboolean fail;
+       
+       do {
+               buffer = g_realloc (buffer, s);
+               r = getcwd (buffer, s);
+               fail = (r == NULL && errno == ERANGE);
+               if (fail) {
+                       s <<= 1;
+               }
+       } while (fail);
+
+       /* On amd64 sometimes the bottom 32-bits of r == the bottom 32-bits of buffer
+        * but the top 32-bits of r have overflown to 0xffffffff (seriously wtf getcwd
+        * so we return the buffer here since it has a pointer to the valid string
+        */
+       return buffer;
+}
diff --git a/mono/eglib/gfile-unix.c b/mono/eglib/gfile-unix.c
new file mode 100644 (file)
index 0000000..ab1fbb4
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * File utility functions.
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <config.h>
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+gboolean
+g_file_test (const gchar *filename, GFileTest test)
+{
+       struct stat st;
+       gboolean have_stat;
+
+       if (filename == NULL || test == 0)
+               return FALSE;
+
+       have_stat = FALSE;
+
+       if ((test & G_FILE_TEST_EXISTS) != 0) {
+               if (access (filename, F_OK) == 0)
+                       return TRUE;
+       }
+
+       if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
+               if (access (filename, X_OK) == 0)
+                       return TRUE;
+       }
+       if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
+               have_stat = (lstat (filename, &st) == 0);
+               if (have_stat && S_ISLNK (st.st_mode))
+                       return TRUE;
+       }
+
+       if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
+               if (!have_stat)
+                       have_stat = (stat (filename, &st) == 0);
+               if (have_stat && S_ISREG (st.st_mode))
+                       return TRUE;
+       }
+       if ((test & G_FILE_TEST_IS_DIR) != 0) {
+               if (!have_stat)
+                       have_stat = (stat (filename, &st) == 0);
+               if (have_stat && S_ISDIR (st.st_mode))
+                       return TRUE;
+       }
+       return FALSE;
+}
+
+gchar *
+g_mkdtemp (char *tmp_template)
+{
+#ifdef HAVE_MKDTEMP
+       char *template_copy = g_strdup (tmp_template);
+
+       return mkdtemp (template_copy);
+#else
+       g_error("Function not supported");
+#endif
+}
diff --git a/mono/eglib/gfile-win32.c b/mono/eglib/gfile-win32.c
new file mode 100644 (file)
index 0000000..61e23cb
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * File utility functions.
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <config.h>
+#include <windows.h>
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <direct.h>
+
+#ifdef G_OS_WIN32
+#include <io.h>
+#define open _open
+#ifndef S_ISREG
+#define S_ISREG(x) ((x &  _S_IFMT) == _S_IFREG)
+#endif
+#ifndef S_ISDIR
+#define S_ISDIR(x) ((x &  _S_IFMT) == _S_IFDIR)
+#endif
+#endif
+
+int mkstemp (char *tmp_template)
+{
+       int fd;
+       gunichar2* utf16_template;
+
+       utf16_template  = u8to16 (tmp_template);
+
+       fd = -1;
+       utf16_template = _wmktemp( utf16_template);
+       if (utf16_template && *utf16_template) {
+               /* FIXME: _O_TEMPORARY causes file to disappear on close causing a test to fail */
+               fd = _wopen( utf16_template, _O_BINARY | _O_CREAT /*| _O_TEMPORARY*/ | _O_RDWR | _O_EXCL, _S_IREAD | _S_IWRITE);
+       }
+
+       /* FIXME: this will crash if utf16_template == NULL */
+       sprintf (tmp_template + strlen (tmp_template) - 6, "%S", utf16_template + wcslen (utf16_template) - 6);
+
+       g_free (utf16_template);
+       return fd;
+}
+
+gchar *
+g_mkdtemp (char *tmp_template)
+{
+       gunichar2* utf16_template;
+
+       utf16_template  = u8to16 (tmp_template);
+
+       utf16_template = _wmktemp(utf16_template);
+       if (utf16_template && *utf16_template) {
+               if (_wmkdir (utf16_template) == 0){
+                       char *ret = u16to8 (utf16_template);
+                       g_free (utf16_template);
+                       return ret;
+               }
+       }
+
+       g_free (utf16_template);
+       return NULL;
+}
+            
+#ifdef _MSC_VER
+#pragma warning(disable:4701)
+#endif
+
+gboolean
+g_file_test (const gchar *filename, GFileTest test)
+{
+       gunichar2* utf16_filename = NULL;
+       DWORD attr;
+       
+       if (filename == NULL || test == 0)
+               return FALSE;
+
+       utf16_filename = u8to16 (filename);
+       attr = GetFileAttributesW (utf16_filename);
+       g_free (utf16_filename);
+       
+       if (attr == INVALID_FILE_ATTRIBUTES)
+               return FALSE;
+
+       if ((test & G_FILE_TEST_EXISTS) != 0) {
+               return TRUE;
+       }
+
+       if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
+               size_t len = strlen (filename);
+               if (len > 4 && strcmp (filename + len-3, "exe"))
+                   return TRUE;
+                   
+               return FALSE;
+       }
+
+       if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
+               if (attr & (FILE_ATTRIBUTE_DEVICE|FILE_ATTRIBUTE_DIRECTORY))
+                       return FALSE;
+               return TRUE;
+       }
+
+       if ((test & G_FILE_TEST_IS_DIR) != 0) {
+               if (attr & FILE_ATTRIBUTE_DIRECTORY)
+                       return TRUE;
+       }
+
+       /* make this last in case it is OR'd with something else */
+       if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
+               return FALSE;
+       }
+
+       return FALSE;
+}
diff --git a/mono/eglib/gfile.c b/mono/eglib/gfile.c
new file mode 100644 (file)
index 0000000..01cfa25
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * File utility functions.
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <config.h>
+
+#include <glib.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <errno.h>
+
+static gpointer error_quark = "FileError";
+
+gpointer
+g_file_error_quark (void)
+{
+       return error_quark;
+}
+
+GFileError
+g_file_error_from_errno (gint err_no)
+{
+       switch (err_no) {
+       case EEXIST:
+               return G_FILE_ERROR_EXIST;
+       case EISDIR:
+               return G_FILE_ERROR_ISDIR;
+       case EACCES:
+               return G_FILE_ERROR_ACCES;
+       case ENAMETOOLONG:
+               return G_FILE_ERROR_NAMETOOLONG;
+       case ENOENT:
+               return G_FILE_ERROR_NOENT;
+       case ENOTDIR:
+               return G_FILE_ERROR_NOTDIR;
+       case ENXIO:
+               return G_FILE_ERROR_NXIO;
+       case ENODEV:
+               return G_FILE_ERROR_NODEV;
+       case EROFS:
+               return G_FILE_ERROR_ROFS;
+#ifdef ETXTBSY
+       case ETXTBSY:
+               return G_FILE_ERROR_TXTBSY;
+#endif
+       case EFAULT:
+               return G_FILE_ERROR_FAULT;
+#ifdef ELOOP
+       case ELOOP:
+               return G_FILE_ERROR_LOOP;
+#endif
+       case ENOSPC:
+               return G_FILE_ERROR_NOSPC;
+       case ENOMEM:
+               return G_FILE_ERROR_NOMEM;
+       case EMFILE:
+               return G_FILE_ERROR_MFILE;
+       case ENFILE:
+               return G_FILE_ERROR_NFILE;
+       case EBADF:
+               return G_FILE_ERROR_BADF;
+       case EINVAL:
+               return G_FILE_ERROR_INVAL;
+       case EPIPE:
+               return G_FILE_ERROR_PIPE;
+       case EAGAIN:
+               return G_FILE_ERROR_AGAIN;
+       case EINTR:
+               return G_FILE_ERROR_INTR;
+       case EIO:
+               return G_FILE_ERROR_IO;
+       case EPERM:
+               return G_FILE_ERROR_PERM;
+       case ENOSYS:
+               return G_FILE_ERROR_NOSYS;
+       default:
+               return G_FILE_ERROR_FAILED;
+       }
+}
+
+#ifdef G_OS_WIN32
+#define TMP_FILE_FORMAT "%.*s%s.tmp"
+#else
+#define TMP_FILE_FORMAT "%.*s.%s~"
+#endif
+
+gboolean
+g_file_set_contents (const gchar *filename, const gchar *contents, gssize length, GError **err)
+{
+       const char *name;
+       char *path;
+       FILE *fp;
+       
+       if (!(name = strrchr (filename, G_DIR_SEPARATOR)))
+               name = filename;
+       else
+               name++;
+       
+       path = g_strdup_printf (TMP_FILE_FORMAT, name - filename, filename, name);
+       if (!(fp = fopen (path, "wb"))) {
+               g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (errno), "%s", g_strerror (errno));
+               g_free (path);
+               return FALSE;
+       }
+       
+       if (length < 0)
+               length = strlen (contents);
+       
+       if (fwrite (contents, 1, length, fp) < length) {
+               g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (ferror (fp)), "%s", g_strerror (ferror (fp)));
+               g_unlink (path);
+               g_free (path);
+               fclose (fp);
+               
+               return FALSE;
+       }
+       
+       fclose (fp);
+       
+       if (g_rename (path, filename) != 0) {
+               g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (errno), "%s", g_strerror (errno));
+               g_unlink (path);
+               g_free (path);
+               return FALSE;
+       }
+       
+       g_free (path);
+       
+       return TRUE;
+}
diff --git a/mono/eglib/ghashtable.c b/mono/eglib/ghashtable.c
new file mode 100644 (file)
index 0000000..5fac0eb
--- /dev/null
@@ -0,0 +1,671 @@
+/*
+ * ghashtable.c: Hashtable implementation
+ *
+ * Author:
+ *   Miguel de Icaza (miguel@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdio.h>
+#include <math.h>
+#include <glib.h>
+
+typedef struct _Slot Slot;
+
+struct _Slot {
+       gpointer key;
+       gpointer value;
+       Slot    *next;
+};
+
+static gpointer KEYMARKER_REMOVED = &KEYMARKER_REMOVED;
+
+struct _GHashTable {
+       GHashFunc      hash_func;
+       GEqualFunc     key_equal_func;
+
+       Slot **table;
+       int   table_size;
+       int   in_use;
+       int   threshold;
+       int   last_rehash;
+       GDestroyNotify value_destroy_func, key_destroy_func;
+};
+
+typedef struct {
+       GHashTable *ht;
+       int slot_index;
+       Slot *slot;
+} Iter;
+
+static const guint prime_tbl[] = {
+       11, 19, 37, 73, 109, 163, 251, 367, 557, 823, 1237,
+       1861, 2777, 4177, 6247, 9371, 14057, 21089, 31627,
+       47431, 71143, 106721, 160073, 240101, 360163,
+       540217, 810343, 1215497, 1823231, 2734867, 4102283,
+       6153409, 9230113, 13845163
+};
+
+static gboolean
+test_prime (int x)
+{
+       if ((x & 1) != 0) {
+               int n;
+               for (n = 3; n< (int)sqrt (x); n += 2) {
+                       if ((x % n) == 0)
+                               return FALSE;
+               }
+               return TRUE;
+       }
+       // There is only one even prime - 2.
+       return (x == 2);
+}
+
+static int
+calc_prime (int x)
+{
+       int i;
+       
+       for (i = (x & (~1))-1; i< G_MAXINT32; i += 2) {
+               if (test_prime (i))
+                       return i;
+       }
+       return x;
+}
+
+guint
+g_spaced_primes_closest (guint x)
+{
+       int i;
+       
+       for (i = 0; i < G_N_ELEMENTS (prime_tbl); i++) {
+               if (x <= prime_tbl [i])
+                       return prime_tbl [i];
+       }
+       return calc_prime (x);
+}
+
+GHashTable *
+g_hash_table_new (GHashFunc hash_func, GEqualFunc key_equal_func)
+{
+       GHashTable *hash;
+
+       if (hash_func == NULL)
+               hash_func = g_direct_hash;
+       if (key_equal_func == NULL)
+               key_equal_func = g_direct_equal;
+       hash = g_new0 (GHashTable, 1);
+
+       hash->hash_func = hash_func;
+       hash->key_equal_func = key_equal_func;
+
+       hash->table_size = g_spaced_primes_closest (1);
+       hash->table = g_new0 (Slot *, hash->table_size);
+       hash->last_rehash = hash->table_size;
+       
+       return hash;
+}
+
+GHashTable *
+g_hash_table_new_full (GHashFunc hash_func, GEqualFunc key_equal_func,
+                      GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
+{
+       GHashTable *hash = g_hash_table_new (hash_func, key_equal_func);
+       if (hash == NULL)
+               return NULL;
+       
+       hash->key_destroy_func = key_destroy_func;
+       hash->value_destroy_func = value_destroy_func;
+       
+       return hash;
+}
+
+#if 0
+static void
+dump_hash_table (GHashTable *hash)
+{
+       int i;
+
+       for (i = 0; i < hash->table_size; i++) {
+               Slot *s;
+
+               for (s = hash->table [i]; s != NULL; s = s->next){
+                       guint hashcode = (*hash->hash_func) (s->key);
+                       guint slot = (hashcode) % hash->table_size;
+                       printf ("key %p hash %x on slot %d correct slot %d tb size %d\n", s->key, hashcode, i, slot, hash->table_size);
+               }
+       }
+}
+#endif
+
+#ifdef SANITY_CHECK
+static void
+sanity_check (GHashTable *hash)
+{
+       int i;
+
+       for (i = 0; i < hash->table_size; i++) {
+               Slot *s;
+
+               for (s = hash->table [i]; s != NULL; s = s->next){
+                       guint hashcode = (*hash->hash_func) (s->key);
+                       guint slot = (hashcode) % hash->table_size;
+                       if (slot != i) {
+                               dump_hashcode_func = 1;
+                               hashcode = (*hash->hash_func) (s->key);
+                               dump_hashcode_func = 0;
+                               g_error ("Key %p (bucket %d) on invalid bucket %d (hashcode %x) (tb size %d)", s->key, slot, i, hashcode, hash->table_size);
+                       }
+               }
+       }
+}
+#else
+
+#define sanity_check(HASH) do {}while(0)
+
+#endif
+
+static void
+do_rehash (GHashTable *hash)
+{
+       int current_size, i;
+       Slot **table;
+
+       /* printf ("Resizing diff=%d slots=%d\n", hash->in_use - hash->last_rehash, hash->table_size); */
+       hash->last_rehash = hash->table_size;
+       current_size = hash->table_size;
+       hash->table_size = g_spaced_primes_closest (hash->in_use);
+       /* printf ("New size: %d\n", hash->table_size); */
+       table = hash->table;
+       hash->table = g_new0 (Slot *, hash->table_size);
+       
+       for (i = 0; i < current_size; i++){
+               Slot *s, *next;
+
+               for (s = table [i]; s != NULL; s = next){
+                       guint hashcode = ((*hash->hash_func) (s->key)) % hash->table_size;
+                       next = s->next;
+
+                       s->next = hash->table [hashcode];
+                       hash->table [hashcode] = s;
+               }
+       }
+       g_free (table);
+}
+
+static void
+rehash (GHashTable *hash)
+{
+       int diff = ABS (hash->last_rehash - hash->in_use);
+
+       /* These are the factors to play with to change the rehashing strategy */
+       /* I played with them with a large range, and could not really get */
+       /* something that was too good, maybe the tests are not that great */
+       if (!(diff * 0.75 > hash->table_size * 2))
+               return;
+       do_rehash (hash);
+       sanity_check (hash);
+}
+
+void
+g_hash_table_insert_replace (GHashTable *hash, gpointer key, gpointer value, gboolean replace)
+{
+       guint hashcode;
+       Slot *s;
+       GEqualFunc equal;
+       
+       g_return_if_fail (hash != NULL);
+       sanity_check (hash);
+
+       equal = hash->key_equal_func;
+       if (hash->in_use >= hash->threshold)
+               rehash (hash);
+
+       hashcode = ((*hash->hash_func) (key)) % hash->table_size;
+       for (s = hash->table [hashcode]; s != NULL; s = s->next){
+               if ((*equal) (s->key, key)){
+                       if (replace){
+                               if (hash->key_destroy_func != NULL)
+                                       (*hash->key_destroy_func)(s->key);
+                               s->key = key;
+                       }
+                       if (hash->value_destroy_func != NULL)
+                               (*hash->value_destroy_func) (s->value);
+                       s->value = value;
+                       sanity_check (hash);
+                       return;
+               }
+       }
+       s = g_new (Slot, 1);
+       s->key = key;
+       s->value = value;
+       s->next = hash->table [hashcode];
+       hash->table [hashcode] = s;
+       hash->in_use++;
+       sanity_check (hash);
+}
+
+GList*
+g_hash_table_get_keys (GHashTable *hash)
+{
+       GHashTableIter iter;
+       GList *rv = NULL;
+       gpointer key;
+
+       g_hash_table_iter_init (&iter, hash);
+
+       while (g_hash_table_iter_next (&iter, &key, NULL))
+               rv = g_list_prepend (rv, key);
+
+       return g_list_reverse (rv);
+}
+
+GList*
+g_hash_table_get_values (GHashTable *hash)
+{
+       GHashTableIter iter;
+       GList *rv = NULL;
+       gpointer value;
+
+       g_hash_table_iter_init (&iter, hash);
+
+       while (g_hash_table_iter_next (&iter, NULL, &value))
+               rv = g_list_prepend (rv, value);
+
+       return g_list_reverse (rv);
+}
+
+
+guint
+g_hash_table_size (GHashTable *hash)
+{
+       g_return_val_if_fail (hash != NULL, 0);
+       
+       return hash->in_use;
+}
+
+gpointer
+g_hash_table_lookup (GHashTable *hash, gconstpointer key)
+{
+       gpointer orig_key, value;
+       
+       if (g_hash_table_lookup_extended (hash, key, &orig_key, &value))
+               return value;
+       else
+               return NULL;
+}
+
+gboolean
+g_hash_table_lookup_extended (GHashTable *hash, gconstpointer key, gpointer *orig_key, gpointer *value)
+{
+       GEqualFunc equal;
+       Slot *s;
+       guint hashcode;
+       
+       g_return_val_if_fail (hash != NULL, FALSE);
+       sanity_check (hash);
+       equal = hash->key_equal_func;
+
+       hashcode = ((*hash->hash_func) (key)) % hash->table_size;
+       
+       for (s = hash->table [hashcode]; s != NULL; s = s->next){
+               if ((*equal)(s->key, key)){
+                       if (orig_key)
+                               *orig_key = s->key;
+                       if (value)
+                               *value = s->value;
+                       return TRUE;
+               }
+       }
+       return FALSE;
+}
+
+void
+g_hash_table_foreach (GHashTable *hash, GHFunc func, gpointer user_data)
+{
+       int i;
+       
+       g_return_if_fail (hash != NULL);
+       g_return_if_fail (func != NULL);
+
+       for (i = 0; i < hash->table_size; i++){
+               Slot *s;
+
+               for (s = hash->table [i]; s != NULL; s = s->next)
+                       (*func)(s->key, s->value, user_data);
+       }
+}
+
+gpointer
+g_hash_table_find (GHashTable *hash, GHRFunc predicate, gpointer user_data)
+{
+       int i;
+       
+       g_return_val_if_fail (hash != NULL, NULL);
+       g_return_val_if_fail (predicate != NULL, NULL);
+
+       for (i = 0; i < hash->table_size; i++){
+               Slot *s;
+
+               for (s = hash->table [i]; s != NULL; s = s->next)
+                       if ((*predicate)(s->key, s->value, user_data))
+                               return s->value;
+       }
+       return NULL;
+}
+
+void
+g_hash_table_remove_all (GHashTable *hash)
+{
+       int i;
+       
+       g_return_if_fail (hash != NULL);
+
+       for (i = 0; i < hash->table_size; i++){
+               Slot *s;
+
+               while (hash->table [i]) {
+                       s = hash->table [i];
+                       g_hash_table_remove (hash, s->key);
+               }
+       }
+}
+
+gboolean
+g_hash_table_remove (GHashTable *hash, gconstpointer key)
+{
+       GEqualFunc equal;
+       Slot *s, *last;
+       guint hashcode;
+       
+       g_return_val_if_fail (hash != NULL, FALSE);
+       sanity_check (hash);
+       equal = hash->key_equal_func;
+
+       hashcode = ((*hash->hash_func)(key)) % hash->table_size;
+       last = NULL;
+       for (s = hash->table [hashcode]; s != NULL; s = s->next){
+               if ((*equal)(s->key, key)){
+                       if (hash->key_destroy_func != NULL)
+                               (*hash->key_destroy_func)(s->key);
+                       if (hash->value_destroy_func != NULL)
+                               (*hash->value_destroy_func)(s->value);
+                       if (last == NULL)
+                               hash->table [hashcode] = s->next;
+                       else
+                               last->next = s->next;
+                       g_free (s);
+                       hash->in_use--;
+                       sanity_check (hash);
+                       return TRUE;
+               }
+               last = s;
+       }
+       sanity_check (hash);
+       return FALSE;
+}
+
+guint
+g_hash_table_foreach_remove (GHashTable *hash, GHRFunc func, gpointer user_data)
+{
+       int i;
+       int count = 0;
+       
+       g_return_val_if_fail (hash != NULL, 0);
+       g_return_val_if_fail (func != NULL, 0);
+
+       sanity_check (hash);
+       for (i = 0; i < hash->table_size; i++){
+               Slot *s, *last;
+
+               last = NULL;
+               for (s = hash->table [i]; s != NULL; ){
+                       if ((*func)(s->key, s->value, user_data)){
+                               Slot *n;
+
+                               if (hash->key_destroy_func != NULL)
+                                       (*hash->key_destroy_func)(s->key);
+                               if (hash->value_destroy_func != NULL)
+                                       (*hash->value_destroy_func)(s->value);
+                               if (last == NULL){
+                                       hash->table [i] = s->next;
+                                       n = s->next;
+                               } else  {
+                                       last->next = s->next;
+                                       n = last->next;
+                               }
+                               g_free (s);
+                               hash->in_use--;
+                               count++;
+                               s = n;
+                       } else {
+                               last = s;
+                               s = s->next;
+                       }
+               }
+       }
+       sanity_check (hash);
+       if (count > 0)
+               rehash (hash);
+       return count;
+}
+
+gboolean
+g_hash_table_steal (GHashTable *hash, gconstpointer key)
+{
+       GEqualFunc equal;
+       Slot *s, *last;
+       guint hashcode;
+       
+       g_return_val_if_fail (hash != NULL, FALSE);
+       sanity_check (hash);
+       equal = hash->key_equal_func;
+       
+       hashcode = ((*hash->hash_func)(key)) % hash->table_size;
+       last = NULL;
+       for (s = hash->table [hashcode]; s != NULL; s = s->next){
+               if ((*equal)(s->key, key)) {
+                       if (last == NULL)
+                               hash->table [hashcode] = s->next;
+                       else
+                               last->next = s->next;
+                       g_free (s);
+                       hash->in_use--;
+                       sanity_check (hash);
+                       return TRUE;
+               }
+               last = s;
+       }
+       sanity_check (hash);
+       return FALSE;
+       
+}
+
+guint
+g_hash_table_foreach_steal (GHashTable *hash, GHRFunc func, gpointer user_data)
+{
+       int i;
+       int count = 0;
+       
+       g_return_val_if_fail (hash != NULL, 0);
+       g_return_val_if_fail (func != NULL, 0);
+
+       sanity_check (hash);
+       for (i = 0; i < hash->table_size; i++){
+               Slot *s, *last;
+
+               last = NULL;
+               for (s = hash->table [i]; s != NULL; ){
+                       if ((*func)(s->key, s->value, user_data)){
+                               Slot *n;
+
+                               if (last == NULL){
+                                       hash->table [i] = s->next;
+                                       n = s->next;
+                               } else  {
+                                       last->next = s->next;
+                                       n = last->next;
+                               }
+                               g_free (s);
+                               hash->in_use--;
+                               count++;
+                               s = n;
+                       } else {
+                               last = s;
+                               s = s->next;
+                       }
+               }
+       }
+       sanity_check (hash);
+       if (count > 0)
+               rehash (hash);
+       return count;
+}
+
+void
+g_hash_table_destroy (GHashTable *hash)
+{
+       int i;
+       
+       g_return_if_fail (hash != NULL);
+
+       for (i = 0; i < hash->table_size; i++){
+               Slot *s, *next;
+
+               for (s = hash->table [i]; s != NULL; s = next){
+                       next = s->next;
+                       
+                       if (hash->key_destroy_func != NULL)
+                               (*hash->key_destroy_func)(s->key);
+                       if (hash->value_destroy_func != NULL)
+                               (*hash->value_destroy_func)(s->value);
+                       g_free (s);
+               }
+       }
+       g_free (hash->table);
+       
+       g_free (hash);
+}
+
+void
+g_hash_table_print_stats (GHashTable *table)
+{
+       int i, max_chain_index, chain_size, max_chain_size;
+       Slot *node;
+
+       max_chain_size = 0;
+       max_chain_index = -1;
+       for (i = 0; i < table->table_size; i++) {
+               chain_size = 0;
+               for (node = table->table [i]; node; node = node->next)
+                       chain_size ++;
+               if (chain_size > max_chain_size) {
+                       max_chain_size = chain_size;
+                       max_chain_index = i;
+               }
+       }
+
+       printf ("Size: %d Table Size: %d Max Chain Length: %d at %d\n", table->in_use, table->table_size, max_chain_size, max_chain_index);
+}
+
+void
+g_hash_table_iter_init (GHashTableIter *it, GHashTable *hash_table)
+{
+       Iter *iter = (Iter*)it;
+
+       memset (iter, 0, sizeof (Iter));
+       iter->ht = hash_table;
+       iter->slot_index = -1;
+}
+
+gboolean g_hash_table_iter_next (GHashTableIter *it, gpointer *key, gpointer *value)
+{
+       Iter *iter = (Iter*)it;
+
+       GHashTable *hash = iter->ht;
+
+       g_assert (iter->slot_index != -2);
+       g_assert (sizeof (Iter) <= sizeof (GHashTableIter));
+
+       if (!iter->slot) {
+               while (TRUE) {
+                       iter->slot_index ++;
+                       if (iter->slot_index >= hash->table_size) {
+                               iter->slot_index = -2;
+                               return FALSE;
+                       }
+                       if (hash->table [iter->slot_index])
+                               break;
+               }
+               iter->slot = hash->table [iter->slot_index];
+       }
+
+       if (key)
+               *key = iter->slot->key;
+       if (value)
+               *value = iter->slot->value;
+       iter->slot = iter->slot->next;
+
+       return TRUE;
+}
+
+gboolean
+g_direct_equal (gconstpointer v1, gconstpointer v2)
+{
+       return v1 == v2;
+}
+
+guint
+g_direct_hash (gconstpointer v1)
+{
+       return GPOINTER_TO_UINT (v1);
+}
+
+gboolean
+g_int_equal (gconstpointer v1, gconstpointer v2)
+{
+       return *(gint *)v1 == *(gint *)v2;
+}
+
+guint
+g_int_hash (gconstpointer v1)
+{
+       return *(guint *)v1;
+}
+
+gboolean
+g_str_equal (gconstpointer v1, gconstpointer v2)
+{
+       return strcmp (v1, v2) == 0;
+}
+
+guint
+g_str_hash (gconstpointer v1)
+{
+       guint hash = 0;
+       char *p = (char *) v1;
+
+       while (*p++)
+               hash = (hash << 5) - (hash + *p);
+
+       return hash;
+}
diff --git a/mono/eglib/giconv.c b/mono/eglib/giconv.c
new file mode 100644 (file)
index 0000000..c7723fe
--- /dev/null
@@ -0,0 +1,1340 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Copyright (C) 2011 Jeffrey Stedfast
+ *
+ *  Permission is hereby granted, free of charge, to any person
+ *  obtaining a copy of this software and associated documentation
+ *  files (the "Software"), to deal in the Software without
+ *  restriction, including without limitation the rights to use, copy,
+ *  modify, merge, publish, distribute, sublicense, and/or sell copies
+ *  of the Software, and to permit persons to whom the Software is
+ *  furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be
+ *  included in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *  DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib.h>
+#include <string.h>
+#ifdef HAVE_ICONV_H
+#include <iconv.h>
+#endif
+#include <errno.h>
+
+#ifdef _MSC_VER
+#define FORCE_INLINE(RET_TYPE) __forceinline RET_TYPE
+#else
+#define FORCE_INLINE(RET_TYPE) inline RET_TYPE __attribute__((always_inline))
+#endif
+
+
+#define UNROLL_DECODE_UTF8 0
+#define UNROLL_ENCODE_UTF8 0
+
+typedef int (* Decoder) (char *inbuf, size_t inleft, gunichar *outchar);
+typedef int (* Encoder) (gunichar c, char *outbuf, size_t outleft);
+
+struct _GIConv {
+       Decoder decode;
+       Encoder encode;
+       gunichar c;
+#ifdef HAVE_ICONV
+       iconv_t cd;
+#endif
+};
+
+static int decode_utf32be (char *inbuf, size_t inleft, gunichar *outchar);
+static int encode_utf32be (gunichar c, char *outbuf, size_t outleft);
+
+static int decode_utf32le (char *inbuf, size_t inleft, gunichar *outchar);
+static int encode_utf32le (gunichar c, char *outbuf, size_t outleft);
+
+static int decode_utf16be (char *inbuf, size_t inleft, gunichar *outchar);
+static int encode_utf16be (gunichar c, char *outbuf, size_t outleft);
+
+static int decode_utf16le (char *inbuf, size_t inleft, gunichar *outchar);
+static int encode_utf16le (gunichar c, char *outbuf, size_t outleft);
+
+static FORCE_INLINE (int) decode_utf8 (char *inbuf, size_t inleft, gunichar *outchar);
+static int encode_utf8 (gunichar c, char *outbuf, size_t outleft);
+
+static int decode_latin1 (char *inbuf, size_t inleft, gunichar *outchar);
+static int encode_latin1 (gunichar c, char *outbuf, size_t outleft);
+
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define decode_utf32 decode_utf32le
+#define encode_utf32 encode_utf32le
+#define decode_utf16 decode_utf16le
+#define encode_utf16 encode_utf16le
+#else
+#define decode_utf32 decode_utf32be
+#define encode_utf32 encode_utf32be
+#define decode_utf16 decode_utf16be
+#define encode_utf16 encode_utf16be
+#endif
+
+static struct {
+       const char *name;
+       Decoder decoder;
+       Encoder encoder;
+} charsets[] = {
+       { "ISO-8859-1", decode_latin1,  encode_latin1  },
+       { "ISO8859-1",  decode_latin1,  encode_latin1  },
+       { "UTF-32BE",   decode_utf32be, encode_utf32be },
+       { "UTF-32LE",   decode_utf32le, encode_utf32le },
+       { "UTF-16BE",   decode_utf16be, encode_utf16be },
+       { "UTF-16LE",   decode_utf16le, encode_utf16le },
+       { "UTF-32",     decode_utf32,   encode_utf32   },
+       { "UTF-16",     decode_utf16,   encode_utf16   },
+       { "UTF-8",      decode_utf8,    encode_utf8    },
+       { "US-ASCII",   decode_latin1,  encode_latin1  },
+       { "Latin1",     decode_latin1,  encode_latin1  },
+       { "ASCII",      decode_latin1,  encode_latin1  },
+       { "UTF32",      decode_utf32,   encode_utf32   },
+       { "UTF16",      decode_utf16,   encode_utf16   },
+       { "UTF8",       decode_utf8,    encode_utf8    },
+};
+
+
+GIConv
+g_iconv_open (const char *to_charset, const char *from_charset)
+{
+#ifdef HAVE_ICONV
+       iconv_t icd = (iconv_t) -1;
+#endif
+       Decoder decoder = NULL;
+       Encoder encoder = NULL;
+       GIConv cd;
+       guint i;
+       
+       if (!to_charset || !from_charset || !to_charset[0] || !from_charset[0]) {
+               errno = EINVAL;
+               
+               return (GIConv) -1;
+       }
+       
+       for (i = 0; i < G_N_ELEMENTS (charsets); i++) {
+               if (!g_ascii_strcasecmp (charsets[i].name, from_charset))
+                       decoder = charsets[i].decoder;
+               
+               if (!g_ascii_strcasecmp (charsets[i].name, to_charset))
+                       encoder = charsets[i].encoder;
+       }
+       
+       if (!encoder || !decoder) {
+#ifdef HAVE_ICONV
+               if ((icd = iconv_open (to_charset, from_charset)) == (iconv_t) -1)
+                       return (GIConv) -1;
+#else
+               errno = EINVAL;
+               
+               return (GIConv) -1;
+#endif
+       }
+       
+       cd = (GIConv) g_malloc (sizeof (struct _GIConv));
+       cd->decode = decoder;
+       cd->encode = encoder;
+       cd->c = -1;
+       
+#ifdef HAVE_ICONV
+       cd->cd = icd;
+#endif
+       
+       return cd;
+}
+
+int
+g_iconv_close (GIConv cd)
+{
+#ifdef HAVE_ICONV
+       if (cd->cd != (iconv_t) -1)
+               iconv_close (cd->cd);
+#endif
+       
+       g_free (cd);
+       
+       return 0;
+}
+
+gsize
+g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft,
+        gchar **outbytes, gsize *outbytesleft)
+{
+       gsize inleft, outleft;
+       char *inptr, *outptr;
+       gunichar c;
+       int rc = 0;
+       
+#ifdef HAVE_ICONV
+       if (cd->cd != (iconv_t) -1) {
+               /* Note: gsize may have a different size than size_t, so we need to
+                  remap inbytesleft and outbytesleft to size_t's. */
+               size_t *outleftptr, *inleftptr;
+               size_t n_outleft, n_inleft;
+               
+               if (inbytesleft) {
+                       n_inleft = *inbytesleft;
+                       inleftptr = &n_inleft;
+               } else {
+                       inleftptr = NULL;
+               }
+               
+               if (outbytesleft) {
+                       n_outleft = *outbytesleft;
+                       outleftptr = &n_outleft;
+               } else {
+                       outleftptr = NULL;
+               }
+#if defined(__NetBSD__)
+               return iconv (cd->cd, (const gchar **)inbytes, inleftptr, outbytes, outleftptr);
+#else
+               return iconv (cd->cd, inbytes, inleftptr, outbytes, outleftptr);
+#endif
+       }
+#endif
+       
+       if (outbytes == NULL || outbytesleft == NULL) {
+               /* reset converter */
+               cd->c = -1;
+               return 0;
+       }
+       
+       inleft = inbytesleft ? *inbytesleft : 0;
+       inptr = inbytes ? *inbytes : NULL;
+       outleft = *outbytesleft;
+       outptr = *outbytes;
+       
+       if ((c = cd->c) != (gunichar) -1)
+               goto encode;
+       
+       while (inleft > 0) {
+               if ((rc = cd->decode (inptr, inleft, &c)) < 0)
+                       break;
+               
+               inleft -= rc;
+               inptr += rc;
+               
+       encode:
+               if ((rc = cd->encode (c, outptr, outleft)) < 0)
+                       break;
+               
+               c = (gunichar) -1;
+               outleft -= rc;
+               outptr += rc;
+       }
+       
+       if (inbytesleft)
+               *inbytesleft = inleft;
+       
+       if (inbytes)
+               *inbytes = inptr;
+       
+       *outbytesleft = outleft;
+       *outbytes = outptr;
+       cd->c = c;
+       
+       return rc < 0 ? -1 : 0;
+}
+
+/*
+ * Unicode encoders and decoders
+ */
+
+static int
+decode_utf32be (char *inbuf, size_t inleft, gunichar *outchar)
+{
+       unsigned char *inptr = (unsigned char *) inbuf;
+       gunichar c;
+       
+       if (inleft < 4) {
+               errno = EINVAL;
+               return -1;
+       }
+       
+       c = (inptr[0] << 24) | (inptr[1] << 16) | (inptr[2] << 8) | inptr[3];
+       
+       if (c >= 0xd800 && c < 0xe000) {
+               errno = EILSEQ;
+               return -1;
+       } else if (c >= 0x110000) {
+               errno = EILSEQ;
+               return -1;
+       }
+       
+       *outchar = c;
+       
+       return 4;
+}
+
+static int
+decode_utf32le (char *inbuf, size_t inleft, gunichar *outchar)
+{
+       unsigned char *inptr = (unsigned char *) inbuf;
+       gunichar c;
+       
+       if (inleft < 4) {
+               errno = EINVAL;
+               return -1;
+       }
+       
+       c = (inptr[3] << 24) | (inptr[2] << 16) | (inptr[1] << 8) | inptr[0];
+       
+       if (c >= 0xd800 && c < 0xe000) {
+               errno = EILSEQ;
+               return -1;
+       } else if (c >= 0x110000) {
+               errno = EILSEQ;
+               return -1;
+       }
+       
+       *outchar = c;
+       
+       return 4;
+}
+
+static int
+encode_utf32be (gunichar c, char *outbuf, size_t outleft)
+{
+       unsigned char *outptr = (unsigned char *) outbuf;
+       
+       if (outleft < 4) {
+               errno = E2BIG;
+               return -1;
+       }
+       
+       outptr[0] = (c >> 24) & 0xff;
+       outptr[1] = (c >> 16) & 0xff;
+       outptr[2] = (c >> 8) & 0xff;
+       outptr[3] = c & 0xff;
+       
+       return 4;
+}
+
+static int
+encode_utf32le (gunichar c, char *outbuf, size_t outleft)
+{
+       unsigned char *outptr = (unsigned char *) outbuf;
+       
+       if (outleft < 4) {
+               errno = E2BIG;
+               return -1;
+       }
+       
+       outptr[0] = c & 0xff;
+       outptr[1] = (c >> 8) & 0xff;
+       outptr[2] = (c >> 16) & 0xff;
+       outptr[3] = (c >> 24) & 0xff;
+       
+       return 4;
+}
+
+static int
+decode_utf16be (char *inbuf, size_t inleft, gunichar *outchar)
+{
+       unsigned char *inptr = (unsigned char *) inbuf;
+       gunichar2 c;
+       gunichar u;
+       
+       if (inleft < 2) {
+               errno = EINVAL;
+               return -1;
+       }
+       
+       u = (inptr[0] << 8) | inptr[1];
+       
+       if (u < 0xd800) {
+               /* 0x0000 -> 0xd7ff */
+               *outchar = u;
+               return 2;
+       } else if (u < 0xdc00) {
+               /* 0xd800 -> 0xdbff */
+               if (inleft < 4) {
+                       errno = EINVAL;
+                       return -2;
+               }
+               
+               c = (inptr[2] << 8) | inptr[3];
+               
+               if (c < 0xdc00 || c > 0xdfff) {
+                       errno = EILSEQ;
+                       return -2;
+               }
+               
+               u = ((u - 0xd800) << 10) + (c - 0xdc00) + 0x0010000UL;
+               *outchar = u;
+               
+               return 4;
+       } else if (u < 0xe000) {
+               /* 0xdc00 -> 0xdfff */
+               errno = EILSEQ;
+               return -1;
+       } else {
+               /* 0xe000 -> 0xffff */
+               *outchar = u;
+               return 2;
+       }
+}
+
+static int
+decode_utf16le (char *inbuf, size_t inleft, gunichar *outchar)
+{
+       unsigned char *inptr = (unsigned char *) inbuf;
+       gunichar2 c;
+       gunichar u;
+       
+       if (inleft < 2) {
+               errno = EINVAL;
+               return -1;
+       }
+       
+       u = (inptr[1] << 8) | inptr[0];
+       
+       if (u < 0xd800) {
+               /* 0x0000 -> 0xd7ff */
+               *outchar = u;
+               return 2;
+       } else if (u < 0xdc00) {
+               /* 0xd800 -> 0xdbff */
+               if (inleft < 4) {
+                       errno = EINVAL;
+                       return -2;
+               }
+               
+               c = (inptr[3] << 8) | inptr[2];
+               
+               if (c < 0xdc00 || c > 0xdfff) {
+                       errno = EILSEQ;
+                       return -2;
+               }
+               
+               u = ((u - 0xd800) << 10) + (c - 0xdc00) + 0x0010000UL;
+               *outchar = u;
+               
+               return 4;
+       } else if (u < 0xe000) {
+               /* 0xdc00 -> 0xdfff */
+               errno = EILSEQ;
+               return -1;
+       } else {
+               /* 0xe000 -> 0xffff */
+               *outchar = u;
+               return 2;
+       }
+}
+
+static int
+encode_utf16be (gunichar c, char *outbuf, size_t outleft)
+{
+       unsigned char *outptr = (unsigned char *) outbuf;
+       gunichar2 ch;
+       gunichar c2;
+       
+       if (c < 0x10000) {
+               if (outleft < 2) {
+                       errno = E2BIG;
+                       return -1;
+               }
+               
+               outptr[0] = (c >> 8) & 0xff;
+               outptr[1] = c & 0xff;
+               
+               return 2;
+       } else {
+               if (outleft < 4) {
+                       errno = E2BIG;
+                       return -1;
+               }
+               
+               c2 = c - 0x10000;
+               
+               ch = (gunichar2) ((c2 >> 10) + 0xd800);
+               outptr[0] = (ch >> 8) & 0xff;
+               outptr[1] = ch & 0xff;
+               
+               ch = (gunichar2) ((c2 & 0x3ff) + 0xdc00);
+               outptr[2] = (ch >> 8) & 0xff;
+               outptr[3] = ch & 0xff;
+               
+               return 4;
+       }
+}
+
+static int
+encode_utf16le (gunichar c, char *outbuf, size_t outleft)
+{
+       unsigned char *outptr = (unsigned char *) outbuf;
+       gunichar2 ch;
+       gunichar c2;
+       
+       if (c < 0x10000) {
+               if (outleft < 2) {
+                       errno = E2BIG;
+                       return -1;
+               }
+               
+               outptr[0] = c & 0xff;
+               outptr[1] = (c >> 8) & 0xff;
+               
+               return 2;
+       } else {
+               if (outleft < 4) {
+                       errno = E2BIG;
+                       return -1;
+               }
+               
+               c2 = c - 0x10000;
+               
+               ch = (gunichar2) ((c2 >> 10) + 0xd800);
+               outptr[0] = ch & 0xff;
+               outptr[1] = (ch >> 8) & 0xff;
+               
+               ch = (gunichar2) ((c2 & 0x3ff) + 0xdc00);
+               outptr[2] = ch & 0xff;
+               outptr[3] = (ch >> 8) & 0xff;
+               
+               return 4;
+       }
+}
+
+static FORCE_INLINE (int)
+decode_utf8 (char *inbuf, size_t inleft, gunichar *outchar)
+{
+       unsigned char *inptr = (unsigned char *) inbuf;
+       gunichar u;
+       int n, i;
+       
+       u = *inptr;
+       
+       if (u < 0x80) {
+               /* simple ascii case */
+               *outchar = u;
+               return 1;
+       } else if (u < 0xc2) {
+               errno = EILSEQ;
+               return -1;
+       } else if (u < 0xe0) {
+               u &= 0x1f;
+               n = 2;
+       } else if (u < 0xf0) {
+               u &= 0x0f;
+               n = 3;
+       } else if (u < 0xf8) {
+               u &= 0x07;
+               n = 4;
+       } else if (u < 0xfc) {
+               u &= 0x03;
+               n = 5;
+       } else if (u < 0xfe) {
+               u &= 0x01;
+               n = 6;
+       } else {
+               errno = EILSEQ;
+               return -1;
+       }
+       
+       if (n > inleft) {
+               errno = EINVAL;
+               return -1;
+       }
+       
+#if UNROLL_DECODE_UTF8
+       switch (n) {
+       case 6: u = (u << 6) | (*++inptr ^ 0x80);
+       case 5: u = (u << 6) | (*++inptr ^ 0x80);
+       case 4: u = (u << 6) | (*++inptr ^ 0x80);
+       case 3: u = (u << 6) | (*++inptr ^ 0x80);
+       case 2: u = (u << 6) | (*++inptr ^ 0x80);
+       }
+#else
+       for (i = 1; i < n; i++)
+               u = (u << 6) | (*++inptr ^ 0x80);
+#endif
+       
+       *outchar = u;
+       
+       return n;
+}
+
+static int
+encode_utf8 (gunichar c, char *outbuf, size_t outleft)
+{
+       unsigned char *outptr = (unsigned char *) outbuf;
+       int base, n, i;
+       
+       if (c < 0x80) {
+               outptr[0] = c;
+               return 1;
+       } else if (c < 0x800) {
+               base = 192;
+               n = 2;
+       } else if (c < 0x10000) {
+               base = 224;
+               n = 3;
+       } else if (c < 0x200000) {
+               base = 240;
+               n = 4;
+       } else if (c < 0x4000000) {
+               base = 248;
+               n = 5;
+       } else {
+               base = 252;
+               n = 6;
+       }
+       
+       if (outleft < n) {
+               errno = E2BIG;
+               return -1;
+       }
+       
+#if UNROLL_ENCODE_UTF8
+       switch (n) {
+       case 6: outptr[5] = (c & 0x3f) | 0x80; c >>= 6;
+       case 5: outptr[4] = (c & 0x3f) | 0x80; c >>= 6;
+       case 4: outptr[3] = (c & 0x3f) | 0x80; c >>= 6;
+       case 3: outptr[2] = (c & 0x3f) | 0x80; c >>= 6;
+       case 2: outptr[1] = (c & 0x3f) | 0x80; c >>= 6;
+       case 1: outptr[0] = c | base;
+       }
+#else
+       for (i = n - 1; i > 0; i--) {
+               outptr[i] = (c & 0x3f) | 0x80;
+               c >>= 6;
+       }
+       
+       outptr[0] = c | base;
+#endif
+       
+       return n;
+}
+
+static int
+decode_latin1 (char *inbuf, size_t inleft, gunichar *outchar)
+{
+       *outchar = (unsigned char) *inbuf;
+       return 1;
+}
+
+static int
+encode_latin1 (gunichar c, char *outbuf, size_t outleft)
+{
+       if (outleft < 1) {
+               errno = E2BIG;
+               return -1;
+       }
+       
+       if (c > 0xff) {
+               errno = EILSEQ;
+               return -1;
+       }
+       
+       *outbuf = (char) c;
+       
+       return 1;
+}
+
+
+/*
+ * Simple conversion API
+ */
+
+static gpointer error_quark = "ConvertError";
+
+gpointer
+g_convert_error_quark (void)
+{
+       return error_quark;
+}
+
+gchar *
+g_convert (const gchar *str, gssize len, const gchar *to_charset, const gchar *from_charset,
+          gsize *bytes_read, gsize *bytes_written, GError **err)
+{
+       gsize outsize, outused, outleft, inleft, grow, rc;
+       char *result, *outbuf, *inbuf;
+       gboolean flush = FALSE;
+       gboolean done = FALSE;
+       GIConv cd;
+       
+       g_return_val_if_fail (str != NULL, NULL);
+       g_return_val_if_fail (to_charset != NULL, NULL);
+       g_return_val_if_fail (from_charset != NULL, NULL);
+       
+       if ((cd = g_iconv_open (to_charset, from_charset)) == (GIConv) -1) {
+               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_CONVERSION,
+                            "Conversion from %s to %s not supported.",
+                            from_charset, to_charset);
+               
+               if (bytes_written)
+                       *bytes_written = 0;
+               
+               if (bytes_read)
+                       *bytes_read = 0;
+               
+               return NULL;
+       }
+       
+       inleft = len < 0 ? strlen (str) : len;
+       inbuf = (char *) str;
+       
+       outleft = outsize = MAX (inleft, 8);
+       outbuf = result = g_malloc (outsize + 4);
+       
+       do {
+               if (!flush)
+                       rc = g_iconv (cd, &inbuf, &inleft, &outbuf, &outleft);
+               else
+                       rc = g_iconv (cd, NULL, NULL, &outbuf, &outleft);
+               
+               if (rc == (gsize) -1) {
+                       switch (errno) {
+                       case E2BIG:
+                               /* grow our result buffer */
+                               grow = MAX (inleft, 8) << 1;
+                               outused = outbuf - result;
+                               outsize += grow;
+                               outleft += grow;
+                               result = g_realloc (result, outsize + 4);
+                               outbuf = result + outused;
+                               break;
+                       case EINVAL:
+                               /* incomplete input, stop converting and terminate here */
+                               if (flush)
+                                       done = TRUE;
+                               else
+                                       flush = TRUE;
+                               break;
+                       case EILSEQ:
+                               /* illegal sequence in the input */
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, "%s", g_strerror (errno));
+                               
+                               if (bytes_read) {
+                                       /* save offset of the illegal input sequence */
+                                       *bytes_read = (inbuf - str);
+                               }
+                               
+                               if (bytes_written)
+                                       *bytes_written = 0;
+                               
+                               g_iconv_close (cd);
+                               g_free (result);
+                               return NULL;
+                       default:
+                               /* unknown errno */
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, "%s", g_strerror (errno));
+                               
+                               if (bytes_written)
+                                       *bytes_written = 0;
+                               
+                               if (bytes_read)
+                                       *bytes_read = 0;
+                               
+                               g_iconv_close (cd);
+                               g_free (result);
+                               return NULL;
+                       }
+               } else if (flush) {
+                       /* input has been converted and output has been flushed */
+                       break;
+               } else {
+                       /* input has been converted, need to flush the output */
+                       flush = TRUE;
+               }
+       } while (!done);
+       
+       g_iconv_close (cd);
+       
+       /* Note: not all charsets can be null-terminated with a single
+           null byte. UCS2, for example, needs 2 null bytes and UCS4
+           needs 4. I hope that 4 null bytes is enough to terminate all
+           multibyte charsets? */
+       
+       /* null-terminate the result */
+       memset (outbuf, 0, 4);
+       
+       if (bytes_written)
+               *bytes_written = outbuf - result;
+       
+       if (bytes_read)
+               *bytes_read = inbuf - str;
+       
+       return result;
+}
+
+
+/*
+ * Unicode conversion
+ */
+
+/**
+ * An explanation of the conversion can be found at:
+ * http://home.tiscali.nl/t876506/utf8tbl.html
+ *
+ **/
+gint
+g_unichar_to_utf8 (gunichar c, gchar *outbuf)
+{
+       int base, n, i;
+       
+       if (c < 0x80) {
+               base = 0;
+               n = 1;
+       } else if (c < 0x800) {
+               base = 192;
+               n = 2;
+       } else if (c < 0x10000) {
+               base = 224;
+               n = 3;
+       } else if (c < 0x200000) {
+               base = 240;
+               n = 4;
+       } else if (c < 0x4000000) {
+               base = 248;
+               n = 5;
+       } else if (c < 0x80000000) {
+               base = 252;
+               n = 6;
+       } else {
+               return -1;
+       }
+       
+       if (outbuf != NULL) {
+               for (i = n - 1; i > 0; i--) {
+                       /* mask off 6 bits worth and add 128 */
+                       outbuf[i] = (c & 0x3f) | 0x80;
+                       c >>= 6;
+               }
+               
+               /* first character has a different base */
+               outbuf[0] = c | base;
+       }
+       
+       return n;
+}
+
+static FORCE_INLINE (int)
+g_unichar_to_utf16 (gunichar c, gunichar2 *outbuf)
+{
+       gunichar c2;
+       
+       if (c < 0xd800) {
+               if (outbuf)
+                       *outbuf = (gunichar2) c;
+               
+               return 1;
+       } else if (c < 0xe000) {
+               return -1;
+       } else if (c < 0x10000) {
+               if (outbuf)
+                       *outbuf = (gunichar2) c;
+               
+               return 1;
+       } else if (c < 0x110000) {
+               if (outbuf) {
+                       c2 = c - 0x10000;
+                       
+                       outbuf[0] = (gunichar2) ((c2 >> 10) + 0xd800);
+                       outbuf[1] = (gunichar2) ((c2 & 0x3ff) + 0xdc00);
+               }
+               
+               return 2;
+       } else {
+               return -1;
+       }
+}
+
+gunichar *
+g_utf8_to_ucs4_fast (const gchar *str, glong len, glong *items_written)
+{
+       gunichar *outbuf, *outptr;
+       char *inptr;
+       glong n, i;
+       
+       g_return_val_if_fail (str != NULL, NULL);
+       
+       n = g_utf8_strlen (str, len);
+       
+       if (items_written)
+               *items_written = n;
+       
+       outptr = outbuf = g_malloc ((n + 1) * sizeof (gunichar));
+       inptr = (char *) str;
+       
+       for (i = 0; i < n; i++) {
+               *outptr++ = g_utf8_get_char (inptr);
+               inptr = g_utf8_next_char (inptr);
+       }
+       
+       *outptr = 0;
+       
+       return outbuf;
+}
+
+static gunichar2 *
+eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong *items_written, gboolean include_nuls, GError **err)
+{
+       gunichar2 *outbuf, *outptr;
+       size_t outlen = 0;
+       size_t inleft;
+       char *inptr;
+       gunichar c;
+       int u, n;
+       
+       g_return_val_if_fail (str != NULL, NULL);
+       
+       if (len < 0) {
+               if (include_nuls) {
+                       g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, "Conversions with embedded nulls must pass the string length");
+                       return NULL;
+               }
+               
+               len = strlen (str);
+       }
+       
+       inptr = (char *) str;
+       inleft = len;
+       
+       while (inleft > 0) {
+               if ((n = decode_utf8 (inptr, inleft, &c)) < 0)
+                       goto error;
+               
+               if (c == 0 && !include_nuls)
+                       break;
+               
+               if ((u = g_unichar_to_utf16 (c, NULL)) < 0) {
+                       errno = EILSEQ;
+                       goto error;
+               }
+               
+               outlen += u;
+               inleft -= n;
+               inptr += n;
+       }
+       
+       if (items_read)
+               *items_read = inptr - str;
+       
+       if (items_written)
+               *items_written = outlen;
+       
+       outptr = outbuf = g_malloc ((outlen + 1) * sizeof (gunichar2));
+       inptr = (char *) str;
+       inleft = len;
+       
+       while (inleft > 0) {
+               if ((n = decode_utf8 (inptr, inleft, &c)) < 0)
+                       break;
+               
+               if (c == 0 && !include_nuls)
+                       break;
+               
+               outptr += g_unichar_to_utf16 (c, outptr);
+               inleft -= n;
+               inptr += n;
+       }
+       
+       *outptr = '\0';
+       
+       return outbuf;
+       
+ error:
+       if (errno == EILSEQ) {
+               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+                            "Illegal byte sequence encounted in the input.");
+       } else if (items_read) {
+               /* partial input is ok if we can let our caller know... */
+       } else {
+               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
+                            "Partial byte sequence encountered in the input.");
+       }
+       
+       if (items_read)
+               *items_read = inptr - str;
+       
+       if (items_written)
+               *items_written = 0;
+       
+       return NULL;
+}
+
+gunichar2 *
+g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err)
+{
+       return eg_utf8_to_utf16_general (str, len, items_read, items_written, FALSE, err);
+}
+
+gunichar2 *
+eg_utf8_to_utf16_with_nuls (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err)
+{
+       return eg_utf8_to_utf16_general (str, len, items_read, items_written, TRUE, err);
+}
+
+gunichar *
+g_utf8_to_ucs4 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err)
+{
+       gunichar *outbuf, *outptr;
+       size_t outlen = 0;
+       size_t inleft;
+       char *inptr;
+       gunichar c;
+       int n;
+       
+       g_return_val_if_fail (str != NULL, NULL);
+       
+       if (len < 0)
+               len = strlen (str);
+       
+       inptr = (char *) str;
+       inleft = len;
+       
+       while (inleft > 0) {
+               if ((n = decode_utf8 (inptr, inleft, &c)) < 0) {
+                       if (errno == EILSEQ) {
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+                                            "Illegal byte sequence encounted in the input.");
+                       } else if (items_read) {
+                               /* partial input is ok if we can let our caller know... */
+                               break;
+                       } else {
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
+                                            "Partial byte sequence encountered in the input.");
+                       }
+                       
+                       if (items_read)
+                               *items_read = inptr - str;
+                       
+                       if (items_written)
+                               *items_written = 0;
+                       
+                       return NULL;
+               } else if (c == 0)
+                       break;
+               
+               outlen += 4;
+               inleft -= n;
+               inptr += n;
+       }
+       
+       if (items_written)
+               *items_written = outlen / 4;
+       
+       if (items_read)
+               *items_read = inptr - str;
+       
+       outptr = outbuf = g_malloc (outlen + 4);
+       inptr = (char *) str;
+       inleft = len;
+       
+       while (inleft > 0) {
+               if ((n = decode_utf8 (inptr, inleft, &c)) < 0)
+                       break;
+               else if (c == 0)
+                       break;
+               
+               *outptr++ = c;
+               inleft -= n;
+               inptr += n;
+       }
+       
+       *outptr = 0;
+       
+       return outbuf;
+}
+
+gchar *
+g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **err)
+{
+       char *inptr, *outbuf, *outptr;
+       size_t outlen = 0;
+       size_t inleft;
+       gunichar c;
+       int n;
+       
+       g_return_val_if_fail (str != NULL, NULL);
+       
+       if (len < 0) {
+               len = 0;
+               while (str[len])
+                       len++;
+       }
+       
+       inptr = (char *) str;
+       inleft = len * 2;
+       
+       while (inleft > 0) {
+               if ((n = decode_utf16 (inptr, inleft, &c)) < 0) {
+                       if (n == -2 && inleft > 2) {
+                               /* This means that the first UTF-16 char was read, but second failed */
+                               inleft -= 2;
+                               inptr += 2;
+                       }
+                       
+                       if (errno == EILSEQ) {
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+                                            "Illegal byte sequence encounted in the input.");
+                       } else if (items_read) {
+                               /* partial input is ok if we can let our caller know... */
+                               break;
+                       } else {
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
+                                            "Partial byte sequence encountered in the input.");
+                       }
+                       
+                       if (items_read)
+                               *items_read = (inptr - (char *) str) / 2;
+                       
+                       if (items_written)
+                               *items_written = 0;
+                       
+                       return NULL;
+               } else if (c == 0)
+                       break;
+               
+               outlen += g_unichar_to_utf8 (c, NULL);
+               inleft -= n;
+               inptr += n;
+       }
+       
+       if (items_read)
+               *items_read = (inptr - (char *) str) / 2;
+       
+       if (items_written)
+               *items_written = outlen;
+       
+       outptr = outbuf = g_malloc (outlen + 1);
+       inptr = (char *) str;
+       inleft = len * 2;
+       
+       while (inleft > 0) {
+               if ((n = decode_utf16 (inptr, inleft, &c)) < 0)
+                       break;
+               else if (c == 0)
+                       break;
+               
+               outptr += g_unichar_to_utf8 (c, outptr);
+               inleft -= n;
+               inptr += n;
+       }
+       
+       *outptr = '\0';
+       
+       return outbuf;
+}
+
+gunichar *
+g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **err)
+{
+       gunichar *outbuf, *outptr;
+       size_t outlen = 0;
+       size_t inleft;
+       char *inptr;
+       gunichar c;
+       int n;
+       
+       g_return_val_if_fail (str != NULL, NULL);
+       
+       if (len < 0) {
+               len = 0;
+               while (str[len])
+                       len++;
+       }
+       
+       inptr = (char *) str;
+       inleft = len * 2;
+       
+       while (inleft > 0) {
+               if ((n = decode_utf16 (inptr, inleft, &c)) < 0) {
+                       if (n == -2 && inleft > 2) {
+                               /* This means that the first UTF-16 char was read, but second failed */
+                               inleft -= 2;
+                               inptr += 2;
+                       }
+                       
+                       if (errno == EILSEQ) {
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+                                            "Illegal byte sequence encounted in the input.");
+                       } else if (items_read) {
+                               /* partial input is ok if we can let our caller know... */
+                               break;
+                       } else {
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
+                                            "Partial byte sequence encountered in the input.");
+                       }
+                       
+                       if (items_read)
+                               *items_read = (inptr - (char *) str) / 2;
+                       
+                       if (items_written)
+                               *items_written = 0;
+                       
+                       return NULL;
+               } else if (c == 0)
+                       break;
+               
+               outlen += 4;
+               inleft -= n;
+               inptr += n;
+       }
+       
+       if (items_read)
+               *items_read = (inptr - (char *) str) / 2;
+       
+       if (items_written)
+               *items_written = outlen / 4;
+       
+       outptr = outbuf = g_malloc (outlen + 4);
+       inptr = (char *) str;
+       inleft = len * 2;
+       
+       while (inleft > 0) {
+               if ((n = decode_utf16 (inptr, inleft, &c)) < 0)
+                       break;
+               else if (c == 0)
+                       break;
+               
+               *outptr++ = c;
+               inleft -= n;
+               inptr += n;
+       }
+       
+       *outptr = 0;
+       
+       return outbuf;
+}
+
+gchar *
+g_ucs4_to_utf8 (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **err)
+{
+       char *outbuf, *outptr;
+       size_t outlen = 0;
+       glong i;
+       int n;
+       
+       g_return_val_if_fail (str != NULL, NULL);
+       
+       if (len < 0) {
+               for (i = 0; str[i] != 0; i++) {
+                       if ((n = g_unichar_to_utf8 (str[i], NULL)) < 0) {
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+                                            "Illegal byte sequence encounted in the input.");
+                               
+                               if (items_written)
+                                       *items_written = 0;
+                               
+                               if (items_read)
+                                       *items_read = i;
+                               
+                               return NULL;
+                       }
+                       
+                       outlen += n;
+               }
+       } else {
+               for (i = 0; i < len && str[i] != 0; i++) {
+                       if ((n = g_unichar_to_utf8 (str[i], NULL)) < 0) {
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+                                            "Illegal byte sequence encounted in the input.");
+                               
+                               if (items_written)
+                                       *items_written = 0;
+                               
+                               if (items_read)
+                                       *items_read = i;
+                               
+                               return NULL;
+                       }
+                       
+                       outlen += n;
+               }
+       }
+       
+       len = i;
+       
+       outptr = outbuf = g_malloc (outlen + 1);
+       for (i = 0; i < len; i++)
+               outptr += g_unichar_to_utf8 (str[i], outptr);
+       *outptr = 0;
+       
+       if (items_written)
+               *items_written = outlen;
+       
+       if (items_read)
+               *items_read = i;
+       
+       return outbuf;
+}
+
+gunichar2 *
+g_ucs4_to_utf16 (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **err)
+{
+       gunichar2 *outbuf, *outptr;
+       size_t outlen = 0;
+       glong i;
+       int n;
+       
+       g_return_val_if_fail (str != NULL, NULL);
+       
+       if (len < 0) {
+               for (i = 0; str[i] != 0; i++) {
+                       if ((n = g_unichar_to_utf16 (str[i], NULL)) < 0) {
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+                                            "Illegal byte sequence encounted in the input.");
+                               
+                               if (items_written)
+                                       *items_written = 0;
+                               
+                               if (items_read)
+                                       *items_read = i;
+                               
+                               return NULL;
+                       }
+                       
+                       outlen += n;
+               }
+       } else {
+               for (i = 0; i < len && str[i] != 0; i++) {
+                       if ((n = g_unichar_to_utf16 (str[i], NULL)) < 0) {
+                               g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+                                            "Illegal byte sequence encounted in the input.");
+                               
+                               if (items_written)
+                                       *items_written = 0;
+                               
+                               if (items_read)
+                                       *items_read = i;
+                               
+                               return NULL;
+                       }
+                       
+                       outlen += n;
+               }
+       }
+       
+       len = i;
+       
+       outptr = outbuf = g_malloc ((outlen + 1) * sizeof (gunichar2));
+       for (i = 0; i < len; i++)
+               outptr += g_unichar_to_utf16 (str[i], outptr);
+       *outptr = 0;
+       
+       if (items_written)
+               *items_written = outlen;
+       
+       if (items_read)
+               *items_read = i;
+       
+       return outbuf;
+}
diff --git a/mono/eglib/glib.h b/mono/eglib/glib.h
new file mode 100644 (file)
index 0000000..060b99e
--- /dev/null
@@ -0,0 +1,1079 @@
+#ifndef __GLIB_H
+#define __GLIB_H
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <ctype.h>
+#include <limits.h>
+
+
+#ifdef _MSC_VER
+#pragma include_alias(<eglib-config.h>, <eglib-config.hw>)
+#endif
+
+#include <stdint.h>
+#include <inttypes.h>
+
+#include <eglib-config.h>
+#ifndef EGLIB_NO_REMAP
+#include <eglib-remap.h>
+#endif
+
+#ifdef G_HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+
+#ifdef WIN32
+/* For alloca */
+#include <malloc.h>
+#endif
+
+#ifndef offsetof
+#   define offsetof(s_name,n_name) (size_t)(char *)&(((s_name*)0)->m_name)
+#endif
+
+#define __EGLIB_X11 1
+
+#ifdef  __cplusplus
+#define G_BEGIN_DECLS  extern "C" {
+#define G_END_DECLS    }
+#else
+#define G_BEGIN_DECLS
+#define G_END_DECLS
+#endif
+
+G_BEGIN_DECLS
+
+/*
+ * Basic data types
+ */
+typedef int            gint;
+typedef unsigned int   guint;
+typedef short          gshort;
+typedef unsigned short gushort;
+typedef long           glong;
+typedef unsigned long  gulong;
+typedef void *         gpointer;
+typedef const void *   gconstpointer;
+typedef char           gchar;
+typedef unsigned char  guchar;
+
+/* Types defined in terms of the stdint.h */
+typedef int8_t         gint8;
+typedef uint8_t        guint8;
+typedef int16_t        gint16;
+typedef uint16_t       guint16;
+typedef int32_t        gint32;
+typedef uint32_t       guint32;
+typedef int64_t        gint64;
+typedef uint64_t       guint64;
+typedef float          gfloat;
+typedef double         gdouble;
+typedef int32_t        gboolean;
+
+typedef guint16 gunichar2;
+typedef guint32 gunichar;
+
+/*
+ * Macros
+ */
+#define G_N_ELEMENTS(s)      (sizeof(s) / sizeof ((s) [0]))
+
+#define FALSE                0
+#define TRUE                 1
+
+#define G_MINSHORT           SHRT_MIN
+#define G_MAXSHORT           SHRT_MAX
+#define G_MAXUSHORT          USHRT_MAX
+#define G_MAXINT             INT_MAX
+#define G_MININT             INT_MIN
+#define G_MAXINT32           INT32_MAX
+#define G_MAXUINT32          UINT32_MAX
+#define G_MININT32           INT32_MIN
+#define G_MININT64           INT64_MIN
+#define G_MAXINT64          INT64_MAX
+#define G_MAXUINT64         UINT64_MAX
+
+#define G_LITTLE_ENDIAN 1234
+#define G_BIG_ENDIAN    4321
+#define G_STMT_START    do 
+#define G_STMT_END      while (0)
+
+#define G_USEC_PER_SEC  1000000
+
+#ifndef ABS
+#define ABS(a)         ((a) > 0 ? (a) : -(a))
+#endif
+
+#define G_STRUCT_OFFSET(p_type,field) offsetof(p_type,field)
+
+#define EGLIB_STRINGIFY(x) #x
+#define EGLIB_TOSTRING(x) EGLIB_STRINGIFY(x)
+#define G_STRLOC __FILE__ ":" EGLIB_TOSTRING(__LINE__) ":"
+
+#define G_CONST_RETURN const
+
+#define G_GUINT64_FORMAT PRIu64
+#define G_GINT64_FORMAT PRIi64
+#define G_GUINT32_FORMAT PRIu32
+#define G_GINT32_FORMAT PRIi32
+
+/*
+ * Allocation
+ */
+void g_free (void *ptr);
+gpointer g_realloc (gpointer obj, gsize size);
+gpointer g_malloc (gsize x);
+gpointer g_malloc0 (gsize x);
+gpointer g_calloc (gsize n, gsize x);
+gpointer g_try_malloc (gsize x);
+gpointer g_try_realloc (gpointer obj, gsize size);
+
+#define g_new(type,size)        ((type *) g_malloc (sizeof (type) * (size)))
+#define g_new0(type,size)       ((type *) g_malloc0 (sizeof (type)* (size)))
+#define g_newa(type,size)       ((type *) alloca (sizeof (type) * (size)))
+
+#define g_memmove(dest,src,len) memmove (dest, src, len)
+#define g_renew(struct_type, mem, n_structs) g_realloc (mem, sizeof (struct_type) * n_structs)
+#define g_alloca(size)         alloca (size)
+
+gpointer g_memdup (gconstpointer mem, guint byte_size);
+static inline gchar   *g_strdup (const gchar *str) { if (str) { return (gchar*) g_memdup (str, (guint)strlen (str) + 1); } return NULL; }
+gchar **g_strdupv (gchar **str_array);
+
+typedef struct {
+       gpointer (*malloc)      (gsize    n_bytes);
+       gpointer (*realloc)     (gpointer mem, gsize n_bytes);
+       void     (*free)        (gpointer mem);
+       gpointer (*calloc)      (gsize    n_blocks, gsize n_block_bytes);
+} GMemVTable;
+
+void g_mem_set_vtable (GMemVTable* vtable);
+
+struct _GMemChunk {
+       guint alloc_size;
+};
+
+typedef struct _GMemChunk GMemChunk;
+/*
+ * Misc.
+ */
+
+gboolean         g_hasenv(const gchar *variable);
+gchar *          g_getenv(const gchar *variable);
+gboolean         g_setenv(const gchar *variable, const gchar *value, gboolean overwrite);
+void             g_unsetenv(const gchar *variable);
+
+gchar*           g_win32_getlocale(void);
+
+/*
+ * Precondition macros
+ */
+#define g_warn_if_fail(x)  G_STMT_START { if (!(x)) { g_warning ("%s:%d: assertion '%s' failed", __FILE__, __LINE__, #x); } } G_STMT_END
+#define g_return_if_fail(x)  G_STMT_START { if (!(x)) { g_critical ("%s:%d: assertion '%s' failed", __FILE__, __LINE__, #x); return; } } G_STMT_END
+#define g_return_val_if_fail(x,e)  G_STMT_START { if (!(x)) { g_critical ("%s:%d: assertion '%s' failed", __FILE__, __LINE__, #x); return (e); } } G_STMT_END
+
+/*
+ * Errors
+ */
+typedef struct {
+       /* In the real glib, this is a GQuark, but we dont use/need that */
+       gpointer domain;
+       gint     code;
+       gchar   *message;
+} GError;
+
+void    g_clear_error (GError **error);
+void    g_error_free (GError *error);
+GError *g_error_new  (gpointer domain, gint code, const char *format, ...);
+void    g_set_error  (GError **err, gpointer domain, gint code, const gchar *format, ...);
+void    g_propagate_error (GError **dest, GError *src);
+
+/*
+ * Strings utility
+ */
+gchar       *g_strdup_printf  (const gchar *format, ...);
+gchar       *g_strdup_vprintf (const gchar *format, va_list args);
+gchar       *g_strndup        (const gchar *str, gsize n);
+const gchar *g_strerror       (gint errnum);
+gchar       *g_strndup        (const gchar *str, gsize n);
+void         g_strfreev       (gchar **str_array);
+gchar       *g_strconcat      (const gchar *first, ...);
+gchar      **g_strsplit       (const gchar *string, const gchar *delimiter, gint max_tokens);
+gchar      **g_strsplit_set   (const gchar *string, const gchar *delimiter, gint max_tokens);
+gchar       *g_strreverse     (gchar *str);
+gboolean     g_str_has_prefix (const gchar *str, const gchar *prefix);
+gboolean     g_str_has_suffix (const gchar *str, const gchar *suffix);
+guint        g_strv_length    (gchar **str_array);
+gchar       *g_strjoin        (const gchar *separator, ...);
+gchar       *g_strjoinv       (const gchar *separator, gchar **str_array);
+gchar       *g_strchug        (gchar *str);
+gchar       *g_strchomp       (gchar *str);
+void         g_strdown        (gchar *string);
+gchar       *g_strnfill       (gsize length, gchar fill_char);
+
+gchar       *g_strdelimit     (gchar *string, const gchar *delimiters, gchar new_delimiter);
+gchar       *g_strescape      (const gchar *source, const gchar *exceptions);
+
+gchar       *g_filename_to_uri   (const gchar *filename, const gchar *hostname, GError **error);
+gchar       *g_filename_from_uri (const gchar *uri, gchar **hostname, GError **error);
+
+gint         g_printf          (gchar const *format, ...);
+gint         g_fprintf         (FILE *file, gchar const *format, ...);
+gint         g_sprintf         (gchar *string, gchar const *format, ...);
+gint         g_snprintf        (gchar *string, gulong n, gchar const *format, ...);
+gint         g_vasprintf       (gchar **ret, const gchar *fmt, va_list ap);
+#define g_vprintf vprintf
+#define g_vfprintf vfprintf
+#define g_vsprintf vsprintf
+#define g_vsnprintf vsnprintf
+
+gsize   g_strlcpy            (gchar *dest, const gchar *src, gsize dest_size);
+gchar  *g_stpcpy             (gchar *dest, const char *src);
+
+
+gchar   g_ascii_tolower      (gchar c);
+gchar   g_ascii_toupper      (gchar c);
+gchar  *g_ascii_strdown      (const gchar *str, gssize len);
+gchar  *g_ascii_strup        (const gchar *str, gssize len);
+gint    g_ascii_strncasecmp  (const gchar *s1, const gchar *s2, gsize n);
+gint    g_ascii_strcasecmp   (const gchar *s1, const gchar *s2);
+gint    g_ascii_xdigit_value (gchar c);
+#define g_ascii_isspace(c)   (isspace (c) != 0)
+#define g_ascii_isalpha(c)   (isalpha (c) != 0)
+#define g_ascii_isprint(c)   (isprint (c) != 0)
+#define g_ascii_isxdigit(c)  (isxdigit (c) != 0)
+
+/* FIXME: g_strcasecmp supports utf8 unicode stuff */
+#ifdef _MSC_VER
+#define g_strcasecmp stricmp
+#define g_strncasecmp strnicmp
+#define g_strstrip(a) g_strchug (g_strchomp (a))
+#else
+#define g_strcasecmp strcasecmp
+#define g_ascii_strtoull strtoull
+#define g_strncasecmp strncasecmp
+#define g_strstrip(a) g_strchug (g_strchomp (a))
+#endif
+#define g_ascii_strdup strdup
+
+
+#define        G_STR_DELIMITERS "_-|> <."
+
+/*
+ * String type
+ */
+typedef struct {
+       char *str;
+       gsize len;
+       gsize allocated_len;
+} GString;
+
+GString     *g_string_new           (const gchar *init);
+GString     *g_string_new_len       (const gchar *init, gssize len);
+GString     *g_string_sized_new     (gsize default_size);
+gchar       *g_string_free          (GString *string, gboolean free_segment);
+GString     *g_string_append        (GString *string, const gchar *val);
+void         g_string_printf        (GString *string, const gchar *format, ...);
+void         g_string_append_printf (GString *string, const gchar *format, ...);
+void         g_string_append_vprintf (GString *string, const gchar *format, va_list args);
+GString     *g_string_append_unichar (GString *string, gunichar c);
+GString     *g_string_append_c      (GString *string, gchar c);
+GString     *g_string_append        (GString *string, const gchar *val);
+GString     *g_string_append_len    (GString *string, const gchar *val, gssize len);
+GString     *g_string_truncate      (GString *string, gsize len);
+GString     *g_string_prepend       (GString *string, const gchar *val);
+GString     *g_string_insert        (GString *string, gssize pos, const gchar *val);
+GString     *g_string_set_size      (GString *string, gsize len);
+GString     *g_string_erase         (GString *string, gssize pos, gssize len);
+
+#define g_string_sprintfa g_string_append_printf
+
+typedef void     (*GFunc)          (gpointer data, gpointer user_data);
+typedef gint     (*GCompareFunc)   (gconstpointer a, gconstpointer b);
+typedef gint     (*GCompareDataFunc) (gconstpointer a, gconstpointer b, gpointer user_data);
+typedef void     (*GHFunc)         (gpointer key, gpointer value, gpointer user_data);
+typedef gboolean (*GHRFunc)        (gpointer key, gpointer value, gpointer user_data);
+typedef void     (*GDestroyNotify) (gpointer data);
+typedef guint    (*GHashFunc)      (gconstpointer key);
+typedef gboolean (*GEqualFunc)     (gconstpointer a, gconstpointer b);
+typedef void     (*GFreeFunc)      (gpointer       data);
+
+/*
+ * Lists
+ */
+typedef struct _GSList GSList;
+struct _GSList {
+       gpointer data;
+       GSList *next;
+};
+
+GSList *g_slist_alloc         (void);
+GSList *g_slist_append        (GSList        *list,
+                              gpointer       data);
+GSList *g_slist_prepend       (GSList        *list,
+                              gpointer       data);
+void    g_slist_free          (GSList        *list);
+void    g_slist_free_1        (GSList        *list);
+GSList *g_slist_copy          (GSList        *list);
+GSList *g_slist_concat        (GSList        *list1,
+                              GSList        *list2);
+void    g_slist_foreach       (GSList        *list,
+                              GFunc          func,
+                              gpointer       user_data);
+GSList *g_slist_last          (GSList        *list);
+GSList *g_slist_find          (GSList        *list,
+                              gconstpointer  data);
+GSList *g_slist_find_custom   (GSList       *list,
+                              gconstpointer  data,
+                              GCompareFunc   func);
+GSList *g_slist_remove        (GSList        *list,
+                              gconstpointer  data);
+GSList *g_slist_remove_all    (GSList        *list,
+                              gconstpointer  data);
+GSList *g_slist_reverse       (GSList        *list);
+guint   g_slist_length        (GSList        *list);
+GSList *g_slist_remove_link   (GSList        *list,
+                              GSList        *link);
+GSList *g_slist_delete_link   (GSList        *list,
+                              GSList        *link);
+GSList *g_slist_insert_sorted (GSList        *list,
+                              gpointer       data,
+                              GCompareFunc   func);
+GSList *g_slist_insert_before (GSList        *list,
+                              GSList        *sibling,
+                              gpointer       data);
+GSList *g_slist_sort          (GSList        *list,
+                              GCompareFunc   func);
+gint    g_slist_index        (GSList        *list,
+                              gconstpointer  data);
+GSList *g_slist_nth          (GSList        *list,
+                              guint          n);
+gpointer g_slist_nth_data     (GSList       *list,
+                              guint          n);
+
+#define g_slist_next(slist) ((slist) ? (((GSList *) (slist))->next) : NULL)
+
+
+typedef struct _GList GList;
+struct _GList {
+  gpointer data;
+  GList *next;
+  GList *prev;
+};
+
+#define g_list_next(list) ((list) ? (((GList *) (list))->next) : NULL)
+#define g_list_previous(list) ((list) ? (((GList *) (list))->prev) : NULL)
+
+GList *g_list_alloc         (void);
+GList *g_list_append        (GList         *list,
+                            gpointer       data);
+GList *g_list_prepend       (GList         *list,
+                            gpointer       data);
+void   g_list_free          (GList         *list);
+void   g_list_free_1        (GList         *list);
+GList *g_list_copy          (GList         *list);
+guint  g_list_length        (GList         *list);
+gint   g_list_index         (GList         *list,
+                            gconstpointer  data);
+GList *g_list_nth           (GList         *list,
+                            guint          n);
+gpointer g_list_nth_data      (GList         *list,
+                            guint          n);
+GList *g_list_last          (GList         *list);
+GList *g_list_concat        (GList         *list1,
+                            GList         *list2);
+void   g_list_foreach       (GList         *list,
+                            GFunc          func,
+                            gpointer       user_data);
+GList *g_list_first         (GList         *list);
+GList *g_list_find          (GList         *list,
+                            gconstpointer  data);
+GList *g_list_find_custom   (GList        *list,
+                            gconstpointer  data,
+                            GCompareFunc   func);
+GList *g_list_remove        (GList         *list,
+                            gconstpointer  data);
+GList *g_list_remove_all    (GList         *list,
+                            gconstpointer  data);
+GList *g_list_reverse       (GList         *list);
+GList *g_list_remove_link   (GList         *list,
+                            GList         *link);
+GList *g_list_delete_link   (GList         *list,
+                            GList         *link);
+GList *g_list_insert_sorted (GList         *list,
+                            gpointer       data,
+                            GCompareFunc   func);
+GList *g_list_insert_before (GList         *list,
+                            GList         *sibling,
+                            gpointer       data);
+GList *g_list_sort          (GList         *sort,
+                            GCompareFunc   func);
+
+/*
+ * Hashtables
+ */
+typedef struct _GHashTable GHashTable;
+typedef struct _GHashTableIter GHashTableIter;
+
+/* Private, but needed for stack allocation */
+struct _GHashTableIter
+{
+       gpointer dummy [8];
+};
+
+GHashTable     *g_hash_table_new             (GHashFunc hash_func, GEqualFunc key_equal_func);
+GHashTable     *g_hash_table_new_full        (GHashFunc hash_func, GEqualFunc key_equal_func,
+                                             GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func);
+void            g_hash_table_insert_replace  (GHashTable *hash, gpointer key, gpointer value, gboolean replace);
+guint           g_hash_table_size            (GHashTable *hash);
+GList          *g_hash_table_get_keys        (GHashTable *hash);
+GList          *g_hash_table_get_values      (GHashTable *hash);
+gpointer        g_hash_table_lookup          (GHashTable *hash, gconstpointer key);
+gboolean        g_hash_table_lookup_extended (GHashTable *hash, gconstpointer key, gpointer *orig_key, gpointer *value);
+void            g_hash_table_foreach         (GHashTable *hash, GHFunc func, gpointer user_data);
+gpointer        g_hash_table_find            (GHashTable *hash, GHRFunc predicate, gpointer user_data);
+gboolean        g_hash_table_remove          (GHashTable *hash, gconstpointer key);
+gboolean        g_hash_table_steal           (GHashTable *hash, gconstpointer key);
+void            g_hash_table_remove_all      (GHashTable *hash);
+guint           g_hash_table_foreach_remove  (GHashTable *hash, GHRFunc func, gpointer user_data);
+guint           g_hash_table_foreach_steal   (GHashTable *hash, GHRFunc func, gpointer user_data);
+void            g_hash_table_destroy         (GHashTable *hash);
+void            g_hash_table_print_stats     (GHashTable *table);
+
+void            g_hash_table_iter_init       (GHashTableIter *iter, GHashTable *hash_table);
+gboolean        g_hash_table_iter_next       (GHashTableIter *iter, gpointer *key, gpointer *value);
+
+guint           g_spaced_primes_closest      (guint x);
+
+#define g_hash_table_insert(h,k,v)    g_hash_table_insert_replace ((h),(k),(v),FALSE)
+#define g_hash_table_replace(h,k,v)   g_hash_table_insert_replace ((h),(k),(v),TRUE)
+
+gboolean g_direct_equal (gconstpointer v1, gconstpointer v2);
+guint    g_direct_hash  (gconstpointer v1);
+gboolean g_int_equal    (gconstpointer v1, gconstpointer v2);
+guint    g_int_hash     (gconstpointer v1);
+gboolean g_str_equal    (gconstpointer v1, gconstpointer v2);
+guint    g_str_hash     (gconstpointer v1);
+
+/*
+ * ByteArray
+ */
+
+typedef struct _GByteArray GByteArray;
+struct _GByteArray {
+       guint8 *data;
+       gint len;
+};
+
+GByteArray *g_byte_array_new    (void);
+GByteArray* g_byte_array_append (GByteArray *array, const guint8 *data, guint len);
+guint8*  g_byte_array_free      (GByteArray *array, gboolean free_segment);
+void     g_byte_array_set_size  (GByteArray *array, gint length);
+
+/*
+ * Array
+ */
+
+typedef struct _GArray GArray;
+struct _GArray {
+       gchar *data;
+       gint len;
+};
+
+GArray *g_array_new               (gboolean zero_terminated, gboolean clear_, guint element_size);
+GArray *g_array_sized_new         (gboolean zero_terminated, gboolean clear_, guint element_size, guint reserved_size);
+gchar*  g_array_free              (GArray *array, gboolean free_segment);
+GArray *g_array_append_vals       (GArray *array, gconstpointer data, guint len);
+GArray* g_array_insert_vals       (GArray *array, guint index_, gconstpointer data, guint len);
+GArray* g_array_remove_index      (GArray *array, guint index_);
+GArray* g_array_remove_index_fast (GArray *array, guint index_);
+void    g_array_set_size          (GArray *array, gint length);
+
+#define g_array_append_val(a,v)   (g_array_append_vals((a),&(v),1))
+#define g_array_insert_val(a,i,v) (g_array_insert_vals((a),(i),&(v),1))
+#define g_array_index(a,t,i)      *(t*)(((a)->data) + sizeof(t) * (i))
+
+/*
+ * QSort
+*/
+
+void g_qsort_with_data (gpointer base, size_t nmemb, size_t size, GCompareDataFunc compare, gpointer user_data);
+
+/*
+ * Pointer Array
+ */
+
+typedef struct _GPtrArray GPtrArray;
+struct _GPtrArray {
+       gpointer *pdata;
+       guint len;
+};
+
+GPtrArray *g_ptr_array_new                (void);
+GPtrArray *g_ptr_array_sized_new          (guint reserved_size);
+void       g_ptr_array_add                (GPtrArray *array, gpointer data);
+gboolean   g_ptr_array_remove             (GPtrArray *array, gpointer data);
+gpointer   g_ptr_array_remove_index       (GPtrArray *array, guint index);
+gboolean   g_ptr_array_remove_fast        (GPtrArray *array, gpointer data);
+gpointer   g_ptr_array_remove_index_fast  (GPtrArray *array, guint index);
+void       g_ptr_array_sort               (GPtrArray *array, GCompareFunc compare_func);
+void       g_ptr_array_sort_with_data     (GPtrArray *array, GCompareDataFunc compare_func, gpointer user_data);
+void       g_ptr_array_set_size           (GPtrArray *array, gint length);
+gpointer  *g_ptr_array_free               (GPtrArray *array, gboolean free_seg);
+void       g_ptr_array_foreach            (GPtrArray *array, GFunc func, gpointer user_data);
+#define    g_ptr_array_index(array,index) (array)->pdata[(index)]
+
+/*
+ * Queues
+ */
+typedef struct {
+       GList *head;
+       GList *tail;
+       guint length;
+} GQueue;
+
+gpointer g_queue_pop_head  (GQueue   *queue);
+void     g_queue_push_head (GQueue   *queue,
+                           gpointer  data);
+void     g_queue_push_tail (GQueue   *queue,
+                           gpointer  data);
+gboolean g_queue_is_empty  (GQueue   *queue);
+GQueue  *g_queue_new       (void);
+void     g_queue_free      (GQueue   *queue);
+void     g_queue_foreach   (GQueue   *queue, GFunc func, gpointer user_data);
+
+/*
+ * Messages
+ */
+#ifndef G_LOG_DOMAIN
+#define G_LOG_DOMAIN ((gchar*) 0)
+#endif
+
+typedef enum {
+       G_LOG_FLAG_RECURSION          = 1 << 0,
+       G_LOG_FLAG_FATAL              = 1 << 1,
+       
+       G_LOG_LEVEL_ERROR             = 1 << 2,
+       G_LOG_LEVEL_CRITICAL          = 1 << 3,
+       G_LOG_LEVEL_WARNING           = 1 << 4,
+       G_LOG_LEVEL_MESSAGE           = 1 << 5,
+       G_LOG_LEVEL_INFO              = 1 << 6,
+       G_LOG_LEVEL_DEBUG             = 1 << 7,
+       
+       G_LOG_LEVEL_MASK              = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL)
+} GLogLevelFlags;
+
+void           g_print                (const gchar *format, ...);
+void           g_printerr             (const gchar *format, ...);
+GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
+GLogLevelFlags g_log_set_fatal_mask   (const gchar *log_domain, GLogLevelFlags fatal_mask);
+void           g_logv                 (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args);
+void           g_log                  (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, ...);
+void           g_assertion_message    (const gchar *format, ...) G_GNUC_NORETURN;
+
+#ifdef HAVE_C99_SUPPORT
+/* The for (;;) tells gc thats g_error () doesn't return, avoiding warnings */
+#define g_error(format, ...)    do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, __VA_ARGS__); for (;;); } while (0)
+#define g_critical(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format, __VA_ARGS__)
+#define g_warning(format, ...)  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, __VA_ARGS__)
+#define g_message(format, ...)  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, __VA_ARGS__)
+#define g_debug(format, ...)    g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, __VA_ARGS__)
+#else   /* HAVE_C99_SUPPORT */
+#define g_error(...)    do { g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, __VA_ARGS__); for (;;); } while (0)
+#define g_critical(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, __VA_ARGS__)
+#define g_warning(...)  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, __VA_ARGS__)
+#define g_message(...)  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, __VA_ARGS__)
+#define g_debug(...)    g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__)
+#endif  /* ndef HAVE_C99_SUPPORT */
+
+typedef void (*GLogFunc) (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data);
+typedef void (*GPrintFunc) (const gchar *string);
+
+void       g_log_default_handler     (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data);
+GLogFunc   g_log_set_default_handler (GLogFunc log_func, gpointer user_data);
+GPrintFunc g_set_print_handler       (GPrintFunc func);
+GPrintFunc g_set_printerr_handler    (GPrintFunc func);
+/*
+ * Conversions
+ */
+
+gpointer g_convert_error_quark(void);
+
+
+/*
+ * Unicode Manipulation: most of this is not used by Mono by default, it is
+ * only used if the old collation code is activated, so this is only the
+ * bare minimum to build.
+ */
+
+typedef enum {
+       G_UNICODE_CONTROL,
+       G_UNICODE_FORMAT,
+       G_UNICODE_UNASSIGNED,
+       G_UNICODE_PRIVATE_USE,
+       G_UNICODE_SURROGATE,
+       G_UNICODE_LOWERCASE_LETTER,
+       G_UNICODE_MODIFIER_LETTER,
+       G_UNICODE_OTHER_LETTER,
+       G_UNICODE_TITLECASE_LETTER,
+       G_UNICODE_UPPERCASE_LETTER,
+       G_UNICODE_COMBINING_MARK,
+       G_UNICODE_ENCLOSING_MARK,
+       G_UNICODE_NON_SPACING_MARK,
+       G_UNICODE_DECIMAL_NUMBER,
+       G_UNICODE_LETTER_NUMBER,
+       G_UNICODE_OTHER_NUMBER,
+       G_UNICODE_CONNECT_PUNCTUATION,
+       G_UNICODE_DASH_PUNCTUATION,
+       G_UNICODE_CLOSE_PUNCTUATION,
+       G_UNICODE_FINAL_PUNCTUATION,
+       G_UNICODE_INITIAL_PUNCTUATION,
+       G_UNICODE_OTHER_PUNCTUATION,
+       G_UNICODE_OPEN_PUNCTUATION,
+       G_UNICODE_CURRENCY_SYMBOL,
+       G_UNICODE_MODIFIER_SYMBOL,
+       G_UNICODE_MATH_SYMBOL,
+       G_UNICODE_OTHER_SYMBOL,
+       G_UNICODE_LINE_SEPARATOR,
+       G_UNICODE_PARAGRAPH_SEPARATOR,
+       G_UNICODE_SPACE_SEPARATOR
+} GUnicodeType;
+
+typedef enum {
+       G_UNICODE_BREAK_MANDATORY,
+       G_UNICODE_BREAK_CARRIAGE_RETURN,
+       G_UNICODE_BREAK_LINE_FEED,
+       G_UNICODE_BREAK_COMBINING_MARK,
+       G_UNICODE_BREAK_SURROGATE,
+       G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
+       G_UNICODE_BREAK_INSEPARABLE,
+       G_UNICODE_BREAK_NON_BREAKING_GLUE,
+       G_UNICODE_BREAK_CONTINGENT,
+       G_UNICODE_BREAK_SPACE,
+       G_UNICODE_BREAK_AFTER,
+       G_UNICODE_BREAK_BEFORE,
+       G_UNICODE_BREAK_BEFORE_AND_AFTER,
+       G_UNICODE_BREAK_HYPHEN,
+       G_UNICODE_BREAK_NON_STARTER,
+       G_UNICODE_BREAK_OPEN_PUNCTUATION,
+       G_UNICODE_BREAK_CLOSE_PUNCTUATION,
+       G_UNICODE_BREAK_QUOTATION,
+       G_UNICODE_BREAK_EXCLAMATION,
+       G_UNICODE_BREAK_IDEOGRAPHIC,
+       G_UNICODE_BREAK_NUMERIC,
+       G_UNICODE_BREAK_INFIX_SEPARATOR,
+       G_UNICODE_BREAK_SYMBOL,
+       G_UNICODE_BREAK_ALPHABETIC,
+       G_UNICODE_BREAK_PREFIX,
+       G_UNICODE_BREAK_POSTFIX,
+       G_UNICODE_BREAK_COMPLEX_CONTEXT,
+       G_UNICODE_BREAK_AMBIGUOUS,
+       G_UNICODE_BREAK_UNKNOWN,
+       G_UNICODE_BREAK_NEXT_LINE,
+       G_UNICODE_BREAK_WORD_JOINER,
+       G_UNICODE_BREAK_HANGUL_L_JAMO,
+       G_UNICODE_BREAK_HANGUL_V_JAMO,
+       G_UNICODE_BREAK_HANGUL_T_JAMO,
+       G_UNICODE_BREAK_HANGUL_LV_SYLLABLE,
+       G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE
+} GUnicodeBreakType;
+
+gunichar       g_unichar_toupper (gunichar c);
+gunichar       g_unichar_tolower (gunichar c);
+gunichar       g_unichar_totitle (gunichar c);
+GUnicodeType   g_unichar_type    (gunichar c);
+gboolean       g_unichar_isspace (gunichar c);
+gboolean       g_unichar_isxdigit (gunichar c);
+gint           g_unichar_xdigit_value (gunichar c);
+GUnicodeBreakType   g_unichar_break_type (gunichar c);
+
+#ifndef MAX
+#define MAX(a,b) (((a)>(b)) ? (a) : (b))
+#endif
+
+#ifndef MIN
+#define MIN(a,b) (((a)<(b)) ? (a) : (b))
+#endif
+
+#ifndef CLAMP
+#define CLAMP(a,low,high) (((a) < (low)) ? (low) : (((a) > (high)) ? (high) : (a)))
+#endif
+
+#if defined(__GNUC__) && (__GNUC__ > 2)
+#define G_LIKELY(expr) (__builtin_expect ((expr) != 0, 1))
+#define G_UNLIKELY(expr) (__builtin_expect ((expr) != 0, 0))
+#else
+#define G_LIKELY(x) (x)
+#define G_UNLIKELY(x) (x)
+#endif
+
+#if defined(_MSC_VER)
+#define  eg_unreachable() __assume(0)
+#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 5)))
+#define  eg_unreachable() __builtin_unreachable()
+#else
+#define  eg_unreachable()
+#endif
+
+#define  g_assert(x)     G_STMT_START { if (G_UNLIKELY (!(x))) g_assertion_message ("* Assertion at %s:%d, condition `%s' not met\n", __FILE__, __LINE__, #x);  } G_STMT_END
+#define  g_assert_not_reached() G_STMT_START { g_assertion_message ("* Assertion: should not be reached at %s:%d\n", __FILE__, __LINE__); eg_unreachable(); } G_STMT_END
+
+/*
+ * Unicode conversion
+ */
+
+#define G_CONVERT_ERROR g_convert_error_quark()
+
+typedef enum {
+       G_CONVERT_ERROR_NO_CONVERSION,
+       G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+       G_CONVERT_ERROR_FAILED,
+       G_CONVERT_ERROR_PARTIAL_INPUT,
+       G_CONVERT_ERROR_BAD_URI,
+       G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
+} GConvertError;
+
+gchar     *g_utf8_strup (const gchar *str, gssize len);
+gchar     *g_utf8_strdown (const gchar *str, gssize len);
+gint       g_unichar_to_utf8 (gunichar c, gchar *outbuf);
+gunichar  *g_utf8_to_ucs4_fast (const gchar *str, glong len, glong *items_written);
+gunichar  *g_utf8_to_ucs4 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err);
+gunichar2 *g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err);
+gunichar2 *eg_utf8_to_utf16_with_nuls (const gchar *str, glong len, glong *items_read, glong *items_written, GError **err);
+gchar     *g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **err);
+gunichar  *g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **err);
+gchar     *g_ucs4_to_utf8  (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **err);
+gunichar2 *g_ucs4_to_utf16 (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **err);
+
+#define u8to16(str) g_utf8_to_utf16(str, (glong)strlen(str), NULL, NULL, NULL)
+
+#ifdef G_OS_WIN32
+#define u16to8(str) g_utf16_to_utf8((gunichar2 *) (str), (glong)wcslen((wchar_t *) (str)), NULL, NULL, NULL)
+#else
+#define u16to8(str) g_utf16_to_utf8(str, (glong)strlen(str), NULL, NULL, NULL)
+#endif
+
+/*
+ * Path
+ */
+gchar  *g_build_path           (const gchar *separator, const gchar *first_element, ...);
+#define g_build_filename(x, ...) g_build_path(G_DIR_SEPARATOR_S, x, __VA_ARGS__)
+gchar  *g_path_get_dirname     (const gchar *filename);
+gchar  *g_path_get_basename    (const char *filename);
+gchar  *g_find_program_in_path (const gchar *program);
+gchar  *g_get_current_dir      (void);
+gboolean g_path_is_absolute    (const char *filename);
+
+const gchar *g_get_home_dir    (void);
+const gchar *g_get_tmp_dir     (void);
+const gchar *g_get_user_name   (void);
+gchar *g_get_prgname           (void);
+void  g_set_prgname            (const gchar *prgname);
+
+gboolean g_ensure_directory_exists (const gchar *filename);
+
+/*
+ * Shell
+ */
+
+gboolean  g_shell_parse_argv (const gchar *command_line, gint *argcp, gchar ***argvp, GError **error);
+gchar    *g_shell_unquote    (const gchar *quoted_string, GError **error);
+gchar    *g_shell_quote      (const gchar *unquoted_string);
+
+/*
+ * Spawn
+ */
+typedef enum {
+       G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1,
+       G_SPAWN_DO_NOT_REAP_CHILD      = 1 << 1,
+       G_SPAWN_SEARCH_PATH            = 1 << 2,
+       G_SPAWN_STDOUT_TO_DEV_NULL     = 1 << 3,
+       G_SPAWN_STDERR_TO_DEV_NULL     = 1 << 4,
+       G_SPAWN_CHILD_INHERITS_STDIN   = 1 << 5,
+       G_SPAWN_FILE_AND_ARGV_ZERO     = 1 << 6
+} GSpawnFlags;
+
+typedef void (*GSpawnChildSetupFunc) (gpointer user_data);
+
+gboolean g_spawn_command_line_sync (const gchar *command_line, gchar **standard_output, gchar **standard_error, gint *exit_status, GError **error);
+gboolean g_spawn_async_with_pipes  (const gchar *working_directory, gchar **argv, gchar **envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup,
+                               gpointer user_data, GPid *child_pid, gint *standard_input, gint *standard_output, gint *standard_error, GError **error);
+
+int eg_getdtablesize (void);
+
+/*
+ * Timer
+ */
+typedef struct _GTimer GTimer;
+
+GTimer *g_timer_new (void);
+void g_timer_destroy (GTimer *timer);
+gdouble g_timer_elapsed (GTimer *timer, gulong *microseconds);
+void g_timer_stop (GTimer *timer);
+void g_timer_start (GTimer *timer);
+
+/*
+ * Date and time
+ */
+typedef struct {
+       glong tv_sec;
+       glong tv_usec;
+} GTimeVal;
+
+void g_get_current_time (GTimeVal *result);
+void g_usleep (gulong microseconds);
+
+/*
+ * File
+ */
+
+gpointer g_file_error_quark (void);
+
+#define G_FILE_ERROR g_file_error_quark ()
+
+typedef enum {
+       G_FILE_ERROR_EXIST,
+       G_FILE_ERROR_ISDIR,
+       G_FILE_ERROR_ACCES,
+       G_FILE_ERROR_NAMETOOLONG,
+       G_FILE_ERROR_NOENT,
+       G_FILE_ERROR_NOTDIR,
+       G_FILE_ERROR_NXIO,
+       G_FILE_ERROR_NODEV,
+       G_FILE_ERROR_ROFS,
+       G_FILE_ERROR_TXTBSY,
+       G_FILE_ERROR_FAULT,
+       G_FILE_ERROR_LOOP,
+       G_FILE_ERROR_NOSPC,
+       G_FILE_ERROR_NOMEM,
+       G_FILE_ERROR_MFILE,
+       G_FILE_ERROR_NFILE,
+       G_FILE_ERROR_BADF,
+       G_FILE_ERROR_INVAL,
+       G_FILE_ERROR_PIPE,
+       G_FILE_ERROR_AGAIN,
+       G_FILE_ERROR_INTR,
+       G_FILE_ERROR_IO,
+       G_FILE_ERROR_PERM,
+       G_FILE_ERROR_NOSYS,
+       G_FILE_ERROR_FAILED
+} GFileError;
+
+typedef enum {
+       G_FILE_TEST_IS_REGULAR = 1 << 0,
+       G_FILE_TEST_IS_SYMLINK = 1 << 1,
+       G_FILE_TEST_IS_DIR = 1 << 2,
+       G_FILE_TEST_IS_EXECUTABLE = 1 << 3,
+       G_FILE_TEST_EXISTS = 1 << 4
+} GFileTest;
+
+
+gboolean   g_file_set_contents (const gchar *filename, const gchar *contents, gssize length, GError **error);
+gboolean   g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error);
+GFileError g_file_error_from_errno (gint err_no);
+gint       g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error);
+gboolean   g_file_test (const gchar *filename, GFileTest test);
+
+#define g_open open
+#define g_rename rename
+#define g_stat stat
+#define g_unlink unlink
+#define g_fopen fopen
+#define g_lstat lstat
+#define g_rmdir rmdir
+#define g_mkstemp mkstemp
+#define g_ascii_isdigit isdigit
+#define g_ascii_strtod strtod
+#define g_ascii_isalnum isalnum
+
+gchar *g_mkdtemp (gchar *tmpl);
+
+/*
+ * Pattern matching
+ */
+typedef struct _GPatternSpec GPatternSpec;
+GPatternSpec * g_pattern_spec_new (const gchar *pattern);
+void           g_pattern_spec_free (GPatternSpec *pspec);
+gboolean       g_pattern_match_string (GPatternSpec *pspec, const gchar *string);
+
+/*
+ * Directory
+ */
+typedef struct _GDir GDir;
+GDir        *g_dir_open (const gchar *path, guint flags, GError **error);
+const gchar *g_dir_read_name (GDir *dir);
+void         g_dir_rewind (GDir *dir);
+void         g_dir_close (GDir *dir);
+
+int          g_mkdir_with_parents (const gchar *pathname, int mode);
+#define g_mkdir mkdir
+
+/*
+ * GMarkup
+ */
+typedef struct _GMarkupParseContext GMarkupParseContext;
+
+typedef enum
+{
+       G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
+       G_MARKUP_TREAT_CDATA_AS_TEXT              = 1 << 1
+} GMarkupParseFlags;
+
+typedef struct {
+       void (*start_element)  (GMarkupParseContext *context,
+                               const gchar *element_name,
+                               const gchar **attribute_names,
+                               const gchar **attribute_values,
+                               gpointer user_data,
+                               GError **error);
+
+       void (*end_element)    (GMarkupParseContext *context,
+                               const gchar         *element_name,
+                               gpointer             user_data,
+                               GError             **error);
+       
+       void (*text)           (GMarkupParseContext *context,
+                               const gchar         *text,
+                               gsize                text_len,  
+                               gpointer             user_data,
+                               GError             **error);
+       
+       void (*passthrough)    (GMarkupParseContext *context,
+                               const gchar         *passthrough_text,
+                               gsize                text_len,  
+                               gpointer             user_data,
+                               GError             **error);
+       void (*error)          (GMarkupParseContext *context,
+                               GError              *error,
+                               gpointer             user_data);
+} GMarkupParser;
+
+GMarkupParseContext *g_markup_parse_context_new   (const GMarkupParser *parser,
+                                                  GMarkupParseFlags flags,
+                                                  gpointer user_data,
+                                                  GDestroyNotify user_data_dnotify);
+void                 g_markup_parse_context_free  (GMarkupParseContext *context);
+gboolean             g_markup_parse_context_parse (GMarkupParseContext *context,
+                                                  const gchar *text, gssize text_len,
+                                                  GError **error);
+gboolean         g_markup_parse_context_end_parse (GMarkupParseContext *context,
+                                                  GError **error);
+
+/*
+ * Character set conversion
+ */
+typedef struct _GIConv *GIConv;
+
+gsize g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft, gchar **outbytes, gsize *outbytesleft);
+GIConv g_iconv_open (const gchar *to_charset, const gchar *from_charset);
+int g_iconv_close (GIConv cd);
+
+gboolean  g_get_charset        (G_CONST_RETURN char **charset);
+gchar    *g_locale_to_utf8     (const gchar *opsysstring, gssize len,
+                               gsize *bytes_read, gsize *bytes_written,
+                               GError **error);
+gchar    *g_locale_from_utf8   (const gchar *utf8string, gssize len, gsize *bytes_read,
+                               gsize *bytes_written, GError **error);
+gchar    *g_filename_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read,
+                               gsize *bytes_written, GError **error);
+gchar    *g_convert            (const gchar *str, gssize len,
+                               const gchar *to_codeset, const gchar *from_codeset,
+                               gsize *bytes_read, gsize *bytes_written, GError **error);
+
+/*
+ * Unicode manipulation
+ */
+extern const guchar g_utf8_jump_table[256];
+
+gboolean  g_utf8_validate      (const gchar *str, gssize max_len, const gchar **end);
+gunichar  g_utf8_get_char_validated (const gchar *str, gssize max_len);
+gchar    *g_utf8_find_prev_char (const char *str, const char *p);
+gchar    *g_utf8_prev_char     (const char *str);
+#define   g_utf8_next_char(p)  ((p) + g_utf8_jump_table[(guchar)(*p)])
+gunichar  g_utf8_get_char      (const gchar *src);
+glong     g_utf8_strlen        (const gchar *str, gssize max);
+gchar    *g_utf8_offset_to_pointer (const gchar *str, glong offset);
+glong     g_utf8_pointer_to_offset (const gchar *str, const gchar *pos);
+
+/*
+ * priorities
+ */
+#define G_PRIORITY_DEFAULT 0
+#define G_PRIORITY_DEFAULT_IDLE 200
+
+#define GUINT16_SWAP_LE_BE_CONSTANT(x) ((((guint16) x) >> 8) | ((((guint16) x) << 8)))
+
+#define GUINT16_SWAP_LE_BE(x) ((guint16) (((guint16) x) >> 8) | ((((guint16)(x)) & 0xff) << 8))
+#define GUINT32_SWAP_LE_BE(x) ((guint32) \
+                              ( (((guint32) (x)) << 24)| \
+                                ((((guint32) (x)) & 0xff0000) >> 8) | \
+                                ((((guint32) (x)) & 0xff00) << 8) | \
+                                (((guint32) (x)) >> 24)) )
+#define GUINT64_SWAP_LE_BE(x) ((guint64) (((guint64)(GUINT32_SWAP_LE_BE(((guint64)x) & 0xffffffff))) << 32) | \
+                              GUINT32_SWAP_LE_BE(((guint64)x) >> 32))
+
+                                 
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#   define GUINT64_FROM_BE(x) GUINT64_SWAP_LE_BE(x)
+#   define GUINT32_FROM_BE(x) GUINT32_SWAP_LE_BE(x)
+#   define GUINT16_FROM_BE(x) GUINT16_SWAP_LE_BE(x)
+#   define GUINT_FROM_BE(x)   GUINT32_SWAP_LE_BE(x)
+#   define GUINT64_FROM_LE(x) (x)
+#   define GUINT32_FROM_LE(x) (x)
+#   define GUINT16_FROM_LE(x) (x)
+#   define GUINT_FROM_LE(x)   (x)
+#   define GUINT64_TO_BE(x)   GUINT64_SWAP_LE_BE(x)
+#   define GUINT32_TO_BE(x)   GUINT32_SWAP_LE_BE(x)
+#   define GUINT16_TO_BE(x)   GUINT16_SWAP_LE_BE(x)
+#   define GUINT_TO_BE(x)     GUINT32_SWAP_LE_BE(x)
+#   define GUINT64_TO_LE(x)   (x)
+#   define GUINT32_TO_LE(x)   (x)
+#   define GUINT16_TO_LE(x)   (x)
+#   define GUINT_TO_LE(x)     (x)
+#else
+#   define GUINT64_FROM_BE(x) (x)
+#   define GUINT32_FROM_BE(x) (x)
+#   define GUINT16_FROM_BE(x) (x)
+#   define GUINT_FROM_BE(x)   (x)
+#   define GUINT64_FROM_LE(x) GUINT64_SWAP_LE_BE(x)
+#   define GUINT32_FROM_LE(x) GUINT32_SWAP_LE_BE(x)
+#   define GUINT16_FROM_LE(x) GUINT16_SWAP_LE_BE(x)
+#   define GUINT_FROM_LE(x)   GUINT32_SWAP_LE_BE(x)
+#   define GUINT64_TO_BE(x)   (x)
+#   define GUINT32_TO_BE(x)   (x)
+#   define GUINT16_TO_BE(x)   (x)
+#   define GUINT_TO_BE(x)     (x)
+#   define GUINT64_TO_LE(x)   GUINT64_SWAP_LE_BE(x)
+#   define GUINT32_TO_LE(x)   GUINT32_SWAP_LE_BE(x)
+#   define GUINT16_TO_LE(x)   GUINT16_SWAP_LE_BE(x)
+#   define GUINT_TO_LE(x)     GUINT32_SWAP_LE_BE(x)
+#endif
+
+#define GINT64_FROM_BE(x)   (GUINT64_TO_BE (x))
+#define GINT32_FROM_BE(x)   (GUINT32_TO_BE (x))
+#define GINT16_FROM_BE(x)   (GUINT16_TO_BE (x))
+#define GINT64_FROM_LE(x)   (GUINT64_TO_LE (x))
+#define GINT32_FROM_LE(x)   (GUINT32_TO_LE (x))
+#define GINT16_FROM_LE(x)   (GUINT16_TO_LE (x))
+
+#define _EGLIB_MAJOR  2
+#define _EGLIB_MIDDLE 4
+#define _EGLIB_MINOR  0
+#define GLIB_CHECK_VERSION(a,b,c) ((a < _EGLIB_MAJOR) || (a == _EGLIB_MAJOR && (b < _EGLIB_MIDDLE || (b == _EGLIB_MIDDLE && c <= _EGLIB_MINOR))))
+
+#define G_HAVE_API_SUPPORT(x) (x)
+#define G_UNSUPPORTED_API "%s:%d: '%s' not supported.", __FILE__, __LINE__
+#define g_unsupported_api(name) G_STMT_START { g_warning (G_UNSUPPORTED_API, name); } G_STMT_END
+G_END_DECLS
+
+#endif
+
+
+
diff --git a/mono/eglib/glist.c b/mono/eglib/glist.c
new file mode 100644 (file)
index 0000000..882fda4
--- /dev/null
@@ -0,0 +1,345 @@
+/*
+ * glist.c: Doubly-linked list implementation
+ *
+ * Authors:
+ *   Duncan Mak (duncan@novell.com)
+ *   Raja R Harinath (rharinath@novell.com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * (C) 2006 Novell, Inc.
+ */
+#include <stdio.h>
+#include <glib.h>
+
+GList*
+g_list_alloc ()
+{
+       return g_new0 (GList, 1);
+}
+
+static inline GList*
+new_node (GList *prev, gpointer data, GList *next)
+{
+       GList *node = g_list_alloc ();
+       node->data = data;
+       node->prev = prev;
+       node->next = next;
+       if (prev)
+               prev->next = node;
+       if (next)
+               next->prev = node;
+       return node;
+}
+
+static inline GList*
+disconnect_node (GList *node)
+{
+       if (node->next)
+               node->next->prev = node->prev;
+       if (node->prev)
+               node->prev->next = node->next;
+       return node;
+}
+
+GList *
+g_list_prepend (GList *list, gpointer data)
+{
+       return new_node (list ? list->prev : NULL, data, list);
+}
+
+void
+g_list_free_1 (GList *list)
+{
+       g_free (list);
+}
+
+void
+g_list_free (GList *list)
+{
+       while (list){
+               GList *next = list->next;
+               g_list_free_1 (list);
+               list = next;
+       }
+}
+
+GList*
+g_list_append (GList *list, gpointer data)
+{
+       GList *node = new_node (g_list_last (list), data, NULL);
+       return list ? list : node;
+}
+
+GList *
+g_list_concat (GList *list1, GList *list2)
+{
+       if (list1 && list2) {
+               list2->prev = g_list_last (list1);
+               list2->prev->next = list2;
+       }
+       return list1 ? list1 : list2;
+}
+
+guint
+g_list_length (GList *list)
+{
+       guint length = 0;
+
+       while (list) {
+               length ++;
+               list = list->next;
+       }
+
+       return length;
+}
+
+GList*
+g_list_remove (GList *list, gconstpointer data)
+{
+       GList *current = g_list_find (list, data);
+       if (!current)
+               return list;
+
+       if (current == list)
+               list = list->next;
+       g_list_free_1 (disconnect_node (current));
+
+       return list;
+}
+
+GList*
+g_list_remove_all (GList *list, gconstpointer data)
+{
+       GList *current = g_list_find (list, data);
+
+       if (!current)
+               return list;
+
+       while (current) {
+               if (current == list)
+                       list = list->next;
+               g_list_free_1 (disconnect_node (current));
+
+               current = g_list_find (list, data);
+       }
+
+       return list;
+}
+
+GList*
+g_list_remove_link (GList *list, GList *link)
+{
+       if (list == link)
+               list = list->next;
+
+       disconnect_node (link);
+       link->next = NULL;
+       link->prev = NULL;
+
+       return list;
+}
+
+GList*
+g_list_delete_link (GList *list, GList *link)
+{
+       list = g_list_remove_link (list, link);
+       g_list_free_1 (link);
+
+       return list;
+}
+
+GList*
+g_list_find (GList *list, gconstpointer data)
+{
+       while (list){
+               if (list->data == data)
+                       return list;
+
+               list = list->next;
+       }
+
+       return NULL;
+}
+
+GList*
+g_list_find_custom (GList *list, gconstpointer data, GCompareFunc func)
+{
+       if (!func)
+               return NULL;
+       
+       while (list) {
+               if (func (list->data, data) == 0)
+                       return list;
+               
+               list = list->next;
+       }
+       
+       return NULL;
+}
+
+GList*
+g_list_reverse (GList *list)
+{
+       GList *reverse = NULL;
+
+       while (list) {
+               reverse = list;
+               list = reverse->next;
+
+               reverse->next = reverse->prev;
+               reverse->prev = list;
+       }
+
+       return reverse;
+}
+
+GList*
+g_list_first (GList *list)
+{
+       if (!list)
+               return NULL;
+
+       while (list->prev)
+               list = list->prev;
+
+       return list;
+}
+
+GList*
+g_list_last (GList *list)
+{
+       if (!list)
+               return NULL;
+
+       while (list->next)
+               list = list->next;
+
+       return list;
+}
+
+GList*
+g_list_insert_sorted (GList *list, gpointer data, GCompareFunc func)
+{
+       GList *prev = NULL;
+       GList *current;
+       GList *node;
+
+       if (!func)
+               return list;
+
+       /* Invariant: !prev || func (prev->data, data) <= 0) */
+       for (current = list; current; current = current->next) {
+               if (func (current->data, data) > 0)
+                       break;
+               prev = current;
+       }
+
+       node = new_node (prev, data, current);
+       return list == current ? node : list;
+}
+
+GList*
+g_list_insert_before (GList *list, GList *sibling, gpointer data)
+{
+       if (sibling) {
+               GList *node = new_node (sibling->prev, data, sibling);
+               return list == sibling ? node : list;
+       }
+       return g_list_append (list, data);
+}
+
+void
+g_list_foreach (GList *list, GFunc func, gpointer user_data)
+{
+       while (list){
+               (*func) (list->data, user_data);
+               list = list->next;
+       }
+}
+
+gint
+g_list_index (GList *list, gconstpointer data)
+{
+       gint index = 0;
+
+       while (list){
+               if (list->data == data)
+                       return index;
+
+               index ++;
+               list = list->next;
+       }
+
+       return -1;
+}
+
+GList*
+g_list_nth (GList *list, guint n)
+{
+       for (; list; list = list->next) {
+               if (n == 0)
+                       break;
+               n--;
+       }
+       return list;
+}
+
+gpointer
+g_list_nth_data (GList *list, guint n)
+{
+       GList *node = g_list_nth (list, n);
+       return node ? node->data : NULL;
+}
+
+GList*
+g_list_copy (GList *list)
+{
+       GList *copy = NULL;
+
+       if (list) {
+               GList *tmp = new_node (NULL, list->data, NULL);
+               copy = tmp;
+
+               for (list = list->next; list; list = list->next)
+                       tmp = new_node (tmp, list->data, NULL);
+       }
+
+       return copy;
+}
+
+typedef GList list_node;
+#include "sort.frag.h"
+
+GList*
+g_list_sort (GList *list, GCompareFunc func)
+{
+       GList *current;
+       if (!list || !list->next)
+               return list;
+       list = do_sort (list, func);
+
+       /* Fixup: do_sort doesn't update 'prev' pointers */
+       list->prev = NULL;
+       for (current = list; current->next; current = current->next)
+               current->next->prev = current;
+
+       return list;
+}
diff --git a/mono/eglib/gmarkup.c b/mono/eglib/gmarkup.c
new file mode 100644 (file)
index 0000000..4e6c664
--- /dev/null
@@ -0,0 +1,474 @@
+/*
+ * gmakrup.c: Minimal XML markup reader.
+ *
+ * Unlike the GLib one, this can not be restarted with more text
+ * as the Mono use does not require it.
+ *
+ * Actually, with further thought, I think that this could be made
+ * to restart very easily.  The pos == end condition would mean
+ * "return to caller" and only at end parse this would be a fatal
+ * error.
+ *
+ * Not that it matters to Mono, but it is very simple to change, there
+ * is a tricky situation: there are a few places where we check p+n
+ * in the source, and that would have to change to be progressive, instead
+ * of depending on the string to be complete at that point, so we would
+ * have to introduce extra states to cope with that.
+ *
+ * Author:
+ *   Miguel de Icaza (miguel@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdio.h>
+#include <ctype.h>
+#include <glib.h>
+
+#define set_error(msg, ...) do { if (error != NULL) *error = g_error_new (GINT_TO_POINTER (1), 1, msg, __VA_ARGS__); } while (0);
+
+typedef enum {
+       START,
+       START_ELEMENT,
+       TEXT,
+       FLUSH_TEXT,
+       CLOSING_ELEMENT,
+       COMMENT,
+       SKIP_XML_DECLARATION
+} ParseState;
+
+struct _GMarkupParseContext {
+       GMarkupParser  parser;
+       gpointer       user_data;
+       GDestroyNotify user_data_dnotify;
+       ParseState     state;
+
+       /* Stores the name of the current element, so we can issue the end_element */
+       GSList         *level;
+
+       GString        *text;
+};
+
+GMarkupParseContext *
+g_markup_parse_context_new (const GMarkupParser *parser,
+                           GMarkupParseFlags flags,
+                           gpointer user_data,
+                           GDestroyNotify user_data_dnotify)
+{
+       GMarkupParseContext *context = g_new0 (GMarkupParseContext, 1);
+
+       context->parser = *parser;
+       context->user_data = user_data;
+       context->user_data_dnotify = user_data_dnotify;
+
+       return context;
+}
+
+void
+g_markup_parse_context_free (GMarkupParseContext *context)
+{
+       GSList *l;
+       
+       g_return_if_fail (context != NULL);
+
+       if (context->user_data_dnotify != NULL)
+               (context->user_data_dnotify) (context->user_data);
+       
+       if (context->text != NULL)
+               g_string_free (context->text, TRUE);
+       for (l = context->level; l; l = l->next)
+               g_free (l->data);
+       g_slist_free (context->level);
+       g_free (context);
+}
+
+static gboolean
+my_isspace (char c)
+{
+       if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v')
+               return TRUE;
+       return FALSE;
+}
+
+static gboolean
+my_isalnum (char c)
+{
+       if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
+               return TRUE;
+       if (c >= '0' && c <= '9')
+               return TRUE;
+
+       return FALSE;
+}
+
+static gboolean
+my_isalpha (char c)
+{
+       if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
+               return TRUE;
+       return FALSE;
+}
+
+static const char *
+skip_space (const char *p, const char *end)
+{
+       for (; p < end && my_isspace (*p); p++)
+               ;
+       return p;
+}
+
+static const char *
+parse_value (const char *p, const char *end, char **value, GError **error)
+{
+       const char *start;
+       int l;
+       
+       if (*p != '"'){
+               set_error ("%s", "Expected the attribute value to start with a quote");
+               return end;
+       }
+       start = ++p;
+       for (; p < end && *p != '"'; p++)
+               ;
+       if (p == end)
+               return end;
+       l = (int)(p - start);
+       p++;
+       *value = g_malloc (l + 1);
+       if (*value == NULL)
+               return end;
+       strncpy (*value, start, l);
+       (*value) [l] = 0;
+       return p;
+}
+
+static const char *
+parse_name (const char *p, const char *end, char **value)
+{
+       const char *start = p;
+       int l;
+       
+       for (; p < end && my_isalnum (*p); p++)
+               ;
+       if (p == end)
+               return end;
+
+       l = (int)(p - start);
+       *value = g_malloc (l + 1);
+       if (*value == NULL)
+               return end;
+       strncpy (*value, start, l);
+       (*value) [l] = 0;
+       return p;
+}
+
+static const char *
+parse_attributes (const char *p, const char *end, char ***names, char ***values, GError **error, int *full_stop, int state)
+{
+       int nnames = 0;
+
+       while (TRUE){
+               p = skip_space (p, end);
+               if (p == end)
+                       return end;
+                       
+               if (*p == '>'){
+                       *full_stop = 0;
+                       return p; 
+               }
+               if (state == SKIP_XML_DECLARATION && *p == '?' && ((p+1) < end) && *(p+1) == '>'){
+                       *full_stop = 0;
+                       return p+1;
+               }
+               
+               if (*p == '/' && ((p+1) < end && *(p+1) == '>')){
+                       *full_stop = 1;
+                       return p+1;
+               } else {
+                       char *name, *value;
+                       
+                       p = parse_name (p, end, &name);
+                       if (p == end)
+                               return p;
+
+                       p = skip_space (p, end);
+                       if (p == end){
+                               g_free (name);
+                               return p;
+                       }
+                       if (*p != '='){
+                               set_error ("Expected an = after the attribute name `%s'", name);
+                               g_free (name);
+                               return end;
+                       }
+                       p++;
+                       p = skip_space (p, end);
+                       if (p == end){
+                               g_free (name);
+                               return end;
+                       }
+
+                       p = parse_value (p, end, &value, error);
+                       if (p == end){
+                               g_free (name);
+                               return p;
+                       }
+
+                       ++nnames;
+                       *names = g_realloc (*names, sizeof (char **) * (nnames+1));
+                       *values = g_realloc (*values, sizeof (char **) * (nnames+1));
+                       (*names) [nnames-1] = name;
+                       (*values) [nnames-1] = value;
+                       (*names) [nnames] = NULL;
+                       (*values) [nnames] = NULL;                      
+               }
+       } 
+}
+
+static void
+destroy_parse_state (GMarkupParseContext *context)
+{
+       GSList *p;
+
+       for (p = context->level; p != NULL; p = p->next)
+               g_free (p->data);
+       
+       g_slist_free (context->level);
+       if (context->text != NULL)
+               g_string_free (context->text, TRUE);
+       context->text = NULL;
+       context->level = NULL;
+}
+
+gboolean
+g_markup_parse_context_parse (GMarkupParseContext *context,
+                             const gchar *text, gssize text_len,
+                             GError **error)
+{
+       const char *p,  *end;
+       
+       g_return_val_if_fail (context != NULL, FALSE);
+       g_return_val_if_fail (text != NULL, FALSE);
+       g_return_val_if_fail (text_len >= 0, FALSE);
+
+       end = text + text_len;
+       
+       for (p = text; p < end; p++){
+               char c = *p;
+
+               switch (context->state){
+               case START:
+                       if (c == ' ' || c == '\t' || c == '\f' || c == '\n' || (c & 0x80))
+                               continue;
+                       if (c == '<'){
+                               if (p+1 < end && p [1] == '?'){
+                                       context->state = SKIP_XML_DECLARATION;
+                                       p++;
+                               } else
+                                       context->state = START_ELEMENT;
+                               continue;
+                       }
+                       set_error ("%s", "Expected < to start the document");
+                       goto fail;
+
+               case SKIP_XML_DECLARATION:
+               case START_ELEMENT: {
+                       const char *element_start = p, *element_end;
+                       char *ename = NULL;
+                       int full_stop = 0, l;
+                       gchar **names = NULL, **values = NULL;
+
+                       for (; p < end && my_isspace (*p); p++)
+                               ;
+                       if (p == end){
+                               set_error ("%s", "Unfinished element");
+                               goto fail;
+                       }
+
+                       if (*p == '!' && (p+2 < end) && (p [1] == '-') && (p [2] == '-')){
+                               context->state = COMMENT;
+                               p += 2;
+                               break;
+                       }
+                       
+                       if (!my_isalpha (*p)){
+                               set_error ("%s", "Expected an element name");
+                               goto fail;
+                       }
+                       
+                       for (++p; p < end && (my_isalnum (*p) || (*p == '.')); p++)
+                               ;
+                       if (p == end){
+                               set_error ("%s", "Expected an element");
+                               goto fail;
+                       }
+                       element_end = p;
+                       
+                       for (; p < end && my_isspace (*p); p++)
+                               ;
+                       if (p == end){
+                               set_error ("%s", "Unfinished element");
+                               goto fail;
+                       }
+                       p = parse_attributes (p, end, &names, &values, error, &full_stop, context->state);
+                       if (p == end){
+                               if (names != NULL) {
+                                       g_strfreev (names);
+                                       g_strfreev (values);
+                               }
+                               /* Only set the error if parse_attributes did not */
+                               if (error != NULL && *error == NULL)
+                                       set_error ("%s", "Unfinished sequence");
+                               goto fail;
+                       }
+                       l = (int)(element_end - element_start);
+                       ename = g_malloc (l + 1);
+                       if (ename == NULL)
+                               goto fail;
+                       strncpy (ename, element_start, l);
+                       ename [l] = 0;
+
+                       if (context->state == START_ELEMENT)
+                               if (context->parser.start_element != NULL)
+                                       context->parser.start_element (context, ename,
+                                                                      (const gchar **) names,
+                                                                      (const gchar **) values,
+                                                                      context->user_data, error);
+
+                       if (names != NULL){
+                               g_strfreev (names);
+                               g_strfreev (values);
+                       }
+
+                       if (error != NULL && *error != NULL){
+                               g_free (ename);
+                               goto fail;
+                       }
+                       
+                       if (full_stop){
+                               if (context->parser.end_element != NULL &&  context->state == START_ELEMENT){
+                                       context->parser.end_element (context, ename, context->user_data, error);
+                                       if (error != NULL && *error != NULL){
+                                               g_free (ename);
+                                               goto fail;
+                                       }
+                               }
+                               g_free (ename);
+                       } else {
+                               context->level = g_slist_prepend (context->level, ename);
+                       }
+                       
+                       context->state = TEXT;
+                       break;
+               } /* case START_ELEMENT */
+
+               case TEXT: {
+                       if (c == '<'){
+                               context->state = FLUSH_TEXT;
+                               break;
+                       }
+                       if (context->parser.text != NULL){
+                               if (context->text == NULL)
+                                       context->text = g_string_new ("");
+                               g_string_append_c (context->text, c);
+                       }
+                       break;
+               }
+
+               case COMMENT:
+                       if (*p != '-')
+                               break;
+                       if (p+2 < end && (p [1] == '-') && (p [2] == '>')){
+                               context->state = TEXT;
+                               p += 2;
+                               break;
+                       }
+                       break;
+                       
+               case FLUSH_TEXT:
+                       if (context->parser.text != NULL && context->text != NULL){
+                               context->parser.text (context, context->text->str, context->text->len,
+                                                     context->user_data, error);
+                               if (error != NULL && *error != NULL)
+                                       goto fail;
+                       }
+                       
+                       if (c == '/')
+                               context->state = CLOSING_ELEMENT;
+                       else {
+                               p--;
+                               context->state = START_ELEMENT;
+                       }
+                       break;
+
+               case CLOSING_ELEMENT: {
+                       GSList *current = context->level;
+                       char *text;
+
+                       if (context->level == NULL){
+                               set_error ("%s", "Too many closing tags, not enough open tags");
+                               goto fail;
+                       }
+                       
+                       text = current->data;
+                       if (context->parser.end_element != NULL){
+                               context->parser.end_element (context, text, context->user_data, error);
+                               if (error != NULL && *error != NULL){
+                                       g_free (text);
+                                       goto fail;
+                               }
+                       }
+                       g_free (text);
+
+                       while (p < end && *p != '>')
+                               p++;
+                       
+                       context->level = context->level->next;
+                       g_slist_free_1 (current);
+                       context->state = TEXT;
+                       break;
+               } /* case CLOSING_ELEMENT */
+                       
+               } /* switch */
+       }
+
+
+       return TRUE;
+ fail:
+       if (context->parser.error && error != NULL && *error)
+               context->parser.error (context, *error, context->user_data);
+       
+       destroy_parse_state (context);
+       return FALSE;
+}
+
+gboolean
+g_markup_parse_context_end_parse (GMarkupParseContext *context, GError **error)
+{
+       g_return_val_if_fail (context != NULL, FALSE);
+
+       /*
+        * In our case, we always signal errors during parse, not at the end
+        * see the notes at the top of this file for details on how this
+        * could be moved here
+        */
+       return TRUE;
+}
diff --git a/mono/eglib/gmem.c b/mono/eglib/gmem.c
new file mode 100644 (file)
index 0000000..eff478d
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * gmem.c: memory utility functions
+ *
+ * Author:
+ *     Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <config.h>
+#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+
+#if defined (ENABLE_OVERRIDABLE_ALLOCATORS)
+
+static GMemVTable sGMemVTable = { malloc, realloc, free, calloc };
+
+void
+g_mem_set_vtable (GMemVTable* vtable)
+{
+       sGMemVTable.calloc = vtable->calloc ? vtable->calloc : calloc;
+       sGMemVTable.realloc = vtable->realloc ? vtable->realloc : realloc;
+       sGMemVTable.malloc = vtable->malloc ? vtable->malloc : malloc;
+       sGMemVTable.free = vtable->free ? vtable->free : free;
+}
+
+#define G_FREE_INTERNAL sGMemVTable.free
+#define G_REALLOC_INTERNAL sGMemVTable.realloc
+#define G_CALLOC_INTERNAL sGMemVTable.calloc
+#define G_MALLOC_INTERNAL sGMemVTable.malloc
+#else
+
+void
+g_mem_set_vtable (GMemVTable* vtable)
+{
+}
+
+#define G_FREE_INTERNAL free
+#define G_REALLOC_INTERNAL realloc
+#define G_CALLOC_INTERNAL calloc
+#define G_MALLOC_INTERNAL malloc
+#endif
+void
+g_free (void *ptr)
+{
+       if (ptr != NULL)
+               G_FREE_INTERNAL (ptr);
+}
+
+gpointer
+g_memdup (gconstpointer mem, guint byte_size)
+{
+       gpointer ptr;
+
+       if (mem == NULL)
+               return NULL;
+
+       ptr = g_malloc (byte_size);
+       if (ptr != NULL)
+               memcpy (ptr, mem, byte_size);
+
+       return ptr;
+}
+
+gpointer g_realloc (gpointer obj, gsize size)
+{
+       gpointer ptr;
+       if (!size) {
+               g_free (obj);
+               return 0;
+       }
+       ptr = G_REALLOC_INTERNAL (obj, size);
+       if (ptr)
+               return ptr;
+       g_error ("Could not allocate %i bytes", size);
+}
+
+gpointer 
+g_malloc (gsize x) 
+{ 
+       gpointer ptr;
+       if (!x)
+               return 0;
+       ptr = G_MALLOC_INTERNAL (x);
+       if (ptr) 
+               return ptr;
+       g_error ("Could not allocate %i bytes", x);
+}
+
+gpointer g_calloc (gsize n, gsize x)
+{
+       gpointer ptr;
+       if (!x || !n)
+               return 0;
+               ptr = G_CALLOC_INTERNAL (n, x);
+       if (ptr)
+               return ptr;
+       g_error ("Could not allocate %i (%i * %i) bytes", x*n, n, x);
+}
+gpointer g_malloc0 (gsize x) 
+{ 
+       return g_calloc (1,x);
+}
+
+gpointer g_try_malloc (gsize x) 
+{
+       if (x)
+               return G_MALLOC_INTERNAL (x);
+       return 0;
+}
+
+
+gpointer g_try_realloc (gpointer obj, gsize size)
+{ 
+       if (!size) {
+               G_FREE_INTERNAL (obj);
+               return 0;
+       } 
+       return G_REALLOC_INTERNAL (obj, size);
+}
diff --git a/mono/eglib/gmisc-unix.c b/mono/eglib/gmisc-unix.c
new file mode 100644 (file)
index 0000000..2529069
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * gmisc.c: Misc functions with no place to go (right now)
+ *
+ * Author:
+ *   Aaron Bockover (abockover@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <config.h>
+#include <stdlib.h>
+#include <glib.h>
+#include <pthread.h>
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+static pthread_mutex_t env_lock = PTHREAD_MUTEX_INITIALIZER;
+
+/* MONO Comment
+ * 
+ * As per the UNIX spec, 
+ * "The return value from getenv() may point to static data which may be overwritten by subsequent calls to getenv(), setenv(), or unsetenv()."
+ * Source: Unix Manual Pages for getenv, IEEE Std 1003.1
+ *
+ * This means that using pointers returned from getenv may (and does) lead to many
+ * pointers which refer to the same piece of memory. When one is freed, all will be freed.
+ *
+ * This is unsafe and an ergonomics risk to fix in the callers. While the caller could lock,
+ * this introduces the risk for looping or exiting while inside of a lock. For this reason,
+ * g_getenv does not mimic the behavior of POSIX getenv anymore.
+ *
+ * The memory address returned will be unique to the invocaton, and must be freed.
+ * */ 
+gchar *
+g_getenv (const gchar *variable)
+{
+       gchar *ret = NULL;
+       pthread_mutex_lock (&env_lock);
+       gchar *res = getenv(variable);
+       if (res)
+               ret = g_strdup(res);
+       pthread_mutex_unlock (&env_lock);
+
+       return ret;
+}
+
+/*
+ * This function checks if the given variable is non-NULL
+ * in the environment. It's useful because it removes memory
+ * freeing requirements.
+ *
+ */
+gboolean
+g_hasenv (const gchar *variable)
+{
+       pthread_mutex_lock (&env_lock);
+       gchar *res = getenv(variable);
+       gboolean not_null = (res != NULL);
+       pthread_mutex_unlock (&env_lock);
+
+       return not_null;
+}
+
+gboolean
+g_setenv(const gchar *variable, const gchar *value, gboolean overwrite)
+{
+       gboolean res;
+       pthread_mutex_lock (&env_lock);
+       res = (setenv(variable, value, overwrite) == 0);
+       pthread_mutex_unlock (&env_lock);
+       return res;
+}
+
+void
+g_unsetenv(const gchar *variable)
+{
+       pthread_mutex_lock (&env_lock);
+       unsetenv(variable);
+       pthread_mutex_unlock (&env_lock);
+}
+
+gchar*
+g_win32_getlocale(void)
+{
+       return NULL;
+}
+
+gboolean
+g_path_is_absolute (const char *filename)
+{
+       g_return_val_if_fail (filename != NULL, FALSE);
+
+       return (*filename == '/');
+}
+
+static pthread_mutex_t pw_lock = PTHREAD_MUTEX_INITIALIZER;
+static const gchar *home_dir;
+static const gchar *user_name;
+
+static void
+get_pw_data (void)
+{
+#ifdef HAVE_GETPWUID_R
+       struct passwd pw;
+       struct passwd *result;
+       char buf [4096];
+#endif
+
+       if (user_name != NULL)
+               return;
+
+       pthread_mutex_lock (&pw_lock);
+       if (user_name != NULL) {
+               pthread_mutex_unlock (&pw_lock);
+               return;
+       }
+
+       home_dir = g_getenv ("HOME");
+       user_name = g_getenv ("USER");
+
+#ifdef HAVE_GETPWUID_R
+       if (home_dir == NULL || user_name == NULL) {
+               if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
+                       if (home_dir == NULL)
+                               home_dir = g_strdup (pw.pw_dir);
+                       if (user_name == NULL)
+                               user_name = g_strdup (pw.pw_name);
+               }
+       }
+#endif
+
+       if (user_name == NULL)
+               user_name = "somebody";
+       if (home_dir == NULL)
+               home_dir = "/";
+
+       pthread_mutex_unlock (&pw_lock);
+}
+
+const gchar *
+g_get_home_dir (void)
+{
+       get_pw_data ();
+       return home_dir;
+}
+
+const char *
+g_get_user_name (void)
+{
+       get_pw_data ();
+       return user_name;
+}
+
+static const char *tmp_dir;
+
+static pthread_mutex_t tmp_lock = PTHREAD_MUTEX_INITIALIZER;
+
+const gchar *
+g_get_tmp_dir (void)
+{
+       if (tmp_dir == NULL){
+               pthread_mutex_lock (&tmp_lock);
+               if (tmp_dir == NULL){
+                       tmp_dir = g_getenv ("TMPDIR");
+                       if (tmp_dir == NULL){
+                               tmp_dir = g_getenv ("TMP");
+                               if (tmp_dir == NULL){
+                                       tmp_dir = g_getenv ("TEMP");
+                                       if (tmp_dir == NULL)
+                                               tmp_dir = "/tmp";
+                               }
+                       }
+               }
+               pthread_mutex_unlock (&tmp_lock);
+       }
+       return tmp_dir;
+}
+
diff --git a/mono/eglib/gmisc-win32-uwp.c b/mono/eglib/gmisc-win32-uwp.c
new file mode 100644 (file)
index 0000000..cdf5896
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * gmisc-win32-uwp.c: UWP misc support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include <assert.h>
+
+gchar*
+g_win32_getlocale(void)
+{
+       gunichar2 buf[19];
+       gint ccBuf = GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SISO639LANGNAME, buf, 9);
+       assert (ccBuf <= 9);
+       if (ccBuf != 0) {
+               buf[ccBuf - 1] = L'-';
+               ccBuf = GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
+               assert (ccBuf <= 9);
+       }
+
+       // Check for GetLocaleInfoEx failure.
+       if (ccBuf == 0)
+               buf[0] = L'\0';
+
+       return u16to8 (buf);
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+#ifdef _MSC_VER
+// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
+void __mono_win32_gmisc_win32_uwp_quiet_lnk4221(void) {}
+#endif
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/eglib/gmisc-win32.c b/mono/eglib/gmisc-win32.c
new file mode 100644 (file)
index 0000000..70d99bf
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * gmisc.c: Misc functions with no place to go (right now)
+ *
+ * Author:
+ *   Aaron Bockover (abockover@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <glib.h>
+
+#include <windows.h>
+#if _MSC_VER && G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+#include <shlobj.h>
+#endif
+#include <direct.h>
+#include <io.h>
+#include <assert.h>
+
+gboolean
+g_hasenv (const gchar *variable)
+{
+       return g_getenv (variable) != NULL;
+}
+
+gchar *
+g_getenv(const gchar *variable)
+{
+       gunichar2 *var, *buffer;
+       gchar* val = NULL;
+       gint32 buffer_size = 1024;
+       gint32 retval;
+       var = u8to16(variable); 
+       buffer = g_malloc(buffer_size*sizeof(gunichar2));
+       retval = GetEnvironmentVariableW (var, buffer, buffer_size);
+       if (retval != 0) {
+               if (retval > buffer_size) {
+                       g_free (buffer);
+                       buffer_size = retval;
+                       buffer = g_malloc(buffer_size*sizeof(gunichar2));
+                       retval = GetEnvironmentVariableW (var, buffer, buffer_size);
+               }
+               val = u16to8 (buffer);
+       } else {
+               if (GetLastError () != ERROR_ENVVAR_NOT_FOUND){
+                       val = g_malloc (1);
+                       *val = 0;
+               }
+       }
+       g_free(var);
+       g_free(buffer);
+       return val; 
+}
+
+gboolean
+g_setenv(const gchar *variable, const gchar *value, gboolean overwrite)
+{
+       gunichar2 *var, *val;
+       gboolean result;
+       var = u8to16(variable); 
+       val = u8to16(value);
+       result = (SetEnvironmentVariableW(var, val) != 0) ? TRUE : FALSE;
+       g_free(var);
+       g_free(val);
+       return result;
+}
+
+void
+g_unsetenv(const gchar *variable)
+{
+       gunichar2 *var;
+       var = u8to16(variable); 
+       SetEnvironmentVariableW(var, L"");
+       g_free(var);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gchar*
+g_win32_getlocale(void)
+{
+       LCID lcid = GetThreadLocale();
+       gchar buf[19];
+       gint ccBuf = GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, buf, 9);
+       buf[ccBuf - 1] = '-';
+       ccBuf += GetLocaleInfoA(lcid, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
+       return g_strdup (buf);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+gboolean
+g_path_is_absolute (const char *filename)
+{
+       g_return_val_if_fail (filename != NULL, FALSE);
+
+       if (filename[0] != '\0' && filename[1] != '\0') {
+               if (filename[1] == ':' && filename[2] != '\0' &&
+                       (filename[2] == '\\' || filename[2] == '/'))
+                       return TRUE;
+               /* UNC paths */
+               else if (filename[0] == '\\' && filename[1] == '\\' && 
+                       filename[2] != '\0')
+                       return TRUE;
+       }
+
+       return FALSE;
+}
+
+#if _MSC_VER && G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static gchar*
+g_get_known_folder_path (void)
+{
+       gchar *folder_path = NULL;
+       PWSTR profile_path = NULL;
+       HRESULT hr = SHGetKnownFolderPath (&FOLDERID_Profile, KF_FLAG_DEFAULT, NULL, &profile_path);
+       if (SUCCEEDED(hr)) {
+               folder_path = u16to8 (profile_path);
+               CoTaskMemFree (profile_path);
+       }
+
+       return folder_path;
+}
+
+#else
+
+static inline gchar *
+g_get_known_folder_path (void)
+{
+       return NULL;
+}
+#endif
+
+const gchar *
+g_get_home_dir (void)
+{
+       gchar *home_dir = g_get_known_folder_path ();
+
+       if (!home_dir) {
+               home_dir = (gchar *) g_getenv ("USERPROFILE");
+       }
+
+       if (!home_dir) {
+               const gchar *drive = g_getenv ("HOMEDRIVE");
+               const gchar *path = g_getenv ("HOMEPATH");
+
+               if (drive && path) {
+                       home_dir = g_malloc (strlen (drive) + strlen (path) + 1);
+                       if (home_dir) {
+                               sprintf (home_dir, "%s%s", drive, path);
+                       }
+               }
+               g_free (drive);
+               g_free (path);
+       }
+
+       return home_dir;
+}
+
+const char *
+g_get_user_name (void)
+{
+       const char * retName = g_getenv ("USER");
+       if (!retName)
+               retName = g_getenv ("USERNAME");
+       return retName;
+}
+
+static const char *tmp_dir;
+
+const gchar *
+g_get_tmp_dir (void)
+{
+       if (tmp_dir == NULL){
+               if (tmp_dir == NULL){
+                       tmp_dir = g_getenv ("TMPDIR");
+                       if (tmp_dir == NULL){
+                               tmp_dir = g_getenv ("TMP");
+                               if (tmp_dir == NULL){
+                                       tmp_dir = g_getenv ("TEMP");
+                                       if (tmp_dir == NULL)
+                                               tmp_dir = "C:\\temp";
+                               }
+                       }
+               }
+       }
+       return tmp_dir;
+}
diff --git a/mono/eglib/gmodule-unix.c b/mono/eglib/gmodule-unix.c
new file mode 100644 (file)
index 0000000..9dd5eaa
--- /dev/null
@@ -0,0 +1,290 @@
+/*
+ * gmodule.c: dl* functions, glib style
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *   Jonathan Chambers (joncham@gmail.com)
+ *   Robert Jordan (robertj@gmx.net)
+ *
+ * (C) 2006 Novell, Inc.
+ * (C) 2006 Jonathan Chambers
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <config.h>
+
+#include <glib.h>
+#include <gmodule.h>
+
+#if defined(G_OS_UNIX) && defined(HAVE_DLFCN_H)
+#include <dlfcn.h>
+
+/* For Linux and Solaris, need to add others as we port this */
+#define LIBPREFIX "lib"
+#define LIBSUFFIX ".so"
+
+struct _GModule {
+       void *handle;
+};
+
+GModule *
+g_module_open (const gchar *file, GModuleFlags flags)
+{
+       int f = 0;
+       GModule *module;
+       void *handle;
+       
+       flags &= G_MODULE_BIND_MASK;
+       if ((flags & G_MODULE_BIND_LAZY) != 0)
+               f |= RTLD_LAZY;
+       if ((flags & G_MODULE_BIND_LOCAL) != 0)
+               f |= RTLD_LOCAL;
+
+       handle = dlopen (file, f);
+       if (handle == NULL)
+               return NULL;
+       
+       module = g_new (GModule,1);
+       module->handle = handle;
+       
+       return module;
+}
+
+gboolean
+g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
+{
+       if (symbol_name == NULL || symbol == NULL)
+               return FALSE;
+
+       if (module == NULL || module->handle == NULL)
+               return FALSE;
+
+       *symbol = dlsym (module->handle, symbol_name);
+       return (*symbol != NULL);
+}
+
+const gchar *
+g_module_error (void)
+{
+       return dlerror ();
+}
+
+gboolean
+g_module_close (GModule *module)
+{
+       void *handle;
+       if (module == NULL || module->handle == NULL)
+               return FALSE;
+
+       handle = module->handle;
+       module->handle = NULL;
+       g_free (module);
+       return (0 == dlclose (handle));
+}
+
+#elif defined (G_OS_WIN32)
+#include <windows.h>
+#include <psapi.h>
+
+#define LIBSUFFIX ".dll"
+#define LIBPREFIX ""
+
+struct _GModule {
+       HMODULE handle;
+       int main_module;
+};
+
+GModule *
+g_module_open (const gchar *file, GModuleFlags flags)
+{
+       GModule *module;
+       module = g_malloc (sizeof (GModule));
+       if (module == NULL)
+               return NULL;
+
+       if (file != NULL) {
+               gunichar2 *file16;
+               file16 = u8to16(file); 
+               module->main_module = FALSE;
+               module->handle = LoadLibrary (file16);
+               g_free(file16);
+               if (!module->handle) {
+                       g_free (module);
+                       return NULL;
+               }
+                       
+       } else {
+               module->main_module = TRUE;
+               module->handle = GetModuleHandle (NULL);
+       }
+
+       return module;
+}
+
+static gpointer
+w32_find_symbol (const gchar *symbol_name)
+{
+       HMODULE *modules;
+       DWORD buffer_size = sizeof (HMODULE) * 1024;
+       DWORD needed, i;
+
+       modules = (HMODULE *) g_malloc (buffer_size);
+
+       if (modules == NULL)
+               return NULL;
+
+       if (!EnumProcessModules (GetCurrentProcess (), modules,
+                                buffer_size, &needed)) {
+               g_free (modules);
+               return NULL;
+       }
+
+       /* check whether the supplied buffer was too small, realloc, retry */
+       if (needed > buffer_size) {
+               g_free (modules);
+
+               buffer_size = needed;
+               modules = (HMODULE *) g_malloc (buffer_size);
+
+               if (modules == NULL)
+                       return NULL;
+
+               if (!EnumProcessModules (GetCurrentProcess (), modules,
+                                        buffer_size, &needed)) {
+                       g_free (modules);
+                       return NULL;
+               }
+       }
+
+       for (i = 0; i < needed / sizeof (HANDLE); i++) {
+               gpointer proc = (gpointer)(intptr_t)GetProcAddress (modules [i], symbol_name);
+               if (proc != NULL) {
+                       g_free (modules);
+                       return proc;
+               }
+       }
+
+       g_free (modules);
+       return NULL;
+}
+
+gboolean
+g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
+{
+       if (module == NULL || symbol_name == NULL || symbol == NULL)
+               return FALSE;
+
+       if (module->main_module) {
+               *symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
+               if (*symbol != NULL)
+                       return TRUE;
+
+               *symbol = w32_find_symbol (symbol_name);
+               return *symbol != NULL;
+       } else {
+               *symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
+               return *symbol != NULL;
+       }
+}
+
+const gchar *
+g_module_error (void)
+{
+       gchar* ret = NULL;
+       TCHAR* buf = NULL;
+       DWORD code = GetLastError ();
+
+       FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 
+               code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 0, NULL);
+
+       ret = u16to8 (buf);
+       LocalFree(buf);
+
+       return ret;
+}
+
+gboolean
+g_module_close (GModule *module)
+{
+       HMODULE handle;
+       int main_module;
+
+       if (module == NULL || module->handle == NULL)
+               return FALSE;
+
+       handle = module->handle;
+       main_module = module->main_module;
+       module->handle = NULL;
+       g_free (module);
+       return (main_module ? 1 : (0 == FreeLibrary (handle)));
+}
+
+#else
+
+#define LIBSUFFIX ""
+#define LIBPREFIX ""
+
+GModule *
+g_module_open (const gchar *file, GModuleFlags flags)
+{
+       g_error ("%s", "g_module_open not implemented on this platform");
+       return NULL;
+}
+
+gboolean
+g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
+{
+       g_error ("%s", "g_module_open not implemented on this platform");
+       return FALSE;
+}
+
+const gchar *
+g_module_error (void)
+{
+       g_error ("%s", "g_module_open not implemented on this platform");
+       return NULL;
+}
+
+gboolean
+g_module_close (GModule *module)
+{
+       g_error ("%s", "g_module_open not implemented on this platform");
+       return FALSE;
+}
+#endif
+
+gchar *
+g_module_build_path (const gchar *directory, const gchar *module_name)
+{
+       char *lib_prefix = "";
+       
+       if (module_name == NULL)
+               return NULL;
+
+       if (strncmp (module_name, "lib", 3) != 0)
+               lib_prefix = LIBPREFIX;
+       
+       if (directory && *directory){ 
+               
+               return g_strdup_printf ("%s/%s%s" LIBSUFFIX, directory, lib_prefix, module_name);
+       }
+       return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name); 
+}
+
diff --git a/mono/eglib/gmodule-win32-internals.h b/mono/eglib/gmodule-win32-internals.h
new file mode 100644 (file)
index 0000000..d18e27f
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __G_MODULE_WINDOWS_INTERNALS_H__
+#define __G_MODULE_WINDOWS_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef G_OS_WIN32
+#include <gmodule.h>
+
+gpointer
+w32_find_symbol (const gchar *symbol_name);
+#endif /* G_OS_WIN32 */
+#endif /* __G_MODULE_WINDOWS_INTERNALS_H__ */
diff --git a/mono/eglib/gmodule-win32-uwp.c b/mono/eglib/gmodule-win32-uwp.c
new file mode 100644 (file)
index 0000000..5117e3b
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * gmodule-win32-uwp.c: UWP gmodule support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include <gmodule-win32-internals.h>
+
+gpointer
+w32_find_symbol (const gchar *symbol_name)
+{
+       g_unsupported_api ("EnumProcessModules");
+       SetLastError (ERROR_NOT_SUPPORTED);
+       return NULL;
+}
+
+const gchar *
+g_module_error (void)
+{
+       gchar *ret = NULL;
+       TCHAR buf [1024];
+       DWORD code = GetLastError ();
+
+       if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
+               code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, G_N_ELEMENTS (buf) - 1, NULL) )
+               buf[0] = TEXT('\0');
+
+       ret = u16to8 (buf);
+       return ret;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+#ifdef _MSC_VER
+// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
+void __mono_win32_gmodule_win32_uwp_quiet_lnk4221(void) {}
+#endif
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/eglib/gmodule-win32.c b/mono/eglib/gmodule-win32.c
new file mode 100644 (file)
index 0000000..72eaca3
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * gmodule.c: dl* functions, glib style
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *   Jonathan Chambers (joncham@gmail.com)
+ *   Robert Jordan (robertj@gmx.net)
+ *
+ * (C) 2006 Novell, Inc.
+ * (C) 2006 Jonathan Chambers
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <config.h>
+#include <glib.h>
+#include <windows.h>
+#include <psapi.h>
+#include <gmodule-win32-internals.h>
+
+#define LIBSUFFIX ".dll"
+#define LIBPREFIX ""
+
+struct _GModule {
+       HMODULE handle;
+       int main_module;
+};
+
+GModule *
+g_module_open (const gchar *file, GModuleFlags flags)
+{
+       GModule *module;
+       module = g_malloc (sizeof (GModule));
+       if (module == NULL)
+               return NULL;
+
+       if (file != NULL) {
+               gunichar2 *file16;
+               file16 = u8to16(file); 
+               module->main_module = FALSE;
+               module->handle = LoadLibraryW (file16);
+               g_free(file16);
+               if (!module->handle) {
+                       g_free (module);
+                       return NULL;
+               }
+                       
+       } else {
+               module->main_module = TRUE;
+               module->handle = GetModuleHandle (NULL);
+       }
+
+       return module;
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gpointer
+w32_find_symbol (const gchar *symbol_name)
+{
+       HMODULE *modules;
+       DWORD buffer_size = sizeof (HMODULE) * 1024;
+       DWORD needed, i;
+
+       modules = (HMODULE *) g_malloc (buffer_size);
+
+       if (modules == NULL)
+               return NULL;
+
+       if (!EnumProcessModules (GetCurrentProcess (), modules,
+                                buffer_size, &needed)) {
+               g_free (modules);
+               return NULL;
+       }
+
+       /* check whether the supplied buffer was too small, realloc, retry */
+       if (needed > buffer_size) {
+               g_free (modules);
+
+               buffer_size = needed;
+               modules = (HMODULE *) g_malloc (buffer_size);
+
+               if (modules == NULL)
+                       return NULL;
+
+               if (!EnumProcessModules (GetCurrentProcess (), modules,
+                                        buffer_size, &needed)) {
+                       g_free (modules);
+                       return NULL;
+               }
+       }
+
+       for (i = 0; i < needed / sizeof (HANDLE); i++) {
+               gpointer proc = (gpointer)(intptr_t)GetProcAddress (modules [i], symbol_name);
+               if (proc != NULL) {
+                       g_free (modules);
+                       return proc;
+               }
+       }
+
+       g_free (modules);
+       return NULL;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+gboolean
+g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol)
+{
+       if (module == NULL || symbol_name == NULL || symbol == NULL)
+               return FALSE;
+
+       if (module->main_module) {
+               *symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
+               if (*symbol != NULL)
+                       return TRUE;
+
+               *symbol = w32_find_symbol (symbol_name);
+               return *symbol != NULL;
+       } else {
+               *symbol = (gpointer)(intptr_t)GetProcAddress (module->handle, symbol_name);
+               return *symbol != NULL;
+       }
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+const gchar *
+g_module_error (void)
+{
+       gchar* ret = NULL;
+       TCHAR* buf = NULL;
+       DWORD code = GetLastError ();
+
+       /* FIXME: buf must not be NULL! */
+       FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 
+               code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 0, NULL);
+
+       ret = u16to8 (buf);
+       LocalFree(buf);
+
+       return ret;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+gboolean
+g_module_close (GModule *module)
+{
+       HMODULE handle;
+       int main_module;
+
+       if (module == NULL || module->handle == NULL)
+               return FALSE;
+
+       handle = module->handle;
+       main_module = module->main_module;
+       module->handle = NULL;
+       g_free (module);
+       return (main_module ? 1 : (0 == FreeLibrary (handle)));
+}
+
+gchar *
+g_module_build_path (const gchar *directory, const gchar *module_name)
+{
+       char *lib_prefix = "";
+       
+       if (module_name == NULL)
+               return NULL;
+
+       if (strncmp (module_name, "lib", 3) != 0)
+               lib_prefix = LIBPREFIX;
+       
+       if (directory && *directory){ 
+               
+               return g_strdup_printf ("%s/%s%s" LIBSUFFIX, directory, lib_prefix, module_name);
+       }
+       return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name); 
+}
diff --git a/mono/eglib/gmodule.h b/mono/eglib/gmodule.h
new file mode 100644 (file)
index 0000000..ee89683
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef __GLIB_GMODULE_H
+#define __GLIB_GMODULE_H
+
+#include <glib.h>
+
+#define G_MODULE_IMPORT extern
+#ifdef G_OS_WIN32
+#define G_MODULE_EXPORT __declspec(dllexport)
+#else
+#define G_MODULE_EXPORT
+#endif
+
+G_BEGIN_DECLS
+
+/*
+ * Modules
+ */
+typedef enum {
+       G_MODULE_BIND_LAZY = 0x01,
+       G_MODULE_BIND_LOCAL = 0x02,
+       G_MODULE_BIND_MASK = 0x03
+} GModuleFlags;
+typedef struct _GModule GModule;
+
+GModule *g_module_open (const gchar *file, GModuleFlags flags);
+gboolean g_module_symbol (GModule *module, const gchar *symbol_name,
+                         gpointer *symbol);
+const gchar *g_module_error (void);
+gboolean g_module_close (GModule *module);
+gchar *  g_module_build_path (const gchar *directory, const gchar *module_name);
+
+extern char *gmodule_libprefix;
+extern char *gmodule_libsuffix;
+
+G_END_DECLS
+
+#endif
diff --git a/mono/eglib/goutput.c b/mono/eglib/goutput.c
new file mode 100644 (file)
index 0000000..7b1627c
--- /dev/null
@@ -0,0 +1,276 @@
+/*
+ * Output and debugging functions
+ *
+ * Author:
+ *   Miguel de Icaza (miguel@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ * Copyright 2011 Xamarin Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <glib.h>
+
+/* The current fatal levels, error is always fatal */
+static GLogLevelFlags fatal = G_LOG_LEVEL_ERROR;
+static GLogFunc default_log_func;
+static gpointer default_log_func_user_data;
+static GPrintFunc stdout_handler, stderr_handler;
+
+static void default_stdout_handler (const gchar *string);
+static void default_stderr_handler (const gchar *string);
+
+void
+g_print (const gchar *format, ...)
+{
+       char *msg;
+       va_list args;
+
+       va_start (args, format);
+       if (g_vasprintf (&msg, format, args) < 0) {
+               va_end (args);
+               return;
+       }
+       va_end (args);
+
+       if (!stdout_handler)
+               stdout_handler = default_stdout_handler;
+
+       stdout_handler (msg);
+       g_free (msg);
+}
+
+void
+g_printerr (const gchar *format, ...)
+{
+       char *msg;
+       va_list args;
+
+       va_start (args, format);
+       if (g_vasprintf (&msg, format, args) < 0) {
+               va_end (args);
+               return;
+       }
+       va_end (args);
+
+       if (!stderr_handler)
+               stderr_handler = default_stderr_handler;
+
+       stderr_handler (msg);
+       g_free (msg);
+}
+
+GLogLevelFlags
+g_log_set_always_fatal (GLogLevelFlags fatal_mask)
+{
+       GLogLevelFlags old_fatal = fatal;
+
+       fatal |= fatal_mask;
+       
+       return old_fatal;
+}
+
+GLogLevelFlags
+g_log_set_fatal_mask (const gchar *log_domain, GLogLevelFlags fatal_mask)
+{
+       /*
+        * Mono does not use a G_LOG_DOMAIN currently, so we just assume things are fatal
+        * if we decide to set G_LOG_DOMAIN (we probably should) we should implement
+        * this.
+        */
+       return fatal_mask;
+}
+
+void
+g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args)
+{
+       char *msg;
+
+       if (!default_log_func)
+               default_log_func = g_log_default_handler;
+       
+       if (g_vasprintf (&msg, format, args) < 0)
+               return;
+
+       default_log_func (log_domain, log_level, msg, default_log_func_user_data);
+       g_free (msg);
+}
+
+void
+g_log (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, ...)
+{
+       va_list args;
+
+       va_start (args, format);
+       g_logv (log_domain, log_level, format, args);
+       va_end (args);
+}
+
+void
+g_assertion_message (const gchar *format, ...)
+{
+       va_list args;
+
+       va_start (args, format);
+       g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
+       va_end (args);
+       exit (0);
+}
+
+#if PLATFORM_ANDROID
+#include <android/log.h>
+
+static android_LogPriority
+to_android_priority (GLogLevelFlags log_level)
+{
+       switch (log_level & G_LOG_LEVEL_MASK)
+       {
+               case G_LOG_LEVEL_ERROR:     return ANDROID_LOG_FATAL;
+               case G_LOG_LEVEL_CRITICAL:  return ANDROID_LOG_ERROR;
+               case G_LOG_LEVEL_WARNING:   return ANDROID_LOG_WARN;
+               case G_LOG_LEVEL_MESSAGE:   return ANDROID_LOG_INFO;
+               case G_LOG_LEVEL_INFO:      return ANDROID_LOG_DEBUG;
+               case G_LOG_LEVEL_DEBUG:     return ANDROID_LOG_VERBOSE;
+       }
+       return ANDROID_LOG_UNKNOWN;
+}
+
+void
+g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
+{
+       __android_log_write (to_android_priority (log_level), log_domain, message);
+       if (log_level & fatal)
+               abort ();
+}
+
+static void
+default_stdout_handler (const gchar *message)
+{
+       /* TODO: provide a proper app name */
+       __android_log_write (ANDROID_LOG_ERROR, "mono", message);
+}
+
+static void
+default_stderr_handler (const gchar *message)
+{
+       /* TODO: provide a proper app name */
+       __android_log_write (ANDROID_LOG_ERROR, "mono", message);
+}
+
+
+#elif defined(HOST_IOS)
+#include <asl.h>
+
+static int
+to_asl_priority (GLogLevelFlags log_level)
+{
+       switch (log_level & G_LOG_LEVEL_MASK)
+       {
+               case G_LOG_LEVEL_ERROR:     return ASL_LEVEL_CRIT;
+               case G_LOG_LEVEL_CRITICAL:  return ASL_LEVEL_ERR;
+               case G_LOG_LEVEL_WARNING:   return ASL_LEVEL_WARNING;
+               case G_LOG_LEVEL_MESSAGE:   return ASL_LEVEL_NOTICE;
+               case G_LOG_LEVEL_INFO:      return ASL_LEVEL_INFO;
+               case G_LOG_LEVEL_DEBUG:     return ASL_LEVEL_DEBUG;
+       }
+       return ASL_LEVEL_ERR;
+}
+
+void
+g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
+{
+       asl_log (NULL, NULL, to_asl_priority (log_level), "%s", message);
+       if (log_level & fatal)
+               abort ();
+}
+
+static void
+default_stdout_handler (const gchar *message)
+{
+       asl_log (NULL, NULL, ASL_LEVEL_WARNING, "%s", message);
+}
+
+static void
+default_stderr_handler (const gchar *message)
+{
+       asl_log (NULL, NULL, ASL_LEVEL_WARNING, "%s", message);
+}
+
+#else
+
+void
+g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
+{
+       FILE *target = stdout;
+
+       fprintf (target, "%s%s%s\n",
+               log_domain != NULL ? log_domain : "",
+               log_domain != NULL ? ": " : "",
+               message);
+
+       if (log_level & fatal) {
+               fflush (stdout);
+               fflush (stderr);
+               abort ();
+       }
+}
+
+static void
+default_stdout_handler (const gchar *string)
+{
+       fprintf (stdout, "%s", string);
+}
+
+static void
+default_stderr_handler (const gchar *string)
+{
+       fprintf (stderr, "%s", string);
+}
+
+#endif
+
+GLogFunc
+g_log_set_default_handler (GLogFunc log_func, gpointer user_data)
+{
+       GLogFunc old = default_log_func;
+       default_log_func = log_func;
+       default_log_func_user_data = user_data;
+       return old;
+}
+
+GPrintFunc
+g_set_print_handler (GPrintFunc func)
+{
+       GPrintFunc old = stdout_handler;
+       stdout_handler = func;
+       return old;
+}
+
+GPrintFunc
+g_set_printerr_handler (GPrintFunc func)
+{
+       GPrintFunc old = stderr_handler;
+       stderr_handler = func;
+       return old;
+}
+
diff --git a/mono/eglib/gpath.c b/mono/eglib/gpath.c
new file mode 100644 (file)
index 0000000..59f5923
--- /dev/null
@@ -0,0 +1,389 @@
+/*
+ * Portable Utility Functions
+ *
+ * Author:
+ *   Miguel de Icaza (miguel@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <config.h>
+#include <stdio.h>
+#include <glib.h>
+#include <errno.h>
+#include <sys/stat.h>
+
+#ifdef G_OS_WIN32
+#include <direct.h> 
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+gchar *
+g_build_path (const gchar *separator, const gchar *first_element, ...)
+{
+       const char *elem, *next, *endptr;
+       gboolean trimmed;
+       GString *path;
+       va_list args;
+       size_t slen;
+       
+       g_return_val_if_fail (separator != NULL, NULL);
+       
+       path = g_string_sized_new (48);
+       slen = strlen (separator);
+       
+       va_start (args, first_element);
+       for (elem = first_element; elem != NULL; elem = next) {
+               /* trim any trailing separators from @elem */
+               endptr = elem + strlen (elem);
+               trimmed = FALSE;
+               
+               while (endptr >= elem + slen) {
+                       if (strncmp (endptr - slen, separator, slen) != 0)
+                               break;
+                       
+                       endptr -= slen;
+                       trimmed = TRUE;
+               }
+               
+               /* append elem, not including any trailing separators */
+               if (endptr > elem)
+                       g_string_append_len (path, elem, endptr - elem);
+               
+               /* get the next element */
+               do {
+                       if (!(next = va_arg (args, char *)))
+                               break;
+                       
+                       /* remove leading separators */
+                       while (!strncmp (next, separator, slen))
+                               next += slen;
+               } while (*next == '\0');
+               
+               if (next || trimmed)
+                       g_string_append_len (path, separator, slen);
+       }
+       va_end (args);
+       
+       return g_string_free (path, FALSE);
+}
+
+static gchar*
+strrchr_seperator (const gchar* filename)
+{
+#ifdef G_OS_WIN32
+       char *p2;
+#endif
+       char *p;
+
+       p = strrchr (filename, G_DIR_SEPARATOR);
+#ifdef G_OS_WIN32
+       p2 = strrchr (filename, '/');
+       if (p2 > p)
+               p = p2;
+#endif
+
+       return p;
+}
+
+gchar *
+g_path_get_dirname (const gchar *filename)
+{
+       char *p, *r;
+       size_t count;
+       g_return_val_if_fail (filename != NULL, NULL);
+
+       p = strrchr_seperator (filename);
+       if (p == NULL)
+               return g_strdup (".");
+       if (p == filename)
+               return g_strdup ("/");
+       count = p - filename;
+       r = g_malloc (count + 1);
+       strncpy (r, filename, count);
+       r [count] = 0;
+
+       return r;
+}
+
+gchar *
+g_path_get_basename (const char *filename)
+{
+       char *r;
+       g_return_val_if_fail (filename != NULL, NULL);
+
+       /* Empty filename -> . */
+       if (!*filename)
+               return g_strdup (".");
+
+       /* No separator -> filename */
+       r = strrchr_seperator (filename);
+       if (r == NULL)
+               return g_strdup (filename);
+
+       /* Trailing slash, remove component */
+       if (r [1] == 0){
+               char *copy = g_strdup (filename);
+               copy [r-filename] = 0;
+               r = strrchr_seperator (copy);
+
+               if (r == NULL){
+                       g_free (copy);                  
+                       return g_strdup ("/");
+               }
+               r = g_strdup (&r[1]);
+               g_free (copy);
+               return r;
+       }
+
+       return g_strdup (&r[1]);
+}
+
+#ifndef HAVE_STRTOK_R
+// This is from BSD's strtok_r
+
+char *
+strtok_r(char *s, const char *delim, char **last)
+{
+       char *spanp;
+       int c, sc;
+       char *tok;
+       
+       if (s == NULL && (s = *last) == NULL)
+               return NULL;
+       
+       /*
+        * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
+        */
+cont:
+       c = *s++;
+       for (spanp = (char *)delim; (sc = *spanp++) != 0; ){
+               if (c == sc)
+                       goto cont;
+       }
+
+       if (c == 0){         /* no non-delimiter characters */
+               *last = NULL;
+               return NULL;
+       }
+       tok = s - 1;
+
+       /*
+        * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
+        * Note that delim must have one NUL; we stop if we see that, too.
+        */
+       for (;;){
+               c = *s++;
+               spanp = (char *)delim;
+               do {
+                       if ((sc = *spanp++) == c) {
+                               if (c == 0)
+                                       s = NULL;
+                               else {
+                                       char *w = s - 1;
+                                       *w = '\0';
+                               }
+                               *last = s;
+                               return tok;
+                       }
+               }
+               while (sc != 0);
+       }
+       /* NOTREACHED */
+}
+#endif
+
+gchar *
+g_find_program_in_path (const gchar *program)
+{
+       char *p;
+       char *x, *l;
+       gchar *curdir = NULL;
+       char *save = NULL;
+#ifdef G_OS_WIN32
+       char *program_exe;
+       char *suffix_list[5] = {".exe",".cmd",".bat",".com",NULL};
+       int listx;
+       gboolean hasSuffix;
+#endif
+
+       g_return_val_if_fail (program != NULL, NULL);
+       x = p = g_strdup (g_getenv ("PATH"));
+
+       if (x == NULL || *x == '\0') {
+               curdir = g_get_current_dir ();
+               x = curdir;
+       }
+
+#ifdef G_OS_WIN32
+       /* see if program already has a suffix */
+       listx = 0;
+       hasSuffix = FALSE;
+       while (!hasSuffix && suffix_list[listx]) {
+               hasSuffix = g_str_has_suffix(program,suffix_list[listx++]);
+       }
+#endif
+
+       while ((l = strtok_r (x, G_SEARCHPATH_SEPARATOR_S, &save)) != NULL){
+               char *probe_path; 
+               
+               x = NULL;
+               probe_path = g_build_path (G_DIR_SEPARATOR_S, l, program, NULL);
+               if (access (probe_path, X_OK) == 0){ /* FIXME: on windows this is just a read permissions test */
+                       g_free (curdir);
+                       g_free (p);
+                       return probe_path;
+               }
+               g_free (probe_path);
+
+#ifdef G_OS_WIN32
+               /* check for program with a suffix attached */
+               if (!hasSuffix) {
+                       listx = 0;
+                       while (suffix_list[listx]) {
+                               program_exe = g_strjoin(NULL,program,suffix_list[listx],NULL);
+                               probe_path = g_build_path (G_DIR_SEPARATOR_S, l, program_exe, NULL);
+                               if (access (probe_path, X_OK) == 0){ /* FIXME: on windows this is just a read permissions test */
+                                       g_free (curdir);
+                                       g_free (p);
+                                       g_free (program_exe);
+                                       return probe_path;
+                               }
+                               listx++;
+                               g_free (probe_path);
+                               g_free (program_exe);
+                       }
+               }
+#endif
+       }
+       g_free (curdir);
+       g_free (p);
+       return NULL;
+}
+
+static char *name;
+
+void
+g_set_prgname (const gchar *prgname)
+{
+       name = g_strdup (prgname);
+}
+
+gchar *
+g_get_prgname (void)
+{
+       return name;
+}
+
+gboolean
+g_ensure_directory_exists (const gchar *filename)
+{
+#ifdef G_OS_WIN32
+       gchar *dir_utf8 = g_path_get_dirname (filename);
+       gunichar2 *p;
+       gunichar2 *dir_utf16 = NULL;
+       int retval;
+       
+       if (!dir_utf8 || !dir_utf8 [0])
+               return FALSE;
+
+       dir_utf16 = g_utf8_to_utf16 (dir_utf8, strlen (dir_utf8), NULL, NULL, NULL);
+       g_free (dir_utf8);
+
+       if (!dir_utf16)
+               return FALSE;
+
+       p = dir_utf16;
+
+       /* make life easy and only use one directory seperator */
+       while (*p != '\0')
+       {
+               if (*p == '/')
+                       *p = '\\';
+               p++;
+       }
+
+       p = dir_utf16;
+
+       /* get past C:\ )*/
+       while (*p++ != '\\')    
+       {
+       }
+
+       while (1) {
+               gboolean bRet = FALSE;
+               p = wcschr (p, '\\');
+               if (p)
+                       *p = '\0';
+               retval = _wmkdir (dir_utf16);
+               if (retval != 0 && errno != EEXIST) {
+                       g_free (dir_utf16);
+                       return FALSE;
+               }
+               if (!p)
+                       break;
+               *p++ = '\\';
+       }
+       
+       g_free (dir_utf16);
+       return TRUE;
+#else
+       char *p;
+       gchar *dir = g_path_get_dirname (filename);
+       int retval;
+       struct stat sbuf;
+       
+       if (!dir || !dir [0]) {
+               g_free (dir);
+               return FALSE;
+       }
+       
+       if (stat (dir, &sbuf) == 0 && S_ISDIR (sbuf.st_mode)) {
+               g_free (dir);
+               return TRUE;
+       }
+       
+       p = dir;
+       while (*p == '/')
+               p++;
+
+       while (1) {
+               p = strchr (p, '/');
+               if (p)
+                       *p = '\0';
+               retval = mkdir (dir, 0777);
+               if (retval != 0 && errno != EEXIST) {
+                       g_free (dir);
+                       return FALSE;
+               }
+               if (!p)
+                       break;
+               *p++ = '/';
+       }
+       
+       g_free (dir);
+       return TRUE;
+#endif
+}
+
diff --git a/mono/eglib/gpattern.c b/mono/eglib/gpattern.c
new file mode 100644 (file)
index 0000000..8486141
--- /dev/null
@@ -0,0 +1,213 @@
+/*
+ * Simple pattern matching
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+
+typedef enum {
+       MATCH_LITERAL,
+       MATCH_ANYCHAR,
+       MATCH_ANYTHING,
+       MATCH_ANYTHING_END,
+       MATCH_INVALID = -1
+} MatchType;
+
+typedef struct {
+       MatchType type;
+       gchar *str;
+} PData;
+
+struct _GPatternSpec {
+       GSList *pattern;
+};
+
+static GSList *
+compile_pattern (const gchar *pattern)
+{
+       GSList *list;
+       size_t i, len;
+       PData *data;
+       gchar c;
+       MatchType last = MATCH_INVALID;
+       GString *str;
+       gboolean free_str;
+
+       if (pattern == NULL)
+               return NULL;
+
+       data = NULL;
+       list = NULL;
+       free_str = TRUE;
+       str = g_string_new ("");
+       for (i = 0, len = strlen (pattern); i < len; i++) {
+               c = pattern [i];
+               if (c == '*' || c == '?') {
+                       if (str->len > 0) {
+                               data = g_new0 (PData, 1);
+                               data->type = MATCH_LITERAL;
+                               data->str = g_string_free (str, FALSE);
+                               list = g_slist_append (list, data);
+                               str = g_string_new ("");
+                       }
+
+                       if (last == MATCH_ANYTHING && c == '*')
+                               continue;
+
+                       data = g_new0 (PData, 1);
+                       data->type = (c == '*') ? MATCH_ANYTHING : MATCH_ANYCHAR;
+                       list = g_slist_append (list, data);
+                       last = data->type;
+               } else {
+                       g_string_append_c (str, c);
+                       last = MATCH_LITERAL;
+               }
+       }
+
+       if (last == MATCH_ANYTHING && str->len == 0) {
+               data->type = MATCH_ANYTHING_END;
+               free_str = TRUE;
+       } else if (str->len > 0) {
+               data = g_new0 (PData, 1);
+               data->type = MATCH_LITERAL;
+               data->str = str->str;
+               free_str = FALSE;
+               list = g_slist_append (list, data);
+       }
+       g_string_free (str, free_str);
+       return list;
+}
+
+#ifdef DEBUG_PATTERN
+static void
+print_pattern (gpointer data, gpointer user_data)
+{
+       PData *d = (PData *) data;
+
+       printf ("Type: %s", d->type == MATCH_LITERAL ? "literal" : d->type == MATCH_ANYCHAR ? "any char" : "anything");
+       if (d->type == MATCH_LITERAL)
+               printf (" String: %s", d->str);
+       printf ("\n");
+}
+#endif
+
+GPatternSpec *
+g_pattern_spec_new (const gchar *pattern)
+{
+       GPatternSpec *spec;
+
+       g_return_val_if_fail (pattern != NULL, NULL);
+       spec = g_new0 (GPatternSpec, 1);
+       if (pattern) {
+               spec->pattern = compile_pattern (pattern);
+#ifdef DEBUG_PATTERN
+               g_slist_foreach (spec->pattern, print_pattern, NULL);
+               printf ("\n");
+#endif
+       }
+       return spec;
+}
+
+static void
+free_pdata (gpointer data, gpointer user_data)
+{
+       PData *d = (PData *) data;
+
+       if (d->str)
+               g_free (d->str);
+       g_free (d);
+}
+
+void
+g_pattern_spec_free (GPatternSpec *pspec)
+{
+       if (pspec) {
+               g_slist_foreach (pspec->pattern, free_pdata, NULL);
+               g_slist_free (pspec->pattern);
+               pspec->pattern = NULL;
+       }
+       g_free (pspec);
+}
+
+static gboolean
+match_string (GSList *list, const gchar *str, size_t idx, size_t max)
+{
+       size_t len;
+
+       while (list && idx < max) {
+               PData *data = (PData *) list->data;
+
+               if (data->type == MATCH_ANYTHING_END)
+                       return TRUE;
+
+               if (data->type == MATCH_LITERAL) {
+                       len = strlen (data->str);
+                       if (strncmp (&str [idx], data->str, len) != 0)
+                               return FALSE;
+                       idx += len;
+                       list = list->next;
+                       if (list) {
+                               /* 
+                                * When recursing, we need this to avoid returning FALSE
+                                * because 'list' will not be NULL
+                                */
+                               data = (PData *) list->data;
+                               if (data->type == MATCH_ANYTHING_END)
+                                       return TRUE;
+                       }
+               } else if (data->type == MATCH_ANYCHAR) {
+                       idx++;
+                       list = list->next;
+               } else if (data->type == MATCH_ANYTHING) {
+                       while (idx < max) {
+                               if (match_string (list->next, str, idx++, max))
+                                       return TRUE;
+                       }
+                       return FALSE;
+               } else {
+                       g_assert_not_reached ();
+               }
+       }
+
+       return (list == NULL && idx >= max);
+}
+gboolean
+g_pattern_match_string (GPatternSpec *pspec, const gchar *string)
+{
+       g_return_val_if_fail (pspec != NULL, FALSE);
+       g_return_val_if_fail (string != NULL, FALSE);
+
+       if (pspec->pattern == NULL)
+               return FALSE;
+       return match_string (pspec->pattern, string, 0, strlen (string));
+}
+
+
diff --git a/mono/eglib/gptrarray.c b/mono/eglib/gptrarray.c
new file mode 100644 (file)
index 0000000..d3e5407
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * Pointer Array
+ *
+ * Author:
+ *   Aaron Bockover (abockover@novell.com)
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *   Jeffrey Stedfast (fejj@novell.com)
+ *
+ * (C) 2006,2011 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdlib.h>
+#include <glib.h>
+
+typedef struct _GPtrArrayPriv {
+       gpointer *pdata;
+       guint len;
+       guint size;
+} GPtrArrayPriv;
+
+static void 
+g_ptr_array_grow(GPtrArrayPriv *array, guint length)
+{
+       guint new_length = array->len + length;
+
+       g_return_if_fail(array != NULL);
+
+       if(new_length <= array->size) {
+               return;
+       }
+
+       array->size = 1;
+
+       while(array->size < new_length) {
+               array->size <<= 1;
+       }
+
+       array->size = MAX(array->size, 16);
+       array->pdata = g_realloc(array->pdata, array->size * sizeof(gpointer));
+}
+
+GPtrArray *
+g_ptr_array_new(void)
+{
+       return g_ptr_array_sized_new(0);
+}
+
+GPtrArray *
+g_ptr_array_sized_new(guint reserved_size)
+{
+       GPtrArrayPriv *array = g_new0(GPtrArrayPriv, 1);
+
+       array->pdata = NULL;
+       array->len = 0;
+       array->size = 0;
+
+       if(reserved_size > 0) {
+               g_ptr_array_grow(array, reserved_size);
+       }
+
+       return (GPtrArray *)array;
+}
+
+gpointer *
+g_ptr_array_free(GPtrArray *array, gboolean free_seg)
+{
+       gpointer *data = NULL;
+       
+       g_return_val_if_fail(array != NULL, NULL);
+
+       if(free_seg) {
+               g_free(array->pdata);
+       } else {
+               data = array->pdata;
+       }
+
+       g_free(array);
+       
+       return data;
+}
+
+void
+g_ptr_array_set_size(GPtrArray *array, gint length)
+{
+       g_return_if_fail(array != NULL);
+
+       if((size_t)length > array->len) {
+               g_ptr_array_grow((GPtrArrayPriv *)array, length);
+               memset(array->pdata + array->len, 0, (length - array->len) 
+                       * sizeof(gpointer));
+       }
+
+       array->len = length;
+}
+
+void
+g_ptr_array_add(GPtrArray *array, gpointer data)
+{
+       g_return_if_fail(array != NULL);
+       g_ptr_array_grow((GPtrArrayPriv *)array, 1);
+       array->pdata[array->len++] = data;
+}
+
+gpointer
+g_ptr_array_remove_index(GPtrArray *array, guint index)
+{
+       gpointer removed_node;
+       
+       g_return_val_if_fail(array != NULL, NULL);
+       g_return_val_if_fail(index < array->len, NULL);
+
+       removed_node = array->pdata[index];
+
+       if(index != array->len - 1) {
+               g_memmove(array->pdata + index, array->pdata + index + 1,
+                       (array->len - index - 1) * sizeof(gpointer));
+       }
+       
+       array->len--;
+       array->pdata[array->len] = NULL;
+
+       return removed_node;
+}
+
+gpointer
+g_ptr_array_remove_index_fast(GPtrArray *array, guint index)
+{
+       gpointer removed_node;
+
+       g_return_val_if_fail(array != NULL, NULL);
+       g_return_val_if_fail(index < array->len, NULL);
+
+       removed_node = array->pdata[index];
+
+       if(index != array->len - 1) {
+               g_memmove(array->pdata + index, array->pdata + array->len - 1,
+                       sizeof(gpointer));
+       }
+
+       array->len--;
+       array->pdata[array->len] = NULL;
+
+       return removed_node;
+}
+
+gboolean
+g_ptr_array_remove(GPtrArray *array, gpointer data)
+{
+       guint i;
+
+       g_return_val_if_fail(array != NULL, FALSE);
+
+       for(i = 0; i < array->len; i++) {
+               if(array->pdata[i] == data) {
+                       g_ptr_array_remove_index(array, i);
+                       return TRUE;
+               }
+       }
+
+       return FALSE;
+}
+
+gboolean
+g_ptr_array_remove_fast(GPtrArray *array, gpointer data)
+{
+       guint i;
+
+       g_return_val_if_fail(array != NULL, FALSE);
+
+       for(i = 0; i < array->len; i++) {
+               if(array->pdata[i] == data) {
+                       array->len--;
+                       if (array->len > 0)
+                               array->pdata [i] = array->pdata [array->len];
+                       else
+                               array->pdata [i] = NULL;
+                       return TRUE;
+               }
+       }
+
+       return FALSE;
+}
+
+void 
+g_ptr_array_foreach(GPtrArray *array, GFunc func, gpointer user_data)
+{
+       guint i;
+
+       for(i = 0; i < array->len; i++) {
+               func(g_ptr_array_index(array, i), user_data);
+       }
+}
+
+void
+g_ptr_array_sort(GPtrArray *array, GCompareFunc compare)
+{
+       g_return_if_fail(array != NULL);
+       qsort(array->pdata, array->len, sizeof(gpointer), compare);
+}
+
+void
+g_ptr_array_sort_with_data (GPtrArray *array, GCompareDataFunc compare, gpointer user_data)
+{
+       g_return_if_fail (array != NULL);
+       
+       g_qsort_with_data (array->pdata, array->len, sizeof (gpointer), compare, user_data);
+}
+
diff --git a/mono/eglib/gqsort.c b/mono/eglib/gqsort.c
new file mode 100644 (file)
index 0000000..59bd453
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * QuickSort
+ *
+ * Author: Jeffrey Stedfast <fejj@novell.com>
+ *
+ * (C) 2011 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdlib.h>
+#include <glib.h>
+
+/* Any segment <= this threshold will be sorted using insertion
+ * sort. OpenBSD seems to use a value of 7 so we'll go with that for
+ * now... */
+#define MAX_THRESHOLD 7
+
+#define STACK_SIZE (8 * sizeof (size_t))
+
+typedef struct _QSortStack {
+       char *array;
+       size_t count;
+} QSortStack;
+
+#define QSORT_PUSH(sp, a, c) (sp->array = a, sp->count = c, sp++)
+#define QSORT_POP(sp, a, c) (sp--, a = sp->array, c = sp->count)
+
+#define SWAPTYPE(TYPE, a, b) {              \
+       long __n = size / sizeof (TYPE);    \
+       register TYPE *__a = (TYPE *) (a);  \
+       register TYPE *__b = (TYPE *) (b);  \
+       register TYPE t;                    \
+                                           \
+       do {                                \
+               t = *__a;                   \
+               *__a++ = *__b;              \
+               *__b++ = t;                 \
+       } while (--__n > 0);                \
+}
+
+#define SWAPBYTE(a, b) SWAPTYPE(char, (a), (b))
+#define SWAPLONG(a, b) SWAPTYPE(long, (a), (b))
+#define SWAP(a, b) if (swaplong) SWAPLONG((a), (b)) else SWAPBYTE((a), (b))
+
+/* check if we can swap by longs rather than bytes by making sure that
+ * memory is properly aligned and that the element size is a multiple
+ * of sizeof (long) */
+#define SWAP_INIT() swaplong = (((char *) base) - ((char *) 0)) % sizeof (long) == 0 && (size % sizeof (long)) == 0
+
+void
+g_qsort_with_data (gpointer base, size_t nmemb, size_t size, GCompareDataFunc compare, gpointer user_data)
+{
+       QSortStack stack[STACK_SIZE], *sp;
+       register char *i, *k, *mid;
+       size_t n, n1, n2;
+       char *lo, *hi;
+       int swaplong;
+       
+       if (nmemb <= 1)
+               return;
+       
+       SWAP_INIT ();
+       
+       /* initialize our stack */
+       sp = stack;
+       QSORT_PUSH (sp, base, nmemb);
+       
+       do {
+               QSORT_POP (sp, lo, n);
+               
+               hi = lo + (n - 1) * size;
+               
+               if (n < MAX_THRESHOLD) {
+                       /* switch to insertion sort */
+                       for (i = lo + size; i <= hi; i += size)
+                               for (k = i; k > lo && compare (k - size, k, user_data) > 0; k -= size)
+                                       SWAP (k - size, k);
+                       
+                       continue;
+               }
+               
+               /* calculate the middle element */
+               mid = lo + (n / 2) * size;
+               
+               /* once we re-order the lo, mid, and hi elements to be in
+                * ascending order, we'll use mid as our pivot. */
+               if (compare (mid, lo, user_data) < 0) {
+                       SWAP (mid, lo);
+               }
+               
+               if (compare (hi, mid, user_data) < 0) {
+                       SWAP (mid, hi);
+                       if (compare (mid, lo, user_data) < 0) {
+                               SWAP (mid, lo);
+                       }
+               }
+               
+               /* since we've already guaranteed that lo <= mid and mid <= hi,
+                * we can skip comparing them again */
+               i = lo + size;
+               k = hi - size;
+               
+               do {
+                       /* find the first element with a value > pivot value */
+                       while (i < k && compare (i, mid, user_data) <= 0)
+                               i += size;
+                       
+                       /* find the last element with a value <= pivot value */
+                       while (k >= i && compare (mid, k, user_data) < 0)
+                               k -= size;
+                       
+                       if (k <= i)
+                               break;
+                       
+                       SWAP (i, k);
+                       
+                       /* make sure we keep track of our pivot element */
+                       if (mid == i) {
+                               mid = k;
+                       } else if (mid == k) {
+                               mid = i;
+                       }
+                       
+                       i += size;
+                       k -= size;
+               } while (1);
+               
+               if (k != mid) {
+                       /* swap the pivot with the last element in the first partition */
+                       SWAP (mid, k);
+               }
+               
+               /* calculate segment sizes */
+               n2 = (hi - k) / size;
+               n1 = (k - lo) / size;
+               
+               /* push our partitions onto the stack, largest first
+                * (to make sure we don't run out of stack space) */
+               if (n2 > n1) {
+                       if (n2 > 1) QSORT_PUSH (sp, k + size, n2);
+                       if (n1 > 1) QSORT_PUSH (sp, lo, n1);
+               } else {
+                       if (n1 > 1) QSORT_PUSH (sp, lo, n1);
+                       if (n2 > 1) QSORT_PUSH (sp, k + size, n2);
+               }
+       } while (sp > stack);
+}
diff --git a/mono/eglib/gqueue.c b/mono/eglib/gqueue.c
new file mode 100644 (file)
index 0000000..cd94e1f
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * gqueue.c: Queue
+ *
+ * Author:
+ *   Duncan Mak (duncan@novell.com)
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2006-2009 Novell, Inc.
+ *
+ */
+
+#include <stdio.h>
+#include <glib.h>
+
+gpointer
+g_queue_pop_head (GQueue *queue)
+{
+       gpointer result;
+       GList *old_head;
+
+       if (!queue || queue->length == 0)
+               return NULL;
+
+       result = queue->head->data;
+       old_head = queue->head;
+       queue->head = old_head->next;
+       g_list_free_1 (old_head);
+
+       if (--queue->length)
+               queue->head->prev = NULL;
+       else
+               queue->tail = NULL;
+
+       return result;
+}
+
+gboolean
+g_queue_is_empty (GQueue *queue)
+{
+       if (!queue)
+               return TRUE;
+       
+       return queue->length == 0;
+}
+
+void
+g_queue_push_head (GQueue *queue, gpointer head)
+{
+       if (!queue)
+               return;
+       
+       queue->head = g_list_prepend (queue->head, head);
+       
+       if (!queue->tail)
+               queue->tail = queue->head;
+
+       queue->length ++;
+}
+
+void
+g_queue_push_tail (GQueue *queue, gpointer data)
+{
+       if (!queue)
+               return;
+
+       queue->tail = g_list_append (queue->tail, data);
+       if (queue->head == NULL)
+               queue->head = queue->tail;
+       else
+               queue->tail = queue->tail->next;
+       queue->length++;
+}
+
+GQueue *
+g_queue_new (void)
+{
+       return g_new0 (GQueue, 1);
+}
+
+void
+g_queue_free (GQueue *queue)
+{
+       if (!queue)
+               return;
+       
+       g_list_free (queue->head);
+       g_free (queue);
+}
+
+void 
+g_queue_foreach (GQueue *queue, GFunc func, gpointer user_data)
+{
+       g_list_foreach (queue->head, func, user_data);
+}
diff --git a/mono/eglib/gshell.c b/mono/eglib/gshell.c
new file mode 100644 (file)
index 0000000..43b4c17
--- /dev/null
@@ -0,0 +1,291 @@
+/*
+ * Shell utility functions.
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdio.h>
+#include <glib.h>
+
+static int
+split_cmdline (const gchar *cmdline, GPtrArray *array, GError **error)
+{
+       gchar *ptr;
+       gchar c;
+       gboolean escaped = FALSE, fresh = TRUE;
+       gchar quote_char = '\0';
+       GString *str;
+
+       str = g_string_new ("");
+       ptr = (gchar *) cmdline;
+       while ((c = *ptr++) != '\0') {
+               if (escaped) {
+                       /*
+                        * \CHAR is only special inside a double quote if CHAR is
+                        * one of: $`"\ and newline
+                        */
+                       if (quote_char == '\"'){
+                               if (!(c == '$' || c == '`' || c == '"' || c == '\\'))
+                                       g_string_append_c (str, '\\');
+                               g_string_append_c (str, c);
+                       } else {
+                               if (!g_ascii_isspace (c))
+                                       g_string_append_c (str, c);
+                       }
+                       escaped = FALSE;
+               } else if (quote_char) {
+                       if (c == quote_char) {
+                               quote_char = '\0';
+                               if (fresh && (g_ascii_isspace (*ptr) || *ptr == '\0')){
+                                       g_ptr_array_add (array, g_string_free (str, FALSE));
+                                       str = g_string_new ("");
+                               }
+                       } else if (c == '\\'){
+                               escaped = TRUE;
+                       } else 
+                               g_string_append_c (str, c);
+               } else if (g_ascii_isspace (c)) {
+                       if (str->len > 0) {
+                               g_ptr_array_add (array, g_string_free (str, FALSE));
+                               str = g_string_new ("");
+                       }
+               } else if (c == '\\') {
+                       escaped = TRUE;
+               } else if (c == '\'' || c == '"') {
+                       fresh = str->len == 0;
+                       quote_char = c;
+               } else {
+                       g_string_append_c (str, c);
+               }
+       }
+
+       if (escaped) {
+               if (error)
+                       *error = g_error_new (G_LOG_DOMAIN, 0, "Unfinished escape.");
+               g_string_free (str, TRUE);
+               return -1;
+       }
+
+       if (quote_char) {
+               if (error)
+                       *error = g_error_new (G_LOG_DOMAIN, 0, "Unfinished quote.");
+               g_string_free (str, TRUE);
+               return -1;
+       }
+
+       if (str->len > 0) {
+               g_ptr_array_add (array, g_string_free (str, FALSE));
+       } else {
+               g_string_free (str, TRUE);
+       }
+       g_ptr_array_add (array, NULL);
+       return 0;
+}
+
+gboolean
+g_shell_parse_argv (const gchar *command_line, gint *argcp, gchar ***argvp, GError **error)
+{
+       GPtrArray *array;
+       gint argc;
+       gchar **argv;
+
+       g_return_val_if_fail (command_line, FALSE);
+       g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+       array = g_ptr_array_new();
+       if (split_cmdline (command_line, array, error)) {
+               g_ptr_array_add (array, NULL);
+               g_strfreev ((gchar **) array->pdata);
+               g_ptr_array_free (array, FALSE);
+               return FALSE;
+       }
+
+       argc = array->len;
+       argv = (gchar **) array->pdata;
+
+       if (argc == 1) {
+               g_strfreev (argv);
+               g_ptr_array_free (array, FALSE);
+               return FALSE;
+       }
+
+       if (argcp) {
+               *argcp = array->len - 1;
+       }
+
+       if (argvp) {
+               *argvp = argv;
+       } else {
+               g_strfreev (argv);
+       }
+
+       g_ptr_array_free (array, FALSE);
+       return TRUE;
+}
+
+gchar *
+g_shell_quote (const gchar *unquoted_string)
+{
+       GString *result = g_string_new ("'");
+       const gchar *p;
+       
+       for (p = unquoted_string; *p; p++){
+               if (*p == '\'')
+                       g_string_append (result, "'\\'");
+               g_string_append_c (result, *p);
+       }
+       g_string_append_c (result, '\'');
+       return g_string_free (result, FALSE);
+}
+
+gchar *
+g_shell_unquote (const gchar *quoted_string, GError **error)
+{
+       GString *result;
+       const char *p;
+       int do_unquote = 0;
+
+       if (quoted_string == NULL)
+               return NULL;
+       
+       /* Quickly try to determine if we need to unquote or not */
+       for (p = quoted_string; *p; p++){
+               if (*p == '\'' || *p == '"' || *p == '\\'){
+                       do_unquote = 1;
+                       break;
+               }
+       }
+       
+       if (!do_unquote)
+               return g_strdup (quoted_string);
+
+       /* We do need to unquote */
+       result = g_string_new ("");
+       for (p = quoted_string; *p; p++){
+
+               if (*p == '\''){
+                       /* Process single quote, not even \ is processed by glib's version */
+                       for (p++; *p; p++){
+                               if (*p == '\'')
+                                       break;
+                               g_string_append_c (result, *p);
+                       }
+                       if (!*p){
+                               g_set_error (error, 0, 0, "Open quote");
+                               return NULL;
+                       }
+               } else if (*p == '"'){
+                       /* Process double quote, allows some escaping */
+                       for (p++; *p; p++){
+                               if (*p == '"')
+                                       break;
+                               if (*p == '\\'){
+                                       p++;
+                                       if (*p == 0){
+                                               g_set_error (error, 0, 0, "Open quote");
+                                               return NULL;
+                                       }
+                                       switch (*p){
+                                       case '$':
+                                       case '"':
+                                       case '\\':
+                                       case '`':
+                                               break;
+                                       default:
+                                               g_string_append_c (result, '\\');
+                                               break;
+                                       }
+                               } 
+                               g_string_append_c (result, *p);
+                       }
+                       if (!*p){
+                               g_set_error (error, 0, 0, "Open quote");
+                               return NULL;
+                       }
+               } else if (*p == '\\'){
+                       char c = *(++p);
+                       if (!(c == '$' || c == '"' || c == '\\' || c == '`' || c == '\'' || c == 0 ))
+                               g_string_append_c (result, '\\');
+                       if (c == 0)
+                               break;
+                       else
+                               g_string_append_c (result, c);
+               } else
+                       g_string_append_c (result, *p);
+       }
+       return g_string_free (result, FALSE);
+}
+
+#if JOINT_TEST
+/*
+ * This test is designed to be built with the 2 glib/eglib to compare
+ */
+
+char *args [] = {
+       "\\",
+       "\"Foo'bar\"",
+       "'foo'",
+       "'fo\'b'",
+       "'foo\"bar'",
+       "'foo' dingus bar",
+       "'foo' 'bar' 'baz'",
+       "\"foo\" 'bar' \"baz\"",
+       "\"f\\$\\\'",
+       "\"\\",
+       "\\\\",
+       "'\\\\'",
+       "\"f\\$\"\\\"\\\\", //  /\\\"\\\\"
+       "'f\\$'\\\"\\\\", 
+       "'f\\$\\\\'", 
+       NULL
+};
+
+
+int
+main ()
+{
+       char **s = args;
+       int i;
+       
+       while (*s){
+               char *r1 = g_shell_unquote (*s, NULL);
+               char *r2 = g2_shell_unquote (*s, NULL);
+               char *ok = r1 == r2 ? "ok" : (r1 != NULL && r2 != NULL && strcmp (r1, r2) == 0) ? "ok" : "fail";
+               
+               printf ("%s [%s] -> [%s] - [%s]\n", ok, *s, r1, r2);
+               s++;
+       }
+       return;
+       char buffer [10];
+       buffer [0] = '\"';
+       buffer [1] = '\\';
+       buffer [3] = '\"';
+       buffer [4] = 0;
+       
+       for (i = 32; i < 255; i++){
+               buffer [2] = i;
+               printf ("%d [%s] -> [%s]\n", i, buffer, g_shell_unquote (buffer, NULL));
+       }
+}
+#endif
diff --git a/mono/eglib/gslist.c b/mono/eglib/gslist.c
new file mode 100644 (file)
index 0000000..5baa297
--- /dev/null
@@ -0,0 +1,362 @@
+/*
+ * gslist.c: Singly-linked list implementation
+ *
+ * Authors:
+ *   Duncan Mak (duncan@novell.com)
+ *   Raja R Harinath (rharinath@novell.com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * (C) 2006 Novell, Inc.
+ */
+
+#include <stdio.h>
+#include <glib.h>
+
+GSList*
+g_slist_alloc (void)
+{
+       return g_new0 (GSList, 1);
+}
+
+void
+g_slist_free_1 (GSList *list)
+{
+       g_free (list);
+}
+
+GSList*
+g_slist_append (GSList *list, gpointer data)
+{
+       return g_slist_concat (list, g_slist_prepend (NULL, data));
+}
+
+/* This is also a list node constructor. */
+GSList*
+g_slist_prepend (GSList *list, gpointer data)
+{
+       GSList *head = g_slist_alloc ();
+       head->data = data;
+       head->next = list;
+
+       return head;
+}
+
+/*
+ * Insert the given data in a new node after the current node. 
+ * Return new node.
+ */
+static inline GSList *
+insert_after (GSList *list, gpointer data)
+{
+       list->next = g_slist_prepend (list->next, data);
+       return list->next;
+}
+
+/*
+ * Return the node prior to the node containing 'data'.
+ * If the list is empty, or the first node contains 'data', return NULL.
+ * If no node contains 'data', return the last node.
+ */
+static inline GSList*
+find_prev (GSList *list, gconstpointer data)
+{
+       GSList *prev = NULL;
+       while (list) {
+               if (list->data == data)
+                       break;
+               prev = list;
+               list = list->next;
+       }
+       return prev;
+}
+
+/* like 'find_prev', but searches for node 'link' */
+static inline GSList*
+find_prev_link (GSList *list, GSList *link)
+{
+       GSList *prev = NULL;
+       while (list) {
+               if (list == link)
+                       break;
+               prev = list;
+               list = list->next;
+       }
+       return prev;
+}
+
+GSList*
+g_slist_insert_before (GSList *list, GSList *sibling, gpointer data)
+{
+       GSList *prev = find_prev_link (list, sibling);
+
+       if (!prev)
+               return g_slist_prepend (list, data);
+
+       insert_after (prev, data);
+       return list;
+}
+
+void
+g_slist_free (GSList *list)
+{
+       while (list) {
+               GSList *next = list->next;
+               g_slist_free_1 (list);
+               list = next;
+       }
+}
+
+GSList*
+g_slist_copy (GSList *list)
+{
+       GSList *copy, *tmp;
+
+       if (!list)
+               return NULL;
+
+       copy = g_slist_prepend (NULL, list->data);
+       tmp = copy;
+
+       for (list = list->next; list; list = list->next)
+               tmp = insert_after (tmp, list->data);
+
+       return copy;
+}
+
+GSList*
+g_slist_concat (GSList *list1, GSList *list2)
+{
+       if (!list1)
+               return list2;
+
+       g_slist_last (list1)->next = list2;
+       return list1;
+}
+
+void
+g_slist_foreach (GSList *list, GFunc func, gpointer user_data)
+{
+       while (list) {
+               (*func) (list->data, user_data);
+               list = list->next;
+       }
+}
+
+GSList*
+g_slist_last (GSList *list)
+{
+       if (!list)
+               return NULL;
+
+       while (list->next)
+               list = list->next;
+
+       return list;
+}
+
+GSList*
+g_slist_find (GSList *list, gconstpointer data)
+{
+       for (; list; list = list->next)
+               if (list->data == data)
+                       break;
+       return list;
+}
+
+GSList *
+g_slist_find_custom (GSList *list, gconstpointer data, GCompareFunc func)
+{
+       if (!func)
+               return NULL;
+       
+       while (list) {
+               if (func (list->data, data) == 0)
+                       return list;
+               
+               list = list->next;
+       }
+       
+       return NULL;
+}
+
+guint
+g_slist_length (GSList *list)
+{
+       guint length = 0;
+
+       while (list) {
+               length ++;
+               list = list->next;
+       }
+
+       return length;
+}
+
+GSList*
+g_slist_remove (GSList *list, gconstpointer data)
+{
+       GSList *prev = find_prev (list, data);
+       GSList *current = prev ? prev->next : list;
+
+       if (current) {
+               if (prev)
+                       prev->next = current->next;
+               else
+                       list = current->next;
+               g_slist_free_1 (current);
+       }
+
+       return list;
+}
+
+GSList*
+g_slist_remove_all (GSList *list, gconstpointer data)
+{
+       GSList *next = list;
+       GSList *prev = NULL;
+       GSList *current;
+
+       while (next) {
+               GSList *tmp_prev = find_prev (next, data);
+               if (tmp_prev)
+                       prev = tmp_prev;
+               current = prev ? prev->next : list;
+
+               if (!current)
+                       break;
+
+               next = current->next;
+
+               if (prev)
+                       prev->next = next;
+               else
+                       list = next;
+               g_slist_free_1 (current);
+       }
+
+       return list;
+}
+
+GSList*
+g_slist_remove_link (GSList *list, GSList *link)
+{
+       GSList *prev = find_prev_link (list, link);
+       GSList *current = prev ? prev->next : list;
+
+       if (current) {
+               if (prev)
+                       prev->next = current->next;
+               else
+                       list = current->next;
+               current->next = NULL;
+       }
+
+       return list;
+}
+
+GSList*
+g_slist_delete_link (GSList *list, GSList *link)
+{
+       list = g_slist_remove_link (list, link);
+       g_slist_free_1 (link);
+
+       return list;
+}
+
+GSList*
+g_slist_reverse (GSList *list)
+{
+       GSList *prev = NULL;
+       while (list){
+               GSList *next = list->next;
+               list->next = prev;
+               prev = list;
+               list = next;
+       }
+
+       return prev;
+}
+
+GSList*
+g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func)
+{
+       GSList *prev = NULL;
+       
+       if (!func)
+               return list;
+
+       if (!list || func (list->data, data) > 0)
+               return g_slist_prepend (list, data);
+
+       /* Invariant: func (prev->data, data) <= 0) */
+       for (prev = list; prev->next; prev = prev->next)
+               if (func (prev->next->data, data) > 0)
+                       break;
+
+       /* ... && (prev->next == 0 || func (prev->next->data, data) > 0)) */
+       insert_after (prev, data);
+       return list;
+}
+
+gint
+g_slist_index (GSList *list, gconstpointer data)
+{
+       gint index = 0;
+       
+       while (list) {
+               if (list->data == data)
+                       return index;
+               
+               index++;
+               list = list->next;
+       }
+       
+       return -1;
+}
+
+GSList*
+g_slist_nth (GSList *list, guint n)
+{
+       for (; list; list = list->next) {
+               if (n == 0)
+                       break;
+               n--;
+       }
+       return list;
+}
+
+gpointer
+g_slist_nth_data (GSList *list, guint n)
+{
+       GSList *node = g_slist_nth (list, n);
+       return node ? node->data : NULL;
+}
+
+typedef GSList list_node;
+#include "sort.frag.h"
+
+GSList*
+g_slist_sort (GSList *list, GCompareFunc func)
+{
+       if (!list || !list->next)
+               return list;
+       return do_sort (list, func);
+}
diff --git a/mono/eglib/gspawn.c b/mono/eglib/gspawn.c
new file mode 100644 (file)
index 0000000..01639be
--- /dev/null
@@ -0,0 +1,530 @@
+/*
+ * Spawning processes.
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+
+#include <glib.h>
+
+#ifdef HAVE_UNISTD_H
+#ifndef __USE_GNU
+#define __USE_GNU
+#endif
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#ifdef HAVE_SYS_RESOURCE_H
+#  include <sys/resource.h>
+#endif
+
+#ifdef G_OS_WIN32
+#include <io.h>
+#include <winsock2.h>
+#define open _open
+#define close _close
+#define read _read
+#define write _write
+/* windows pipe api details: http://msdn2.microsoft.com/en-us/library/edze9h7e(VS.80).aspx */
+#define pipe(x) _pipe(x, 256, 0)
+#endif
+
+#define set_error(msg, ...) do { if (error != NULL) *error = g_error_new (G_LOG_DOMAIN, 1, msg, __VA_ARGS__); } while (0)
+#define set_error_cond(cond,msg, ...) do { if ((cond) && error != NULL) *error = g_error_new (G_LOG_DOMAIN, 1, msg, __VA_ARGS__); } while (0)
+#define set_error_status(status,msg, ...) do { if (error != NULL) *error = g_error_new (G_LOG_DOMAIN, status, msg, __VA_ARGS__); } while (0)
+#define NO_INTR(var,cmd) do { (var) = (cmd); } while ((var) == -1 && errno == EINTR)
+#define CLOSE_PIPE(p) do { close (p [0]); close (p [1]); } while (0)
+
+#if defined(__APPLE__)
+#if defined (TARGET_OSX)
+/* Apple defines this in crt_externs.h but doesn't provide that header for 
+ * arm-apple-darwin9.  We'll manually define the symbol on Apple as it does
+ * in fact exist on all implementations (so far) 
+ */
+gchar ***_NSGetEnviron(void);
+#define environ (*_NSGetEnviron())
+#else
+static char *mono_environ[1] = { NULL };
+#define environ mono_environ
+#endif /* defined (TARGET_OSX) */
+#elif defined(_MSC_VER)
+/* MS defines this in stdlib.h */
+#else
+extern char **environ;
+#endif
+
+#ifndef G_OS_WIN32
+static int
+safe_read (int fd, gchar *buffer, gint count, GError **error)
+{
+       int res;
+
+       NO_INTR (res, read (fd, buffer, count));
+       set_error_cond (res == -1, "%s", "Error reading from pipe.");
+       return res;
+}
+
+static int
+read_pipes (int outfd, gchar **out_str, int errfd, gchar **err_str, GError **error)
+{
+       fd_set rfds;
+       int res;
+       gboolean out_closed;
+       gboolean err_closed;
+       GString *out = NULL;
+       GString *err = NULL;
+       gchar *buffer = NULL;
+       gint nread;
+
+       out_closed = (outfd < 0);
+       err_closed = (errfd < 0);
+       if (out_str) {
+               *out_str = NULL;
+               out = g_string_new ("");
+       }       
+
+       if (err_str) {
+               *err_str = NULL;
+               err = g_string_new ("");
+       }       
+
+       do {
+               if (out_closed && err_closed)
+                       break;
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4389)
+#endif
+
+               FD_ZERO (&rfds);
+               if (!out_closed && outfd >= 0)
+                       FD_SET (outfd, &rfds);
+               if (!err_closed && errfd >= 0)
+                       FD_SET (errfd, &rfds);
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+               res = select (MAX (outfd, errfd) + 1, &rfds, NULL, NULL, NULL);
+               if (res > 0) {
+                       if (buffer == NULL)
+                               buffer = g_malloc (1024);
+                       if (!out_closed && FD_ISSET (outfd, &rfds)) {
+                               nread = safe_read (outfd, buffer, 1024, error);
+                               if (nread < 0) {
+                                       close (errfd);
+                                       close (outfd);
+                                       return -1;
+                               }
+                               g_string_append_len (out, buffer, nread);
+                               if (nread <= 0) {
+                                       out_closed = TRUE;
+                                       close (outfd);
+                               }
+                       }
+
+                       if (!err_closed && FD_ISSET (errfd, &rfds)) {
+                               nread = safe_read (errfd, buffer, 1024, error);
+                               if (nread < 0) {
+                                       close (errfd);
+                                       close (outfd);
+                                       return -1;
+                               }
+                               g_string_append_len (err, buffer, nread);
+                               if (nread <= 0) {
+                                       err_closed = TRUE;
+                                       close (errfd);
+                               }
+                       }
+               }
+       } while (res > 0 || (res == -1 && errno == EINTR));
+
+       g_free (buffer);
+       if (out_str)
+               *out_str = g_string_free (out, FALSE);
+
+       if (err_str)
+               *err_str = g_string_free (err, FALSE);
+
+       return 0;
+}
+
+static gboolean
+create_pipe (int *fds, GError **error)
+{
+       if (pipe (fds) == -1) {
+               set_error ("%s", "Error creating pipe.");
+               return FALSE;
+       }
+       return TRUE;
+}
+#endif /* G_OS_WIN32 */
+
+static int
+write_all (int fd, const void *vbuf, size_t n)
+{
+       const char *buf = (const char *) vbuf;
+       size_t nwritten = 0;
+       int w;
+       
+       do {
+               do {
+                       w = write (fd, buf + nwritten, n - nwritten);
+               } while (w == -1 && errno == EINTR);
+               
+               if (w == -1)
+                       return -1;
+               
+               nwritten += w;
+       } while (nwritten < n);
+       
+       return nwritten;
+}
+
+#ifndef G_OS_WIN32
+int
+eg_getdtablesize (void)
+{
+#ifdef HAVE_GETRLIMIT
+       struct rlimit limit;
+       int res;
+
+       res = getrlimit (RLIMIT_NOFILE, &limit);
+       g_assert (res == 0);
+       return limit.rlim_cur;
+#else
+       return getdtablesize ();
+#endif
+}
+#else
+int
+eg_getdtablesize (void)
+{
+       g_error ("Should not be called");
+}
+#endif
+
+gboolean
+g_spawn_command_line_sync (const gchar *command_line,
+                               gchar **standard_output,
+                               gchar **standard_error,
+                               gint *exit_status,
+                               GError **error)
+{
+#ifdef G_OS_WIN32
+#elif !defined (HAVE_FORK) || !defined (HAVE_EXECV)
+       fprintf (stderr, "g_spawn_command_line_sync not supported on this platform\n");
+       return FALSE;
+#else
+       pid_t pid;
+       gchar **argv;
+       gint argc;
+       int stdout_pipe [2] = { -1, -1 };
+       int stderr_pipe [2] = { -1, -1 };
+       int status;
+       int res;
+       
+       if (!g_shell_parse_argv (command_line, &argc, &argv, error))
+               return FALSE;
+
+       if (standard_output && !create_pipe (stdout_pipe, error))
+               return FALSE;
+
+       if (standard_error && !create_pipe (stderr_pipe, error)) {
+               if (standard_output) {
+                       CLOSE_PIPE (stdout_pipe);
+               }
+               return FALSE;
+       }
+
+       pid = fork ();
+       if (pid == 0) {
+               gint i;
+
+               if (standard_output) {
+                       close (stdout_pipe [0]);
+                       dup2 (stdout_pipe [1], STDOUT_FILENO);
+               }
+
+               if (standard_error) {
+                       close (stderr_pipe [0]);
+                       dup2 (stderr_pipe [1], STDERR_FILENO);
+               }
+               for (i = eg_getdtablesize () - 1; i >= 3; i--)
+                       close (i);
+
+               /* G_SPAWN_SEARCH_PATH is always enabled for g_spawn_command_line_sync */
+               if (!g_path_is_absolute (argv [0])) {
+                       gchar *arg0;
+
+                       arg0 = g_find_program_in_path (argv [0]);
+                       if (arg0 == NULL) {
+                               exit (1);
+                       }
+                       //g_free (argv [0]);
+                       argv [0] = arg0;
+               }
+               execv (argv [0], argv);
+               exit (1); /* TODO: What now? */
+       }
+
+       g_strfreev (argv);
+       if (standard_output)
+               close (stdout_pipe [1]);
+
+       if (standard_error)
+               close (stderr_pipe [1]);
+
+       if (standard_output || standard_error) {
+               res = read_pipes (stdout_pipe [0], standard_output, stderr_pipe [0], standard_error, error);
+               if (res) {
+                       waitpid (pid, &status, WNOHANG); /* avoid zombie */
+                       return FALSE;
+               }
+       }
+
+       NO_INTR (res, waitpid (pid, &status, 0));
+
+       /* TODO: What if error? */
+       if (WIFEXITED (status) && exit_status) {
+               *exit_status = WEXITSTATUS (status);
+       }
+#endif
+       return TRUE;
+}
+
+/*
+ * This is the only use we have in mono/metadata
+!g_spawn_async_with_pipes (NULL, (char**)addr_argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &child_pid, &ch_in, &ch_out, NULL, NULL)
+*/
+gboolean
+g_spawn_async_with_pipes (const gchar *working_directory,
+                       gchar **argv,
+                       gchar **envp,
+                       GSpawnFlags flags,
+                       GSpawnChildSetupFunc child_setup,
+                       gpointer user_data,
+                       GPid *child_pid,
+                       gint *standard_input,
+                       gint *standard_output,
+                       gint *standard_error,
+                       GError **error)
+{
+#ifdef G_OS_WIN32
+#elif !defined (HAVE_FORK) || !defined (HAVE_EXECVE)
+       fprintf (stderr, "g_spawn_async_with_pipes is not supported on this platform\n");
+       return FALSE;
+#else
+       pid_t pid;
+       int info_pipe [2];
+       int in_pipe [2] = { -1, -1 };
+       int out_pipe [2] = { -1, -1 };
+       int err_pipe [2] = { -1, -1 };
+       int status;
+
+       g_return_val_if_fail (argv != NULL, FALSE); /* Only mandatory arg */
+
+       if (!create_pipe (info_pipe, error))
+               return FALSE;
+
+       if (standard_output && !create_pipe (out_pipe, error)) {
+               CLOSE_PIPE (info_pipe);
+               return FALSE;
+       }
+
+       if (standard_error && !create_pipe (err_pipe, error)) {
+               CLOSE_PIPE (info_pipe);
+               CLOSE_PIPE (out_pipe);
+               return FALSE;
+       }
+
+       if (standard_input && !create_pipe (in_pipe, error)) {
+               CLOSE_PIPE (info_pipe);
+               CLOSE_PIPE (out_pipe);
+               CLOSE_PIPE (err_pipe);
+               return FALSE;
+       }
+
+       pid = fork ();
+       if (pid == -1) {
+               CLOSE_PIPE (info_pipe);
+               CLOSE_PIPE (out_pipe);
+               CLOSE_PIPE (err_pipe);
+               CLOSE_PIPE (in_pipe);
+               set_error ("%s", "Error in fork ()");
+               return FALSE;
+       }
+
+       if (pid == 0) {
+               /* No zombie left behind */
+               if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0) {
+                       pid = fork ();
+               }
+
+               if (pid != 0) {
+                       exit (pid == -1 ? 1 : 0);
+               }  else {
+                       gint i;
+                       int fd;
+                       gchar *arg0;
+                       gchar **actual_args;
+                       gint unused;
+
+                       close (info_pipe [0]);
+                       close (in_pipe [1]);
+                       close (out_pipe [0]);
+                       close (err_pipe [0]);
+
+                       /* when exec* succeeds, we want to close this fd, which will return
+                        * a 0 read on the parent. We're not supposed to keep it open forever.
+                        * If exec fails, we still can write the error to it before closing.
+                        */
+                       fcntl (info_pipe [1], F_SETFD, FD_CLOEXEC);
+
+                       if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0) {
+                               pid = getpid ();
+                               NO_INTR (unused, write_all (info_pipe [1], &pid, sizeof (pid_t)));
+                       }
+
+                       if (working_directory && chdir (working_directory) == -1) {
+                               int err = errno;
+                               NO_INTR (unused, write_all (info_pipe [1], &err, sizeof (int)));
+                               exit (0);
+                       }
+
+                       if (standard_output) {
+                               dup2 (out_pipe [1], STDOUT_FILENO);
+                       } else if ((flags & G_SPAWN_STDOUT_TO_DEV_NULL) != 0) {
+                               fd = open ("/dev/null", O_WRONLY);
+                               dup2 (fd, STDOUT_FILENO);
+                       }
+
+                       if (standard_error) {
+                               dup2 (err_pipe [1], STDERR_FILENO);
+                       } else if ((flags & G_SPAWN_STDERR_TO_DEV_NULL) != 0) {
+                               fd = open ("/dev/null", O_WRONLY);
+                               dup2 (fd, STDERR_FILENO);
+                       }
+
+                       if (standard_input) {
+                               dup2 (in_pipe [0], STDIN_FILENO);
+                       } else if ((flags & G_SPAWN_CHILD_INHERITS_STDIN) == 0) {
+                               fd = open ("/dev/null", O_RDONLY);
+                               dup2 (fd, STDIN_FILENO);
+                       }
+
+                       if ((flags & G_SPAWN_LEAVE_DESCRIPTORS_OPEN) != 0) {
+                               for (i = eg_getdtablesize () - 1; i >= 3; i--)
+                                       close (i);
+                       }
+
+                       actual_args = ((flags & G_SPAWN_FILE_AND_ARGV_ZERO) == 0) ? argv : argv + 1;
+                       if (envp == NULL)
+                               envp = environ;
+
+                       if (child_setup)
+                               child_setup (user_data);
+
+                       arg0 = argv [0];
+                       if (!g_path_is_absolute (arg0) || (flags & G_SPAWN_SEARCH_PATH) != 0) {
+                               arg0 = g_find_program_in_path (argv [0]);
+                               if (arg0 == NULL) {
+                                       int err = ENOENT;
+                                       write_all (info_pipe [1], &err, sizeof (int));
+                                       exit (0);
+                               }
+                       }
+
+                       execve (arg0, actual_args, envp);
+                       write_all (info_pipe [1], &errno, sizeof (int));
+                       exit (0);
+               }
+       } else if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0) {
+               int w;
+               /* Wait for the first child if two are created */
+               NO_INTR (w, waitpid (pid, &status, 0));
+               if (status == 1 || w == -1) {
+                       CLOSE_PIPE (info_pipe);
+                       CLOSE_PIPE (out_pipe);
+                       CLOSE_PIPE (err_pipe);
+                       CLOSE_PIPE (in_pipe);
+                       set_error ("Error in fork (): %d", status);
+                       return FALSE;
+               }
+       }
+       close (info_pipe [1]);
+       close (in_pipe [0]);
+       close (out_pipe [1]);
+       close (err_pipe [1]);
+
+       if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0) {
+               int x;
+               NO_INTR (x, read (info_pipe [0], &pid, sizeof (pid_t))); /* if we read < sizeof (pid_t)... */
+       }
+
+       if (child_pid) {
+               *child_pid = pid;
+       }
+
+       if (read (info_pipe [0], &status, sizeof (int)) != 0) {
+               close (info_pipe [0]);
+               close (in_pipe [0]);
+               close (out_pipe [1]);
+               close (err_pipe [1]);
+               set_error_status (status, "Error in exec (%d -> %s)", status, strerror (status));
+               return FALSE;
+       }
+
+       close (info_pipe [0]);
+       if (standard_input)
+               *standard_input = in_pipe [1];
+       if (standard_output)
+               *standard_output = out_pipe [0];
+       if (standard_error)
+               *standard_error = err_pipe [0];
+#endif
+       return TRUE;
+}
+
+
diff --git a/mono/eglib/gstr.c b/mono/eglib/gstr.c
new file mode 100644 (file)
index 0000000..cd2fda3
--- /dev/null
@@ -0,0 +1,1045 @@
+/*
+ * gstr.c: String Utility Functions.
+ *
+ * Author:
+ *   Miguel de Icaza (miguel@novell.com)
+ *   Aaron Bockover (abockover@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <config.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <glib.h>
+
+#ifndef G_OS_WIN32
+#include <pthread.h>
+#endif
+
+#include <errno.h>
+
+/*
+ *  Linux knows two different versions of strerror_r () that can only be distinguished
+ *  by using feature test macros.  Please check the man pages for more details.
+ */
+#if defined (_POSIX_C_SOURCE) && defined (_GNU_SOURCE)
+#if (_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE
+#define USE_STRERROR_R_XSI
+#endif
+#endif
+
+/* 
+ * g_strndup and g_vasprintf need to allocate memory with g_malloc if 
+ * ENABLE_OVERRIDABLE_ALLOCATORS is defined so that it can be safely freed with g_free 
+ * rather than free.
+ */
+
+/* This is not a macro, because I dont want to put _GNU_SOURCE in the glib.h header */
+gchar *
+g_strndup (const gchar *str, gsize n)
+{
+#if defined (HAVE_STRNDUP) && !defined (ENABLE_OVERRIDABLE_ALLOCATORS)
+       return strndup (str, n);
+#else
+       if (str) {
+               char *retval = g_malloc(n+1);
+               if (retval) {
+                       strncpy(retval, str, n)[n] = 0;
+               }
+               return retval;
+       }
+       return NULL;
+#endif
+}
+
+gint g_vasprintf (gchar **ret, const gchar *fmt, va_list ap)
+{
+#if defined (HAVE_VASPRINTF) && !defined (ENABLE_OVERRIDABLE_ALLOCATORS)
+  return vasprintf (ret, fmt, ap);
+#else
+       char *buf;
+       int len;
+       size_t buflen;
+       va_list ap2;
+       
+#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR)
+       ap2 = ap;
+       len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( )
+#else
+       va_copy(ap2, ap);
+       len = vsnprintf(NULL, 0, fmt, ap2);
+#endif
+
+       if (len >= 0 && (buf = g_malloc ((buflen = (size_t) (len + 1)))) != NULL) {
+               len = vsnprintf(buf, buflen, fmt, ap);
+               *ret = buf;
+       } else {
+               *ret = NULL;
+               len = -1;
+       }
+
+       va_end(ap2);
+       return len;
+#endif
+}
+
+void
+g_strfreev (gchar **str_array)
+{
+       gchar **orig = str_array;
+       if (str_array == NULL)
+               return;
+       while (*str_array != NULL){
+               g_free (*str_array);
+               str_array++;
+       }
+       g_free (orig);
+}
+
+gchar **
+g_strdupv (gchar **str_array)
+{
+       guint length;
+       gchar **ret;
+       guint i;
+
+       if (!str_array)
+               return NULL;
+
+       length = g_strv_length(str_array);
+       ret = g_new0(gchar *, length + 1);
+       for (i = 0; str_array[i]; i++) {
+               ret[i] = g_strdup(str_array[i]);
+       }
+       ret[length] = NULL;
+       return ret;
+}
+
+guint
+g_strv_length(gchar **str_array)
+{
+       gint length = 0;
+       g_return_val_if_fail(str_array != NULL, 0);
+       for(length = 0; str_array[length] != NULL; length++);
+       return length;
+}
+
+gboolean
+g_str_has_suffix(const gchar *str, const gchar *suffix)
+{
+       size_t str_length;
+       size_t suffix_length;
+       
+       g_return_val_if_fail(str != NULL, FALSE);
+       g_return_val_if_fail(suffix != NULL, FALSE);
+
+       str_length = strlen(str);
+       suffix_length = strlen(suffix);
+
+       return suffix_length <= str_length ?
+               strncmp(str + str_length - suffix_length, suffix, suffix_length) == 0 :
+               FALSE;
+}
+
+gboolean
+g_str_has_prefix(const gchar *str, const gchar *prefix)
+{
+       size_t str_length;
+       size_t prefix_length;
+       
+       g_return_val_if_fail(str != NULL, FALSE);
+       g_return_val_if_fail(prefix != NULL, FALSE);
+
+       str_length = strlen(str);
+       prefix_length = strlen(prefix);
+
+       return prefix_length <= str_length ?
+               strncmp(str, prefix, prefix_length) == 0 :
+               FALSE;
+}
+
+gchar *
+g_strdup_vprintf (const gchar *format, va_list args)
+{
+       int n;
+       char *ret;
+       
+       n = g_vasprintf (&ret, format, args);
+       if (n == -1)
+               return NULL;
+
+       return ret;
+}
+
+gchar *
+g_strdup_printf (const gchar *format, ...)
+{
+       gchar *ret;
+       va_list args;
+       int n;
+
+       va_start (args, format);
+       n = g_vasprintf (&ret, format, args);
+       va_end (args);
+       if (n == -1)
+               return NULL;
+
+       return ret;
+}
+
+
+/*
+Max error number we support. It's empirically found by looking at our target OS.
+
+Last this was checked was June-2017.
+
+Apple is at 106.
+Android is at 133.
+*/
+#define MONO_ERRNO_MAX 200
+#define str(s) #s
+
+#ifndef G_OS_WIN32
+static pthread_mutex_t strerror_lock = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
+static char *error_messages [MONO_ERRNO_MAX];
+
+const gchar *
+g_strerror (gint errnum)
+{
+       if (errnum < 0)
+               errnum = -errnum;
+       if (errnum >= MONO_ERRNO_MAX)
+               return ("Error number higher than " str (MONO_ERRNO_MAX));
+
+       if (!error_messages [errnum]) {
+#ifndef G_OS_WIN32
+               pthread_mutex_lock (&strerror_lock);
+#endif
+
+#ifdef HAVE_STRERROR_R
+               char tmp_buff [128]; //Quite arbitrary, should be large enough
+               char *buff = tmp_buff;
+               size_t buff_len = sizeof (tmp_buff);
+               buff [0] = 0;
+
+#ifdef USE_STRERROR_R_XSI
+               int r;
+               while ((r = strerror_r (errnum, buff, buff_len - 1))) {
+                       if (r != ERANGE) {
+                               buff = g_strdup_printf ("Invalid Error code '%d'", errnum);
+                               break;
+                       }
+                       if (buff == tmp_buff)
+                               buff = g_malloc (buff_len * 2);
+                       else
+                               buff = g_realloc (buff, buff_len * 2);
+                       buff_len *= 2;
+                //Spec is not clean on whether size argument includes space for null terminator or not 
+               }
+               if (!error_messages [errnum])
+                       error_messages [errnum] = g_strdup (buff);
+               if (buff != tmp_buff)
+                       g_free (buff);
+#else /* USE_STRERROR_R_XSI */
+               buff = strerror_r (errnum, buff, buff_len);
+               if (!error_messages [errnum])
+                       error_messages [errnum] = g_strdup (buff);
+#endif /* USE_STRERROR_R_XSI */
+
+#else /* HAVE_STRERROR_R */
+               if (!error_messages [errnum])
+                       error_messages [errnum] = g_strdup_printf ("Error code '%d'", errnum);
+#endif /* HAVE_STRERROR_R */
+
+
+#ifndef G_OS_WIN32
+               pthread_mutex_unlock (&strerror_lock);
+#endif
+
+       }
+       return error_messages [errnum];
+}
+
+gchar *
+g_strconcat (const gchar *first, ...)
+{
+       va_list args;
+       size_t total = 0;
+       char *s, *ret;
+       g_return_val_if_fail (first != NULL, NULL);
+
+       total += strlen (first);
+       va_start (args, first);
+       for (s = va_arg (args, char *); s != NULL; s = va_arg(args, char *)){
+               total += strlen (s);
+       }
+       va_end (args);
+       
+       ret = g_malloc (total + 1);
+       if (ret == NULL)
+               return NULL;
+
+       ret [total] = 0;
+       strcpy (ret, first);
+       va_start (args, first);
+       for (s = va_arg (args, char *); s != NULL; s = va_arg(args, char *)){
+               strcat (ret, s);
+       }
+       va_end (args);
+
+       return ret;
+}
+
+static void
+add_to_vector (gchar ***vector, int size, gchar *token)
+{
+       *vector = *vector == NULL ? 
+               (gchar **)g_malloc(2 * sizeof(*vector)) :
+               (gchar **)g_realloc(*vector, (size + 1) * sizeof(*vector));
+               
+       (*vector)[size - 1] = token;
+}
+
+gchar ** 
+g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens)
+{
+       const gchar *c;
+       gchar *token, **vector;
+       gint size = 1;
+       
+       g_return_val_if_fail (string != NULL, NULL);
+       g_return_val_if_fail (delimiter != NULL, NULL);
+       g_return_val_if_fail (delimiter[0] != 0, NULL);
+       
+       if (strncmp (string, delimiter, strlen (delimiter)) == 0) {
+               vector = (gchar **)g_malloc (2 * sizeof(vector));
+               vector[0] = g_strdup ("");
+               size++;
+               string += strlen (delimiter);
+       } else {
+               vector = NULL;
+       }
+
+       while (*string && !(max_tokens > 0 && size >= max_tokens)) {
+               c = string;
+               if (strncmp (string, delimiter, strlen (delimiter)) == 0) {
+                       token = g_strdup ("");
+                       string += strlen (delimiter);
+               } else {
+                       while (*string && strncmp (string, delimiter, strlen (delimiter)) != 0) {
+                               string++;
+                       }
+
+                       if (*string) {
+                               gsize toklen = (string - c);
+                               token = g_strndup (c, toklen);
+
+                               /* Need to leave a trailing empty
+                                * token if the delimiter is the last
+                                * part of the string
+                                */
+                               if (strcmp (string, delimiter) != 0) {
+                                       string += strlen (delimiter);
+                               }
+                       } else {
+                               token = g_strdup (c);
+                       }
+               }
+                       
+               add_to_vector (&vector, size, token);
+               size++;
+       }
+
+       if (*string) {
+               if (strcmp (string, delimiter) == 0)
+                       add_to_vector (&vector, size, g_strdup (""));
+               else {
+                       /* Add the rest of the string as the last element */
+                       add_to_vector (&vector, size, g_strdup (string));
+               }
+               size++;
+       }
+       
+       if (vector == NULL) {
+               vector = (gchar **) g_malloc (2 * sizeof (vector));
+               vector [0] = NULL;
+       } else if (size > 0) {
+               vector[size - 1] = NULL;
+       }
+       
+       return vector;
+}
+
+static gboolean
+charcmp (gchar testchar, const gchar *compare)
+{
+       while(*compare) {
+               if (*compare == testchar) {
+                       return TRUE;
+               }
+               compare++;
+       }
+       
+       return FALSE;
+}
+
+gchar ** 
+g_strsplit_set (const gchar *string, const gchar *delimiter, gint max_tokens)
+{
+       const gchar *c;
+       gchar *token, **vector;
+       gint size = 1;
+       
+       g_return_val_if_fail (string != NULL, NULL);
+       g_return_val_if_fail (delimiter != NULL, NULL);
+       g_return_val_if_fail (delimiter[0] != 0, NULL);
+       
+       if (charcmp (*string, delimiter)) {
+               vector = (gchar **)g_malloc (2 * sizeof(vector));
+               vector[0] = g_strdup ("");
+               size++;
+               string++;
+       } else {
+               vector = NULL;
+       }
+
+       c = string;
+       while (*string && !(max_tokens > 0 && size >= max_tokens)) {
+               if (charcmp (*string, delimiter)) {
+                       gsize toklen = (string - c);
+                       if (toklen == 0) {
+                               token = g_strdup ("");
+                       } else {
+                               token = g_strndup (c, toklen);
+                       }
+                       
+                       c = string + 1;
+                       
+                       add_to_vector (&vector, size, token);
+                       size++;
+               }
+
+               string++;
+       }
+       
+       if (max_tokens > 0 && size >= max_tokens) {
+               if (*string) {
+                       /* Add the rest of the string as the last element */
+                       add_to_vector (&vector, size, g_strdup (string));
+                       size++;
+               }
+       } else {
+               if (*c) {
+                       /* Fill in the trailing last token */
+                       add_to_vector (&vector, size, g_strdup (c));
+                       size++;
+               } else {
+                       /* Need to leave a trailing empty token if the
+                        * delimiter is the last part of the string
+                        */
+                       add_to_vector (&vector, size, g_strdup (""));
+                       size++;
+               }
+       }
+       
+       if (vector == NULL) {
+               vector = (gchar **) g_malloc (2 * sizeof (vector));
+               vector [0] = NULL;
+       } else if (size > 0) {
+               vector[size - 1] = NULL;
+       }
+       
+       return vector;
+}
+
+gchar *
+g_strreverse (gchar *str)
+{
+       size_t i, j;
+       gchar c;
+
+       if (str == NULL)
+               return NULL;
+
+       if (*str == 0)
+               return str;
+
+       for (i = 0, j = strlen (str) - 1; i < j; i++, j--) {
+               c = str [i];
+               str [i] = str [j];
+               str [j] = c;
+       }
+
+       return str;
+}
+
+gchar *
+g_strjoin (const gchar *separator, ...)
+{
+       va_list args;
+       char *res, *s, *r;
+       size_t len, slen;
+
+       if (separator != NULL)
+               slen = strlen (separator);
+       else
+               slen = 0;
+       
+       len = 0;
+       va_start (args, separator);
+       for (s = va_arg (args, char *); s != NULL; s = va_arg (args, char *)){
+               len += strlen (s);
+               len += slen;
+       }
+       va_end (args);
+
+       if (len == 0)
+               return g_strdup ("");
+       
+       /* Remove the last separator */
+       if (slen > 0 && len > 0)
+               len -= slen;
+
+       res = g_malloc (len + 1);
+       va_start (args, separator);
+       s = va_arg (args, char *);
+       r = g_stpcpy (res, s);
+       for (s = va_arg (args, char *); s != NULL; s = va_arg (args, char *)){
+               if (separator != NULL)
+                       r = g_stpcpy (r, separator);
+               r = g_stpcpy (r, s);
+       }
+       va_end (args);
+
+       return res;
+}
+
+gchar *
+g_strjoinv (const gchar *separator, gchar **str_array)
+{
+       char *res, *r;
+       size_t slen, len, i;
+       
+       if (separator != NULL)
+               slen = strlen (separator);
+       else
+               slen = 0;
+       
+       len = 0;
+       for (i = 0; str_array [i] != NULL; i++){
+               len += strlen (str_array [i]);
+               len += slen;
+       }
+
+       if (len == 0)
+               return g_strdup ("");
+
+       if (slen > 0 && len > 0)
+               len -= slen;
+
+       res = g_malloc (len + 1);
+       r = g_stpcpy (res, str_array [0]);
+       for (i = 1; str_array [i] != NULL; i++){
+               if (separator != NULL)
+                       r = g_stpcpy (r, separator);
+               r = g_stpcpy (r, str_array [i]);
+       }
+
+       return res;
+}
+
+gchar *
+g_strchug (gchar *str)
+{
+       size_t len;
+       gchar *tmp;
+
+       if (str == NULL)
+               return NULL;
+
+       tmp = str;
+       while (*tmp && isspace (*tmp)) tmp++;
+       if (str != tmp) {
+               len = strlen (str) - (tmp - str - 1);
+               memmove (str, tmp, len);
+       }
+       return str;
+}
+
+gchar *
+g_strchomp (gchar *str)
+{
+       gchar *tmp;
+
+       if (str == NULL)
+               return NULL;
+
+       tmp = str + strlen (str) - 1;
+       while (*tmp && isspace (*tmp)) tmp--;
+       *(tmp + 1) = '\0';
+       return str;
+}
+
+gint
+g_printf(gchar const *format, ...)
+{
+       va_list args;
+       gint ret;
+
+       va_start(args, format);
+       ret = vprintf(format, args);
+       va_end(args);
+
+       return ret;
+}
+
+gint
+g_fprintf(FILE *file, gchar const *format, ...)
+{
+       va_list args;
+       gint ret;
+
+       va_start(args, format);
+       ret = vfprintf(file, format, args);
+       va_end(args);
+
+       return ret;
+}
+
+gint
+g_sprintf(gchar *string, gchar const *format, ...)
+{
+       va_list args;
+       gint ret;
+
+       va_start(args, format);
+       ret = vsprintf(string, format, args);
+       va_end(args);
+
+       return ret;
+}
+
+gint
+g_snprintf(gchar *string, gulong n, gchar const *format, ...)
+{
+       va_list args;
+       gint ret;
+       
+       va_start(args, format);
+       ret = vsnprintf(string, n, format, args);
+       va_end(args);
+
+       return ret;
+}
+
+static const char hx [] = { '0', '1', '2', '3', '4', '5', '6', '7',
+                                 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+
+static gboolean
+char_needs_encoding (char c)
+{
+       if (((unsigned char)c) >= 0x80)
+               return TRUE;
+       
+       if ((c >= '@' && c <= 'Z') ||
+           (c >= 'a' && c <= 'z') ||
+           (c >= '&' && c < 0x3b) ||
+           (c == '!') || (c == '$') || (c == '_') || (c == '=') || (c == '~'))
+               return FALSE;
+       return TRUE;
+}
+
+gchar *
+g_filename_to_uri (const gchar *filename, const gchar *hostname, GError **error)
+{
+       size_t n;
+       char *ret, *rp;
+       const char *p;
+#ifdef G_OS_WIN32
+       const char *uriPrefix = "file:///";
+#else
+       const char *uriPrefix = "file://";
+#endif
+       
+       g_return_val_if_fail (filename != NULL, NULL);
+
+       if (hostname != NULL)
+               g_warning ("%s", "eglib: g_filename_to_uri: hostname not handled");
+
+       if (!g_path_is_absolute (filename)){
+               if (error != NULL)
+                       *error = g_error_new (NULL, 2, "Not an absolute filename");
+               
+               return NULL;
+       }
+       
+       n = strlen (uriPrefix) + 1;
+       for (p = filename; *p; p++){
+#ifdef G_OS_WIN32
+               if (*p == '\\') {
+                       n++;
+                       continue;
+               }
+#endif
+               if (char_needs_encoding (*p))
+                       n += 3;
+               else
+                       n++;
+       }
+       ret = g_malloc (n);
+       strcpy (ret, uriPrefix);
+       for (p = filename, rp = ret + strlen (ret); *p; p++){
+#ifdef G_OS_WIN32
+               if (*p == '\\') {
+                       *rp++ = '/';
+                       continue;
+               }
+#endif
+               if (char_needs_encoding (*p)){
+                       *rp++ = '%';
+                       *rp++ = hx [((unsigned char)(*p)) >> 4];
+                       *rp++ = hx [((unsigned char)(*p)) & 0xf];
+               } else
+                       *rp++ = *p;
+       }
+       *rp = 0;
+       return ret;
+}
+
+static int
+decode (char p)
+{
+       if (p >= '0' && p <= '9')
+               return p - '0';
+       if (p >= 'A' && p <= 'F')
+               return p - 'A';
+       if (p >= 'a' && p <= 'f')
+               return p - 'a';
+       g_assert_not_reached ();
+       return 0;
+}
+
+gchar *
+g_filename_from_uri (const gchar *uri, gchar **hostname, GError **error)
+{
+       const char *p;
+       char *r, *result;
+       int flen = 0;
+       
+       g_return_val_if_fail (uri != NULL, NULL);
+
+       if (hostname != NULL)
+               g_warning ("%s", "eglib: g_filename_from_uri: hostname not handled");
+
+       if (strncmp (uri, "file:///", 8) != 0){
+               if (error != NULL)
+                       *error = g_error_new (NULL, 2, "URI does not start with the file: scheme");
+               return NULL;
+       }
+
+       for (p = uri + 8; *p; p++){
+               if (*p == '%'){
+                       if (p [1] && p [2] && isxdigit (p [1]) && isxdigit (p [2])){
+                               p += 2;
+                       } else {
+                               if (error != NULL)
+                                       *error = g_error_new (NULL, 2, "URI contains an invalid escape sequence");
+                               return NULL;
+                       }
+               } 
+               flen++;
+       }
+#ifndef G_OS_WIN32
+       flen++;
+#endif
+
+       result = g_malloc (flen + 1);
+       result [flen] = 0;
+
+#ifndef G_OS_WIN32
+       *result = '/';
+       r = result + 1;
+#else
+       r = result;
+#endif
+
+       for (p = uri + 8; *p; p++){
+               if (*p == '%'){
+                       *r++ = (char)((decode (p [1]) << 4) | decode (p [2]));
+                       p += 2;
+               } else
+                       *r++ = *p;
+               flen++;
+       }
+       return result;
+}
+
+void
+g_strdown (gchar *string)
+{
+       g_return_if_fail (string != NULL);
+
+       while (*string){
+               *string = (gchar)tolower (*string);
+               string++;
+       }
+}
+
+gchar
+g_ascii_tolower (gchar c)
+{
+       return c >= 'A' && c <= 'Z' ? c + ('a' - 'A') : c;
+}
+
+gchar *
+g_ascii_strdown (const gchar *str, gssize len)
+{
+       char *ret;
+       int i;
+       
+       g_return_val_if_fail  (str != NULL, NULL);
+
+       if (len == -1)
+               len = strlen (str);
+       
+       ret = g_malloc (len + 1);
+       for (i = 0; i < len; i++)
+               ret [i] = (guchar) g_ascii_tolower (str [i]);
+       ret [i] = 0;
+       
+       return ret;
+}
+
+gchar
+g_ascii_toupper (gchar c)
+{
+       return c >= 'a' && c <= 'z' ? c + ('A' - 'a') : c;
+}
+
+gchar *
+g_ascii_strup (const gchar *str, gssize len)
+{
+       char *ret;
+       int i;
+       
+       g_return_val_if_fail  (str != NULL, NULL);
+
+       if (len == -1)
+               len = strlen (str);
+       
+       ret = g_malloc (len + 1);
+       for (i = 0; i < len; i++)
+               ret [i] = (guchar) g_ascii_toupper (str [i]);
+       ret [i] = 0;
+       
+       return ret;
+}
+
+gint
+g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n)
+{
+       gsize i;
+       
+       g_return_val_if_fail (s1 != NULL, 0);
+       g_return_val_if_fail (s2 != NULL, 0);
+
+       for (i = 0; i < n; i++) {
+               gchar c1 = g_ascii_tolower (*s1++);
+               gchar c2 = g_ascii_tolower (*s2++);
+               
+               if (c1 != c2)
+                       return c1 - c2;
+       }
+       
+       return 0;
+}
+
+gint
+g_ascii_strcasecmp (const gchar *s1, const gchar *s2)
+{
+       const char *sp1 = s1;
+       const char *sp2 = s2;
+       
+       g_return_val_if_fail (s1 != NULL, 0);
+       g_return_val_if_fail (s2 != NULL, 0);
+       
+       while (*sp1 != '\0') {
+               char c1 = g_ascii_tolower (*sp1++);
+               char c2 = g_ascii_tolower (*sp2++);
+               
+               if (c1 != c2)
+                       return c1 - c2;
+       }
+       
+       return (*sp1) - (*sp2);
+}
+
+gchar *
+g_strdelimit (gchar *string, const gchar *delimiters, gchar new_delimiter)
+{
+       gchar *ptr;
+
+       g_return_val_if_fail (string != NULL, NULL);
+
+       if (delimiters == NULL)
+               delimiters = G_STR_DELIMITERS;
+
+       for (ptr = string; *ptr; ptr++) {
+               if (strchr (delimiters, *ptr))
+                       *ptr = new_delimiter;
+       }
+       
+       return string;
+}
+
+gsize 
+g_strlcpy (gchar *dest, const gchar *src, gsize dest_size)
+{
+#ifdef HAVE_STRLCPY
+       return strlcpy (dest, src, dest_size);
+#else
+       gchar *d;
+       const gchar *s;
+       gchar c;
+       gsize len;
+       
+       g_return_val_if_fail (src != NULL, 0);
+       g_return_val_if_fail (dest != NULL, 0);
+
+       len = dest_size;
+       if (len == 0)
+               return 0;
+
+       s = src;
+       d = dest;
+       while (--len) {
+               c = *s++;
+               *d++ = c;
+               if (c == '\0')
+                       return (dest_size - len - 1);
+       }
+
+       /* len is 0 i we get here */
+       *d = '\0';
+       /* we need to return the length of src here */
+       while (*s++) ; /* instead of a plain strlen, we use 's' */
+       return s - src - 1;
+#endif
+}
+
+gchar *
+g_stpcpy (gchar *dest, const char *src)
+{
+       g_return_val_if_fail (dest != NULL, dest);
+       g_return_val_if_fail (src != NULL, dest);
+
+#if HAVE_STPCPY
+       return stpcpy (dest, src);
+#else
+       while (*src)
+               *dest++ = *src++;
+       
+       *dest = '\0';
+       
+       return dest;
+#endif
+}
+
+static const gchar escaped_dflt [256] = {
+       1, 1, 1, 1, 1, 1, 1, 1, 'b', 't', 'n', 1, 'f', 'r', 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '\\', 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+};
+
+gchar *
+g_strescape (const gchar *source, const gchar *exceptions)
+{
+       gchar escaped [256];
+       const gchar *ptr;
+       gchar c;
+       gchar op;
+       gchar *result;
+       gchar *res_ptr;
+
+       g_return_val_if_fail (source != NULL, NULL);
+
+       memcpy (escaped, escaped_dflt, 256);
+       if (exceptions != NULL) {
+               for (ptr = exceptions; *ptr; ptr++)
+                       escaped [(int) *ptr] = 0;
+       }
+       result = g_malloc (strlen (source) * 4 + 1); /* Worst case: everything octal. */
+       res_ptr = result;
+       for (ptr = source; *ptr; ptr++) {
+               c = *ptr;
+               op = escaped [(int) c];
+               if (op == 0) {
+                       *res_ptr++ = c;
+               } else {
+                       *res_ptr++ = '\\';
+                       if (op != 1) {
+                               *res_ptr++ = op;
+                       } else {
+                               *res_ptr++ = '0' + ((c >> 6) & 3);
+                               *res_ptr++ = '0' + ((c >> 3) & 7);
+                               *res_ptr++ = '0' + (c & 7);
+                       }
+               }
+       }
+       *res_ptr = '\0';
+       return result;
+}
+
+gint
+g_ascii_xdigit_value (gchar c)
+{
+       return ((isxdigit (c) == 0) ? -1 :
+               ((c >= '0' && c <= '9') ? (c - '0') :
+                ((c >= 'a' && c <= 'f') ? (c - 'a' + 10) :
+                 (c - 'A' + 10))));
+}
+
+gchar *
+g_strnfill (gsize length, gchar fill_char)
+{
+       gchar *ret = g_new (gchar, length + 1);
+
+       memset (ret, fill_char, length);
+       ret [length] = 0;
+       return ret;
+}
diff --git a/mono/eglib/gstring.c b/mono/eglib/gstring.c
new file mode 100644 (file)
index 0000000..ba75789
--- /dev/null
@@ -0,0 +1,276 @@
+/*
+ * String functions
+ *
+ * Author:
+ *   Miguel de Icaza (miguel@novell.com)
+ *   Aaron Bockover (abockover@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <stdio.h>
+#include <glib.h>
+
+#define GROW_IF_NECESSARY(s,l) { \
+       if(s->len + l >= s->allocated_len) { \
+               s->allocated_len = (s->allocated_len + l + 16) * 2; \
+               s->str = g_realloc(s->str, s->allocated_len); \
+       } \
+}
+
+GString *
+g_string_new_len (const gchar *init, gssize len)
+{
+       GString *ret = g_new (GString, 1);
+
+       if (init == NULL)
+               ret->len = 0;
+       else
+               ret->len = len < 0 ? strlen(init) : len;
+       ret->allocated_len = MAX(ret->len + 1, 16);
+       ret->str = g_malloc(ret->allocated_len);
+       if (init)
+               memcpy(ret->str, init, ret->len);
+       ret->str[ret->len] = 0;
+
+       return ret;
+}
+
+GString *
+g_string_new (const gchar *init)
+{
+       return g_string_new_len(init, -1);
+}
+
+GString *
+g_string_sized_new (gsize default_size)
+{
+       GString *ret = g_new (GString, 1);
+
+       ret->str = g_malloc (default_size);
+       ret->str [0] = 0;
+       ret->len = 0;
+       ret->allocated_len = default_size;
+
+       return ret;
+}
+
+gchar *
+g_string_free (GString *string, gboolean free_segment)
+{
+       gchar *data;
+       
+       g_return_val_if_fail (string != NULL, NULL);
+
+       data = string->str;
+       g_free(string);
+       
+       if(!free_segment) {
+               return data;
+       }
+
+       g_free(data);
+       return NULL;
+}
+
+GString *
+g_string_append_len (GString *string, const gchar *val, gssize len)
+{
+       g_return_val_if_fail(string != NULL, NULL);
+       g_return_val_if_fail(val != NULL, string);
+
+       if(len < 0) {
+               len = strlen(val);
+       }
+
+       GROW_IF_NECESSARY(string, len);
+       memcpy(string->str + string->len, val, len);
+       string->len += len;
+       string->str[string->len] = 0;
+
+       return string;
+}
+
+GString *
+g_string_append (GString *string, const gchar *val)
+{
+       g_return_val_if_fail(string != NULL, NULL);
+       g_return_val_if_fail(val != NULL, string);
+
+       return g_string_append_len(string, val, -1);
+}
+
+GString *
+g_string_append_c (GString *string, gchar c)
+{
+       g_return_val_if_fail(string != NULL, NULL);
+
+       GROW_IF_NECESSARY(string, 1);
+       
+       string->str[string->len] = c;
+       string->str[string->len + 1] = 0;
+       string->len++;
+
+       return string;
+}
+
+GString *
+g_string_append_unichar (GString *string, gunichar c)
+{
+       gchar utf8[6];
+       gint len;
+       
+       g_return_val_if_fail (string != NULL, NULL);
+       
+       if ((len = g_unichar_to_utf8 (c, utf8)) <= 0)
+               return string;
+       
+       return g_string_append_len (string, utf8, len);
+}
+
+GString *
+g_string_prepend (GString *string, const gchar *val)
+{
+       gssize len;
+       
+       g_return_val_if_fail (string != NULL, string);
+       g_return_val_if_fail (val != NULL, string);
+
+       len = strlen (val);
+       
+       GROW_IF_NECESSARY(string, len); 
+       memmove(string->str + len, string->str, string->len + 1);
+       memcpy(string->str, val, len);
+
+       return string;
+}
+
+GString *
+g_string_insert (GString *string, gssize pos, const gchar *val)
+{
+       gssize len;
+       
+       g_return_val_if_fail (string != NULL, string);
+       g_return_val_if_fail (val != NULL, string);
+       g_return_val_if_fail (pos <= string->len, string);
+
+       len = strlen (val);
+       
+       GROW_IF_NECESSARY(string, len); 
+       memmove(string->str + pos + len, string->str + pos, string->len - pos - len + 1);
+       memcpy(string->str + pos, val, len);
+
+       return string;
+}
+
+void
+g_string_append_printf (GString *string, const gchar *format, ...)
+{
+       char *ret;
+       va_list args;
+       
+       g_return_if_fail (string != NULL);
+       g_return_if_fail (format != NULL);
+
+       va_start (args, format);
+       ret = g_strdup_vprintf (format, args);
+       va_end (args);
+       g_string_append (string, ret);
+
+       g_free (ret);
+}
+
+void
+g_string_append_vprintf (GString *string, const gchar *format, va_list args)
+{
+       char *ret;
+
+       g_return_if_fail (string != NULL);
+       g_return_if_fail (format != NULL);
+
+       ret = g_strdup_vprintf (format, args);
+       g_string_append (string, ret);
+       g_free (ret);
+}
+
+void
+g_string_printf (GString *string, const gchar *format, ...)
+{
+       va_list args;
+       
+       g_return_if_fail (string != NULL);
+       g_return_if_fail (format != NULL);
+
+       g_free (string->str);
+       
+       va_start (args, format);
+       string->str = g_strdup_vprintf (format, args);
+       va_end (args);
+
+       string->len = strlen (string->str);
+       string->allocated_len = string->len+1;
+}
+
+GString *
+g_string_truncate (GString *string, gsize len)
+{
+       g_return_val_if_fail (string != NULL, string);
+
+       /* Silent return */
+       if (len >= string->len)
+               return string;
+       
+       string->len = len;
+       string->str[len] = 0;
+       return string;
+}
+
+GString *
+g_string_set_size (GString *string, gsize len)
+{
+       g_return_val_if_fail (string != NULL, string);
+
+       GROW_IF_NECESSARY(string, len);
+       
+       string->len = len;
+       string->str[len] = 0;
+       return string;
+}
+
+GString *
+g_string_erase (GString *string, gssize pos, gssize len)
+{
+       g_return_val_if_fail (string != NULL, string);
+
+       /* Silent return */
+       if (pos >= string->len)
+               return string;
+
+       if (len == -1 || (pos + len) >= string->len) {
+               string->str[pos] = 0;
+       }
+       else {
+               memmove (string->str + pos, string->str + pos + len, string->len - (pos + len) + 1);
+               string->len -= len;
+       }
+
+       return string;
+}
diff --git a/mono/eglib/gtimer-unix.c b/mono/eglib/gtimer-unix.c
new file mode 100644 (file)
index 0000000..085e2c1
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Timer
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <glib.h>
+#include <sys/time.h>
+
+struct _GTimer {
+       struct timeval start;
+       struct timeval stop;
+};
+
+GTimer *g_timer_new (void)
+{
+       GTimer *timer;
+
+       timer = g_new0 (GTimer, 1);
+       g_timer_start (timer);
+       return timer;
+}
+
+void
+g_timer_destroy (GTimer *timer)
+{
+       g_return_if_fail (timer != NULL);
+       g_free (timer);
+}
+
+void
+g_timer_start (GTimer *timer)
+{
+       g_return_if_fail (timer != NULL);
+       gettimeofday (&timer->start, NULL);
+       memset (&timer->stop, 0, sizeof (struct timeval));
+}
+
+void
+g_timer_stop (GTimer *timer)
+{
+       g_return_if_fail (timer != NULL);
+       gettimeofday (&timer->stop, NULL);
+}
+
+gdouble
+g_timer_elapsed (GTimer *timer, gulong *microseconds)
+{
+       struct timeval tv;
+       gulong seconds;
+       long usec;
+       gdouble result;
+
+       g_return_val_if_fail (timer != NULL, 0.0);
+
+       if (timer->stop.tv_sec == 0 && timer->stop.tv_usec == 0) {
+               gettimeofday (&tv, NULL);
+       } else {
+               tv = timer->stop;
+       }
+
+       usec = (tv.tv_usec) - (timer->start.tv_usec);
+       seconds = tv.tv_sec - timer->start.tv_sec;
+       if (microseconds) {
+               if (usec < 0) {
+                       usec += 1000000;
+                       seconds--;
+               }
+               *microseconds = usec;
+       }
+       result = seconds * 1000000 + usec;
+       return (result / 1000000);
+}
+
+
diff --git a/mono/eglib/gtimer-win32.c b/mono/eglib/gtimer-win32.c
new file mode 100644 (file)
index 0000000..07e802b
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Timer
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo@novell.com
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <glib.h>
+#include <windows.h>
+
+struct _GTimer {
+       guint64 start;
+       guint64 stop;
+};
+
+GTimer *g_timer_new (void)
+{
+       GTimer *timer;
+
+       timer = g_new0 (GTimer, 1);
+       g_timer_start (timer);
+       return timer;
+}
+
+void
+g_timer_destroy (GTimer *timer)
+{
+       g_return_if_fail (timer != NULL);
+       g_free (timer);
+}
+
+void
+g_timer_start (GTimer *timer)
+{
+       g_return_if_fail (timer != NULL);
+
+       QueryPerformanceCounter ((LARGE_INTEGER*)&timer->start);
+}
+
+void
+g_timer_stop (GTimer *timer)
+{
+       g_return_if_fail (timer != NULL);
+
+       QueryPerformanceCounter ((LARGE_INTEGER*)&timer->stop);
+}
+
+gdouble
+g_timer_elapsed (GTimer *timer, gulong *microseconds)
+{
+       static guint64 freq = 0;
+       guint64 delta, stop;
+
+       if (freq == 0) {
+               if (!QueryPerformanceFrequency ((LARGE_INTEGER *)&freq))
+                       freq = 1;
+       }
+
+       if (timer->stop == 0) {
+               QueryPerformanceCounter ((LARGE_INTEGER*)&stop);
+       }
+       else {
+               stop = timer->stop;
+       }
+
+       delta = stop - timer->start;
+
+       if (microseconds)
+               *microseconds = (gulong) (delta * (1000000.0 / freq));
+
+       return (gdouble) delta / (gdouble) freq;
+}
+
+
diff --git a/mono/eglib/gunicode-win32-uwp.c b/mono/eglib/gunicode-win32-uwp.c
new file mode 100644 (file)
index 0000000..ef36ffc
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * gunicode-win32-uwp.c: UWP unicode support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#define CODESET 1
+#include <windows.h>
+
+extern const char *my_charset;
+static gboolean is_utf8;
+
+gboolean
+g_get_charset (G_CONST_RETURN char **charset)
+{
+       if (my_charset == NULL) {
+               static char buf [14];
+               CPINFOEXA cp_info;
+
+               GetCPInfoExA (CP_ACP, 0, &cp_info);
+               sprintf (buf, "CP%u", cp_info.CodePage);
+               my_charset = buf;
+               is_utf8 = FALSE;
+       }
+       
+       if (charset != NULL)
+               *charset = my_charset;
+
+       return is_utf8;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+#ifdef _MSC_VER
+// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
+void __mono_win32_gunicode_win32_uwp_quiet_lnk4221(void) {}
+#endif
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/eglib/gunicode-win32.c b/mono/eglib/gunicode-win32.c
new file mode 100644 (file)
index 0000000..a35cfcd
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * gunicode-win32.c: Windows unicode support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+#define CODESET 1
+#include <windows.h>
+
+extern const char *my_charset;
+static gboolean is_utf8;
+
+gboolean
+g_get_charset (G_CONST_RETURN char **charset)
+{
+       if (my_charset == NULL) {
+               static char buf [14];
+               sprintf (buf, "CP%u", GetACP ());
+               my_charset = buf;
+               is_utf8 = FALSE;
+       }
+       
+       if (charset != NULL)
+               *charset = my_charset;
+
+       return is_utf8;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+#ifdef _MSC_VER
+// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
+void __mono_win32_mono_gunicode_win32_quiet_lnk4221(void) {}
+#endif
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
diff --git a/mono/eglib/gunicode.c b/mono/eglib/gunicode.c
new file mode 100644 (file)
index 0000000..c1280f9
--- /dev/null
@@ -0,0 +1,240 @@
+/*
+ * gunicode.c: Some Unicode routines 
+ *
+ * Author:
+ *   Miguel de Icaza (miguel@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * utf8 validation code came from:
+ *     libxml2-2.6.26 licensed under the MIT X11 license
+ *
+ * Authors credit in libxml's string.c:
+ *   William Brack <wbrack@mmm.com.hk>
+ *   daniel@veillard.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+#include <config.h>
+#include <stdio.h>
+#include <glib.h>
+#include <unicode-data.h>
+#include <errno.h>
+
+#ifndef G_OS_WIN32
+#    ifdef HAVE_LOCALCHARSET_H
+#       include <localcharset.h>
+#    endif
+#endif
+
+const char *my_charset;
+
+/*
+ * Character set conversion
+ */
+
+GUnicodeType 
+g_unichar_type (gunichar c)
+{
+       int i;
+
+       guint16 cp = (guint16) c;
+       for (i = 0; i < unicode_category_ranges_count; i++) {
+               if (cp < unicode_category_ranges [i].start)
+                       continue;
+               if (unicode_category_ranges [i].end <= cp)
+                       continue;
+               return unicode_category [i] [cp - unicode_category_ranges [i].start];
+       }
+
+       /*
+       // 3400-4DB5: OtherLetter
+       // 4E00-9FC3: OtherLetter
+       // AC00-D7A3: OtherLetter
+       // D800-DFFF: OtherSurrogate
+       // E000-F8FF: OtherPrivateUse
+       // 20000-2A6D6 OtherLetter
+       // F0000-FFFFD OtherPrivateUse
+       // 100000-10FFFD OtherPrivateUse
+       */
+       if (0x3400 <= cp && cp < 0x4DB5)
+               return G_UNICODE_OTHER_LETTER;
+       if (0x4E00 <= cp && cp < 0x9FC3)
+               return G_UNICODE_OTHER_LETTER;
+       if (0xAC00<= cp && cp < 0xD7A3)
+               return G_UNICODE_OTHER_LETTER;
+       if (0xD800 <= cp && cp < 0xDFFF)
+               return G_UNICODE_SURROGATE;
+       if (0xE000 <= cp && cp < 0xF8FF)
+               return G_UNICODE_PRIVATE_USE;
+       /* since the argument is UTF-16, we cannot check beyond FFFF */
+
+       /* It should match any of above */
+       return 0;
+}
+
+GUnicodeBreakType
+g_unichar_break_type (gunichar c)
+{
+       // MOONLIGHT_FIXME
+       return G_UNICODE_BREAK_UNKNOWN;
+}
+
+gunichar
+g_unichar_case (gunichar c, gboolean upper)
+{
+       gint8 i, i2;
+       guint32 cp = (guint32) c, v;
+
+       for (i = 0; i < simple_case_map_ranges_count; i++) {
+               if (cp < simple_case_map_ranges [i].start)
+                       return c;
+               if (simple_case_map_ranges [i].end <= cp)
+                       continue;
+               if (c < 0x10000) {
+                       const guint16 *tab = upper ? simple_upper_case_mapping_lowarea [i] : simple_lower_case_mapping_lowarea [i];
+                       v = tab [cp - simple_case_map_ranges [i].start];
+               } else {
+                       const guint32 *tab;
+                       i2 = (gint8)(i - (upper ? simple_upper_case_mapping_lowarea_table_count : simple_lower_case_mapping_lowarea_table_count));
+                       tab = upper ? simple_upper_case_mapping_higharea [i2] : simple_lower_case_mapping_higharea [i2];
+                       v = tab [cp - simple_case_map_ranges [i].start];
+               }
+               return v != 0 ? (gunichar) v : c;
+       }
+       return c;
+}
+
+gunichar
+g_unichar_toupper (gunichar c)
+{
+       return g_unichar_case (c, TRUE);
+}
+
+gunichar
+g_unichar_tolower (gunichar c)
+{
+       return g_unichar_case (c, FALSE);
+}
+
+gunichar
+g_unichar_totitle (gunichar c)
+{
+       guint8 i;
+       guint32 cp;
+
+       cp = (guint32) c;
+       for (i = 0; i < simple_titlecase_mapping_count; i++) {
+               if (simple_titlecase_mapping [i].codepoint == cp)
+                       return simple_titlecase_mapping [i].title;
+               if (simple_titlecase_mapping [i].codepoint > cp)
+                       /* it is ordered, hence no more match */
+                       break;
+       }
+       return g_unichar_toupper (c);
+}
+
+gboolean
+g_unichar_isxdigit (gunichar c)
+{
+       return (g_unichar_xdigit_value (c) != -1);
+
+}
+
+gint
+g_unichar_xdigit_value (gunichar c)
+{
+       if (c >= 0x30 && c <= 0x39) /*0-9*/
+               return (c - 0x30);
+       if (c >= 0x41 && c <= 0x46) /*A-F*/
+               return (c - 0x37);
+       if (c >= 0x61 && c <= 0x66) /*a-f*/
+               return (c - 0x57);
+       return -1;
+}
+
+gboolean
+g_unichar_isspace (gunichar c)
+{
+       GUnicodeType type = g_unichar_type (c);
+       if (type == G_UNICODE_LINE_SEPARATOR ||
+           type == G_UNICODE_PARAGRAPH_SEPARATOR ||
+           type == G_UNICODE_SPACE_SEPARATOR)
+               return TRUE;
+
+       return FALSE;
+}
+
+
+/*
+ * This is broken, and assumes an UTF8 system, but will do for eglib's first user
+ */
+gchar *
+g_filename_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read, gsize *bytes_written, GError **error)
+{
+       char *res;
+       
+       if (len == -1)
+               len = strlen (utf8string);
+
+       res = g_malloc (len + 1);
+       g_strlcpy (res, utf8string, len + 1);
+       return res;
+}
+
+#ifndef G_OS_WIN32
+static gboolean is_utf8;
+
+gboolean
+g_get_charset (G_CONST_RETURN char **charset)
+{
+       if (my_charset == NULL) {
+               /* These shouldn't be heap allocated */
+#if defined(HAVE_LOCALCHARSET_H)
+               my_charset = locale_charset ();
+#else
+               my_charset = "UTF-8";
+#endif
+               is_utf8 = strcmp (my_charset, "UTF-8") == 0;
+       }
+       
+       if (charset != NULL)
+               *charset = my_charset;
+
+       return is_utf8;
+}
+#endif /* G_OS_WIN32 */
+
+gchar *
+g_locale_to_utf8 (const gchar *opsysstring, gssize len, gsize *bytes_read, gsize *bytes_written, GError **error)
+{
+       g_get_charset (NULL);
+
+       return g_convert (opsysstring, len, "UTF-8", my_charset, bytes_read, bytes_written, error);
+}
+
+gchar *
+g_locale_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read, gsize *bytes_written, GError **error)
+{
+       g_get_charset (NULL);
+
+       return g_convert (utf8string, len, my_charset, "UTF-8", bytes_read, bytes_written, error);
+}
diff --git a/mono/eglib/gutf8.c b/mono/eglib/gutf8.c
new file mode 100644 (file)
index 0000000..c4c9b91
--- /dev/null
@@ -0,0 +1,373 @@
+/*
+ * gutf8.c: UTF-8 conversion
+ *
+ * Author:
+ *   Atsushi Enomoto  <atsushi@ximian.com>
+ *
+ * (C) 2006 Novell, Inc.
+ * Copyright 2012 Xamarin Inc
+ */
+
+#include <stdio.h>
+#include <glib.h>
+
+/*
+ * Index into the table below with the first byte of a UTF-8 sequence to get
+ * the number of bytes that are supposed to follow it to complete the sequence.
+ *
+ * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is left
+ * as-is for anyone who may want to do such conversion, which was allowed in
+ * earlier algorithms.
+*/
+const guchar g_utf8_jump_table[256] = {
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+       3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1
+};
+
+static gchar *
+utf8_case_conv (const gchar *str, gssize len, gboolean upper)
+{
+       gunichar *ustr;
+       glong i, ulen;
+       gchar *utf8;
+       
+       ustr = g_utf8_to_ucs4_fast (str, (glong) len, &ulen);
+       for (i = 0; i < ulen; i++)
+               ustr[i] = upper ? g_unichar_toupper (ustr[i]) : g_unichar_tolower (ustr[i]);
+       utf8 = g_ucs4_to_utf8 (ustr, ulen, NULL, NULL, NULL);
+       g_free (ustr);
+       
+       return utf8;
+}
+
+gchar *
+g_utf8_strup (const gchar *str, gssize len)
+{
+       return utf8_case_conv (str, len, TRUE);
+}
+
+gchar *
+g_utf8_strdown (const gchar *str, gssize len)
+{
+       return utf8_case_conv (str, len, FALSE);
+}
+
+static gboolean
+utf8_validate (const unsigned char *inptr, size_t len)
+{
+       const unsigned char *ptr = inptr + len;
+       unsigned char c;
+       
+       /* Everything falls through when TRUE... */
+       switch (len) {
+       default:
+               return FALSE;
+       case 4:
+               if ((c = (*--ptr)) < 0x80 || c > 0xBF)
+                       return FALSE;
+               
+               if ((c == 0xBF || c == 0xBE) && ptr[-1] == 0xBF) {
+                       if (ptr[-2] == 0x8F || ptr[-2] == 0x9F ||
+                           ptr[-2] == 0xAF || ptr[-2] == 0xBF)
+                               return FALSE;
+               }
+       case 3:
+               if ((c = (*--ptr)) < 0x80 || c > 0xBF)
+                       return FALSE;
+       case 2:
+               if ((c = (*--ptr)) < 0x80 || c > 0xBF)
+                       return FALSE;
+               
+               /* no fall-through in this inner switch */
+               switch (*inptr) {
+               case 0xE0: if (c < 0xA0) return FALSE; break;
+               case 0xED: if (c > 0x9F) return FALSE; break;
+               case 0xEF: if (c == 0xB7 && (ptr[1] > 0x8F && ptr[1] < 0xB0)) return FALSE;
+                       if (c == 0xBF && (ptr[1] == 0xBE || ptr[1] == 0xBF)) return FALSE;
+                       break;
+               case 0xF0: if (c < 0x90) return FALSE; break;
+               case 0xF4: if (c > 0x8F) return FALSE; break;
+               default:   if (c < 0x80) return FALSE; break;
+               }
+       case 1: if (*inptr >= 0x80 && *inptr < 0xC2) return FALSE;
+       }
+       
+       if (*inptr > 0xF4)
+               return FALSE;
+       
+       return TRUE;
+}
+
+/**
+ * g_utf8_validate:
+ * @str: a utf-8 encoded string
+ * @max_len: max number of bytes to validate (or -1 to validate the entire null-terminated string)
+ * @end: output parameter to mark the end of the valid input
+ *
+ * Checks @utf for being valid UTF-8. @str is assumed to be
+ * null-terminated. This function is not super-strict, as it will
+ * allow longer UTF-8 sequences than necessary. Note that Java is
+ * capable of producing these sequences if provoked. Also note, this
+ * routine checks for the 4-byte maximum size, but does not check for
+ * 0x10ffff maximum value.
+ *
+ * Return value: %TRUE if @str is valid or %FALSE otherwise.
+ **/
+gboolean
+g_utf8_validate (const gchar *str, gssize max_len, const gchar **end)
+{
+       guchar *inptr = (guchar *) str;
+       gboolean valid = TRUE;
+       guint length, min;
+       gssize n = 0;
+       
+       if (max_len == 0)
+               return FALSE;
+       
+       if (max_len < 0) {
+               while (*inptr != 0) {
+                       length = g_utf8_jump_table[*inptr];
+                       if (!utf8_validate (inptr, length)) {
+                               valid = FALSE;
+                               break;
+                       }
+                       
+                       inptr += length;
+               }
+       } else {
+               while (n < max_len) {
+                       if (*inptr == 0) {
+                               /* Note: return FALSE if we encounter nul-byte
+                                * before max_len is reached. */
+                               valid = FALSE;
+                               break;
+                       }
+                       
+                       length = g_utf8_jump_table[*inptr];
+                       min = MIN (length, max_len - n);
+                       
+                       if (!utf8_validate (inptr, min)) {
+                               valid = FALSE;
+                               break;
+                       }
+                       
+                       if (min < length) {
+                               valid = FALSE;
+                               break;
+                       }
+                       
+                       inptr += length;
+                       n += length;
+               }
+       }
+       
+       if (end != NULL)
+               *end = (gchar *) inptr;
+       
+       return valid;
+}
+
+gunichar
+g_utf8_get_char_validated (const gchar *str, gssize max_len)
+{
+       unsigned char *inptr = (unsigned char *) str;
+       gunichar u = *inptr;
+       int n, i;
+       
+       if (max_len == 0)
+               return -2;
+       
+       if (u < 0x80) {
+               /* simple ascii case */
+               return u;
+       } else if (u < 0xc2) {
+               return -1;
+       } else if (u < 0xe0) {
+               u &= 0x1f;
+               n = 2;
+       } else if (u < 0xf0) {
+               u &= 0x0f;
+               n = 3;
+       } else if (u < 0xf8) {
+               u &= 0x07;
+               n = 4;
+       } else if (u < 0xfc) {
+               u &= 0x03;
+               n = 5;
+       } else if (u < 0xfe) {
+               u &= 0x01;
+               n = 6;
+       } else {
+               return -1;
+       }
+       
+       if (max_len > 0) {
+               if (!utf8_validate (inptr, MIN (max_len, n)))
+                       return -1;
+               
+               if (max_len < n)
+                       return -2;
+       } else {
+               if (!utf8_validate (inptr, n))
+                       return -1;
+       }
+       
+       for (i = 1; i < n; i++)
+               u = (u << 6) | (*++inptr ^ 0x80);
+       
+       return u;
+}
+
+glong
+g_utf8_strlen (const gchar *str, gssize max_len)
+{
+       const guchar *inptr = (const guchar *) str;
+       glong clen = 0, len = 0, n;
+       
+       if (max_len == 0)
+               return 0;
+       
+       if (max_len < 0) {
+               while (*inptr) {
+                       inptr += g_utf8_jump_table[*inptr];
+                       len++;
+               }
+       } else {
+               while (len < max_len && *inptr) {
+                       n = g_utf8_jump_table[*inptr];
+                       if ((clen + n) > max_len)
+                               break;
+                       
+                       inptr += n;
+                       clen += n;
+                       len++;
+               }
+       }
+       
+       return len;
+}
+
+gunichar
+g_utf8_get_char (const gchar *src)
+{
+       unsigned char *inptr = (unsigned char *) src;
+       gunichar u = *inptr;
+       int n, i;
+       
+       if (u < 0x80) {
+               /* simple ascii case */
+               return u;
+       } else if (u < 0xe0) {
+               u &= 0x1f;
+               n = 2;
+       } else if (u < 0xf0) {
+               u &= 0x0f;
+               n = 3;
+       } else if (u < 0xf8) {
+               u &= 0x07;
+               n = 4;
+       } else if (u < 0xfc) {
+               u &= 0x03;
+               n = 5;
+       } else {
+               u &= 0x01;
+               n = 6;
+       }
+       
+       for (i = 1; i < n; i++)
+               u = (u << 6) | (*++inptr ^ 0x80);
+       
+       return u;
+}
+
+gchar *
+g_utf8_find_prev_char (const gchar *str, const gchar *p)
+{
+       while (p > str) {
+               p--;
+               if ((*p & 0xc0) != 0xb0)
+                       return (gchar *)p;
+       }
+       return NULL;
+}
+
+gchar *
+g_utf8_prev_char (const gchar *str)
+{
+       const gchar *p = str;
+       do {
+               p--;
+       } while ((*p & 0xc0) == 0xb0);
+       
+       return (gchar *)p;
+}
+
+gchar *
+g_utf8_offset_to_pointer (const gchar *str, glong offset)
+{
+       const gchar *p = str;
+
+       if (offset > 0) {
+               do {
+                       p = g_utf8_next_char (p);
+                       offset --;
+               } while (offset > 0);
+       }
+       else if (offset < 0) {
+               const gchar *jump = str;
+               do {
+                       // since the minimum size of a character is 1
+                       // we know we can step back at least offset bytes
+                       jump = jump + offset;
+                       
+                       // if we land in the middle of a character
+                       // walk to the beginning
+                       while ((*jump & 0xc0) == 0xb0)
+                               jump --;
+                       
+                       // count how many characters we've actually walked
+                       // by going forward
+                       p = jump;
+                       do {
+                               p = g_utf8_next_char (p);
+                               offset ++;
+                       } while (p < jump);
+                       
+               } while (offset < 0);
+       }
+       
+       return (gchar *)p;
+}
+
+glong
+g_utf8_pointer_to_offset (const gchar *str, const gchar *pos)
+{
+       const gchar *inptr, *inend;
+       glong offset = 0;
+       glong sign = 1;
+       
+       if (pos == str)
+               return 0;
+       
+       if (str < pos) {
+               inptr = str;
+               inend = pos;
+       } else {
+               inptr = pos;
+               inend = str;
+               sign = -1;
+       }
+       
+       do {
+               inptr = g_utf8_next_char (inptr);
+               offset++;
+       } while (inptr < inend);
+       
+       return offset * sign;
+}
diff --git a/mono/eglib/sort.frag.h b/mono/eglib/sort.frag.h
new file mode 100644 (file)
index 0000000..6dc1950
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * sort.frag.h: Common implementation of linked-list sorting
+ *
+ * Author:
+ *   Raja R Harinath (rharinath@novell.com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * (C) 2006 Novell, Inc.
+ */
+
+/*
+ * This code requires a typedef named 'list_node' for the list node.  It
+ * is assumed that the list type is the type of a pointer to a list
+ * node, and that the node has a field named 'next' that implements to
+ * the linked list.  No additional invariant is maintained (e.g. the
+ * 'prev' pointer of a doubly-linked list node is _not_ updated).  Any
+ * invariant would require a post-processing pass to fix matters if
+ * necessary.
+ */
+typedef list_node *digit;
+
+/*
+ * The maximum possible depth of the merge tree
+ *   = ceiling (log2 (maximum number of list nodes))
+ *   = ceiling (log2 (maximum possible memory size/size of each list node))
+ *   = number of bits in 'size_t' - floor (log2 (sizeof digit))
+ * Also, each list in sort_info is at least 2 nodes long: we can reduce the depth by 1
+ */
+#define FLOOR_LOG2(x) (((x)>=2) + ((x)>=4) + ((x)>=8) + ((x)>=16) + ((x)>=32) + ((x)>=64) + ((x)>=128))
+#define MAX_RANKS ((sizeof (size_t) * 8) - FLOOR_LOG2(sizeof (list_node)) - 1)
+
+struct sort_info
+{
+       int min_rank, n_ranks;
+       GCompareFunc func;
+
+       /* Invariant: ranks[i] == NULL || length(ranks[i]) >= 2**(i+1) */
+       list_node *ranks [MAX_RANKS]; /* ~ 128 bytes on 32bit, ~ 512 bytes on 64bit */
+};
+
+static inline void
+init_sort_info (struct sort_info *si, GCompareFunc func)
+{
+       si->min_rank = si->n_ranks = 0;
+       si->func = func;
+       /* we don't need to initialize si->ranks, since we never lookup past si->n_ranks.  */
+}
+
+static inline list_node *
+merge_lists (list_node *first, list_node *second, GCompareFunc func)
+{
+       /* merge the two lists */
+       list_node *list = NULL;
+       list_node **pos = &list;
+       while (first && second) {
+               if (func (first->data, second->data) > 0) {
+                       *pos = second;
+                       second = second->next;
+               } else {
+                       *pos = first;
+                       first = first->next;
+               }
+               pos = &((*pos)->next);
+       }
+       *pos = first ? first : second;
+       return list;
+}
+
+/* Pre-condition: upto <= si->n_ranks, list == NULL || length(list) == 1 */
+static inline list_node *
+sweep_up (struct sort_info *si, list_node *list, int upto)
+{
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+       /*
+        * GCC incorrectly thinks we're writing below si->ranks array bounds.
+        */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
+
+       int i;
+       for (i = si->min_rank; i < upto; ++i) {
+               list = merge_lists (si->ranks [i], list, si->func);
+               si->ranks [i] = NULL;
+       }
+       return list;
+
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+#pragma GCC diagnostic pop
+#endif
+}
+
+/*
+ * The 'ranks' array essentially captures the recursion stack of a mergesort.
+ * The merge tree is built in a bottom-up manner.  The control loop for
+ * updating the 'ranks' array is analogous to incrementing a binary integer,
+ * and the O(n) time for counting upto n translates to O(n) merges when
+ * inserting rank-0 lists.  When we plug in the sizes of the lists involved in
+ * those merges, we get the O(n log n) time for the sort.
+ *
+ * Inserting higher-ranked lists reduce the height of the merge tree, and also
+ * eliminate a lot of redundant comparisons when merging two lists that would've
+ * been part of the same run.  Adding a rank-i list is analogous to incrementing
+ * a binary integer by 2**i in one operation, thus sharing a similar speedup.
+ *
+ * When inserting higher-ranked lists, we choose to clear out the lower ranks
+ * in the interests of keeping the sort stable, but this makes analysis harder.
+ * Note that clearing the lower-ranked lists is O(length(list))-- thus it
+ * shouldn't affect the O(n log n) behaviour.  IOW, inserting one rank-i list
+ * is equivalent to inserting 2**i rank-0 lists, thus even if we do i additional
+ * merges in the clearing-out (taking at most 2**i time) we are still fine.
+ */
+
+#define stringify2(x) #x
+#define stringify(x) stringify2(x)
+
+/* Pre-condition: 2**(rank+1) <= length(list) < 2**(rank+2) (therefore: length(list) >= 2) */
+static inline void
+insert_list (struct sort_info *si, list_node* list, int rank)
+{
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+       /*
+        * GCC incorrectly thinks we're writing below si->ranks array bounds.
+        */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
+
+       int i;
+
+       if (rank > si->n_ranks) {
+               if (rank > MAX_RANKS) {
+                       g_warning ("Rank '%d' should not exceed " stringify (MAX_RANKS), rank);
+                       rank = MAX_RANKS;
+               }
+               list = merge_lists (sweep_up (si, NULL, si->n_ranks), list, si->func);
+               for (i = si->n_ranks; i < rank; ++i)
+                       si->ranks [i] = NULL;
+       } else {
+               if (rank)
+                       list = merge_lists (sweep_up (si, NULL, rank), list, si->func);
+               for (i = rank; i < si->n_ranks && si->ranks [i]; ++i) {
+                       list = merge_lists (si->ranks [i], list, si->func);
+                       si->ranks [i] = NULL;
+               }
+       }
+
+       if (i == MAX_RANKS) /* Will _never_ happen: so we can just devolve into quadratic ;-) */
+               --i;
+       if (i >= si->n_ranks)
+               si->n_ranks = i + 1;
+       si->min_rank = i;
+       si->ranks [i] = list;
+
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+#pragma GCC diagnostic pop
+#endif
+}
+
+#undef stringify2
+#undef stringify
+#undef MAX_RANKS
+#undef FLOOR_LOG2
+
+/* A non-recursive mergesort */
+static inline digit
+do_sort (list_node* list, GCompareFunc func)
+{
+       struct sort_info si;
+
+       init_sort_info (&si, func);
+
+       while (list && list->next) {
+               list_node* next = list->next;
+               list_node* tail = next->next;
+
+               if (func (list->data, next->data) > 0) {
+                       next->next = list;
+                       next = list;
+                       list = list->next;
+               }
+               next->next = NULL;
+
+               insert_list (&si, list, 0);
+
+               list = tail;
+       }
+
+       return sweep_up (&si, list, si.n_ranks);
+}
diff --git a/mono/eglib/test/.gitignore b/mono/eglib/test/.gitignore
new file mode 100644 (file)
index 0000000..2d669e1
--- /dev/null
@@ -0,0 +1,12 @@
+/Makefile
+/Makefile.in
+/.libs
+/.deps
+/*.lo
+/*.la
+/*.o
+/semantic.cache
+/.project
+/.cproject
+/test-eglib
+/test-glib
diff --git a/mono/eglib/test/Makefile.am b/mono/eglib/test/Makefile.am
new file mode 100644 (file)
index 0000000..c669d84
--- /dev/null
@@ -0,0 +1,44 @@
+EXTRA_DIST = UTF-8.txt UTF-16BE.txt UTF-16LE.txt UTF-32BE.txt UTF-32LE.txt
+
+SOURCES = \
+       test.c          \
+       test.h          \
+       tests.h         \
+       driver.c        \
+       hashtable.c     \
+       string-util.c   \
+       string.c        \
+       slist.c         \
+       sizes.c         \
+       ptrarray.c      \
+       list.c          \
+       array.c         \
+       fake.c          \
+       path.c          \
+       queue.c         \
+       shell.c         \
+       spawn.c         \
+       timer.c         \
+       file.c          \
+       pattern.c       \
+       dir.c           \
+       markup.c        \
+       unicode.c       \
+       utf8.c          \
+       endian.c        \
+       module.c        \
+       memory.c
+
+test_eglib_SOURCES = $(SOURCES)
+
+test_eglib_CFLAGS = -Wall -DEGLIB_TESTS=1 -D_FORTIFY_SOURCE=2 -I$(srcdir)/../src -I../src -DDRIVER_NAME=\"EGlib\"
+test_eglib_LDADD = ../src/libeglib.la $(LIBICONV)
+
+run-eglib: all
+       srcdir=`readlink -f $(srcdir)` ./test-eglib
+
+noinst_PROGRAMS = test-eglib
+
+run-both: run-eglib
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/mono/eglib/test/README b/mono/eglib/test/README
new file mode 100644 (file)
index 0000000..7c28d03
--- /dev/null
@@ -0,0 +1,113 @@
+EGlib Unit Testing
+===============================================================================
+
+       1. Writing new tests
+       2. Using the test driver
+
+===============================================================================
+1. Writing new tests
+===============================================================================
+
+Tests are easy to write, but must be grouped in to logical cases. For instance,
+the GPtrArray group has a number of tests that cover the entire GPtrArray
+implementation.
+
+These logical case groups should be in a single C file, and must have
+three elements:
+
+       #include <glib.h>
+       #include "test.h"
+
+       ...
+       <define test implementations>
+       ...
+
+       static Test groupname_tests [] = {
+               {"groupname_test1", groupname_test1},
+               {"groupname_test1", groupname_test2},
+               {NULL, NULL}
+       };
+
+       DEFINE_TEST_GROUP_INIT(groupname_tests_init, groupname_tests)
+
+A test implementation should look like:
+
+       RESULT groupname_test1()
+       {
+               <perform the test>
+
+               if(test_failed) {
+                       return FAILED("reason: %s", "this works like printf");
+               }
+
+               return OK; /* just NULL, but OK is cute */
+       }
+
+Once a test group is written, it needs to be added to the groups table
+in tests.h:
+
+       DEFINE_TEST_GROUP_INIT_H(groupname_tests_init) // same as in impl
+
+       static Group test_groups [] = {
+               ...
+               {"groupname", groupname_tests_init}
+               ...
+       };
+
+===============================================================================
+2. Using the test driver
+===============================================================================
+
+When tests are written, they are rebuilt with make. Two programs will be
+built:
+
+       test-eglib: the test driver and tests linked against eglib
+       test-glib:  the test driver and tests linked against system glib-2.0
+
+Each driver program works exactly the same. Running test-eglib will run 
+the tests against eglib, and test-glib against glib-2.0.
+
+The test driver supports a few options to allow for performance measuring:
+
+       --help          show all options and available test groups
+       --time          time the overall run and report it, even if --quiet is set
+       --quiet         do not print test results, useful for timing
+       --iterations N  run all or specified test groups N times
+
+Run "test-eglib --help" for more details.
+
+Example: run the ptrarray test group 100000 times and only print the time 
+         it took to perform all iterations
+
+       ./test-eglib -tqi 100000 ptrarray
+
+Example: show single iteration of test output for two groups
+       
+       ./test-eglib ptrarray hashtable
+
+Example: show test output of all available groups
+
+       ./test-eglib
+
+The 'test-both' script can be used to run both test-eglib and test-glib
+with the same options back to back:
+
+       $ ./test-both -tqi 100000 ptrarray
+       EGlib Total Time: 1.1961s
+       GLib Total Time: 0.955957s
+
+test-both also has a nice --speed-compare mode that shows comparison
+information about EGlib vs GLib. It can run all tests or specific tests
+with a configurable number of iterations. --speed-compare mode always runs
+the drivers with -qtni
+
+The syntax for --speed-compare is:
+
+       ./test-both --speed-compare [ITERATIONS] [GROUPS...]
+
+       $ ./test-both --speed-compare       Runs all tests with default iterations
+       $ ./test-both --speed-compare 500   Runs all tests with 500 iterations
+       $ ./test-both --speed-compare ptrarray   Runs ptrarray test with default
+                                                iterations
+
+
diff --git a/mono/eglib/test/UTF-16BE.txt b/mono/eglib/test/UTF-16BE.txt
new file mode 100644 (file)
index 0000000..b7e494c
Binary files /dev/null and b/mono/eglib/test/UTF-16BE.txt differ
diff --git a/mono/eglib/test/UTF-16LE.txt b/mono/eglib/test/UTF-16LE.txt
new file mode 100644 (file)
index 0000000..30fe7b0
Binary files /dev/null and b/mono/eglib/test/UTF-16LE.txt differ
diff --git a/mono/eglib/test/UTF-32BE.txt b/mono/eglib/test/UTF-32BE.txt
new file mode 100644 (file)
index 0000000..a1fd543
Binary files /dev/null and b/mono/eglib/test/UTF-32BE.txt differ
diff --git a/mono/eglib/test/UTF-32LE.txt b/mono/eglib/test/UTF-32LE.txt
new file mode 100644 (file)
index 0000000..043afc9
Binary files /dev/null and b/mono/eglib/test/UTF-32LE.txt differ
diff --git a/mono/eglib/test/UTF-8.txt b/mono/eglib/test/UTF-8.txt
new file mode 100644 (file)
index 0000000..4363f27
--- /dev/null
@@ -0,0 +1,212 @@
+
+UTF-8 encoded sample plain-text file
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+
+Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25
+
+
+The ASCII compatible UTF-8 encoding used in this plain-text file
+is defined in Unicode, ISO 10646-1, and RFC 2279.
+
+
+Using Unicode/UTF-8, you can write in emails and source code things such as
+
+Mathematics and sciences:
+
+  ∮ E⋅da = Q,  n → ∞, ∑ f(i) = ∏ g(i),      ⎧⎡⎛┌─────┐⎞⎤⎫
+                                            ⎪⎢⎜│a²+b³ ⎟⎥⎪
+  ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β),    ⎪⎢⎜│───── ⎟⎥⎪
+                                            ⎪⎢⎜⎷ c₈   ⎟⎥⎪
+  ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ,                   ⎨⎢⎜       ⎟⎥⎬
+                                            ⎪⎢⎜ ∞     ⎟⎥⎪
+  ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫),      ⎪⎢⎜ ⎲     ⎟⎥⎪
+                                            ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪
+  2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm     ⎩⎣⎝i=1    ⎠⎦⎭
+
+Linguistics and dictionaries:
+
+  ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn
+  Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ]
+
+APL:
+
+  ((V⍳V)=⍳⍴V)/V←,V    ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈
+
+Nicer typography in plain text files:
+
+  ╔══════════════════════════════════════════╗
+  ║                                          ║
+  ║   • ‘single’ and “double” quotes         ║
+  ║                                          ║
+  ║   • Curly apostrophes: “We’ve been here” ║
+  ║                                          ║
+  ║   • Latin-1 apostrophe and accents: '´`  ║
+  ║                                          ║
+  ║   • ‚deutsche‘ „Anführungszeichen“       ║
+  ║                                          ║
+  ║   • †, ‡, ‰, •, 3–4, —, −5/+5, ™, …      ║
+  ║                                          ║
+  ║   • ASCII safety test: 1lI|, 0OD, 8B     ║
+  ║                      ╭─────────╮         ║
+  ║   • the euro symbol: │ 14.95 € │         ║
+  ║                      ╰─────────╯         ║
+  ╚══════════════════════════════════════════╝
+
+Combining characters:
+
+  STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑
+
+Greek (in Polytonic):
+
+  The Greek anthem:
+
+  Σὲ γνωρίζω ἀπὸ τὴν κόψη
+  τοῦ σπαθιοῦ τὴν τρομερή,
+  σὲ γνωρίζω ἀπὸ τὴν ὄψη
+  ποὺ μὲ βία μετράει τὴ γῆ.
+
+  ᾿Απ᾿ τὰ κόκκαλα βγαλμένη
+  τῶν ῾Ελλήνων τὰ ἱερά
+  καὶ σὰν πρῶτα ἀνδρειωμένη
+  χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά!
+
+  From a speech of Demosthenes in the 4th century BC:
+
+  Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι,
+  ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς
+  λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ
+  τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿
+  εἰς τοῦτο προήκοντα,  ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ
+  πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν
+  οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι,
+  οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν
+  ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον
+  τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι
+  γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν
+  προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους
+  σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ
+  τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ
+  τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς
+  τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον.
+
+  Δημοσθένους, Γ´ ᾿Ολυνθιακὸς
+
+Georgian:
+
+  From a Unicode conference invitation:
+
+  გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო
+  კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს,
+  ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს
+  ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი,
+  ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება
+  ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში,
+  ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში.
+
+Russian:
+
+  From a Unicode conference invitation:
+
+  Зарегистрируйтесь сейчас на Десятую Международную Конференцию по
+  Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии.
+  Конференция соберет широкий круг экспертов по  вопросам глобального
+  Интернета и Unicode, локализации и интернационализации, воплощению и
+  применению Unicode в различных операционных системах и программных
+  приложениях, шрифтах, верстке и многоязычных компьютерных системах.
+
+Thai (UCS Level 2):
+
+  Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese
+  classic 'San Gua'):
+
+  [----------------------------|------------------------]
+    ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช  พระปกเกศกองบู๊กู้ขึ้นใหม่
+  สิบสองกษัตริย์ก่อนหน้าแลถัดไป       สององค์ไซร้โง่เขลาเบาปัญญา
+    ทรงนับถือขันทีเป็นที่พึ่ง           บ้านเมืองจึงวิปริตเป็นนักหนา
+  โฮจิ๋นเรียกทัพทั่วหัวเมืองมา         หมายจะฆ่ามดชั่วตัวสำคัญ
+    เหมือนขับไสไล่เสือจากเคหา      รับหมาป่าเข้ามาเลยอาสัญ
+  ฝ่ายอ้องอุ้นยุแยกให้แตกกัน          ใช้สาวนั้นเป็นชนวนชื่นชวนใจ
+    พลันลิฉุยกุยกีกลับก่อเหตุ          ช่างอาเพศจริงหนาฟ้าร้องไห้
+  ต้องรบราฆ่าฟันจนบรรลัย           ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ
+
+  (The above is a two-column text. If combining characters are handled
+  correctly, the lines of the second column should be aligned with the
+  | character above.)
+
+Ethiopian:
+
+  Proverbs in the Amharic language:
+
+  ሰማይ አይታረስ ንጉሥ አይከሰስ።
+  ብላ ካለኝ እንደአባቴ በቆመጠኝ።
+  ጌጥ ያለቤቱ ቁምጥና ነው።
+  ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው።
+  የአፍ ወለምታ በቅቤ አይታሽም።
+  አይጥ በበላ ዳዋ ተመታ።
+  ሲተረጉሙ ይደረግሙ።
+  ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል።
+  ድር ቢያብር አንበሳ ያስር።
+  ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም።
+  እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም።
+  የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ።
+  ሥራ ከመፍታት ልጄን ላፋታት።
+  ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል።
+  የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ።
+  ተንጋሎ ቢተፉ ተመልሶ ባፉ።
+  ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው።
+  እግርህን በፍራሽህ ልክ ዘርጋ።
+
+Runes:
+
+  ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ
+
+  (Old English, which transcribed into Latin reads 'He cwaeth that he
+  bude thaem lande northweardum with tha Westsae.' and means 'He said
+  that he lived in the northern land near the Western Sea.')
+
+Braille:
+
+  ⡌⠁⠧⠑ ⠼⠁⠒  ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌
+
+  ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞
+  ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎
+  ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂
+  ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙
+  ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑
+  ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲
+
+  ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲
+
+  ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹
+  ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞
+  ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕
+  ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹
+  ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎
+  ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎
+  ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳
+  ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞
+  ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲
+
+  (The first couple of paragraphs of "A Christmas Carol" by Dickens)
+
+Compact font selection example text:
+
+  ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789
+  abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ
+  –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд
+  ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა
+
+Greetings in various languages:
+
+  Hello world, Καλημέρα κόσμε, コンニチハ
+
+Box drawing alignment tests:                                          █
+                                                                      ▉
+  ╔══╦══╗  ┌──┬──┐  ╭──┬──╮  ╭──┬──╮  ┏━━┳━━┓  ┎┒┏┑   ╷  ╻ ┏┯┓ ┌┰┐    ▊ ╱╲╱╲╳╳╳
+  ║┌─╨─┐║  │╔═╧═╗│  │╒═╪═╕│  │╓─╁─╖│  ┃┌─╂─┐┃  ┗╃╄┙  ╶┼╴╺╋╸┠┼┨ ┝╋┥    ▋ ╲╱╲╱╳╳╳
+  ║│╲ ╱│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╿ │┃  ┍╅╆┓   ╵  ╹ ┗┷┛ └┸┘    ▌ ╱╲╱╲╳╳╳
+  ╠╡ ╳ ╞╣  ├╢   ╟┤  ├┼─┼─┼┤  ├╫─╂─╫┤  ┣┿╾┼╼┿┫  ┕┛┖┚     ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳
+  ║│╱ ╲│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╽ │┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▎
+  ║└─╥─┘║  │╚═╤═╝│  │╘═╪═╛│  │╙─╀─╜│  ┃└─╂─┘┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▏
+  ╚══╩══╝  └──┴──┘  ╰──┴──╯  ╰──┴──╯  ┗━━┻━━┛  ▗▄▖▛▀▜   └╌╌┘ ╎ ┗╍╍┛ ┋  ▁▂▃▄▅▆▇█
+                                               ▝▀▘▙▄▟
diff --git a/mono/eglib/test/array.c b/mono/eglib/test/array.c
new file mode 100644 (file)
index 0000000..37d5486
--- /dev/null
@@ -0,0 +1,163 @@
+#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+#include "test.h"
+
+/* example from glib documentation */
+RESULT
+test_array_big ()
+{
+       GArray *garray;
+       gint i;
+
+       /* We create a new array to store gint values.
+          We don't want it zero-terminated or cleared to 0's. */
+       garray = g_array_new (FALSE, FALSE, sizeof (gint));
+       for (i = 0; i < 10000; i++)
+               g_array_append_val (garray, i);
+
+       for (i = 0; i < 10000; i++)
+               if (g_array_index (garray, gint, i) != i)
+                       return FAILED ("array value didn't match");
+       
+       g_array_free (garray, TRUE);
+
+       return NULL;
+}
+
+RESULT
+test_array_index ()
+{
+       GArray *array = g_array_new (FALSE, FALSE, sizeof (int));
+       int v;
+
+       v = 27;
+       g_array_append_val (array, v);
+
+       if (27 != g_array_index (array, int, 0))
+               return FAILED ("");
+
+       g_array_free (array, TRUE);
+
+       return NULL;
+}
+
+RESULT
+test_array_append_zero_terminated ()
+{
+       GArray *array = g_array_new (TRUE, FALSE, sizeof (int));
+       int v;
+
+       v = 27;
+       g_array_append_val (array, v);
+
+       if (27 != g_array_index (array, int, 0))
+               return FAILED ("g_array_append_val failed");
+
+       if (0 != g_array_index (array, int, 1))
+               return FAILED ("zero_terminated didn't append a zero element");
+
+       g_array_free (array, TRUE);
+
+       return NULL;
+}
+
+RESULT
+test_array_append ()
+{
+       GArray *array = g_array_new (FALSE, FALSE, sizeof (int));
+       int v;
+
+       if (0 != array->len)
+               return FAILED ("initial array length not zero");
+
+       v = 27;
+
+       g_array_append_val (array, v);
+
+       if (1 != array->len)
+               return FAILED ("array append failed");
+
+       g_array_free (array, TRUE);
+
+       return NULL;
+}
+
+RESULT
+test_array_insert_val ()
+{
+       GArray *array = g_array_new (FALSE, FALSE, sizeof (gpointer));
+       gpointer ptr0, ptr1, ptr2, ptr3;
+
+       g_array_insert_val (array, 0, array);
+
+       if (array != g_array_index (array, gpointer, 0))
+               return FAILED ("1 The value in the array is incorrect");
+
+       g_array_insert_val (array, 1, array);
+       if (array != g_array_index (array, gpointer, 1))
+               return FAILED ("2 The value in the array is incorrect");
+
+       g_array_insert_val (array, 2, array);
+       if (array != g_array_index (array, gpointer, 2))
+               return FAILED ("3 The value in the array is incorrect");
+       
+       g_array_free (array, TRUE);
+       array = g_array_new (FALSE, FALSE, sizeof (gpointer));
+       ptr0 = array;
+       ptr1 = array + 1;
+       ptr2 = array + 2;
+       ptr3 = array + 3;
+
+       g_array_insert_val (array, 0, ptr0);
+       g_array_insert_val (array, 1, ptr1);
+       g_array_insert_val (array, 2, ptr2);
+       g_array_insert_val (array, 1, ptr3);
+       if (ptr0 != g_array_index (array, gpointer, 0))
+               return FAILED ("4 The value in the array is incorrect");
+       if (ptr3 != g_array_index (array, gpointer, 1))
+               return FAILED ("5 The value in the array is incorrect");
+       if (ptr1 != g_array_index (array, gpointer, 2))
+               return FAILED ("6 The value in the array is incorrect");
+       if (ptr2 != g_array_index (array, gpointer, 3))
+               return FAILED ("7 The value in the array is incorrect");
+
+       g_array_free (array, TRUE);
+       return NULL;
+}
+
+RESULT
+test_array_remove ()
+{
+       GArray *array = g_array_new (FALSE, FALSE, sizeof (int));
+       int v[] = {30, 29, 28, 27, 26, 25};
+
+       g_array_append_vals (array, v, 6);
+
+       if (6 != array->len)
+               return FAILED ("append_vals fail");
+
+       g_array_remove_index (array, 3);
+
+       if (5 != array->len)
+               return FAILED ("remove_index failed to update length");
+
+       if (26 != g_array_index (array, int, 3))
+               return FAILED ("remove_index failed to update the array");
+
+       g_array_free (array, TRUE);
+
+       return NULL;
+}
+
+static Test array_tests [] = {
+       {"big", test_array_big},
+       {"append", test_array_append},
+       {"insert_val", test_array_insert_val},
+       {"index", test_array_index},
+       {"remove", test_array_remove},
+       {"append_zero_term", test_array_append_zero_terminated},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(array_tests_init, array_tests)
diff --git a/mono/eglib/test/dir.c b/mono/eglib/test/dir.c
new file mode 100644 (file)
index 0000000..f871121
--- /dev/null
@@ -0,0 +1,66 @@
+#include <config.h>
+#include <glib.h>
+#include <string.h>
+#include <stdio.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef G_OS_UNIX
+#include <pthread.h>
+#endif
+#include "test.h"
+
+/* This test is just to be used with valgrind */
+RESULT
+test_dir ()
+{
+       GDir *dir;
+       GError *error;
+       const gchar *name;
+
+       /*
+       dir = g_dir_open (NULL, 0, NULL);
+       */
+       dir = g_dir_open ("", 0, NULL);
+       if (dir != NULL)
+               return FAILED ("1 Should be an error");
+
+       dir = g_dir_open ("", 9, NULL);
+       if (dir != NULL)
+               return FAILED ("2 Should be an error");
+
+       error = NULL;
+       dir = g_dir_open (".ljasdslakjd", 9, &error);
+       if (dir != NULL)
+               return FAILED ("3 opendir should fail");
+       if (error == NULL)
+               return FAILED ("4 got no error");
+       g_error_free (error);
+       error = NULL;
+       dir = g_dir_open (g_get_tmp_dir (), 9, &error);
+       if (dir == NULL)
+               return FAILED ("5 opendir should succeed");
+       if (error != NULL)
+               return FAILED ("6 got an error");
+       name = NULL;
+       name = g_dir_read_name (dir);
+       if (name == NULL)
+               return FAILED ("7 didn't read a file name");
+       while ((name = g_dir_read_name (dir)) != NULL) {
+               if (strcmp (name, ".") == 0)
+                       return FAILED (". directory found");
+               if (strcmp (name, "..") == 0)
+                       return FAILED (".. directory found");
+       }
+       g_dir_close (dir);
+       return OK;
+}
+
+static Test dir_tests [] = {
+       {"g_dir_*", test_dir},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(dir_tests_init, dir_tests)
+
+
diff --git a/mono/eglib/test/driver.c b/mono/eglib/test/driver.c
new file mode 100644 (file)
index 0000000..806e8b6
--- /dev/null
@@ -0,0 +1,255 @@
+/*
+ * EGLib Unit Test Driver
+ *
+ * Author:
+ *   Aaron Bockover (abockover@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <config.h>
+#include "test.h"
+
+#ifndef DRIVER_EXTERNAL_TESTS
+#include "tests.h"
+#endif
+
+#include <stdio.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
+
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+
+#ifndef DRIVER_NAME
+#define DRIVER_NAME "EGlib"
+#endif
+
+typedef struct _StringArray {
+       gchar **strings;
+       gint length;
+} StringArray;
+
+static StringArray *
+string_array_append(StringArray *array, gchar *string)
+{
+       if(array == NULL) {
+               array = g_new0(StringArray, 1);
+               array->length = 1;
+               array->strings = g_malloc(sizeof(gchar *) * 2);
+       } else {
+               array->length++;
+               array->strings = g_realloc(array->strings, sizeof(gchar *) 
+                       * (array->length + 1));
+       }
+       
+       array->strings[array->length - 1] = string;
+       array->strings[array->length] = NULL;
+
+       return array;
+}
+
+gint global_passed = 0, global_tests = 0;
+
+static void
+string_array_free(StringArray *array)
+{
+       g_free(array->strings);
+       g_free(array);
+}
+
+static void print_help(char *s)
+{
+       gint i;
+       
+       printf("Usage: %s [OPTION]... [TESTGROUP]...\n\n", s);
+       printf("OPTIONS are:\n");
+       printf("  -h, --help          show this help\n");
+       printf("  -t, --time          time the tests\n");
+       printf("  -i, --iterations    number of times to run tests\n");
+       printf("  -q, --quiet         do not print test results; "
+               "final time always prints\n");
+       printf("  -n, --no-labels     print final time without labels, "
+               "nice for scripts\n");
+       printf("  -d, --debug         do not run tests, "
+               "debug the driver itself for valgrind\n\n");
+       printf("TESTGROUPS available:\n");
+
+       for(i = 0; test_groups[i].name != NULL; i++) {
+               if(test_groups[i].handler != fake_tests_init) {
+                       printf("  %s\n", test_groups[i].name);
+               }
+       }
+
+       printf("\n");
+}
+
+#ifdef DRIVER_EXTERNAL_MAIN
+gint run_tests_main(gint argc, gchar **argv)
+#else
+gint main(gint argc, gchar **argv)
+#endif
+{
+       gint i, j, c, iterations = 1;
+       StringArray *tests_to_run = NULL;
+       gdouble time_start;
+       gboolean report_time = FALSE;
+       gboolean quiet = FALSE;
+       gboolean global_failure = FALSE;
+       gboolean no_final_time_labels = FALSE;
+       gboolean debug = FALSE;
+
+#if HAVE_GETOPT_H
+       static struct option long_options [] = {
+               {"help",       no_argument,       0, 'h'},
+               {"time",       no_argument,       0, 't'},
+               {"quiet",      no_argument,       0, 'q'},
+               {"iterations", required_argument, 0, 'i'},
+               {"debug",      no_argument,       0, 'd'},
+               {"no-labels",  no_argument,       0, 'n'},
+               {0, 0, 0, 0}
+       };
+
+       while((c = getopt_long(argc, argv, "dhtqni:", long_options, NULL)) != -1) {                     switch(c) {
+                       case 'h':
+                               print_help(argv[0]);
+                               return 1;
+                       case 't':
+                               report_time = TRUE;
+                               break;
+                       case 'i':
+                               iterations = atoi(optarg);
+                               break;
+                       case 'q':
+                               quiet = TRUE;
+                               break;
+                       case 'n':
+                               no_final_time_labels = TRUE;
+                               break;
+                       case 'd':
+                               debug = TRUE;
+                               break;
+               }
+       }
+
+       for(i = optind; i < argc; i++) {
+               if(argv[i][0] == '-') {
+                       continue;
+               }
+
+               tests_to_run = string_array_append(tests_to_run, argv[i]);
+       }
+#endif
+
+       time_start = get_timestamp();
+       
+       for(j = 0; test_groups[j].name != NULL; j++) {
+               gboolean run = TRUE;
+               gchar *tests = NULL;
+               gchar *group = NULL;
+               
+               if(tests_to_run != NULL) {
+                       gint k;
+                       run = FALSE;
+                       
+                       for(k = 0; k < tests_to_run->length; k++) {     
+                               gchar *user = tests_to_run->strings[k];
+                               const gchar *table = test_groups[j].name;
+                               size_t user_len = strlen(user);
+                               size_t table_len = strlen(table);
+                               
+                               if(strncmp(user, table, table_len) == 0) {
+                                       if(user_len > table_len && user[table_len] != ':') {
+                                               break;
+                                       }
+                                       
+                                       run = TRUE;
+                                       group = tests_to_run->strings[k];
+                                       break;
+                               }
+                       }
+               }
+       
+               if(run) {
+                       gboolean passed;
+                       gchar **split = NULL;
+                       
+                       if(debug && test_groups[j].handler != fake_tests_init) {
+                               printf("Skipping %s, in driver debug mode\n", 
+                                       test_groups[j].name);
+                               continue;
+                       } else if(!debug && test_groups[j].handler == fake_tests_init) {
+                               continue;
+                       }
+
+                       if(group != NULL) {
+                               split = eg_strsplit(group, ":", -1);    
+                               if(split != NULL) {
+                                       gint m;
+                                       for(m = 0; split[m] != NULL; m++) {
+                                               if(m == 1) {
+                                                       tests = strdup(split[m]);
+                                                       break;
+                                               }
+                                       }
+                                       eg_strfreev(split);
+                               }
+                       }
+                       
+                       passed = run_group(&(test_groups[j]), 
+                               iterations, quiet, report_time, tests);
+
+                       if(tests != NULL) {
+                               g_free(tests);
+                       }
+
+                       if(!passed && !global_failure) {
+                               global_failure = TRUE;
+                       }
+               }
+       }
+       
+       if(!quiet) {
+               gdouble pass_percentage = ((gdouble)global_passed / (gdouble)global_tests) * 100.0;
+               printf("=============================\n");
+               printf("Overall result: %s : %d / %d (%g%%)\n", global_failure ? "FAILED" : "OK", global_passed, global_tests, pass_percentage);
+       }
+       
+       if(report_time) {
+               gdouble duration = get_timestamp() - time_start;
+               if(no_final_time_labels) {
+                       printf("%g\n", duration);
+               } else {
+                       printf("%s Total Time: %g\n", DRIVER_NAME, duration);
+               }
+       }
+
+       if(tests_to_run != NULL) {
+               string_array_free(tests_to_run);
+       }
+
+       return global_tests - global_passed;
+}
+
+
diff --git a/mono/eglib/test/endian.c b/mono/eglib/test/endian.c
new file mode 100644 (file)
index 0000000..3347d76
--- /dev/null
@@ -0,0 +1,38 @@
+#include "test.h"
+
+RESULT
+test_swap ()
+{
+       guint32 a = 0xabcdef01, res32;
+       guint64 b = (((guint64)a) << 32) | a, res64;
+       guint64 b_expect = (((guint64)0x1efcdab) << 32) | 0x01efcdab;
+       guint16 c = 0xabcd, res16;
+       
+       res32 = GUINT32_SWAP_LE_BE (a);
+       if (res32 != 0x01efcdab)
+               return FAILED ("GUINT32_SWAP_LE_BE returned 0x%x", res32);
+       res32 = GUINT32_SWAP_LE_BE (1);
+       if (res32 != 0x1000000)
+               return FAILED ("GUINT32_SWAP_LE_BE returned 0x%x", res32);
+
+       res64 = GUINT64_SWAP_LE_BE(b);
+       if (res64 != b_expect)
+               return FAILED ("GUINT64_SWAP_LE_BE returned 0x%llx (had=0x%llx)", res64, b);
+       res16 = GUINT16_SWAP_LE_BE(c);
+       if (res16 != 0xcdab)
+               return FAILED ("GUINT16_SWAP_LE_BE returned 0x%x", (guint32) res16);    
+       
+       return OK;
+}
+
+/*
+ * test initialization
+ */
+
+static Test endian_tests [] = {
+       {"swap", test_swap},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(endian_tests_init, endian_tests)
+
diff --git a/mono/eglib/test/fake.c b/mono/eglib/test/fake.c
new file mode 100644 (file)
index 0000000..c8d9af6
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Fake test allows debugging of the driver itself
+ */
+#include "test.h"
+
+RESULT
+test_fake()
+{
+       return OK;
+}
+
+static Test fake_tests [] = {
+       {"fake", test_fake},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(fake_tests_init, fake_tests)
+
diff --git a/mono/eglib/test/file.c b/mono/eglib/test/file.c
new file mode 100644 (file)
index 0000000..19276c9
--- /dev/null
@@ -0,0 +1,228 @@
+#include <config.h>
+#include <glib.h>
+#include <string.h>
+#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include "test.h"
+
+#ifdef G_OS_WIN32
+#include <io.h>
+#define close _close
+#endif
+
+RESULT
+test_file_get_contents ()
+{
+       GError *error;
+       gchar *content;
+       gboolean ret;
+       gsize length;
+#ifdef G_OS_WIN32
+       const gchar *filename = "c:\\Windows\\system.ini";
+#else
+       const gchar *filename = "/etc/hosts";
+#endif
+
+       /*
+       filename != NULL
+       ret = g_file_get_contents (NULL, NULL, NULL, NULL);
+       contents != NULL
+       ret = g_file_get_contents ("", NULL, NULL, NULL);
+       error no such file and fails for 'error' not being null too
+       ret = g_file_get_contents ("", &content, NULL, &error);
+       */
+
+       error = NULL;
+       ret = g_file_get_contents ("", &content, NULL, &error);
+       if (ret)
+               return FAILED ("HAH!");
+       if (error == NULL)
+               return FAILED ("Got nothing as error.");
+       if (content != NULL)
+               return FAILED ("Content is uninitialized");
+
+       g_error_free (error);
+       error = NULL;
+       ret = g_file_get_contents (filename, &content, &length, &error);
+       if (!ret)
+               return FAILED ("The error is %d %s\n", error->code, error->message);
+       if (error != NULL)
+               return FAILED ("Got an error returning TRUE");
+       if (content == NULL)
+               return FAILED ("Content is NULL");
+       if (strlen (content) != length)
+               return FAILED ("length is %d but the string is %d", length, strlen (content));
+       g_free (content);
+
+       return OK;
+}
+
+RESULT
+test_open_tmp ()
+{
+       GError *error;
+       gint fd;
+       gchar *name = GINT_TO_POINTER (-1);
+
+       /*
+        * Okay, this works, but creates a .xxx file in /tmp on every run. Disabled.
+        * fd = g_file_open_tmp (NULL, NULL, NULL);
+        * if (fd < 0)
+        *      return FAILED ("Default failed.");
+        * close (fd);
+       */
+       error = NULL;
+       fd = g_file_open_tmp ("invalidtemplate", NULL, &error);
+       if (fd != -1)
+               return FAILED ("The template was invalid and accepted");
+       if (error == NULL)
+               return FAILED ("No error returned.");
+       g_error_free (error);
+
+       error = NULL;
+       fd = g_file_open_tmp ("i/nvalidtemplate", &name, &error);
+       if (fd != -1)
+               return FAILED ("The template was invalid and accepted");
+       if (error == NULL)
+               return FAILED ("No error returned.");
+       if (name == NULL)
+               return FAILED ("'name' is not reset");
+       g_error_free (error);
+
+       error = NULL;
+       fd = g_file_open_tmp ("valid-XXXXXX", &name, &error);
+       if (fd == -1)
+               return FAILED ("This should be valid");
+       if (error != NULL)
+               return FAILED ("No error returned.");
+       if (name == NULL)
+               return FAILED ("No name returned.");
+       close (fd);
+       unlink (name);
+       g_free (name);
+       return OK;
+}
+
+RESULT
+test_file ()
+{
+       gboolean res;
+       const gchar *tmp;
+       gchar *path;
+
+#ifndef G_OS_WIN32 /* FIXME */
+       gchar *sympath;
+       gint ignored G_GNUC_UNUSED;
+#endif
+
+       res = g_file_test (NULL, 0);
+       if (res)
+               return FAILED ("Should return FALSE HERE");
+
+       res = g_file_test ("file.c", 0);
+       if (res)
+               return FAILED ("Should return FALSE HERE");
+
+       tmp = g_get_tmp_dir ();
+       res = g_file_test (tmp, G_FILE_TEST_EXISTS);
+       if (!res)
+               return FAILED ("tmp does not exist.");
+       res = g_file_test (tmp, G_FILE_TEST_IS_REGULAR);
+       if (res)
+               return FAILED ("tmp is regular");
+
+       res = g_file_test (tmp, G_FILE_TEST_IS_DIR);
+       if (!res)
+               return FAILED ("tmp is not a directory");
+       res = g_file_test (tmp, G_FILE_TEST_IS_EXECUTABLE);
+       if (!res)
+               return FAILED ("tmp is not a executable");
+
+       res = g_file_test (tmp, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_SYMLINK);
+       if (!res)
+               return FAILED ("2 tmp does not exist.");
+       res = g_file_test (tmp, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK);
+       if (res)
+               return FAILED ("2 tmp is regular");
+
+       res = g_file_test (tmp, G_FILE_TEST_IS_DIR | G_FILE_TEST_IS_SYMLINK);
+       if (!res)
+               return FAILED ("2 tmp is not a directory");
+       res = g_file_test (tmp, G_FILE_TEST_IS_EXECUTABLE | G_FILE_TEST_IS_SYMLINK);
+       if (!res)
+               return FAILED ("2 tmp is not a executable");
+
+       close (g_file_open_tmp (NULL, &path, NULL)); /* create an empty file */
+       res = g_file_test (path, G_FILE_TEST_EXISTS);
+       if (!res)
+               return FAILED ("3 %s should exist", path);
+       res = g_file_test (path, G_FILE_TEST_IS_REGULAR);
+       /* This is strange. Empty file is reported as not existing! */
+       if (!res)
+               return FAILED ("3 %s IS_REGULAR", path);
+       res = g_file_test (path, G_FILE_TEST_IS_DIR);
+       if (res)
+               return FAILED ("3 %s should not be a directory", path);
+       res = g_file_test (path, G_FILE_TEST_IS_EXECUTABLE);
+       if (res)
+               return FAILED ("3 %s should not be executable", path);
+       res = g_file_test (path, G_FILE_TEST_IS_SYMLINK);
+       if (res)
+               return FAILED ("3 %s should not be a symlink", path);
+
+#ifndef G_OS_WIN32 /* FIXME */
+       sympath = g_strconcat (path, "-link", NULL);
+       ignored = symlink (path, sympath);
+       res = g_file_test (sympath, G_FILE_TEST_EXISTS);
+       if (!res)
+               return FAILED ("4 %s should not exist", sympath);
+       res = g_file_test (sympath, G_FILE_TEST_IS_REGULAR);
+       if (!res)
+               return FAILED ("4 %s should not be a regular file", sympath);
+       res = g_file_test (sympath, G_FILE_TEST_IS_DIR);
+       if (res)
+               return FAILED ("4 %s should not be a directory", sympath);
+       res = g_file_test (sympath, G_FILE_TEST_IS_EXECUTABLE);
+       if (res)
+               return FAILED ("4 %s should not be executable", sympath);
+       res = g_file_test (sympath, G_FILE_TEST_IS_SYMLINK);
+       if (!res)
+               return FAILED ("4 %s should be a symlink", sympath);
+
+       unlink (path);
+
+       res = g_file_test (sympath, G_FILE_TEST_EXISTS);
+       if (res)
+               return FAILED ("5 %s should exist", sympath);
+       res = g_file_test (sympath, G_FILE_TEST_IS_REGULAR);
+       if (res)
+               return FAILED ("5 %s should be a regular file", sympath);
+       res = g_file_test (sympath, G_FILE_TEST_IS_DIR);
+       if (res)
+               return FAILED ("5 %s should not be a directory", sympath);
+       res = g_file_test (sympath, G_FILE_TEST_IS_EXECUTABLE);
+       if (res)
+               return FAILED ("5 %s should not be executable", sympath);
+       res = g_file_test (sympath, G_FILE_TEST_IS_SYMLINK);
+       if (!res)
+               return FAILED ("5 %s should be a symlink", sympath);
+       unlink (sympath);
+       g_free (sympath);
+#endif
+       g_free (path);
+       return OK;
+}
+
+static Test file_tests [] = {
+       {"g_file_get_contents", test_file_get_contents},
+       {"g_file_open_tmp", test_open_tmp},
+       {"g_file_test", test_file},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(file_tests_init, file_tests)
+
+
diff --git a/mono/eglib/test/hashtable.c b/mono/eglib/test/hashtable.c
new file mode 100644 (file)
index 0000000..8eb9885
--- /dev/null
@@ -0,0 +1,177 @@
+#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+#include "test.h"
+
+int foreach_count = 0;
+int foreach_fail = 0;
+
+void foreach (gpointer key, gpointer value, gpointer user_data)
+{
+       foreach_count++;
+       if (GPOINTER_TO_INT (user_data) != 'a')
+               foreach_fail = 1;
+}
+
+RESULT hash_t1 (void)
+{
+       GHashTable *t = g_hash_table_new (g_str_hash, g_str_equal);
+
+       foreach_count = 0;
+       foreach_fail = 0;
+       g_hash_table_insert (t, "hello", "world");
+       g_hash_table_insert (t, "my", "god");
+
+       g_hash_table_foreach (t, foreach, GINT_TO_POINTER('a'));
+       if (foreach_count != 2)
+               return FAILED ("did not find all keys, got %d expected 2", foreach_count);
+       if (foreach_fail)
+               return FAILED("failed to pass the user-data to foreach");
+       
+       if (!g_hash_table_remove (t, "my"))
+               return FAILED ("did not find known key");
+       if (g_hash_table_size (t) != 1)
+               return FAILED ("unexpected size");
+       g_hash_table_insert(t, "hello", "moon");
+       if (strcmp (g_hash_table_lookup (t, "hello"), "moon") != 0)
+               return FAILED ("did not replace world with moon");
+               
+       if (!g_hash_table_remove (t, "hello"))
+               return FAILED ("did not find known key");
+       if (g_hash_table_size (t) != 0)
+               return FAILED ("unexpected size");
+       g_hash_table_destroy (t);
+
+       return OK;
+}
+
+RESULT hash_t2 (void)
+{
+       return OK;
+}
+
+RESULT hash_default (void)
+{
+       GHashTable *hash = g_hash_table_new (NULL, NULL);
+
+       if (hash == NULL)
+               return FAILED ("g_hash_table_new should return a valid hash");
+
+       g_hash_table_destroy (hash);
+       return NULL;
+}
+
+RESULT
+hash_null_lookup (void)
+{
+       GHashTable *hash = g_hash_table_new (NULL, NULL);
+       gpointer ok, ov;
+               
+       g_hash_table_insert (hash, NULL, GINT_TO_POINTER (1));
+       g_hash_table_insert (hash, GINT_TO_POINTER(1), GINT_TO_POINTER(2));
+
+       if (!g_hash_table_lookup_extended (hash, NULL, &ok, &ov))
+               return FAILED ("Did not find the NULL");
+       if (ok != NULL)
+               return FAILED ("Incorrect key found");
+       if (ov != GINT_TO_POINTER (1))
+               return FAILED ("Got wrong value %p\n", ov);
+
+       if (!g_hash_table_lookup_extended (hash, GINT_TO_POINTER(1), &ok, &ov))
+               return FAILED ("Did not find the 1");
+       if (ok != GINT_TO_POINTER(1))
+               return FAILED ("Incorrect key found");
+       if (ov != GINT_TO_POINTER (2))
+               return FAILED ("Got wrong value %p\n", ov);
+       
+       g_hash_table_destroy (hash);
+
+       return NULL;
+}
+
+static void
+counter (gpointer key, gpointer value, gpointer user_data)
+{
+       int *counter = (int *) user_data;
+
+       (*counter)++;
+}
+
+RESULT hash_grow (void)
+{
+       GHashTable *hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+       int i, count = 0;
+       
+       for (i = 0; i < 1000; i++)
+               g_hash_table_insert (hash, g_strdup_printf ("%d", i), g_strdup_printf ("x-%d", i));
+
+       for (i = 0; i < 1000; i++){
+               char buffer [30];
+               gpointer value;
+               
+               sprintf (buffer, "%d", i);
+
+               value = g_hash_table_lookup (hash, buffer);
+               sprintf (buffer, "x-%d", i);
+               if (strcmp (value, buffer) != 0){
+                       return FAILED ("Failed to lookup the key %d, the value was %s\n", i, value);
+               }
+       }
+
+       if (g_hash_table_size (hash) != 1000)
+               return FAILED ("Did not find 1000 elements on the hash, found %d\n", g_hash_table_size (hash));
+
+       /* Now do the manual count, lets not trust the internals */
+       g_hash_table_foreach (hash, counter, &count);
+       if (count != 1000){
+               return FAILED ("Foreach count is not 1000");
+       }
+
+       g_hash_table_destroy (hash);
+       return NULL;
+}
+
+RESULT hash_iter (void)
+{
+#if !defined(GLIB_MAJOR_VERSION) || GLIB_CHECK_VERSION(2, 16, 0)
+       GHashTable *hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
+       GHashTableIter iter;
+       int i, sum, keys_sum, values_sum;
+       gpointer key, value;
+
+       sum = 0;
+       for (i = 0; i < 1000; i++) {
+               sum += i;
+               g_hash_table_insert (hash, GUINT_TO_POINTER (i), GUINT_TO_POINTER (i));
+       }
+
+       keys_sum = values_sum = 0;
+       g_hash_table_iter_init (&iter, hash);
+       while (g_hash_table_iter_next (&iter, &key, &value)) {
+               if (key != value)
+                       return FAILED ("key != value");
+               keys_sum += GPOINTER_TO_UINT (key);
+               values_sum += GPOINTER_TO_UINT (value);
+       }
+       if (keys_sum != sum || values_sum != sum)
+               return FAILED ("Did not find all key-value pairs");
+       g_hash_table_destroy (hash);
+       return NULL;
+#else
+       /* GHashTableIter was added in glib 2.16 */
+       return NULL;
+#endif
+}
+
+static Test hashtable_tests [] = {
+       {"t1", hash_t1},
+       {"t2", hash_t2},
+       {"grow", hash_grow},
+       {"default", hash_default},
+       {"null_lookup", hash_null_lookup},
+       {"iter", hash_iter},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(hashtable_tests_init, hashtable_tests)
+
diff --git a/mono/eglib/test/list.c b/mono/eglib/test/list.c
new file mode 100644 (file)
index 0000000..68dadee
--- /dev/null
@@ -0,0 +1,438 @@
+#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+#include "test.h"
+
+RESULT
+test_list_length ()
+{
+       GList *list = g_list_prepend (NULL, "foo");
+
+       if (g_list_length (list) != 1)
+               return FAILED ("length failed. #1");
+
+       list = g_list_prepend (list, "bar");
+       if (g_list_length (list) != 2)
+               return FAILED ("length failed. #2");
+
+       list = g_list_append (list, "bar");
+       if (g_list_length (list) != 3)
+               return FAILED ("length failed. #3");
+
+       g_list_free (list);
+       return NULL;
+}
+
+RESULT
+test_list_nth ()
+{
+       char *foo = "foo";
+       char *bar = "bar";
+       char *baz = "baz";
+       GList *nth, *list;
+       list = g_list_prepend (NULL, baz);
+       list = g_list_prepend (list, bar);
+       list = g_list_prepend (list, foo);
+
+       nth = g_list_nth (list, 0);
+       if (nth->data != foo)
+               return FAILED ("nth failed. #0");
+
+       nth = g_list_nth (list, 1);
+       if (nth->data != bar)
+               return FAILED ("nth failed. #1");
+       
+       nth = g_list_nth (list, 2);
+       if (nth->data != baz)
+               return FAILED ("nth failed. #2");
+
+       nth = g_list_nth (list, 3);
+       if (nth)
+               return FAILED ("nth failed. #3: %s", nth->data);
+
+       g_list_free (list);
+       return OK;
+}
+
+RESULT
+test_list_index ()
+{
+       int i;
+       char *foo = "foo";
+       char *bar = "bar";
+       char *baz = "baz";
+       GList *list;
+       list = g_list_prepend (NULL, baz);
+       list = g_list_prepend (list, bar);
+       list = g_list_prepend (list, foo);
+
+       i = g_list_index (list, foo);
+       if (i != 0)
+               return FAILED ("index failed. #0: %d", i);
+
+       i = g_list_index (list, bar);
+       if (i != 1)
+               return FAILED ("index failed. #1: %d", i);
+       
+       i = g_list_index (list, baz);
+       if (i != 2)
+               return FAILED ("index failed. #2: %d", i);
+
+       g_list_free (list);
+       return OK;
+}
+
+RESULT
+test_list_append ()
+{
+       GList *list = g_list_prepend (NULL, "first");
+       if (g_list_length (list) != 1)
+               return FAILED ("Prepend failed");
+
+       list = g_list_append (list, "second");
+
+       if (g_list_length (list) != 2)
+               return FAILED ("Append failed");
+
+       g_list_free (list);
+       return OK;
+}
+
+RESULT
+test_list_last ()
+{
+       GList *foo = g_list_prepend (NULL, "foo");
+       GList *bar = g_list_prepend (NULL, "bar");
+       GList *last;
+       
+       foo = g_list_concat (foo, bar);
+       last = g_list_last (foo);
+
+       if (last != bar)
+               return FAILED ("last failed. #1");
+
+       foo = g_list_concat (foo, g_list_prepend (NULL, "baz"));
+       foo = g_list_concat (foo, g_list_prepend (NULL, "quux"));
+
+       last = g_list_last (foo);       
+       if (strcmp ("quux", last->data))
+               return FAILED ("last failed. #2");
+
+       g_list_free (foo);
+
+       return OK;
+}
+
+RESULT
+test_list_concat ()
+{
+       GList *foo = g_list_prepend (NULL, "foo");
+       GList *bar = g_list_prepend (NULL, "bar");
+       GList *list = g_list_concat (foo, bar);
+
+       if (g_list_length (list) != 2)
+               return FAILED ("Concat failed. #1");
+
+       if (strcmp (list->data, "foo"))
+               return FAILED ("Concat failed. #2");
+
+       if (strcmp (list->next->data, "bar"))
+               return FAILED ("Concat failed. #3");
+
+       if (g_list_first (list) != foo)
+               return FAILED ("Concat failed. #4");
+       
+       if (g_list_last (list) != bar)
+               return FAILED ("Concat failed. #5");
+
+       g_list_free (list);
+
+       return OK;
+}
+
+
+static gint
+compare (gconstpointer a, gconstpointer b)
+{
+       char *foo = (char *) a;
+       char *bar = (char *) b;
+
+       if (strlen (foo) < strlen (bar))
+               return -1;
+
+       return 1;
+}
+
+RESULT
+test_list_insert_sorted ()
+{
+       GList *list = g_list_prepend (NULL, "a");
+       list = g_list_append (list, "aaa");
+
+       /* insert at the middle */
+       list = g_list_insert_sorted (list, "aa", compare);
+       if (strcmp ("aa", list->next->data))
+               return FAILED ("insert_sorted failed. #1");
+
+       /* insert at the beginning */
+       list = g_list_insert_sorted (list, "", compare);
+       if (strcmp ("", list->data))
+               return FAILED ("insert_sorted failed. #2");             
+
+       /* insert at the end */
+       list = g_list_insert_sorted (list, "aaaa", compare);
+       if (strcmp ("aaaa", g_list_last (list)->data))
+               return FAILED ("insert_sorted failed. #3");
+
+       g_list_free (list);
+       return OK;
+}
+
+RESULT
+test_list_copy ()
+{
+       int i, length;
+       GList *list, *copy;
+       list = g_list_prepend (NULL, "a");
+       list = g_list_append  (list, "aa");
+       list = g_list_append  (list, "aaa");
+       list = g_list_append  (list, "aaaa");
+
+       length = g_list_length (list);
+       copy = g_list_copy (list);
+
+       for (i = 0; i < length; i++)
+               if (strcmp (g_list_nth (list, i)->data,
+                           g_list_nth (copy, i)->data))
+                       return FAILED ("copy failed.");
+
+       g_list_free (list);
+       g_list_free (copy);     
+       return OK;
+}
+
+RESULT
+test_list_reverse ()
+{
+       guint i, length;
+       GList *list, *reverse;
+       list = g_list_prepend (NULL, "a");
+       list = g_list_append  (list, "aa");
+       list = g_list_append  (list, "aaa");
+       list = g_list_append  (list, "aaaa");
+
+       length  = g_list_length (list);
+       reverse = g_list_reverse (g_list_copy (list));
+
+       if (g_list_length (reverse) != length)
+               return FAILED ("reverse failed #1");
+
+       for (i = 0; i < length; i++){
+               guint j = length - i - 1;
+               if (strcmp (g_list_nth (list, i)->data,
+                           g_list_nth (reverse, j)->data))
+                       return FAILED ("reverse failed. #2");
+       }
+
+       g_list_free (list);
+       g_list_free (reverse);  
+       return OK;
+}
+
+RESULT
+test_list_remove ()
+{
+       GList *list = g_list_prepend (NULL, "three");
+       char *one = "one";
+       list = g_list_prepend (list, "two");
+       list = g_list_prepend (list, one);
+
+       list = g_list_remove (list, one);
+
+       if (g_list_length (list) != 2)
+               return FAILED ("Remove failed");
+
+       if (strcmp ("two", list->data) != 0)
+               return FAILED ("Remove failed");
+
+       g_list_free (list);
+       return OK;
+}
+
+RESULT
+test_list_remove_link ()
+{
+       GList *foo = g_list_prepend (NULL, "a");
+       GList *bar = g_list_prepend (NULL, "b");
+       GList *baz = g_list_prepend (NULL, "c");
+       GList *list = foo;
+
+       foo = g_list_concat (foo, bar);
+       foo = g_list_concat (foo, baz); 
+
+       list = g_list_remove_link (list, bar);
+
+       if (g_list_length (list) != 2)
+               return FAILED ("remove_link failed #1");
+
+       if (bar->next != NULL)
+               return FAILED ("remove_link failed #2");
+
+       g_list_free (list);     
+       g_list_free (bar);
+       return OK;
+}
+
+RESULT
+test_list_insert_before ()
+{
+       GList *foo, *bar, *baz;
+
+       foo = g_list_prepend (NULL, "foo");
+       foo = g_list_insert_before (foo, NULL, "bar");
+       bar = g_list_last (foo);
+
+       if (strcmp (bar->data, "bar"))
+               return FAILED ("1");
+
+       baz = g_list_insert_before (foo, bar, "baz");
+       if (foo != baz)
+               return FAILED ("2");
+
+       if (strcmp (g_list_nth_data (foo, 1), "baz"))
+               return FAILED ("3: %s", g_list_nth_data (foo, 1));      
+
+       g_list_free (foo);
+       return OK;
+}
+
+#define N_ELEMS 101
+
+static int intcompare (gconstpointer p1, gconstpointer p2)
+{
+       return GPOINTER_TO_INT (p1) - GPOINTER_TO_INT (p2);
+}
+
+static gboolean verify_sort (GList *list, int len)
+{
+       int prev;
+
+       if (list->prev)
+               return FALSE;
+
+       prev = GPOINTER_TO_INT (list->data);
+       len--;
+       for (list = list->next; list; list = list->next) {
+               int curr = GPOINTER_TO_INT (list->data);
+               if (prev > curr)
+                       return FALSE;
+               prev = curr;
+
+               if (!list->prev || list->prev->next != list)
+                       return FALSE;
+
+               if (len == 0)
+                       return FALSE;
+               len--;
+       }
+       return len == 0;
+}
+
+RESULT
+test_list_sort ()
+{
+       int i, j, mul;
+       GList *list = NULL;
+
+       for (i = 0; i < N_ELEMS; ++i)
+               list = g_list_prepend (list, GINT_TO_POINTER (i));
+       list = g_list_sort (list, intcompare);
+       if (!verify_sort (list, N_ELEMS))
+               return FAILED ("decreasing list");
+
+       g_list_free (list);
+
+       list = NULL;
+       for (i = 0; i < N_ELEMS; ++i)
+               list = g_list_prepend (list, GINT_TO_POINTER (-i));
+       list = g_list_sort (list, intcompare);
+       if (!verify_sort (list, N_ELEMS))
+               return FAILED ("increasing list");
+
+       g_list_free (list);
+
+       list = g_list_prepend (NULL, GINT_TO_POINTER (0));
+       for (i = 1; i < N_ELEMS; ++i) {
+               list = g_list_prepend (list, GINT_TO_POINTER (i));
+               list = g_list_prepend (list, GINT_TO_POINTER (-i));
+       }
+       list = g_list_sort (list, intcompare);
+       if (!verify_sort (list, 2*N_ELEMS-1))
+               return FAILED ("alternating list");
+
+       g_list_free (list);
+
+       list = NULL;
+       mul = 1;
+       for (i = 1; i < N_ELEMS; ++i) {
+               mul = -mul;
+               for (j = 0; j < i; ++j)
+                       list = g_list_prepend (list, GINT_TO_POINTER (mul * j));
+       }
+       list = g_list_sort (list, intcompare);
+       if (!verify_sort (list, (N_ELEMS*N_ELEMS - N_ELEMS)/2))
+               return FAILED ("wavering list");
+
+       g_list_free (list);
+
+       return OK;
+}
+
+static gint
+find_custom (gconstpointer a, gconstpointer b)
+{
+       return(strcmp (a, b));
+}
+
+RESULT
+test_list_find_custom ()
+{
+       GList *list = NULL, *found;
+       char *foo = "foo";
+       char *bar = "bar";
+       char *baz = "baz";
+       
+       list = g_list_prepend (list, baz);
+       list = g_list_prepend (list, bar);
+       list = g_list_prepend (list, foo);
+       
+       found = g_list_find_custom (list, baz, find_custom);
+       
+       if (found == NULL)
+               return FAILED ("Find failed");
+       
+       g_list_free (list);
+       
+       return OK;
+}
+
+static Test list_tests [] = {
+       {       "length", test_list_length},
+       {          "nth", test_list_nth},
+       {        "index", test_list_index},     
+       {         "last", test_list_last},      
+       {       "append", test_list_append},
+       {       "concat", test_list_concat},
+       {"insert_sorted", test_list_insert_sorted},
+       {"insert_before", test_list_insert_before},
+       {         "copy", test_list_copy},
+       {      "reverse", test_list_reverse},
+       {       "remove", test_list_remove},
+       {  "remove_link", test_list_remove_link},
+       {  "remove_link", test_list_remove_link},
+       {         "sort", test_list_sort},
+       {  "find_custom", test_list_find_custom},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(list_tests_init, list_tests)
diff --git a/mono/eglib/test/markup.c b/mono/eglib/test/markup.c
new file mode 100644 (file)
index 0000000..cf8d3f2
--- /dev/null
@@ -0,0 +1,234 @@
+#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+#include "test.h"
+
+#define do_bad_test(s) do { char *r = markup_test (s); if (r == NULL) return FAILED ("Failed on test " # s); else g_free (r); } while (0)
+#define do_ok_test(s) do { char *r = markup_test (s); if (r != NULL) return FAILED ("Could not parse valid " # s); } while (0)
+
+static char *
+markup_test (const char *s)
+{
+       GMarkupParser *parser = g_new0 (GMarkupParser, 1);
+       GMarkupParseContext *context;
+       GError *error = NULL;
+       
+       context = g_markup_parse_context_new (parser, 0, 0, 0);
+
+       g_markup_parse_context_parse (context, s, strlen (s), &error);
+       g_markup_parse_context_free (context);
+
+       if (error != NULL){
+               char *msg = g_strdup (error->message);
+               g_error_free (error);
+
+               g_free (parser);
+               return msg;
+       }
+       g_free (parser);
+       return NULL;
+}
+
+RESULT
+invalid_documents (void)
+{
+       /* These should fail */
+       do_bad_test ("<1>");
+       do_bad_test ("<a<");
+       do_bad_test ("</a>");
+       do_bad_test ("<a b>");
+       do_bad_test ("<a b=>");
+       do_bad_test ("<a b=c>");
+       
+       return OK;
+}
+
+RESULT
+valid_documents (void)
+{
+       /* These should fail */
+       do_ok_test ("<a>");
+       do_ok_test ("<a a=\"b\">");
+       
+       return OK;
+}
+
+/*
+ * This is a test for the kind of files that the code in mono/domain.c
+ * parses;  This code comes from Mono
+ */
+typedef struct {
+        GSList *supported_runtimes;
+        char *required_runtime;
+        int configuration_count;
+        int startup_count;
+} AppConfigInfo;
+
+static char *
+get_attribute_value (const gchar **attribute_names,
+                    const gchar **attribute_values,
+                    const char *att_name)
+{
+        int n;
+        for (n=0; attribute_names[n] != NULL; n++) {
+                if (strcmp (attribute_names[n], att_name) == 0)
+                        return g_strdup (attribute_values[n]);
+        }
+        return NULL;
+}
+
+static void
+start_element (GMarkupParseContext *context,
+              const gchar         *element_name,
+              const gchar        **attribute_names,
+              const gchar        **attribute_values,
+              gpointer             user_data,
+              GError             **error)
+{
+        AppConfigInfo* app_config = (AppConfigInfo*) user_data;
+
+        if (strcmp (element_name, "configuration") == 0) {
+                app_config->configuration_count++;
+                return;
+        }
+        if (strcmp (element_name, "startup") == 0) {
+                app_config->startup_count++;
+                return;
+        }
+
+        if (app_config->configuration_count != 1 || app_config->startup_count != 1)
+                return;
+
+        if (strcmp (element_name, "requiredRuntime") == 0) {
+                app_config->required_runtime = get_attribute_value (attribute_names, attribute_values, "version");
+        } else if (strcmp (element_name, "supportedRuntime") == 0) {
+                char *version = get_attribute_value (attribute_names, attribute_values, "version");
+                app_config->supported_runtimes = g_slist_append (app_config->supported_runtimes, version);
+        }
+}
+
+static void
+end_element   (GMarkupParseContext *context,
+              const gchar         *element_name,
+              gpointer             user_data,
+              GError             **error)
+{
+        AppConfigInfo* app_config = (AppConfigInfo*) user_data;
+       
+        if (strcmp (element_name, "configuration") == 0) {
+                app_config->configuration_count--;
+        } else if (strcmp (element_name, "startup") == 0) {
+                app_config->startup_count--;
+        }
+}
+
+static const GMarkupParser
+mono_parser = {
+        start_element,
+        end_element,
+        NULL,
+        NULL,
+        NULL
+};
+
+AppConfigInfo *
+domain_test (char *text)
+{
+       AppConfigInfo *app_config = g_new0 (AppConfigInfo, 1);
+       GMarkupParseContext *context;
+       
+        context = g_markup_parse_context_new (&mono_parser, 0, app_config, NULL);
+        if (g_markup_parse_context_parse (context, text, strlen (text), NULL)) {
+                g_markup_parse_context_end_parse (context, NULL);
+        }
+        g_markup_parse_context_free (context);
+
+       return app_config;
+}
+
+void
+domain_free (AppConfigInfo *info)
+{
+       GSList *l;
+       if (info->required_runtime)
+               g_free (info->required_runtime);
+       for (l = info->supported_runtimes; l != NULL; l = l->next){
+               g_free (l->data);
+       }
+       g_slist_free (info->supported_runtimes);
+       g_free (info);
+}
+
+RESULT
+mono_domain (void)
+{
+       AppConfigInfo *info;
+
+       info = domain_test ("<configuration><!--hello--><startup><!--world--><requiredRuntime version=\"v1\"><!--r--></requiredRuntime></startup></configuration>"); 
+       if (info->required_runtime == NULL)
+               return FAILED ("No required runtime section");
+       if (strcmp (info->required_runtime, "v1") != 0)
+               return FAILED ("Got a runtime version %s, expected v1", info->required_runtime);
+       domain_free (info);
+
+       info = domain_test ("<configuration><startup><requiredRuntime version=\"v1\"/><!--comment--></configuration><!--end-->");
+       if (info->required_runtime == NULL)
+               return FAILED ("No required runtime section on auto-close section");
+       if (strcmp (info->required_runtime, "v1") != 0)
+               return FAILED ("Got a runtime version %s, expected v1", info->required_runtime);
+       domain_free (info);
+
+       info = domain_test ("<!--start--><configuration><startup><supportedRuntime version=\"v1\"/><!--middle--><supportedRuntime version=\"v2\"/></startup></configuration>");
+       if ((strcmp ((char*)info->supported_runtimes->data, "v1") == 0)){
+               if (info->supported_runtimes->next == NULL)
+                       return FAILED ("Expected 2 supported runtimes");
+               
+               if ((strcmp ((char*)info->supported_runtimes->next->data, "v2") != 0))
+                       return FAILED ("Expected v1, v2, got %s", info->supported_runtimes->next->data);
+               if (info->supported_runtimes->next->next != NULL)
+                       return FAILED ("Expected v1, v2, got more");
+       } else
+               return FAILED ("Expected `v1', got %s", info->supported_runtimes->data);
+       domain_free (info);
+
+       return NULL;
+}
+
+RESULT
+mcs_config (void)
+{
+       return markup_test ("<configuration>\r\n  <system.diagnostics>\r\n    <trace autoflush=\"true\" indentsize=\"4\">\r\n      <listeners>\r\n        <add name=\"compilerLogListener\" type=\"System.Diagnostics.TextWriterTraceListener,System\"/>      </listeners>    </trace>   </system.diagnostics> </configuration>");
+
+}
+
+RESULT
+xml_parse (void)
+{
+       return markup_test ("<?xml version=\"1.0\" encoding=\"utf-8\"?><a></a>");
+}
+
+RESULT
+machine_config (void)
+{
+       char *data;
+       gsize size;
+       
+       if (g_file_get_contents ("../../data/net_1_1/machine.config", &data, &size, NULL)){
+               return markup_test (data);
+       }
+       printf ("Ignoring this test\n");
+       return NULL;
+}
+
+static Test markup_tests [] = {
+       {"invalid_documents", invalid_documents},
+       {"good_documents", valid_documents},
+       {"mono_domain", mono_domain},
+       {"mcs_config", mcs_config},
+       {"xml_parse", xml_parse},
+       {"machine_config", machine_config},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(markup_tests_init, markup_tests)
+
diff --git a/mono/eglib/test/memory.c b/mono/eglib/test/memory.c
new file mode 100644 (file)
index 0000000..db7db08
--- /dev/null
@@ -0,0 +1,40 @@
+
+#include <glib.h>
+#include "test.h"
+
+RESULT
+test_memory_zero_size_allocations ()
+{
+       gpointer p;
+
+       p = g_malloc (0);
+        if (p)
+                return FAILED ("Calling g_malloc with size zero should return NULL.");
+
+       p = g_malloc0 (0);
+        if (p)
+                return FAILED ("Calling g_malloc0 with size zero should return NULL.");
+
+       p = g_realloc (NULL, 0);
+        if (p)
+                return FAILED ("Calling g_realloc with size zero should return NULL.");
+
+       p = g_new (int, 0);
+        if (p)
+                return FAILED ("Calling g_new with size zero should return NULL.");
+
+       p = g_new0 (int, 0);
+        if (p)
+                return FAILED ("Calling g_new0 with size zero should return NULL.");
+
+        return OK;
+}
+
+
+static Test memory_tests [] = {
+        {       "zero_size_allocations", test_memory_zero_size_allocations},
+        {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(memory_tests_init, memory_tests)
+
diff --git a/mono/eglib/test/module.c b/mono/eglib/test/module.c
new file mode 100644 (file)
index 0000000..a283637
--- /dev/null
@@ -0,0 +1,64 @@
+#include <config.h>
+#include <glib.h>
+#include <gmodule.h>
+#include <string.h>
+#include <stdio.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include "test.h"
+
+#if defined (G_OS_WIN32)
+#define EXTERNAL_SYMBOL "GetProcAddress"
+#else
+#define EXTERNAL_SYMBOL "system"
+#endif
+
+void G_MODULE_EXPORT
+dummy_test_export ()
+{
+}
+
+/* test for g_module_open (NULL, ...) */
+RESULT
+test_module_symbol_null ()
+{
+       gpointer proc = GINT_TO_POINTER (42);
+
+       GModule *m = g_module_open (NULL, G_MODULE_BIND_LAZY);
+
+       if (m == NULL)
+               return FAILED ("bind to main module failed. #0");
+
+       if (g_module_symbol (m, "__unlikely_\nexistent__", &proc))
+               return FAILED ("non-existent symbol lookup failed. #1");
+
+       if (proc)
+               return FAILED ("non-existent symbol lookup failed. #2");
+
+       if (!g_module_symbol (m, EXTERNAL_SYMBOL, &proc))
+               return FAILED ("external lookup failed. #3");
+
+       if (!proc)
+               return FAILED ("external lookup failed. #4");
+
+       if (!g_module_symbol (m, "dummy_test_export", &proc))
+               return FAILED ("in-proc lookup failed. #5");
+
+       if (!proc)
+               return FAILED ("in-proc lookup failed. #6");
+
+       if (!g_module_close (m))
+               return FAILED ("close failed. #7");
+
+       return OK;
+}
+
+static Test module_tests [] = {
+       {"g_module_symbol_null", test_module_symbol_null},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(module_tests_init, module_tests)
+
+
diff --git a/mono/eglib/test/path.c b/mono/eglib/test/path.c
new file mode 100644 (file)
index 0000000..e3832a0
--- /dev/null
@@ -0,0 +1,357 @@
+#include <config.h>
+#include <glib.h>
+#include <string.h>
+#include <stdio.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef G_OS_UNIX
+#include <pthread.h>
+#endif
+#include "test.h"
+
+#ifdef G_OS_WIN32
+#include <direct.h>
+#define chdir _chdir
+#endif
+
+/* This test is just to be used with valgrind */
+RESULT
+test_buildpath ()
+{
+       char *s;
+       char *buffer = "var/private";
+       char *dir = "/";
+       
+       s = g_build_path ("/", "hola///", "//mundo", NULL);
+       if (strcmp (s, "hola/mundo") != 0)
+               return FAILED ("1 Got wrong result, got: %s", s);
+       g_free (s);
+
+       s = g_build_path ("/", "hola/", "/mundo", NULL);
+       if (strcmp (s, "hola/mundo") != 0)
+               return FAILED ("2 Got wrong result, got: %s", s);
+       g_free (s);
+
+       s = g_build_path ("/", "hola/", "mundo", NULL);
+       if (strcmp (s, "hola/mundo") != 0)
+               return FAILED ("3 Got wrong result, got: %s", s);
+       g_free (s);
+
+       s = g_build_path ("/", "hola", "/mundo", NULL);
+       if (strcmp (s, "hola/mundo") != 0)
+               return FAILED ("4 Got wrong result, got: %s", s);
+       g_free (s);
+
+       s = g_build_path ("/", "/hello", "world/", NULL);
+       if (strcmp (s, "/hello/world/") != 0)
+               return FAILED ("5 Got wrong result, got: %s", s);
+       g_free (s);
+       
+       /* Now test multi-char-separators */
+       s = g_build_path ("**", "hello", "world", NULL);
+       if (strcmp (s, "hello**world") != 0)
+               return FAILED ("6 Got wrong result, got: %s", s);
+       g_free (s);
+
+       s = g_build_path ("**", "hello**", "world", NULL);
+       if (strcmp (s, "hello**world") != 0)
+               return FAILED ("7 Got wrong result, got: %s", s);
+       g_free (s);
+
+       s = g_build_path ("**", "hello**", "**world", NULL);
+       if (strcmp (s, "hello**world") != 0)
+               return FAILED ("8 Got wrong result, got: %s", s);
+       g_free (s);
+       
+       s = g_build_path ("**", "hello**", "**world", NULL);
+       if (strcmp (s, "hello**world") != 0)
+               return FAILED ("9 Got wrong result, got: %s", s);
+       g_free (s);
+
+       s = g_build_path ("1234567890", "hello", "world", NULL);
+       if (strcmp (s, "hello1234567890world") != 0)
+               return FAILED ("10 Got wrong result, got: %s", s);
+       g_free (s);
+
+       s = g_build_path ("1234567890", "hello1234567890", "1234567890world", NULL);
+       if (strcmp (s, "hello1234567890world") != 0)
+               return FAILED ("11 Got wrong result, got: %s", s);
+       g_free (s);
+
+       s = g_build_path ("1234567890", "hello12345678901234567890", "1234567890world", NULL);
+       if (strcmp (s, "hello1234567890world") != 0)
+               return FAILED ("12 Got wrong result, got: %s", s);
+       g_free (s);
+
+       /* Multiple */
+       s = g_build_path ("/", "a", "b", "c", "d", NULL);
+       if (strcmp (s, "a/b/c/d") != 0)
+               return FAILED ("13 Got wrong result, got: %s", s);
+       g_free (s);
+
+       s = g_build_path ("/", "/a", "", "/c/", NULL);
+       if (strcmp (s, "/a/c/") != 0)
+               return FAILED ("14 Got wrong result, got: %s", s);
+       g_free (s);
+
+       /* Null */
+       s = g_build_path ("/", NULL, NULL);
+       if (s == NULL)
+               return FAILED ("must get a non-NULL return");
+       if (s [0] != 0)
+               return FAILED ("must get an empty string");
+
+       // This is to test the regression introduced by Levi for the Windows support
+       // that code errouneously read below the allowed area (in this case dir [-1]).
+       // and caused all kinds of random errors.
+       dir = "//";
+       dir++;
+       s = g_build_filename (dir, buffer, NULL);
+       if (s [0] != '/')
+               return FAILED ("Must have a '/' at the start");
+
+       g_free (s);
+       return OK;
+}
+
+RESULT
+test_buildfname ()
+{
+       char *s;
+       
+       s = g_build_filename ("a", "b", "c", "d", NULL);
+#ifdef G_OS_WIN32
+       if (strcmp (s, "a\\b\\c\\d") != 0)
+#else
+       if (strcmp (s, "a/b/c/d") != 0)
+#endif
+               return FAILED ("1 Got wrong result, got: %s", s);
+       g_free (s);
+
+#ifdef G_OS_WIN32
+       s = g_build_filename ("C:\\", "a", NULL);
+       if (strcmp (s, "C:\\a") != 0)
+#else
+       s = g_build_filename ("/", "a", NULL);
+       if (strcmp (s, "/a") != 0)
+#endif
+               return FAILED ("1 Got wrong result, got: %s", s);
+
+#ifndef G_OS_WIN32
+       s = g_build_filename ("/", "foo", "/bar", "tolo/", "/meo/", NULL);
+       if (strcmp (s, "/foo/bar/tolo/meo/") != 0)
+               return FAILED ("1 Got wrong result, got: %s", s);
+#endif
+       
+       return OK;
+}
+
+char *
+test_dirname ()
+{
+       char *s;
+
+#ifdef G_OS_WIN32
+       s = g_path_get_dirname ("c:\\home\\miguel");
+       if (strcmp (s, "c:\\home") != 0)
+               return FAILED ("Expected c:\\home, got %s", s);
+       g_free (s);
+
+       s = g_path_get_dirname ("c:/home/miguel");
+       if (strcmp (s, "c:/home") != 0)
+               return FAILED ("Expected c:/home, got %s", s);
+       g_free (s);
+
+       s = g_path_get_dirname ("c:\\home\\dingus\\");
+       if (strcmp (s, "c:\\home\\dingus") != 0)
+               return FAILED ("Expected c:\\home\\dingus, got %s", s);
+       g_free (s);
+
+       s = g_path_get_dirname ("dir.c");
+       if (strcmp (s, ".") != 0)
+               return FAILED ("Expected `.', got %s", s);
+       g_free (s);
+
+       s = g_path_get_dirname ("c:\\index.html");
+       if (strcmp (s, "c:") != 0)
+               return FAILED ("Expected [c:], got [%s]", s);
+#else
+       s = g_path_get_dirname ("/home/miguel");
+       if (strcmp (s, "/home") != 0)
+               return FAILED ("Expected /home, got %s", s);
+       g_free (s);
+
+       s = g_path_get_dirname ("/home/dingus/");
+       if (strcmp (s, "/home/dingus") != 0)
+               return FAILED ("Expected /home/dingus, got %s", s);
+       g_free (s);
+
+       s = g_path_get_dirname ("dir.c");
+       if (strcmp (s, ".") != 0)
+               return FAILED ("Expected `.', got %s", s);
+       g_free (s);
+
+       s = g_path_get_dirname ("/index.html");
+       if (strcmp (s, "/") != 0)
+               return FAILED ("Expected [/], got [%s]", s);
+#endif 
+       return OK;
+}
+
+char *
+test_basename ()
+{
+       char *s;
+
+#ifdef G_OS_WIN32
+       s = g_path_get_basename ("");
+       if (strcmp (s, ".") != 0)
+               return FAILED ("Expected `.', got %s", s);
+       g_free (s);
+
+       s = g_path_get_basename ("c:\\home\\dingus\\");
+       if (strcmp (s, "dingus") != 0)
+               return FAILED ("1 Expected dingus, got %s", s);
+       g_free (s);
+
+       s = g_path_get_basename ("c:/home/dingus/");
+       if (strcmp (s, "dingus") != 0)
+               return FAILED ("1 Expected dingus, got %s", s);
+       g_free (s);
+
+       s = g_path_get_basename ("c:\\home\\dingus");
+       if (strcmp (s, "dingus") != 0)
+               return FAILED ("2 Expected dingus, got %s", s);
+       g_free (s);
+
+       s = g_path_get_basename ("c:/home/dingus");
+       if (strcmp (s, "dingus") != 0)
+               return FAILED ("2 Expected dingus, got %s", s);
+       g_free (s);
+#else
+       s = g_path_get_basename ("");
+       if (strcmp (s, ".") != 0)
+               return FAILED ("Expected `.', got %s", s);
+       g_free (s);
+
+       s = g_path_get_basename ("/home/dingus/");
+       if (strcmp (s, "dingus") != 0)
+               return FAILED ("1 Expected dingus, got %s", s);
+       g_free (s);
+
+       s = g_path_get_basename ("/home/dingus");
+       if (strcmp (s, "dingus") != 0)
+               return FAILED ("2 Expected dingus, got %s", s);
+       g_free (s);
+#endif
+       return OK;
+}
+
+gchar *
+test_ppath ()
+{
+       char *s;
+#ifdef G_OS_WIN32
+       const gchar *searchfor = "explorer.exe";
+#else
+       const gchar *searchfor = "ls";
+#endif
+       s = g_find_program_in_path (searchfor);
+       if (s == NULL)
+               return FAILED ("No %s on this system?", searchfor);
+       g_free (s);
+       return OK;
+}
+
+gchar *
+test_ppath2 ()
+{
+       char *s;
+       const char *path = g_getenv ("PATH");
+#ifdef G_OS_WIN32
+       const gchar *searchfor = "test_eglib.exe";
+#else
+       const gchar *searchfor = "test-glib";
+#endif
+       
+       g_setenv ("PATH", "", TRUE);
+       s = g_find_program_in_path ("ls");
+       if (s != NULL) {
+               g_setenv ("PATH", path, TRUE);
+               return FAILED ("Found something interesting here: %s", s);
+       }
+       g_free (s);
+       s = g_find_program_in_path (searchfor);
+       if (s == NULL) {
+               g_setenv ("PATH", path, TRUE);
+               return FAILED ("It should find '%s' in the current directory.", searchfor);
+       }
+       g_free (s);
+       g_setenv ("PATH", path, TRUE);
+       return OK;
+}
+
+#ifndef DISABLE_FILESYSTEM_TESTS
+gchar *
+test_cwd ()
+{
+       char *dir = g_get_current_dir ();
+#ifdef G_OS_WIN32
+       const gchar *newdir = "C:\\Windows";
+#else
+       const gchar *newdir = "/bin";
+#endif
+
+       if (dir == NULL)
+               return FAILED ("No current directory?");
+       g_free (dir);
+       
+       if (chdir (newdir) == -1)
+               return FAILED ("No %s?", newdir);
+       
+       dir = g_get_current_dir ();
+       if (strcmp (dir, newdir) != 0)
+               return FAILED("Did not go to %s?", newdir);
+       g_free (dir);
+       
+       return OK;
+}
+#else
+gchar *
+test_cwd ()
+{
+       return OK;
+}
+#endif
+
+gchar *
+test_misc ()
+{
+       const char *home = g_get_home_dir ();
+       const char *tmp = g_get_tmp_dir ();
+       
+       if (home == NULL)
+               return FAILED ("Where did my home go?");
+
+       if (tmp == NULL)
+               return FAILED ("Where did my /tmp go?");
+
+       return OK;
+}
+
+static Test path_tests [] = {
+       {"g_build_filename", test_buildfname},
+       {"g_buildpath", test_buildpath},
+       {"g_path_get_dirname", test_dirname},
+       {"g_path_get_basename", test_basename},
+       {"g_find_program_in_path", test_ppath},
+       {"g_find_program_in_path2", test_ppath2},
+       {"test_cwd", test_cwd },
+       {"test_misc", test_misc },
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(path_tests_init, path_tests)
+
+
diff --git a/mono/eglib/test/pattern.c b/mono/eglib/test/pattern.c
new file mode 100644 (file)
index 0000000..7db5a7b
--- /dev/null
@@ -0,0 +1,61 @@
+#include <config.h>
+#include <glib.h>
+#include <string.h>
+#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include "test.h"
+
+#define MATCH(pat,string,error_if,msg) \
+       spec = g_pattern_spec_new (pat); \
+       res = g_pattern_match_string (spec, string); \
+       if (res == error_if) \
+               return FAILED (msg " returned %s", res ? "TRUE" : "FALSE"); \
+       g_pattern_spec_free (spec);
+
+#define TEST_MATCH(pat,string,n) MATCH (pat, string, FALSE, "MATCH " #n)
+#define TEST_NO_MATCH(pat,string,n) MATCH (pat, string,TRUE, "NO_MATCH " #n)
+
+RESULT
+test_pattern_spec ()
+{
+       GPatternSpec *spec;
+       gboolean res;
+
+       /* spec = g_pattern_spec_new (NULL); */
+       TEST_MATCH ("*", "hola", 1);
+       TEST_MATCH ("hola", "hola", 2);
+       TEST_MATCH ("????", "hola", 3);
+       TEST_MATCH ("???a", "hola", 4);
+       TEST_MATCH ("h??a", "hola", 5);
+       TEST_MATCH ("h??*", "hola", 6);
+       TEST_MATCH ("h*", "hola", 7);
+       TEST_MATCH ("*hola", "hola", 8);
+       TEST_MATCH ("*l*", "hola", 9);
+       TEST_MATCH ("h*??", "hola", 10);
+       TEST_MATCH ("h*???", "hola", 11);
+       TEST_MATCH ("?o??", "hola", 12);
+       TEST_MATCH ("*h*o*l*a*", "hola", 13);
+       TEST_MATCH ("h*o*l*a", "hola", 14);
+       TEST_MATCH ("h?*?", "hola", 15);
+
+       TEST_NO_MATCH ("", "hola", 1);
+       TEST_NO_MATCH ("?????", "hola", 2);
+       TEST_NO_MATCH ("???", "hola", 3);
+       TEST_NO_MATCH ("*o", "hola", 4);
+       TEST_NO_MATCH ("h", "hola", 5);
+       TEST_NO_MATCH ("h*????", "hola", 6);
+
+       return OK;
+}
+
+static Test pattern_tests [] = {
+       {"g_pattern_spec*", test_pattern_spec},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(pattern_tests_init, pattern_tests)
+
+
diff --git a/mono/eglib/test/ptrarray.c b/mono/eglib/test/ptrarray.c
new file mode 100644 (file)
index 0000000..34d78b0
--- /dev/null
@@ -0,0 +1,349 @@
+#include <stdio.h>
+#include <glib.h>
+#include "test.h"
+
+/* Redefine the private structure only to verify proper allocations */
+typedef struct _GPtrArrayPriv {
+       gpointer *pdata;
+       guint len;
+       guint size;
+} GPtrArrayPriv;
+
+/* Don't add more than 32 items to this please */
+static const char *items [] = {
+       "Apples", "Oranges", "Plumbs", "Goats", "Snorps", "Grapes", 
+       "Tickle", "Place", "Coffee", "Cookies", "Cake", "Cheese",
+       "Tseng", "Holiday", "Avenue", "Smashing", "Water", "Toilet",
+       NULL
+};
+
+static GPtrArray *ptrarray_alloc_and_fill(guint *item_count)
+{
+       GPtrArray *array = g_ptr_array_new();
+       gint i;
+       
+       for(i = 0; items[i] != NULL; i++) {
+               g_ptr_array_add(array, (gpointer)items[i]);
+       }
+
+       if(item_count != NULL) {
+               *item_count = i;
+       }
+       
+       return array;
+}
+
+static guint guess_size(guint length)
+{
+       guint size = 1;
+
+       while(size < length) {
+               size <<= 1;
+       }
+
+       return size;
+}
+
+RESULT ptrarray_alloc()
+{
+       GPtrArrayPriv *array;
+       guint i;
+       
+       array = (GPtrArrayPriv *)ptrarray_alloc_and_fill(&i);
+       
+       if(array->size != guess_size(array->len)) {
+               return FAILED("Size should be %d, but it is %d", 
+                       guess_size(array->len), array->size);
+       }
+       
+       if(array->len != i) {
+               return FAILED("Expected %d node(s) in the array", i);
+       }
+       
+       g_ptr_array_free((GPtrArray *)array, TRUE);
+
+       return OK;
+}
+
+RESULT ptrarray_for_iterate()
+{
+       GPtrArray *array = ptrarray_alloc_and_fill(NULL);
+       guint i;
+
+       for(i = 0; i < array->len; i++) {
+               char *item = (char *)g_ptr_array_index(array, i);
+               if(item != items[i]) {
+                       return FAILED(
+                               "Expected item at %d to be %s, but it was %s", 
+                               i, items[i], item);
+               }
+       }
+
+       g_ptr_array_free(array, TRUE);
+
+       return OK;
+}
+
+static gint foreach_iterate_index = 0;
+static char *foreach_iterate_error = NULL;
+
+void foreach_callback(gpointer data, gpointer user_data)
+{
+       char *item = (char *)data;
+       const char *item_cmp = items[foreach_iterate_index++];
+
+       if(foreach_iterate_error != NULL) {
+               return;
+       }
+
+       if(item != item_cmp) {
+               foreach_iterate_error = FAILED(
+                       "Expected item at %d to be %s, but it was %s", 
+                               foreach_iterate_index - 1, item_cmp, item);
+       }
+}
+
+RESULT ptrarray_foreach_iterate()
+{
+       GPtrArray *array = ptrarray_alloc_and_fill(NULL);
+       
+       foreach_iterate_index = 0;
+       foreach_iterate_error = NULL;
+       
+       g_ptr_array_foreach(array, foreach_callback, array);
+       
+       g_ptr_array_free(array, TRUE);
+
+       return foreach_iterate_error;
+}
+
+RESULT ptrarray_set_size()
+{
+       GPtrArray *array = g_ptr_array_new();
+       guint i, grow_length = 50;
+       
+       g_ptr_array_add(array, (gpointer)items[0]);
+       g_ptr_array_add(array, (gpointer)items[1]);
+       g_ptr_array_set_size(array, grow_length);
+
+       if(array->len != grow_length) {
+               return FAILED("Array length should be 50, it is %d", array->len);
+       } else if(array->pdata[0] != items[0]) {
+               return FAILED("Item 0 was overwritten, should be %s", items[0]);
+       } else if(array->pdata[1] != items[1]) {
+               return FAILED("Item 1 was overwritten, should be %s", items[1]);
+       }
+
+       for(i = 2; i < array->len; i++) {
+               if(array->pdata[i] != NULL) {
+                       return FAILED("Item %d is not NULL, it is %p", i, array->pdata[i]);
+               }
+       }
+
+       g_ptr_array_free(array, TRUE);
+
+       return OK;
+}
+
+RESULT ptrarray_remove_index()
+{
+       GPtrArray *array;
+       guint i;
+       
+       array = ptrarray_alloc_and_fill(&i);
+       
+       g_ptr_array_remove_index(array, 0);
+       if(array->pdata[0] != items[1]) {
+               return FAILED("First item is not %s, it is %s", items[1],
+                       array->pdata[0]);
+       }
+
+       g_ptr_array_remove_index(array, array->len - 1);
+       
+       if(array->pdata[array->len - 1] != items[array->len]) {
+               return FAILED("Last item is not %s, it is %s", 
+                       items[array->len - 2], array->pdata[array->len - 1]);
+       }
+
+       g_ptr_array_free(array, TRUE);
+
+       return OK;
+}
+
+RESULT ptrarray_remove_index_fast()
+{
+       GPtrArray *array;
+       guint i;
+
+       array = ptrarray_alloc_and_fill(&i);
+
+       g_ptr_array_remove_index_fast(array, 0);
+       if(array->pdata[0] != items[array->len]) {
+               return FAILED("First item is not %s, it is %s", items[array->len],
+                       array->pdata[0]);
+       }
+
+       g_ptr_array_remove_index_fast(array, array->len - 1);
+       if(array->pdata[array->len - 1] != items[array->len - 1]) {
+               return FAILED("Last item is not %s, it is %s",
+                       items[array->len - 1], array->pdata[array->len - 1]);
+       }
+
+       g_ptr_array_free(array, TRUE);
+
+       return OK;
+}
+
+RESULT ptrarray_remove()
+{
+       GPtrArray *array;
+       guint i;
+       
+       array = ptrarray_alloc_and_fill(&i);
+
+       g_ptr_array_remove(array, (gpointer)items[7]);
+
+       if(!g_ptr_array_remove(array, (gpointer)items[4])) {
+               return FAILED("Item %s not removed", items[4]);
+       }
+
+       if(g_ptr_array_remove(array, (gpointer)items[4])) {
+               return FAILED("Item %s still in array after removal", items[4]);
+       }
+
+       if(array->pdata[array->len - 1] != items[array->len + 1]) {
+               return FAILED("Last item in GPtrArray not correct");
+       }
+
+       g_ptr_array_free(array, TRUE);
+
+       return OK;
+}
+
+static gint ptrarray_sort_compare(gconstpointer a, gconstpointer b)
+{
+       gchar *stra = *(gchar **) a;
+       gchar *strb = *(gchar **) b;
+       return strcmp(stra, strb);
+}
+
+RESULT ptrarray_sort()
+{
+       GPtrArray *array = g_ptr_array_new();
+       guint i;
+       gchar *letters [] = { "A", "B", "C", "D", "E" };
+       
+       g_ptr_array_add(array, letters[0]);
+       g_ptr_array_add(array, letters[1]);
+       g_ptr_array_add(array, letters[2]);
+       g_ptr_array_add(array, letters[3]);
+       g_ptr_array_add(array, letters[4]);
+       
+       g_ptr_array_sort(array, ptrarray_sort_compare);
+
+       for(i = 0; i < array->len; i++) {
+               if(array->pdata[i] != letters[i]) {
+                       return FAILED("Array out of order, expected %s got %s at position %d",
+                               letters [i], (gchar *) array->pdata [i], i);
+               }
+       }
+
+       g_ptr_array_free(array, TRUE);
+       
+       return OK;
+}
+
+static gint ptrarray_sort_compare_with_data (gconstpointer a, gconstpointer b, gpointer user_data)
+{
+       gchar *stra = *(gchar **) a;
+       gchar *strb = *(gchar **) b;
+
+       if (strcmp (user_data, "this is the data for qsort") != 0)
+               fprintf (stderr, "oops at compare with_data\n");
+
+       return strcmp(stra, strb);
+}
+
+RESULT ptrarray_sort_with_data ()
+{
+       GPtrArray *array = g_ptr_array_new();
+       guint i;
+       gchar *letters [] = { "A", "B", "C", "D", "E" };
+
+       g_ptr_array_add(array, letters[4]);
+       g_ptr_array_add(array, letters[1]);
+       g_ptr_array_add(array, letters[2]);
+       g_ptr_array_add(array, letters[0]);
+       g_ptr_array_add(array, letters[3]);
+
+       g_ptr_array_sort_with_data(array, ptrarray_sort_compare_with_data, "this is the data for qsort");
+
+       for(i = 0; i < array->len; i++) {
+               if(array->pdata[i] != letters[i]) {
+                       return FAILED("Array out of order, expected %s got %s at position %d",
+                               letters [i], (gchar *) array->pdata [i], i);
+               }
+       }
+
+       g_ptr_array_free(array, TRUE);
+
+       return OK;
+}
+
+RESULT ptrarray_remove_fast()
+{
+       GPtrArray *array = g_ptr_array_new();
+       gchar *letters [] = { "A", "B", "C", "D", "E" };
+       
+       if (g_ptr_array_remove_fast (array, NULL))
+               return FAILED ("Removing NULL succeeded");
+
+       g_ptr_array_add(array, letters[0]);
+       if (!g_ptr_array_remove_fast (array, letters[0]) || array->len != 0)
+               return FAILED ("Removing last element failed");
+
+       g_ptr_array_add(array, letters[0]);
+       g_ptr_array_add(array, letters[1]);
+       g_ptr_array_add(array, letters[2]);
+       g_ptr_array_add(array, letters[3]);
+       g_ptr_array_add(array, letters[4]);
+
+       if (!g_ptr_array_remove_fast (array, letters[0]) || array->len != 4)
+               return FAILED ("Removing first element failed");
+
+       if (array->pdata [0] != letters [4])
+               return FAILED ("First element wasn't replaced with last upon removal");
+
+       if (g_ptr_array_remove_fast (array, letters[0]))
+               return FAILED ("Succedeed removing a non-existing element");
+
+       if (!g_ptr_array_remove_fast (array, letters[3]) || array->len != 3)
+               return FAILED ("Failed removing \"D\"");
+
+       if (!g_ptr_array_remove_fast (array, letters[1]) || array->len != 2)
+               return FAILED ("Failed removing \"B\"");
+
+       if (array->pdata [0] != letters [4] || array->pdata [1] != letters [2])
+               return FAILED ("Last two elements are wrong");
+       g_ptr_array_free(array, TRUE);
+       
+       return OK;
+}
+
+static Test ptrarray_tests [] = {
+       {"alloc", ptrarray_alloc},
+       {"for_iterate", ptrarray_for_iterate},
+       {"foreach_iterate", ptrarray_foreach_iterate},
+       {"set_size", ptrarray_set_size},
+       {"remove_index", ptrarray_remove_index},
+       {"remove_index_fast", ptrarray_remove_index_fast},
+       {"remove", ptrarray_remove},
+       {"sort", ptrarray_sort},
+       {"remove_fast", ptrarray_remove_fast},
+       {"sort_with_data", ptrarray_sort_with_data},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(ptrarray_tests_init, ptrarray_tests)
+
+
diff --git a/mono/eglib/test/queue.c b/mono/eglib/test/queue.c
new file mode 100644 (file)
index 0000000..b12ddec
--- /dev/null
@@ -0,0 +1,184 @@
+#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+#include "test.h"
+
+RESULT
+test_queue_push ()
+{
+       GQueue *queue = g_queue_new ();
+
+       g_queue_push_head (queue, "foo");
+       g_queue_push_head (queue, "bar");
+       g_queue_push_head (queue, "baz");
+
+       if (queue->length != 3)
+               return FAILED ("push failed");
+
+       if (NULL != queue->head->prev)
+               return FAILED ("HEAD: prev is wrong");
+       if (strcmp ("baz", queue->head->data))
+               return FAILED ("HEAD: First element is wrong");
+       if (strcmp ("bar", queue->head->next->data))
+               return FAILED ("HEAD: Second element is wrong");
+       if (strcmp ("foo", queue->head->next->next->data))
+               return FAILED ("HEAD: Third element is wrong");
+       if (NULL != queue->head->next->next->next)
+               return FAILED ("HEAD: End is wrong");
+
+       if (NULL != queue->tail->next)
+               return FAILED ("TAIL: next is wrong");
+       if (strcmp ("foo", queue->tail->data))
+               return FAILED ("TAIL: Third element is wrong");
+       if (strcmp ("bar", queue->tail->prev->data))
+               return FAILED ("TAIL: Second element is wrong");
+       if (strcmp ("baz", queue->tail->prev->prev->data))
+               return FAILED ("TAIL: First element is wrong");
+       if (NULL != queue->tail->prev->prev->prev)
+               return FAILED ("TAIL: End is wrong");
+
+       g_queue_free (queue);
+       return OK;
+}
+
+RESULT
+test_queue_push_tail ()
+{
+       GQueue *queue = g_queue_new ();
+
+       g_queue_push_tail (queue, "baz");
+       g_queue_push_tail (queue, "bar");
+       g_queue_push_tail (queue, "foo");
+
+       if (queue->length != 3)
+               return FAILED ("push failed");
+
+       if (NULL != queue->head->prev)
+               return FAILED ("HEAD: prev is wrong");
+       if (strcmp ("baz", queue->head->data))
+               return FAILED ("HEAD: First element is wrong");
+       if (strcmp ("bar", queue->head->next->data))
+               return FAILED ("HEAD: Second element is wrong");
+       if (strcmp ("foo", queue->head->next->next->data))
+               return FAILED ("HEAD: Third element is wrong");
+       if (NULL != queue->head->next->next->next)
+               return FAILED ("HEAD: End is wrong");
+
+       if (NULL != queue->tail->next)
+               return FAILED ("TAIL: next is wrong");
+       if (strcmp ("foo", queue->tail->data))
+               return FAILED ("TAIL: Third element is wrong");
+       if (strcmp ("bar", queue->tail->prev->data))
+               return FAILED ("TAIL: Second element is wrong");
+       if (strcmp ("baz", queue->tail->prev->prev->data))
+               return FAILED ("TAIL: First element is wrong");
+       if (NULL != queue->tail->prev->prev->prev)
+               return FAILED ("TAIL: End is wrong");
+
+       g_queue_free (queue);
+       return OK;
+}
+
+RESULT
+test_queue_pop ()
+{
+       GQueue *queue = g_queue_new ();
+       gpointer data;
+
+       g_queue_push_head (queue, "foo");
+       g_queue_push_head (queue, "bar");
+       g_queue_push_head (queue, "baz");
+
+       data = g_queue_pop_head (queue);
+       if (strcmp ("baz", data))
+               return FAILED ("expect baz.");
+
+       data = g_queue_pop_head (queue);
+       if (strcmp ("bar", data))
+               return FAILED ("expect bar.");  
+
+       data = g_queue_pop_head (queue);
+       if (strcmp ("foo", data))
+               return FAILED ("expect foo.");
+       
+       if (g_queue_is_empty (queue) == FALSE)
+               return FAILED ("expect is_empty.");
+
+       if (queue->length != 0)
+               return FAILED ("expect 0 length .");
+
+       g_queue_push_head (queue, "foo");
+       g_queue_push_head (queue, "bar");
+       g_queue_push_head (queue, "baz");
+
+       g_queue_pop_head (queue);
+
+       if (NULL != queue->head->prev)
+               return FAILED ("HEAD: prev is wrong");
+       if (strcmp ("bar", queue->head->data))
+               return FAILED ("HEAD: Second element is wrong");
+       if (strcmp ("foo", queue->head->next->data))
+               return FAILED ("HEAD: Third element is wrong");
+       if (NULL != queue->head->next->next)
+               return FAILED ("HEAD: End is wrong");
+
+       if (NULL != queue->tail->next)
+               return FAILED ("TAIL: next is wrong");
+       if (strcmp ("foo", queue->tail->data))
+               return FAILED ("TAIL: Second element is wrong");
+       if (strcmp ("bar", queue->tail->prev->data))
+               return FAILED ("TAIL: First element is wrong");
+       if (NULL != queue->tail->prev->prev)
+               return FAILED ("TAIL: End is wrong");
+
+       g_queue_free (queue);
+       return OK;
+}
+
+RESULT
+test_queue_new ()
+{
+       GQueue *queue = g_queue_new ();
+
+       if (queue->length != 0)
+               return FAILED ("expect length == 0");
+
+       if (queue->head != NULL)
+               return FAILED ("expect head == NULL");
+
+       if (queue->tail != NULL)
+               return FAILED ("expect tail == NULL");
+
+       g_queue_free (queue);
+       return OK;
+}
+
+RESULT
+test_queue_is_empty ()
+{
+       GQueue *queue = g_queue_new ();
+
+       if (g_queue_is_empty (queue) == FALSE)
+               return FAILED ("new queue should be empty");
+
+       g_queue_push_head (queue, "foo");
+
+       if (g_queue_is_empty (queue) == TRUE)
+               return FAILED ("expected TRUE");
+
+       g_queue_free (queue);
+
+       return OK;
+}
+
+static Test queue_tests [] = {
+       {    "push", test_queue_push},
+       {"push_tail", test_queue_push_tail},
+       {     "pop", test_queue_pop},
+       {     "new", test_queue_new},
+       {"is_empty", test_queue_is_empty},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(queue_tests_init, queue_tests)
+
diff --git a/mono/eglib/test/shell.c b/mono/eglib/test/shell.c
new file mode 100644 (file)
index 0000000..4715f1c
--- /dev/null
@@ -0,0 +1,331 @@
+#include <glib.h>
+#include <string.h>
+#include <stdio.h>
+#include "test.h"
+
+RESULT
+test_shell_argv1 ()
+{
+       GError *error;
+       gint argc;
+       gchar **argv;
+       gboolean ret;
+
+       /* The next line prints a critical error and returns FALSE 
+       ret = g_shell_parse_argv (NULL, NULL, NULL, NULL);
+       */
+       ret = g_shell_parse_argv ("", NULL, NULL, NULL);
+       if (ret)
+               return FAILED ("1. It should return FALSE");
+
+       ret = g_shell_parse_argv ("hola", NULL, NULL, NULL);
+       if (!ret)
+               return FAILED ("2. It should return TRUE");
+
+       argc = 0;
+       ret = g_shell_parse_argv ("hola", &argc, NULL, NULL);
+       if (!ret)
+               return FAILED ("3. It should return TRUE");
+       if (argc != 1)
+               return FAILED ("4. argc was %d", argc);
+
+       argc = 0;
+       ret = g_shell_parse_argv ("hola bola", &argc, NULL, NULL);
+       if (!ret)
+               return FAILED ("5. It should return TRUE");
+       if (argc != 2)
+               return FAILED ("6. argc was %d", argc);
+
+       argc = 0;
+       ret = g_shell_parse_argv ("hola bola", &argc, &argv, NULL);
+       if (!ret)
+               return FAILED ("7. It should return TRUE");
+       if (argc != 2)
+               return FAILED ("8. argc was %d", argc);
+       if (strcmp (argv [0], "hola"))
+               return FAILED ("9. argv[0] was %s", argv [0]);
+       if (strcmp (argv [1], "bola"))
+               return FAILED ("10. argv[1] was %s", argv [1]);
+
+       g_strfreev (argv);
+       argv = NULL;
+       argc = 0;
+       error = NULL;
+       ret = g_shell_parse_argv ("hola      'bola'", &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("11. It should return TRUE");
+       if (argc != 2)
+               return FAILED ("12. argc was %d expected 2", argc);
+       if (strcmp (argv [0], "hola"))
+               return FAILED ("13. argv[0] was %s", argv [0]);
+       if (strcmp (argv [1], "bola"))
+               return FAILED ("14. argv[1] was %s", argv [1]);
+       if (error != NULL)
+               return FAILED ("15. error is not null");
+
+
+       g_strfreev (argv);
+       argv = NULL;
+       argc = 0;
+       error = NULL;
+       ret = g_shell_parse_argv ("hola    ''  'bola'", &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("16. It should return TRUE");
+       if (argc != 3)
+               return FAILED ("17. argc was %d expected 3", argc);
+       if (strcmp (argv [0], "hola"))
+               return FAILED ("18. argv[0] was %s", argv [0]);
+       if (strcmp (argv [1], ""))
+               return FAILED ("19. argv[2] was %s", argv [1]);
+       if (strcmp (argv [2], "bola"))
+               return FAILED ("19. argv[2] was %s", argv [2]);
+       if (error != NULL)
+               return FAILED ("20. error is not null");
+
+       g_strfreev (argv);
+       argv = NULL;
+       argc = 0;
+       error = NULL;
+       ret = g_shell_parse_argv ("hola'' bola", &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("21. It should return TRUE");
+       if (argc != 2)
+               return FAILED ("22. argc was %d expected 2", argc);
+       if (strcmp (argv [0], "hola"))
+               return FAILED ("23. argv[0] was %s", argv [0]);
+       if (strcmp (argv [1], "bola"))
+               return FAILED ("24. argv[2] was %s", argv [1]);
+       if (error != NULL)
+               return FAILED ("25. error is not null");
+       
+       return OK;
+}
+
+RESULT
+test_shell_argv2 ()
+{
+       GError *error;
+       gint argc;
+       gchar **argv;
+       gboolean ret;
+
+       argv = NULL;
+       argc = 0;
+       error = NULL;
+       ret = g_shell_parse_argv ("hola      \"bola\"", &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("1. It should return TRUE");
+       if (argc != 2)
+               return FAILED ("2. argc was %d expected 2", argc);
+       if (strcmp (argv [0], "hola"))
+               return FAILED ("3. argv[0] was %s", argv [0]);
+       if (strcmp (argv [1], "bola"))
+               return FAILED ("4. argv[1] was %s", argv [1]);
+       if (error != NULL)
+               return FAILED ("5. error is not null");
+
+       g_strfreev (argv);
+       argv = NULL;
+       argc = 0;
+       error = NULL;
+       ret = g_shell_parse_argv ("hola    \"\"  \"bola \"", &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("6. It should return TRUE");
+       if (argc != 3)
+               return FAILED ("7. argc was %d expected 3", argc);
+       if (strcmp (argv [0], "hola"))
+               return FAILED ("8. argv[0] was %s", argv [0]);
+       if (strcmp (argv [1], ""))
+               return FAILED ("9. argv[2] was %s", argv [1]);
+       if (strcmp (argv [2], "bola "))
+               return FAILED ("10. argv[2] was %s", argv [2]);
+       if (error != NULL)
+               return FAILED ("11. error is not null");
+
+       g_strfreev (argv);
+       argv = NULL;
+       argc = 0;
+       error = NULL;
+       ret = g_shell_parse_argv ("hola\n\t    \"\t\"  \"bola \"", &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("10. It should return TRUE");
+       if (argc != 3)
+               return FAILED ("11. argc was %d expected 3", argc);
+       if (strcmp (argv [0], "hola"))
+               return FAILED ("12. argv[0] was %s", argv [0]);
+       if (strcmp (argv [1], "\t"))
+               return FAILED ("13. argv[2] was %s", argv [1]);
+       if (strcmp (argv [2], "bola "))
+               return FAILED ("14. argv[2] was %s", argv [2]);
+       if (error != NULL)
+               return FAILED ("15. error is not null");
+
+       g_strfreev (argv);
+       argv = NULL;
+       argc = 0;
+       error = NULL;
+       ret = g_shell_parse_argv ("hola\n\t  \\\n  \"\t\"  \"bola \"", &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("16. It should return TRUE");
+       if (argc != 3)
+               return FAILED ("17. argc was %d expected 3", argc);
+       if (strcmp (argv [0], "hola"))
+               return FAILED ("18. argv[0] was %s", argv [0]);
+       if (strcmp (argv [1], "\t"))
+               return FAILED ("19. argv[2] was %s", argv [1]);
+       if (strcmp (argv [2], "bola "))
+               return FAILED ("20. argv[2] was %s", argv [2]);
+       if (error != NULL)
+               return FAILED ("21. error is not null");
+
+       g_strfreev (argv);
+       return OK;
+}
+
+RESULT
+test_shell_argv3 ()
+{
+       GError *error;
+       gint argc;
+       gchar **argv;
+       gboolean ret;
+
+       argv = NULL;
+       argc = 0;
+       error = NULL;
+       ret = g_shell_parse_argv ("hola      \"bola", &argc, &argv, &error);
+       if (ret)
+               return FAILED ("1. It should return FALSE");
+       if (argc != 0)
+               return FAILED ("2. argc was %d expected 0", argc);
+       if (argv != NULL)
+               return FAILED ("3. argv[0] was %s", argv [0]);
+       if (error == NULL)
+               return FAILED ("4. error is null");
+
+       /* Text ended before matching quote was found for ". (The text was 'hola      "bola') */
+       g_error_free (error);
+       error = NULL;
+       ret = g_shell_parse_argv ("hola      \\\"bola", &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("5. It should return TRUE");
+       if (argc != 2)
+               return FAILED ("6. argc was %d expected 2", argc);
+       if (strcmp (argv [0], "hola"))
+               return FAILED ("18. argv[0] was %s", argv [0]);
+       if (strcmp (argv [1], "\"bola"))
+               return FAILED ("18. argv[1] was %s", argv [1]);
+       if (error != NULL)
+               return FAILED ("8. error is not null");
+
+       g_strfreev (argv);
+       argv = NULL;
+       argc = 0;
+       ret = g_shell_parse_argv ("hola      \"\n\\'bola\"", &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("9. It should return TRUE. %s", error->message);
+       if (argc != 2)
+               return FAILED ("10. argc was %d expected 2", argc);
+       if (strcmp (argv [0], "hola"))
+               return FAILED ("11. argv[0] was %s", argv [0]);
+       if (strcmp (argv [1], "\n\\'bola"))
+               return FAILED ("12. argv[1] was %s", argv [1]);
+       if (error != NULL)
+               return FAILED ("13. error is not null");
+
+       g_strfreev (argv);
+       argv = NULL;
+       argc = 0;
+       return OK;
+}
+
+// This was the 2.8 showstopper error
+RESULT
+test_shell_argv4 ()
+{
+       GError *error;
+       gint argc;
+       gchar **argv;
+       gboolean ret;
+       char *str = "'/usr/bin/gnome-terminal' -e \"bash -c 'read -p \\\"Press any key to continue...\\\" -n1;'\"";
+
+       argv = NULL;
+       argc = 0;
+       error = NULL;
+       ret = g_shell_parse_argv (str, &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("1. It should return TRUE");
+       if (argc != 3)
+               return FAILED ("2. argc was %d expected 3", argc);
+       if (argv == NULL)
+               return FAILED ("3. argv[0] was NULL");
+       if (error != NULL)
+               return FAILED ("4. error was set");
+
+       if (strcmp (argv [0], "/usr/bin/gnome-terminal"))
+               return FAILED ("5. Expected /usr/bin/gnome-terminal got %s", argv [0]);
+       if (strcmp (argv [1], "-e"))
+               return FAILED ("6. Expected -e, got: %s", argv [1]);
+       if (strcmp (argv [2], "bash -c 'read -p \"Press any key to continue...\" -n1;'"))
+               return FAILED ("7. Got unexpected result: %s\n", argv [2]);
+       
+       return OK;
+}
+
+// This is https://bugzilla.novell.com/show_bug.cgi?id=655896
+RESULT
+test_shell_argv5 ()
+{
+       GError *error;
+       gint argc;
+       gchar **argv;
+       gboolean ret;
+       char *str = "echo \"foo\",\"bar\"";
+
+       argv = NULL;
+       argc = 0;
+       error = NULL;
+       ret = g_shell_parse_argv (str, &argc, &argv, &error);
+       if (!ret)
+               return FAILED ("1. It should return TRUE");
+       if (argc != 2)
+               return FAILED ("2. argc was %d expected 2", argc);
+       if (argv == NULL)
+               return FAILED ("3. argv[0] was NULL");
+       if (error != NULL)
+               return FAILED ("4. error was set");
+
+       if (strcmp (argv [0], "echo"))
+               return FAILED ("5. Expected echo got %s", argv [0]);
+       if (strcmp (argv [1], "foo,bar"))
+               return FAILED ("6. Expected foo,bar, got: %s", argv [1]);
+       
+       return OK;
+}
+
+RESULT
+test_quote ()
+{
+       if (strcmp (g_shell_quote ("foo"), "'foo'"))
+               return FAILED ("Should return 'foo'");
+
+       if (strcmp (g_shell_quote ("foo'bar"), "'foo'\\''bar'"))
+               return FAILED ("Should return 'foo'\\''bar'");
+
+       if (strcmp (g_shell_quote ("foo bar"), "'foo bar'"))
+               return FAILED ("Should return 'foo bar'");
+       return OK;
+}
+
+static Test shell_tests [] = {
+       {"test_shell_argv1", test_shell_argv1},
+       {"test_shell_argv2", test_shell_argv2},
+       {"test_shell_argv3", test_shell_argv3},
+       {"test_shell_argv4", test_shell_argv4},
+       {"test_shell_argv5", test_shell_argv5},
+       {"g_shell_quote", test_quote},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(shell_tests_init, shell_tests)
+
diff --git a/mono/eglib/test/sizes.c b/mono/eglib/test/sizes.c
new file mode 100644 (file)
index 0000000..06ed8a5
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Tests to ensure that our type definitions are correct
+ *
+ * These depend on -Werror, -Wall being set to catch the build error.
+ */
+#include <stdio.h>
+#ifndef _MSC_VER
+#include <stdint.h>
+#endif
+#include <string.h>
+#include <glib.h>
+#include "test.h"
+
+RESULT
+test_formats ()
+{
+       char buffer [1024];
+       gsize a = 1;
+       
+       sprintf (buffer, "%" G_GSIZE_FORMAT, a);
+
+       return NULL;
+}
+
+RESULT
+test_ptrconv ()
+{
+       int iv, iv2;
+       unsigned int uv, uv2;
+       gpointer ptr;
+
+       iv = G_MAXINT32;
+       ptr = GINT_TO_POINTER (iv);
+       iv2 = GPOINTER_TO_INT (ptr);
+       if (iv != iv2)
+               return FAILED ("int to pointer and back conversions fail %d != %d", iv, iv2);
+
+       iv = G_MININT32;
+       ptr = GINT_TO_POINTER (iv);
+       iv2 = GPOINTER_TO_INT (ptr);
+       if (iv != iv2)
+               return FAILED ("int to pointer and back conversions fail %d != %d", iv, iv2);
+
+       iv = 1;
+       ptr = GINT_TO_POINTER (iv);
+       iv2 = GPOINTER_TO_INT (ptr);
+       if (iv != iv2)
+               return FAILED ("int to pointer and back conversions fail %d != %d", iv, iv2);
+
+       iv = -1;
+       ptr = GINT_TO_POINTER (iv);
+       iv2 = GPOINTER_TO_INT (ptr);
+       if (iv != iv2)
+               return FAILED ("int to pointer and back conversions fail %d != %d", iv, iv2);
+
+       iv = 0;
+       ptr = GINT_TO_POINTER (iv);
+       iv2 = GPOINTER_TO_INT (ptr);
+       if (iv != iv2)
+               return FAILED ("int to pointer and back conversions fail %d != %d", iv, iv2);
+
+       uv = 0;
+       ptr = GUINT_TO_POINTER (uv);
+       uv2 = GPOINTER_TO_UINT (ptr);
+       if (uv != uv2)
+               return FAILED ("uint to pointer and back conversions fail %u != %d", uv, uv2);
+       
+       uv = 1;
+       ptr = GUINT_TO_POINTER (uv);
+       uv2 = GPOINTER_TO_UINT (ptr);
+       if (uv != uv2)
+               return FAILED ("uint to pointer and back conversions fail %u != %d", uv, uv2);
+
+       uv = UINT32_MAX;
+       ptr = GUINT_TO_POINTER (uv);
+       uv2 = GPOINTER_TO_UINT (ptr);
+       if (uv != uv2)
+               return FAILED ("uint to pointer and back conversions fail %u != %d", uv, uv2);
+
+       return NULL;
+       
+}
+
+typedef struct {
+       int a;
+       int b;
+} my_struct;
+
+RESULT
+test_offset ()
+{
+       if (G_STRUCT_OFFSET (my_struct, a) != 0)
+               return FAILED ("offset of a is not zero");
+       
+       if (G_STRUCT_OFFSET (my_struct, b) != 4 && G_STRUCT_OFFSET (my_struct, b) != 8)
+               return FAILED ("offset of b is 4 or 8, macro might be busted");
+
+       return OK;
+}
+
+static Test size_tests [] = {
+       {"formats", test_formats},
+       {"ptrconv", test_ptrconv},
+       {"g_struct_offset", test_offset},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(size_tests_init, size_tests)
diff --git a/mono/eglib/test/slist.c b/mono/eglib/test/slist.c
new file mode 100644 (file)
index 0000000..3f8360e
--- /dev/null
@@ -0,0 +1,345 @@
+#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+#include "test.h"
+
+
+RESULT
+test_slist_nth ()
+{
+       char *foo = "foo";
+       char *bar = "bar";
+       char *baz = "baz";
+       GSList *nth, *list;
+       list = g_slist_prepend (NULL, baz);
+       list = g_slist_prepend (list, bar);
+       list = g_slist_prepend (list, foo);
+
+       nth = g_slist_nth (list, 0);
+       if (nth->data != foo)
+               return FAILED ("nth failed. #0");
+
+       nth = g_slist_nth (list, 1);
+       if (nth->data != bar)
+               return FAILED ("nth failed. #1");
+       
+       nth = g_slist_nth (list, 2);
+       if (nth->data != baz)
+               return FAILED ("nth failed. #2");
+
+       nth = g_slist_nth (list, 3);
+       if (nth)
+               return FAILED ("nth failed. #3: %s", nth->data);
+
+       g_slist_free (list);
+       return OK;
+}
+
+RESULT
+test_slist_index ()
+{
+       int i;
+       char *foo = "foo";
+       char *bar = "bar";
+       char *baz = "baz";
+       GSList *list;
+       list = g_slist_prepend (NULL, baz);
+       list = g_slist_prepend (list, bar);
+       list = g_slist_prepend (list, foo);
+
+       i = g_slist_index (list, foo);
+       if (i != 0)
+               return FAILED ("index failed. #0: %d", i);
+
+       i = g_slist_index (list, bar);
+       if (i != 1)
+               return FAILED ("index failed. #1: %d", i);
+       
+       i = g_slist_index (list, baz);
+       if (i != 2)
+               return FAILED ("index failed. #2: %d", i);
+
+       g_slist_free (list);
+       return OK;
+}
+
+RESULT
+test_slist_append ()
+{
+       GSList *foo;
+       GSList *list = g_slist_append (NULL, "first");
+       if (g_slist_length (list) != 1)
+               return FAILED ("append(null,...) failed");
+
+       foo = g_slist_append (list, "second");
+       if (foo != list)
+               return FAILED ("changed list head on non-empty");
+
+       if (g_slist_length (list) != 2)
+               return FAILED ("Append failed");
+
+       g_slist_free (list);
+       return OK;
+}
+
+RESULT
+test_slist_concat ()
+{
+       GSList *foo = g_slist_prepend (NULL, "foo");
+       GSList *bar = g_slist_prepend (NULL, "bar");
+
+       GSList *list = g_slist_concat (foo, bar);
+
+       if (g_slist_length (list) != 2)
+               return FAILED ("Concat failed.");
+
+       g_slist_free (list);
+       return OK;
+}
+
+RESULT
+test_slist_find ()
+{
+       GSList *list = g_slist_prepend (NULL, "three");
+       GSList *found;
+       char *data;
+               
+       list = g_slist_prepend (list, "two");
+       list = g_slist_prepend (list, "one");
+
+       data = "four";
+       list = g_slist_append (list, data);
+
+       found = g_slist_find (list, data);
+
+       if (found->data != data)
+               return FAILED ("Find failed");
+
+       g_slist_free (list);
+       return OK;
+}
+
+static gint
+find_custom (gconstpointer a, gconstpointer b)
+{
+       return(strcmp (a, b));
+}
+
+RESULT
+test_slist_find_custom ()
+{
+       GSList *list = NULL, *found;
+       char *foo = "foo";
+       char *bar = "bar";
+       char *baz = "baz";
+       
+       list = g_slist_prepend (list, baz);
+       list = g_slist_prepend (list, bar);
+       list = g_slist_prepend (list, foo);
+       
+       found = g_slist_find_custom (list, baz, find_custom);
+       
+       if (found == NULL)
+               return FAILED ("Find failed");
+       
+       g_slist_free (list);
+       
+       return OK;
+}
+
+RESULT
+test_slist_remove ()
+{
+       GSList *list = g_slist_prepend (NULL, "three");
+       char *one = "one";
+       list = g_slist_prepend (list, "two");
+       list = g_slist_prepend (list, one);
+
+       list = g_slist_remove (list, one);
+
+       if (g_slist_length (list) != 2)
+               return FAILED ("Remove failed");
+
+       if (strcmp ("two", list->data) != 0)
+               return FAILED ("Remove failed");
+
+       g_slist_free (list);
+       return OK;
+}
+
+RESULT
+test_slist_remove_link ()
+{
+       GSList *foo = g_slist_prepend (NULL, "a");
+       GSList *bar = g_slist_prepend (NULL, "b");
+       GSList *baz = g_slist_prepend (NULL, "c");
+       GSList *list = foo;
+
+       foo = g_slist_concat (foo, bar);
+       foo = g_slist_concat (foo, baz);        
+
+       list = g_slist_remove_link (list, bar);
+
+       if (g_slist_length (list) != 2)
+               return FAILED ("remove_link failed #1");
+
+       if (bar->next != NULL)
+               return FAILED ("remove_link failed #2");
+
+       g_slist_free (list);    
+       g_slist_free (bar);
+
+       return OK;
+}
+
+static gint
+compare (gconstpointer a, gconstpointer b)
+{
+       char *foo = (char *) a;
+       char *bar = (char *) b;
+
+       if (strlen (foo) < strlen (bar))
+               return -1;
+
+       return 1;
+}
+
+RESULT
+test_slist_insert_sorted ()
+{
+       GSList *list = g_slist_prepend (NULL, "a");
+       list = g_slist_append (list, "aaa");
+
+       /* insert at the middle */
+       list = g_slist_insert_sorted (list, "aa", compare);
+       if (strcmp ("aa", list->next->data))
+               return FAILED("insert_sorted failed #1");
+
+       /* insert at the beginning */
+       list = g_slist_insert_sorted (list, "", compare);
+       if (strcmp ("", list->data))
+               return FAILED ("insert_sorted failed #2");
+
+       /* insert at the end */
+       list = g_slist_insert_sorted (list, "aaaa", compare);
+       if (strcmp ("aaaa", g_slist_last (list)->data))
+               return FAILED ("insert_sorted failed #3");
+
+       g_slist_free (list);    
+       return OK;
+}
+
+RESULT
+test_slist_insert_before ()
+{
+       GSList *foo, *bar, *baz;
+
+       foo = g_slist_prepend (NULL, "foo");
+       foo = g_slist_insert_before (foo, NULL, "bar");
+       bar = g_slist_last (foo);
+
+       if (strcmp (bar->data, "bar"))
+               return FAILED ("1");
+
+       baz = g_slist_insert_before (foo, bar, "baz");
+       if (foo != baz)
+               return FAILED ("2");
+
+       if (strcmp (foo->next->data, "baz"))
+               return FAILED ("3: %s", foo->next->data);
+
+       g_slist_free (foo);
+       return OK;
+}
+
+#define N_ELEMS 100
+
+static int intcompare (gconstpointer p1, gconstpointer p2)
+{
+       return GPOINTER_TO_INT (p1) - GPOINTER_TO_INT (p2);
+}
+
+static gboolean verify_sort (GSList *list, int len)
+{
+       int prev = GPOINTER_TO_INT (list->data);
+       len--;
+       for (list = list->next; list; list = list->next) {
+               int curr = GPOINTER_TO_INT (list->data);
+               if (prev > curr)
+                       return FALSE;
+               prev = curr;
+
+               if (len == 0)
+                       return FALSE;
+               len--;
+       }
+       return len == 0;
+}
+
+RESULT
+test_slist_sort ()
+{
+       int i, j, mul;
+       GSList *list = NULL;
+
+       for (i = 0; i < N_ELEMS; ++i)
+               list = g_slist_prepend (list, GINT_TO_POINTER (i));
+       list = g_slist_sort (list, intcompare);
+       if (!verify_sort (list, N_ELEMS))
+               return FAILED ("decreasing list");
+
+       g_slist_free (list);
+
+       list = NULL;
+       for (i = 0; i < N_ELEMS; ++i)
+               list = g_slist_prepend (list, GINT_TO_POINTER (-i));
+       list = g_slist_sort (list, intcompare);
+       if (!verify_sort (list, N_ELEMS))
+               return FAILED ("increasing list");
+
+       g_slist_free (list);
+
+       list = g_slist_prepend (NULL, GINT_TO_POINTER (0));
+       for (i = 1; i < N_ELEMS; ++i) {
+               list = g_slist_prepend (list, GINT_TO_POINTER (-i));
+               list = g_slist_prepend (list, GINT_TO_POINTER (i));
+       }
+       list = g_slist_sort (list, intcompare);
+       if (!verify_sort (list, 2*N_ELEMS-1))
+               return FAILED ("alternating list");
+
+       g_slist_free (list);
+
+       list = NULL;
+       mul = 1;
+       for (i = 1; i < N_ELEMS; ++i) {
+               mul = -mul;
+               for (j = 0; j < i; ++j)
+                       list = g_slist_prepend (list, GINT_TO_POINTER (mul * j));
+       }
+       list = g_slist_sort (list, intcompare);
+       if (!verify_sort (list, (N_ELEMS*N_ELEMS - N_ELEMS)/2))
+               return FAILED ("wavering list");
+
+       g_slist_free (list);
+
+       return OK;
+}
+
+static Test slist_tests [] = {
+       {"nth", test_slist_nth},
+       {"index", test_slist_index},
+       {"append", test_slist_append},
+       {"concat", test_slist_concat},
+       {"find", test_slist_find},
+       {"find_custom", test_slist_find_custom},
+       {"remove", test_slist_remove},
+       {"remove_link", test_slist_remove_link},
+       {"insert_sorted", test_slist_insert_sorted},
+       {"insert_before", test_slist_insert_before},
+       {"sort", test_slist_sort},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(slist_tests_init, slist_tests)
+
diff --git a/mono/eglib/test/spawn.c b/mono/eglib/test/spawn.c
new file mode 100644 (file)
index 0000000..ec30fc8
--- /dev/null
@@ -0,0 +1,82 @@
+#include <config.h>
+#include <glib.h>
+#include <string.h>
+#include <stdio.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include "test.h"
+
+#ifdef G_OS_WIN32
+#include <io.h>
+#define read _read
+#define close _close
+#endif
+
+RESULT
+test_spawn_sync ()
+{
+       gchar *out;
+       gchar *err;
+       gint status = -1;
+       GError *error = NULL;
+
+       if (!g_spawn_command_line_sync ("ls", &out, &err, &status, &error))
+               return FAILED ("Error executing 'ls'");
+
+       if (status != 0)
+               return FAILED ("Status is %d", status);
+
+       if (out == NULL || strlen (out) == 0)
+               return FAILED ("Didn't get any output from ls!?");
+
+       g_free (out);
+       g_free (err);
+       return OK;
+}
+
+RESULT
+test_spawn_async ()
+{
+       /*
+gboolean
+g_spawn_async_with_pipes (const gchar *working_directory,
+                       gchar **argv,
+                       gchar **envp,
+                       GSpawnFlags flags,
+                       GSpawnChildSetupFunc child_setup,
+                       gpointer user_data,
+                       GPid *child_pid,
+                       gint *standard_input,
+                       gint *standard_output,
+                       gint *standard_error,
+                       GError **error) */
+       char *argv [15];
+       int stdout_fd = -1;
+       char buffer [512];
+       pid_t child_pid = 0;
+
+       memset (argv, 0, 15 * sizeof (char *));
+       argv [0] = "ls";
+       if (!g_spawn_async_with_pipes (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &child_pid, NULL, &stdout_fd, NULL, NULL))
+               return FAILED ("1 Failed to run ls");
+       if (child_pid == 0)
+               return FAILED ("2 child pid not returned");
+       if (stdout_fd == -1)
+               return FAILED ("3 out fd is -1");
+
+       while (read (stdout_fd, buffer, 512) > 0);
+       close (stdout_fd);
+
+       return OK;
+}
+
+static Test spawn_tests [] = {
+       {"g_shell_spawn_sync", test_spawn_sync},
+       {"g_shell_spawn_async_with_pipes", test_spawn_async},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(spawn_tests_init, spawn_tests)
+
+
diff --git a/mono/eglib/test/string-util.c b/mono/eglib/test/string-util.c
new file mode 100644 (file)
index 0000000..73efd13
--- /dev/null
@@ -0,0 +1,698 @@
+#include <glib.h>
+#include <string.h>
+#include <stdio.h>
+#include "test.h"
+
+/* This test is just to be used with valgrind */
+RESULT
+test_strfreev ()
+{
+       gchar **array = g_new (gchar *, 4);
+       array [0] = g_strdup ("one");
+       array [1] = g_strdup ("two");
+       array [2] = g_strdup ("three");
+       array [3] = NULL;
+       
+       g_strfreev (array);
+       g_strfreev (NULL);
+
+       return OK;
+}
+
+RESULT
+test_concat ()
+{
+       gchar *x = g_strconcat ("Hello", ", ", "world", NULL);
+       if (strcmp (x, "Hello, world") != 0)
+               return FAILED("concat failed, got: %s", x);
+       g_free (x);
+       return OK;
+}
+
+RESULT
+test_split ()
+{
+       const gchar *to_split = "Hello world, how are we doing today?";
+       gint i;
+       gchar **v;
+       
+       v= g_strsplit(to_split, " ", 0);
+       
+       if(v == NULL) {
+               return FAILED("split failed, got NULL vector (1)");
+       }
+       
+       for(i = 0; v[i] != NULL; i++);
+       if(i != 7) {
+               return FAILED("split failed, expected 7 tokens, got %d", i);
+       }
+       
+       g_strfreev(v);
+
+       v = g_strsplit(to_split, ":", -1);
+       if(v == NULL) {
+               return FAILED("split failed, got NULL vector (2)");
+       }
+
+       for(i = 0; v[i] != NULL; i++);
+       if(i != 1) {
+               return FAILED("split failed, expected 1 token, got %d", i);
+       }
+
+       if(strcmp(v[0], to_split) != 0) {
+               return FAILED("expected vector[0] to be '%s' but it was '%s'",
+                       to_split, v[0]);
+       }
+       g_strfreev(v);
+
+       v = g_strsplit ("", ":", 0);
+       if (v == NULL)
+               return FAILED ("g_strsplit returned NULL");
+       g_strfreev (v);
+
+       v = g_strsplit ("/home/miguel/dingus", "/", 0);
+       if (v [0][0] != 0)
+               return FAILED ("Got a non-empty first element");
+       g_strfreev (v);
+
+       v = g_strsplit ("appdomain1, Version=0.0.0.0, Culture=neutral", ",", 4);
+       if (strcmp (v [0], "appdomain1") != 0)
+               return FAILED ("Invalid value");
+       
+       if (strcmp (v [1], " Version=0.0.0.0") != 0)
+               return FAILED ("Invalid value");
+       
+       if (strcmp (v [2], " Culture=neutral") != 0)
+               return FAILED ("Invalid value");
+
+       if (v [3] != NULL)
+               return FAILED ("Expected only 3 elements");
+       
+       g_strfreev (v);
+
+       v = g_strsplit ("abcXYdefXghiXYjklYmno", "XY", 4);
+       if (strcmp (v [0], "abc") != 0)
+               return FAILED ("Invalid value 0");
+       
+       if (strcmp (v [1], "defXghi") != 0)
+               return FAILED ("Invalid value 1");
+
+       if (strcmp (v [2], "jklYmno") != 0)
+               return FAILED ("Invalid value 2");
+
+       if (v [3] != NULL)
+               return FAILED ("Expected only 3 elements (1)");
+       
+       g_strfreev (v);
+
+       v = g_strsplit ("abcXYdefXghiXYjklYmno", "XY", 2);
+       if (strcmp (v [0], "abc") != 0)
+               return FAILED ("Invalid value 3");
+       
+       if (strcmp (v [1], "defXghiXYjklYmno") != 0)
+               return FAILED ("Invalid value 4");
+
+       if (v [2] != NULL)
+               return FAILED ("Expected only 2 elements (2)");
+       
+       g_strfreev (v);
+
+       v = g_strsplit ("abcXYdefXghiXYjklYmnoXY", "XY", 3);
+       if (strcmp (v [0], "abc") != 0)
+               return FAILED ("Invalid value 5");
+       
+       if (strcmp (v [1], "defXghi") != 0)
+               return FAILED ("Invalid value 6");
+
+       if (strcmp (v [2], "jklYmnoXY") != 0)
+               return FAILED ("Invalid value 7");
+
+       if (v [3] != NULL)
+               return FAILED ("Expected only 3 elements (3)");
+       
+       g_strfreev (v);
+
+       v = g_strsplit ("abcXYXYXYdefXY", "XY", -1);
+       if (strcmp (v [0], "abc") != 0)
+               return FAILED ("Invalid value 8");
+
+       if (strcmp (v [1], "") != 0)
+               return FAILED ("Invalid value 9");
+
+       if (strcmp (v [2], "") != 0)
+               return FAILED ("Invalid value 10");
+       
+       if (strcmp (v [3], "def") != 0)
+               return FAILED ("Invalid value 11");
+
+       if (strcmp (v [4], "") != 0)
+               return FAILED ("Invalid value 12");
+
+       if (v [5] != NULL)
+               return FAILED ("Expected only 5 elements (4)");
+       
+       g_strfreev (v);
+
+       v = g_strsplit ("XYXYXYabcXYdef", "XY", -1);
+       if (strcmp (v [0], "") != 0)
+               return FAILED ("Invalid value 13");
+       
+       if (strcmp (v [1], "") != 0)
+               return FAILED ("Invalid value 14");
+       
+       if (strcmp (v [2], "") != 0)
+               return FAILED ("Invalid value 15");
+       
+       if (strcmp (v [3], "abc") != 0)
+               return FAILED ("Invalid value 16");
+       
+       if (strcmp (v [4], "def") != 0)
+               return FAILED ("Invalid value 17");
+
+       if (v [5] != NULL)
+               return FAILED ("Expected only 5 elements (5)");
+       
+       g_strfreev (v);
+
+       v = g_strsplit ("value=", "=", 2);
+       if (strcmp (v [0], "value") != 0)
+               return FAILED ("Invalid value 18; expected 'value', got '%s'", v [0]);
+       if (strcmp (v [1], "") != 0)
+               return FAILED ("Invalid value 19; expected '', got '%s'", v [1]);
+       if (v [2] != NULL)
+               return FAILED ("Expected only 2 elements (6)");
+
+       g_strfreev (v);
+
+       return OK;
+}
+
+RESULT
+test_split_set ()
+{
+       gchar **v;
+       
+       v = g_strsplit_set ("abcXYdefXghiXYjklYmno", "XY", 6);
+       if (strcmp (v [0], "abc") != 0)
+               return FAILED ("Invalid value 0");
+
+       if (strcmp (v [1], "") != 0)
+               return FAILED ("Invalid value 1");
+       
+       if (strcmp (v [2], "def") != 0)
+               return FAILED ("Invalid value 2");
+
+       if (strcmp (v [3], "ghi") != 0)
+               return FAILED ("Invalid value 3");
+
+       if (strcmp (v [4], "") != 0)
+               return FAILED ("Invalid value 4");
+
+       if (strcmp (v [5], "jklYmno") != 0)
+               return FAILED ("Invalid value 5");
+
+       if (v [6] != NULL)
+               return FAILED ("Expected only 6 elements (1)");
+
+       g_strfreev (v);
+
+       v = g_strsplit_set ("abcXYdefXghiXYjklYmno", "XY", 3);
+       if (strcmp (v [0], "abc") != 0)
+               return FAILED ("Invalid value 6");
+
+       if (strcmp (v [1], "") != 0)
+               return FAILED ("Invalid value 7");
+       
+       if (strcmp (v [2], "defXghiXYjklYmno") != 0)
+               return FAILED ("Invalid value 8");
+
+       if (v [3] != NULL)
+               return FAILED ("Expected only 3 elements (2)");
+       
+       g_strfreev (v);
+
+       v = g_strsplit_set ("abcXdefYghiXjklYmnoX", "XY", 5);
+       if (strcmp (v [0], "abc") != 0)
+               return FAILED ("Invalid value 9");
+       
+       if (strcmp (v [1], "def") != 0)
+               return FAILED ("Invalid value 10");
+
+       if (strcmp (v [2], "ghi") != 0)
+               return FAILED ("Invalid value 11");
+
+       if (strcmp (v [3], "jkl") != 0)
+               return FAILED ("Invalid value 12");
+
+       if (strcmp (v [4], "mnoX") != 0)
+               return FAILED ("Invalid value 13");
+
+       if (v [5] != NULL)
+               return FAILED ("Expected only 5 elements (5)");
+       
+       g_strfreev (v);
+
+       v = g_strsplit_set ("abcXYXdefXY", "XY", -1);
+       if (strcmp (v [0], "abc") != 0)
+               return FAILED ("Invalid value 14");
+
+       if (strcmp (v [1], "") != 0)
+               return FAILED ("Invalid value 15");
+
+       if (strcmp (v [2], "") != 0)
+               return FAILED ("Invalid value 16");
+       
+       if (strcmp (v [3], "def") != 0)
+               return FAILED ("Invalid value 17");
+
+       if (strcmp (v [4], "") != 0)
+               return FAILED ("Invalid value 18");
+
+       if (strcmp (v [5], "") != 0)
+               return FAILED ("Invalid value 19");
+
+       if (v [6] != NULL)
+               return FAILED ("Expected only 6 elements (4)");
+       
+       g_strfreev (v);
+
+       v = g_strsplit_set ("XYXabcXYdef", "XY", -1);
+       if (strcmp (v [0], "") != 0)
+               return FAILED ("Invalid value 20");
+       
+       if (strcmp (v [1], "") != 0)
+               return FAILED ("Invalid value 21");
+       
+       if (strcmp (v [2], "") != 0)
+               return FAILED ("Invalid value 22");
+       
+       if (strcmp (v [3], "abc") != 0)
+               return FAILED ("Invalid value 23");
+
+       if (strcmp (v [4], "") != 0)
+               return FAILED ("Invalid value 24");
+       
+       if (strcmp (v [5], "def") != 0)
+               return FAILED ("Invalid value 25");
+
+       if (v [6] != NULL)
+               return FAILED ("Expected only 6 elements (5)");
+       
+       g_strfreev (v);
+
+       return OK;
+}
+
+RESULT
+test_strreverse ()
+{
+       RESULT res = OK;
+       gchar *a = g_strdup ("onetwothree");
+       gchar *a_target = "eerhtowteno";
+       gchar *b = g_strdup ("onetwothre");
+       gchar *b_target = "erhtowteno";
+       gchar *c = g_strdup ("");
+       gchar *c_target = "";
+
+       g_strreverse (a);
+       if (strcmp (a, a_target)) {
+               res = FAILED("strreverse failed. Expecting: '%s' and got '%s'\n", a, a_target);
+               goto cleanup;
+       }
+
+       g_strreverse (b);
+       if (strcmp (b, b_target)) {
+               res = FAILED("strreverse failed. Expecting: '%s' and got '%s'\n", b, b_target);
+               goto cleanup;
+       }
+
+       g_strreverse (c);
+       if (strcmp (c, c_target)) {
+               res = FAILED("strreverse failed. Expecting: '%s' and got '%s'\n", b, b_target);
+               goto cleanup;
+       }
+
+cleanup:
+       g_free (c);
+       g_free (b);
+       g_free (a);
+       return res;
+}
+
+RESULT
+test_strjoin ()
+{
+       char *s;
+       
+       s = g_strjoin (NULL, "a", "b", NULL);
+       if (strcmp (s, "ab") != 0)
+               return FAILED ("Join of two strings with no separator fails");
+       g_free (s);
+
+       s = g_strjoin ("", "a", "b", NULL);
+       if (strcmp (s, "ab") != 0)
+               return FAILED ("Join of two strings with empty separator fails");
+       g_free (s);
+
+       s = g_strjoin ("-", "a", "b", NULL);
+       if (strcmp (s, "a-b") != 0)
+               return FAILED ("Join of two strings with separator fails");
+       g_free (s);
+
+       s = g_strjoin ("-", "aaaa", "bbbb", "cccc", "dddd", NULL);
+       if (strcmp (s, "aaaa-bbbb-cccc-dddd") != 0)
+               return FAILED ("Join of multiple strings fails");
+       g_free (s);
+
+       s = g_strjoin ("-", NULL);
+       if (s == NULL || (strcmp (s, "") != 0))
+               return FAILED ("Failed to join empty arguments");
+       g_free (s);
+
+       return OK;
+}
+
+RESULT
+test_strchug ()
+{
+       char *str = g_strdup (" \t\n hola");
+
+       g_strchug (str);
+       if (strcmp ("hola", str)) {
+               fprintf (stderr, "%s\n", str);
+               g_free (str);
+               return FAILED ("Failed.");
+       }
+       g_free (str);
+       return OK;
+}
+
+RESULT
+test_strchomp ()
+{
+       char *str = g_strdup ("hola  \t");
+
+       g_strchomp (str);
+       if (strcmp ("hola", str)) {
+               fprintf (stderr, "%s\n", str);
+               g_free (str);
+               return FAILED ("Failed.");
+       }
+       g_free (str);
+       return OK;
+}
+
+RESULT
+test_strstrip ()
+{
+       char *str = g_strdup (" \t hola   ");
+
+       g_strstrip (str);
+       if (strcmp ("hola", str)) {
+               fprintf (stderr, "%s\n", str);
+               g_free (str);
+               return FAILED ("Failed.");
+       }
+       g_free (str);
+       return OK;
+}
+
+#define urit(so,j) do { s = g_filename_to_uri (so, NULL, NULL); if (strcmp (s, j) != 0) return FAILED("Got %s expected %s", s, j); g_free (s); } while (0);
+
+#define errit(so) do { s = g_filename_to_uri (so, NULL, NULL); if (s != NULL) return FAILED ("got %s, expected NULL", s); } while (0);
+
+RESULT
+test_filename_to_uri ()
+{
+#ifdef G_OS_WIN32
+#else
+       char *s;
+
+       urit ("/a", "file:///a");
+       urit ("/home/miguel", "file:///home/miguel");
+       urit ("/home/mig uel", "file:///home/mig%20uel");
+       urit ("/\303\241", "file:///%C3%A1");
+       urit ("/\303\241/octal", "file:///%C3%A1/octal");
+       urit ("/%", "file:///%25");
+       urit ("/\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040", "file:///%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20");
+       urit ("/!$&'()*+,-./", "file:///!$&'()*+,-./");
+       urit ("/\042\043\045", "file:///%22%23%25");
+       urit ("/0123456789:=", "file:///0123456789:=");
+       urit ("/\073\074\076\077", "file:///%3B%3C%3E%3F");
+       urit ("/\133\134\135\136_\140\173\174\175", "file:///%5B%5C%5D%5E_%60%7B%7C%7D");
+       urit ("/\173\174\175\176\177\200", "file:///%7B%7C%7D~%7F%80");
+       urit ("/@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", "file:///@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
+       errit ("a");
+       errit ("./hola");
+#endif
+       
+       return OK;
+}
+
+#define fileit(so,j) do { s = g_filename_from_uri (so, NULL, NULL); if (strcmp (s, j) != 0) return FAILED("Got %s expected %s", s, j); g_free (s); } while (0);
+
+#define ferrit(so) do { s = g_filename_from_uri (so, NULL, NULL); if (s != NULL) return FAILED ("got %s, expected NULL", s); } while (0);
+
+RESULT
+test_filename_from_uri ()
+{
+#ifdef G_OS_WIN32
+#else
+       char *s;
+
+       fileit ("file:///a", "/a");
+       fileit ("file:///%41", "/A");
+       fileit ("file:///home/miguel", "/home/miguel");
+       fileit ("file:///home/mig%20uel", "/home/mig uel");
+       ferrit ("/a");
+       ferrit ("a");
+       ferrit ("file://a");
+       ferrit ("file:a");
+       ferrit ("file:///%");
+       ferrit ("file:///%0");
+       ferrit ("file:///%jj");
+#endif
+       
+       return OK;
+}
+
+RESULT
+test_ascii_xdigit_value ()
+{
+       int i;
+       gchar j;
+
+       i = g_ascii_xdigit_value ('9' + 1);
+       if (i != -1)
+               return FAILED ("'9' + 1");
+       i = g_ascii_xdigit_value ('0' - 1);
+       if (i != -1)
+               return FAILED ("'0' - 1");
+       i = g_ascii_xdigit_value ('a' - 1);
+       if (i != -1)
+               return FAILED ("'a' - 1");
+       i = g_ascii_xdigit_value ('f' + 1);
+       if (i != -1)
+               return FAILED ("'f' + 1");
+       i = g_ascii_xdigit_value ('A' - 1);
+       if (i != -1)
+               return FAILED ("'A' - 1");
+       i = g_ascii_xdigit_value ('F' + 1);
+       if (i != -1)
+               return FAILED ("'F' + 1");
+
+       for (j = '0'; j < '9'; j++) {
+               int c = g_ascii_xdigit_value (j);
+               if (c  != (j - '0'))
+                       return FAILED ("Digits %c -> %d", j, c);
+       }
+       for (j = 'a'; j < 'f'; j++) {
+               int c = g_ascii_xdigit_value (j);
+               if (c  != (j - 'a' + 10))
+                       return FAILED ("Lower %c -> %d", j, c);
+       }
+       for (j = 'A'; j < 'F'; j++) {
+               int c = g_ascii_xdigit_value (j);
+               if (c  != (j - 'A' + 10))
+                       return FAILED ("Upper %c -> %d", j, c);
+       }
+       return OK;
+}
+
+RESULT
+test_strdelimit ()
+{
+       gchar *str;
+
+       str = g_strdup (G_STR_DELIMITERS);
+       str = g_strdelimit (str, NULL, 'a');
+       if (0 != strcmp ("aaaaaaa", str))
+               return FAILED ("All delimiters: '%s'", str);
+       g_free (str);
+       str = g_strdup ("hola");
+       str = g_strdelimit (str, "ha", '+');
+       if (0 != strcmp ("+ol+", str))
+               return FAILED ("2 delimiters: '%s'", str);
+       g_free (str);
+       return OK;
+}
+
+#define NUMBERS "0123456789"
+
+RESULT
+test_strlcpy ()
+{
+       const gchar *src = "onetwothree";
+       gchar *dest;
+       gsize i;
+
+       dest = g_malloc (strlen (src) + 1);
+       memset (dest, 0, strlen (src) + 1);
+       i = g_strlcpy (dest, src, (gsize)-1);
+       if (i != strlen (src))
+               return FAILED ("Test1 got %d", i);
+
+       if (0 != strcmp (dest, src))
+               return FAILED ("Src and dest not equal");
+
+       i = g_strlcpy (dest, src, 3);
+       if (i != strlen (src))
+               return FAILED ("Test1 got %d", i);
+       if (0 != strcmp (dest, "on"))
+               return FAILED ("Test2");
+
+       i = g_strlcpy (dest, src, 1);
+       if (i != strlen (src))
+               return FAILED ("Test3 got %d", i);
+       if (*dest != '\0')
+               return FAILED ("Test4");
+
+       i = g_strlcpy (dest, src, 12345);
+       if (i != strlen (src))
+               return FAILED ("Test4 got %d", i);
+       if (0 != strcmp (dest, src))
+               return FAILED ("Src and dest not equal 2");
+       g_free (dest);
+
+       /* This is a test for g_filename_from_utf8, even if it does not look like it */
+       dest = g_filename_from_utf8 (NUMBERS, strlen (NUMBERS), NULL, NULL, NULL);
+       if (0 != strcmp (dest, NUMBERS))
+               return FAILED ("problem [%s] and [%s]", dest, NUMBERS);
+       g_free (dest);
+       
+       return OK;
+}
+
+RESULT
+test_strescape ()
+{
+       gchar *str;
+
+       str = g_strescape ("abc", NULL);
+       if (strcmp ("abc", str))
+               return FAILED ("#1");
+       str = g_strescape ("\t\b\f\n\r\\\"abc", NULL);
+       if (strcmp ("\\t\\b\\f\\n\\r\\\\\\\"abc", str))
+               return FAILED ("#2 %s", str);
+       str = g_strescape ("\001abc", NULL);
+       if (strcmp ("\\001abc", str))
+               return FAILED ("#3 %s", str);
+       str = g_strescape ("\001abc", "\001");
+       if (strcmp ("\001abc", str))
+               return FAILED ("#3 %s", str);
+       return OK;
+}
+
+RESULT
+test_ascii_strncasecmp ()
+{
+       int n;
+
+       n = g_ascii_strncasecmp ("123", "123", 1);
+       if (n != 0)
+               return FAILED ("Should have been 0");
+       
+       n = g_ascii_strncasecmp ("423", "123", 1);
+       if (n != 3)
+               return FAILED ("Should have been 3, got %d", n);
+
+       n = g_ascii_strncasecmp ("123", "423", 1);
+       if (n != -3)
+               return FAILED ("Should have been -3, got %d", n);
+
+       n = g_ascii_strncasecmp ("1", "1", 10);
+       if (n != 0)
+               return FAILED ("Should have been 0, got %d", n);
+       return OK;
+}
+
+RESULT
+test_ascii_strdown ()
+{
+       const gchar *a = "~09+AaBcDeFzZ$0909EmPAbCdEEEEEZZZZAAA";
+       const gchar *b = "~09+aabcdefzz$0909empabcdeeeeezzzzaaa";
+       gchar *c;
+       gint n, l;
+
+       l = (gint)strlen (b);
+       c = g_ascii_strdown (a, l);
+       n = g_ascii_strncasecmp (b, c, l);
+
+       if (n != 0) {
+               g_free (c);
+               return FAILED ("Should have been 0, got %d", n);
+       }
+
+       g_free (c);
+       return OK;
+}
+
+RESULT
+test_strdupv ()
+{
+       gchar **one;
+       gchar **two;
+       gint len;
+
+       one = g_strdupv (NULL);
+       if (one)
+               return FAILED ("Should have been NULL");
+
+       one = g_malloc (sizeof (gchar *));
+       *one = NULL;
+       two = g_strdupv (one);
+       if (!two)
+               FAILED ("Should have been not NULL");
+       len = g_strv_length (two);
+       if (len)
+               FAILED ("Should have been 0");
+       g_strfreev (two);
+       g_strfreev (one);
+       return NULL;
+}
+
+static Test strutil_tests [] = {
+       {"g_strfreev", test_strfreev},
+       {"g_strconcat", test_concat},
+       {"g_strsplit", test_split},
+       {"g_strsplit_set", test_split_set},
+       {"g_strreverse", test_strreverse},
+       {"g_strjoin", test_strjoin},
+       {"g_strchug", test_strchug},
+       {"g_strchomp", test_strchomp},
+       {"g_strstrip", test_strstrip},
+       {"g_filename_to_uri", test_filename_to_uri},
+       {"g_filename_from_uri", test_filename_from_uri},
+       {"g_ascii_xdigit_value", test_ascii_xdigit_value},
+       {"g_strdelimit", test_strdelimit},
+       {"g_strlcpy", test_strlcpy},
+       {"g_strescape", test_strescape},
+       {"g_ascii_strncasecmp", test_ascii_strncasecmp },
+       {"g_ascii_strdown", test_ascii_strdown },
+       {"g_strdupv", test_strdupv },
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(strutil_tests_init, strutil_tests)
+
+
diff --git a/mono/eglib/test/string.c b/mono/eglib/test/string.c
new file mode 100644 (file)
index 0000000..02ad0ad
--- /dev/null
@@ -0,0 +1,237 @@
+#include <glib.h>
+#include <string.h>
+#include <stdio.h>
+#include "test.h"
+
+#define sfail(k,p) if (s->str [p] != k) { g_string_free (s,TRUE); return FAILED("Got %s, Failed at %d, expected '%c'", s->str, p, k);}
+
+RESULT
+test_append_speed()
+{
+       GString *s = g_string_new("");
+       gint i;
+       
+       for(i = 0; i < 1024; i++) {
+               g_string_append(s, "x");
+       }
+       
+       if(strlen (s->str) != 1024) {
+               return FAILED("Incorrect string size, got: %s %d", 
+                       s->str, strlen(s->str));
+       }
+       
+       g_string_free (s, TRUE);
+
+       return OK;
+}
+
+RESULT
+test_append_c_speed()
+{
+       GString *s = g_string_new("");
+       gint i;
+       
+       for(i = 0; i < 1024; i++) {
+               g_string_append_c(s, 'x');
+       }
+       
+       if(strlen(s->str) != 1024) {
+               return FAILED("Incorrect string size, got: %s %d", s->str, 
+                       strlen(s->str));
+       }
+       
+       g_string_free(s, TRUE);
+
+       return OK;
+}
+
+RESULT
+test_gstring ()
+{
+       GString *s = g_string_new_len ("My stuff", 2);
+       char *ret;
+       int i;
+
+       if (strcmp (s->str, "My") != 0)
+               return "Expected only 'My' on the string";
+       g_string_free (s, TRUE);
+
+       s = g_string_new_len ("My\0\0Rest", 6);
+       if (s->str [2] != 0)
+               return "Null was not copied";
+       if (strcmp (s->str+4, "Re") != 0){
+               return "Did not find the 'Re' part";
+       }
+
+       g_string_append (s, "lalalalalalalalalalalalalalalalalalalalalalal");
+       if (s->str [2] != 0)
+               return "Null as not copied";
+       if (strncmp (s->str+4, "Relala", 6) != 0){
+               return FAILED("Did not copy correctly, got: %s", s->str+4);
+       }
+
+       g_string_free (s, TRUE);
+
+       s = g_string_new ("");
+       for (i = 0; i < 1024; i++){
+               g_string_append_c (s, 'x');
+       }
+       if (strlen (s->str) != 1024){
+               return FAILED("Incorrect string size, got: %s %d\n", s->str, strlen (s->str));
+       }
+       g_string_free (s, TRUE);
+
+       s = g_string_new ("hola");
+       g_string_sprintfa (s, "%s%d", ", bola", 5);
+       if (strcmp (s->str, "hola, bola5") != 0){
+               return FAILED("Incorrect data, got: %s\n", s->str);
+       }
+       g_string_free (s, TRUE);
+
+       s = g_string_new ("Hola");
+       g_string_printf (s, "Dingus");
+       
+       /* Test that it does not release it */
+       ret = g_string_free (s, FALSE);
+       g_free (ret);
+
+       s = g_string_new_len ("H" "\000" "H", 3);
+       g_string_append_len (s, "1" "\000" "2", 3);
+       sfail ('H', 0);
+       sfail ( 0, 1);
+       sfail ('H', 2);
+       sfail ('1', 3);
+       sfail ( 0, 4);
+       sfail ('2', 5);
+       g_string_free (s, TRUE);
+       
+       return OK;
+}
+
+RESULT
+test_sized ()
+{
+       GString *s = g_string_sized_new (20);
+
+       if (s->str [0] != 0)
+               return FAILED ("Expected an empty string");
+       if (s->len != 0)
+               return FAILED ("Expected an empty len");
+
+       g_string_free (s, TRUE);
+       
+       return NULL;
+}
+
+RESULT
+test_truncate ()
+{
+       GString *s = g_string_new ("0123456789");
+       g_string_truncate (s, 3);
+
+       if (strlen (s->str) != 3)
+               return FAILED ("size of string should have been 3, instead it is [%s]\n", s->str);
+       g_string_free (s, TRUE);
+       
+       s = g_string_new ("a");
+       s = g_string_truncate (s, 10);
+       if (strlen (s->str) != 1)
+               return FAILED ("The size is not 1");
+       g_string_truncate (s, (gsize)-1);
+       if (strlen (s->str) != 1)
+               return FAILED ("The size is not 1");
+       g_string_truncate (s, 0);
+       if (strlen (s->str) != 0)
+               return FAILED ("The size is not 0");
+       
+       g_string_free (s, TRUE);
+
+       return NULL;
+}
+
+RESULT
+test_prepend ()
+{
+       GString *s = g_string_new ("dingus");
+       g_string_prepend (s, "one");
+
+       if (strcmp (s->str, "onedingus") != 0)
+               return FAILED ("Failed, expected onedingus, got [%s]", s->str);
+
+       g_string_free (s, TRUE);
+
+       /* This is to force the code that where stuff does not fit in the allocated block */
+       s = g_string_sized_new (1);
+       g_string_prepend (s, "one");
+       if (strcmp (s->str, "one") != 0)
+               return FAILED ("Got erroneous result, expected [one] got [%s]", s->str);
+       g_string_free (s, TRUE);
+
+       /* This is to force the path where things fit */
+       s = g_string_new ("123123123123123123123123");
+       g_string_truncate (s, 1);
+       if (strcmp (s->str, "1") != 0)
+               return FAILED ("Expected [1] string, got [%s]", s->str);
+
+       g_string_prepend (s, "pre");
+       if (strcmp (s->str, "pre1") != 0)
+               return FAILED ("Expected [pre1], got [%s]", s->str);
+       g_string_free (s, TRUE);
+       
+       return NULL;
+}
+
+RESULT
+test_appendlen ()
+{
+       GString *s = g_string_new ("");
+
+       g_string_append_len (s, "boo\000x", 0);
+       if (s->len != 0)
+               return FAILED ("The length is not zero %d", s->len);
+       g_string_append_len (s, "boo\000x", 5);
+       if (s->len != 5)
+               return FAILED ("The length is not five %d", s->len);
+       g_string_append_len (s, "ha", -1);
+       if (s->len != 7)
+               return FAILED ("The length is not seven %d", s->len);
+               
+       g_string_free (s, TRUE);
+
+       return NULL;
+}
+
+RESULT
+test_macros ()
+{
+       char *s = g_strdup (G_STRLOC);
+       char *p = strchr (s + 2, ':');
+       int n;
+       
+       if (p == NULL)
+               return FAILED ("Did not find a separator");
+       n = atoi (p+1);
+       if (n <= 0)
+               return FAILED ("did not find a valid line number");
+
+       *p = 0;
+       if (strcmp (s + strlen(s) - 8 , "string.c") != 0)
+               return FAILED ("This did not store the filename on G_STRLOC");
+       
+       g_free (s);
+       return NULL;
+}
+
+static Test string_tests [] = {
+       {"append-speed", test_append_speed},
+       {"append_c-speed", test_append_c_speed},
+       {"ctor+append", test_gstring },
+       {"ctor+sized", test_sized },
+       {"truncate", test_truncate },
+       {"prepend", test_prepend },
+       {"append_len", test_appendlen },
+       {"macros", test_macros },
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(string_tests_init, string_tests)
diff --git a/mono/eglib/test/test-both b/mono/eglib/test/test-both
new file mode 100755 (executable)
index 0000000..038c927
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/sh
+
+for arg in $@; do 
+       if [ "x$arg" = "x--help" ]; then
+               echo "Usage: $0 [OPTION]... [ITERATIONS] [TESTGROUP]..."
+               echo ""
+               echo "Works the same as test-eglib or test-glib with the following"
+               echo "exception. Run test-eglib --help for details on normal testing"
+               echo ""
+               echo "If the first OPTION is --speed-compare, the following is"
+               echo "applicable to this program:"
+               echo ""
+               echo "  --speed-compare    run drivers in -qtni mode and report"
+               echo "                     speed comparison information"
+               echo ""
+               echo "After --speed-compare, the number of iterations "
+               echo "(optional, default is 100000) can be specified, followed "
+               echo "by specific tests to run (or none to run all)"
+               echo ""
+               echo "If --speed-compare is not the first argument, all arguments are"
+               echo "passed on directly to each driver"
+               echo ""
+               exit 1
+       fi
+done
+
+if [ ! -x "./test-glib" -o ! -x "./test-eglib" ]; then
+       make
+fi
+
+if [ "x$1" = "x--speed-compare" ]; then
+       ITERATIONS=100000
+       if [ ! -z "$2" ]; then
+               case $2 in
+                       *[0-9]*) ITERATIONS=$2; break;
+               esac
+       fi      
+
+       OPTIONS="-qnti $ITERATIONS"
+
+       for arg in $@; do
+               if [ "x$arg" = "x--speed-compare" ]; then       
+                       continue;
+               elif [ "$arg" = "$ITERATIONS" ]; then
+                       continue;
+               fi
+
+               OPTIONS="$OPTIONS $arg"
+       done
+       
+       echo "Running tests with $OPTIONS..."
+       
+       GLIB=`./test-glib $OPTIONS`
+       EGLIB=`./test-eglib $OPTIONS`
+
+       # this blows
+       FASTER_NAME=`echo "$GLIB GLib $EGLIB EGlib" | awk '{ if($1 < $3) print $2; else print $4 }'`
+       FASTER_SPEED=`echo "$GLIB $EGLIB" | awk '{ if($1 < $2) print $1; else print $2 }'`
+       SLOWER_NAME=`echo "$GLIB GLib $EGLIB EGlib" | awk '{ if($1 > $3) print $2; else print $4 }'`
+       SLOWER_SPEED=`echo "$GLIB $EGLIB" | awk '{ if($1 > $2) print $1; else print $2 }'`
+
+       FASTER_PERCENTAGE=`echo "$SLOWER_SPEED $FASTER_SPEED" | awk '{ print ($1 / $2) * 100 }'`
+
+       echo "$FASTER_NAME $FASTER_SPEED"
+       echo "$SLOWER_NAME $SLOWER_SPEED"
+       echo "------------------------------------------------"
+       echo "$FASTER_NAME is $FASTER_PERCENTAGE% faster than $SLOWER_NAME"
+       
+       exit 0;
+fi
+
+./test-eglib $@
+./test-glib $@
+
diff --git a/mono/eglib/test/test.c b/mono/eglib/test/test.c
new file mode 100644 (file)
index 0000000..7c870e9
--- /dev/null
@@ -0,0 +1,275 @@
+/*
+ * EGLib Unit Group/Test Runners
+ *
+ * Author:
+ *   Aaron Bockover (abockover@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <config.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <glib.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#endif
+
+#include "test.h"
+
+extern gint global_passed, global_tests;
+static gchar *last_result = NULL;
+
+gboolean 
+run_test(Test *test, gchar **result_out)
+{
+       gchar *result; 
+
+       if((result = test->handler()) == NULL) {
+               *result_out = NULL;
+               return TRUE;
+       } else {
+               *result_out = result;   
+               return FALSE;
+       }
+}
+
+gboolean
+run_group(Group *group, gint iterations, gboolean quiet, 
+       gboolean time, gchar *tests_to_run_s)
+{
+       Test *tests = group->handler();
+       gint i, j, passed = 0, total = 0;
+       gdouble start_time_group, start_time_test;
+       gchar **tests_to_run = NULL;
+
+       if(!quiet) {
+               if(iterations > 1) {
+                       printf("[%s] (%dx)\n", group->name, iterations);
+               } else {
+                       printf("[%s]\n", group->name);
+               }
+       }
+
+       if(tests_to_run_s != NULL) {
+               tests_to_run = eg_strsplit(tests_to_run_s, ",", -1);
+       }
+
+       start_time_group = get_timestamp();
+
+       for(i = 0; tests[i].name != NULL; i++) {
+               gchar *result = "";
+               gboolean iter_pass, run;
+       
+               iter_pass = FALSE;
+               if(tests_to_run != NULL) {
+                       gint j;
+                       run = FALSE;
+                       for(j = 0; tests_to_run[j] != NULL; j++) {
+                               if(strcmp(tests_to_run[j], tests[i].name) == 0) {
+                                       run = TRUE;
+                                       break;
+                               }
+                       }
+               } else {
+                       run = TRUE;
+               }
+
+               if(!run) {
+                       continue;
+               }
+       
+               total++;
+       
+               if(!quiet) {
+                       printf("  %s: ", tests[i].name);
+               }
+
+               start_time_test = get_timestamp();
+               
+               for(j = 0; j < iterations; j++) {
+                       iter_pass = run_test(&(tests[i]), &result);
+                       if(!iter_pass) {
+                               break;
+                       }
+               }
+
+               if(iter_pass) {
+                       passed++;
+                       if(!quiet) {
+                               if(time) {
+                                       printf("OK (%g)\n", get_timestamp() - start_time_test);
+                               } else {
+                                       printf("OK\n");
+                               }
+                       }
+               } else  {                       
+                       if(!quiet) {
+                               printf("FAILED (%s)\n", result);
+                       }
+                       
+                       if(last_result == result) {
+                               last_result = NULL;
+                               g_free(result);
+                       }
+               }
+       }
+
+       global_passed += passed;
+       global_tests += total;
+
+       if(!quiet) {
+               gdouble pass_percentage = ((gdouble)passed / (gdouble)total) * 100.0;
+               if(time) {
+                       printf("  %d / %d (%g%%, %g)\n", passed, total,
+                               pass_percentage, get_timestamp() - start_time_group);
+               } else {
+                       printf("  %d / %d (%g%%)\n", passed, total, pass_percentage);
+               }
+       }
+
+       if(tests_to_run != NULL) {
+               eg_strfreev(tests_to_run);
+       }
+
+       return passed == total;
+}
+
+RESULT
+FAILED(const gchar *format, ...)
+{
+       gchar *ret;
+       va_list args;
+       gint n;
+
+#if !defined(HAVE_VASPRINTF) && !defined(_EGLIB_MAJOR)
+       /* We are linked against the real glib, no vasprintf */
+       g_assert_not_reached ();
+       return NULL;
+#else
+       va_start(args, format);
+       n = g_vasprintf(&ret, format, args);
+       va_end(args);
+
+       if(n == -1) {
+               last_result = NULL;
+               return NULL;
+       }
+
+       last_result = ret;
+       return ret;
+#endif
+}
+
+gdouble
+get_timestamp()
+{
+       /* FIXME: We should use g_get_current_time here */
+       GTimeVal res;
+       g_get_current_time (&res);
+       return res.tv_sec + (1.e-6) * res.tv_usec;
+}
+
+/* 
+ * Duplicating code here from EGlib to avoid g_strsplit skew between
+ * EGLib and GLib
+ */
+gchar ** 
+eg_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens)
+{
+       gchar *string_c;
+       gchar *strtok_save, **vector;
+       gchar *token, *token_c;
+       gint size = 1;
+       size_t token_length;
+
+       g_return_val_if_fail(string != NULL, NULL);
+       g_return_val_if_fail(delimiter != NULL, NULL);
+       g_return_val_if_fail(delimiter[0] != 0, NULL);
+       
+       token_length = strlen(string);
+       string_c = (gchar *)g_malloc(token_length + 1);
+       memcpy(string_c, string, token_length);
+       string_c[token_length] = 0;
+       
+       vector = NULL;
+       token = (gchar *)strtok_r(string_c, delimiter, &strtok_save);
+
+       while(token != NULL) {
+               token_length = strlen(token);
+               token_c = (gchar *)g_malloc(token_length + 1);
+               memcpy(token_c, token, token_length);
+               token_c[token_length] = 0;
+
+               vector = vector == NULL ? 
+                       (gchar **)g_malloc(2 * sizeof(vector)) :
+                       (gchar **)g_realloc(vector, (size + 1) * sizeof(vector));
+       
+               vector[size - 1] = token_c;     
+               size++;
+
+               if(max_tokens > 0 && size >= max_tokens) {
+                       if(size > max_tokens) {
+                               break;
+                       }
+
+                       token = strtok_save;
+               } else {
+                       token = (gchar *)strtok_r(NULL, delimiter, &strtok_save);
+               }
+       }
+
+       if(vector != NULL && size > 0) {
+               vector[size - 1] = NULL;
+       }
+       
+       g_free(string_c);
+       string_c = NULL;
+
+       return vector;
+}
+
+void
+eg_strfreev (gchar **str_array)
+{
+       gchar **orig = str_array;
+       if (str_array == NULL)
+               return;
+       while (*str_array != NULL){
+               g_free (*str_array);
+               str_array++;
+       }
+       g_free (orig);
+}
+
+
+
diff --git a/mono/eglib/test/test.h b/mono/eglib/test/test.h
new file mode 100644 (file)
index 0000000..5c7275e
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * EGLib Unit Group/Test Runners
+ *
+ * Author:
+ *   Aaron Bockover (abockover@novell.com)
+ *
+ * (C) 2006 Novell, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#ifndef _TEST_H
+#define _TEST_H
+
+#include <config.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+
+#ifdef _MSC_VER
+/* disable the following warnings 
+ * C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored. 
+ * C4127: conditional expression is constant (test macros produce a lot of these)
+*/
+#pragma warning(disable:4100 4127)
+#endif
+
+typedef gchar * RESULT;
+
+typedef struct _Test Test;
+typedef struct _Group Group;
+
+typedef gchar * (* RunTestHandler)();
+typedef Test * (* LoadGroupHandler)();
+
+struct _Test {
+       const gchar *name;
+       RunTestHandler handler;
+};
+
+struct _Group {
+       const gchar *name;
+       LoadGroupHandler handler;
+};
+
+gboolean run_group(Group *group, gint iterations, gboolean quiet, 
+       gboolean time, gchar *tests);
+#undef FAILED
+RESULT FAILED(const gchar *format, ...);
+gdouble get_timestamp();
+gchar ** eg_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens);
+void eg_strfreev (gchar **str_array);
+
+#define OK NULL
+
+#define DEFINE_TEST_GROUP_INIT(name, table) \
+       Test * (name)() { return table; }
+
+#define DEFINE_TEST_GROUP_INIT_H(name) \
+       Test * (name)();
+
+#endif /* _TEST_H */
+
+
diff --git a/mono/eglib/test/tests.h b/mono/eglib/test/tests.h
new file mode 100644 (file)
index 0000000..fdca395
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test.h"
+
+DEFINE_TEST_GROUP_INIT_H(string_tests_init);
+DEFINE_TEST_GROUP_INIT_H(strutil_tests_init);
+DEFINE_TEST_GROUP_INIT_H(slist_tests_init);
+DEFINE_TEST_GROUP_INIT_H(list_tests_init);
+DEFINE_TEST_GROUP_INIT_H(hashtable_tests_init);
+DEFINE_TEST_GROUP_INIT_H(ptrarray_tests_init);
+DEFINE_TEST_GROUP_INIT_H(size_tests_init);
+DEFINE_TEST_GROUP_INIT_H(fake_tests_init);
+DEFINE_TEST_GROUP_INIT_H(array_tests_init);
+DEFINE_TEST_GROUP_INIT_H(queue_tests_init);
+DEFINE_TEST_GROUP_INIT_H(path_tests_init);
+DEFINE_TEST_GROUP_INIT_H(shell_tests_init);
+DEFINE_TEST_GROUP_INIT_H(spawn_tests_init);
+DEFINE_TEST_GROUP_INIT_H(timer_tests_init);
+DEFINE_TEST_GROUP_INIT_H(file_tests_init);
+DEFINE_TEST_GROUP_INIT_H(pattern_tests_init);
+DEFINE_TEST_GROUP_INIT_H(dir_tests_init);
+DEFINE_TEST_GROUP_INIT_H(markup_tests_init);
+DEFINE_TEST_GROUP_INIT_H(unicode_tests_init);
+DEFINE_TEST_GROUP_INIT_H(utf8_tests_init);
+DEFINE_TEST_GROUP_INIT_H(endian_tests_init);
+DEFINE_TEST_GROUP_INIT_H(module_tests_init);
+DEFINE_TEST_GROUP_INIT_H(memory_tests_init);
+
+static Group test_groups [] = {        
+       {"string",    string_tests_init}, 
+       {"strutil",   strutil_tests_init},
+       {"ptrarray",  ptrarray_tests_init},
+       {"slist",     slist_tests_init},
+       {"list",      list_tests_init},
+       {"hashtable", hashtable_tests_init},
+       {"sizes",     size_tests_init},
+       {"fake",      fake_tests_init},
+       {"array",     array_tests_init},
+       {"queue",     queue_tests_init},
+       {"path",      path_tests_init},
+       {"shell",     shell_tests_init},
+       {"markup",    markup_tests_init},
+#if !DISABLE_PROCESS_TESTS 
+       {"spawn",     spawn_tests_init},
+       {"module",    module_tests_init},
+#endif
+#if !DISABLE_FILESYSTEM_TESTS
+       {"file",      file_tests_init},
+#endif
+       {"timer",     timer_tests_init},
+       {"pattern",   pattern_tests_init},
+       {"dir",       dir_tests_init},
+       {"unicode",   unicode_tests_init},
+       {"utf8",      utf8_tests_init},
+       {"endian",    endian_tests_init},
+       {"memory",    memory_tests_init},
+       {NULL, NULL}
+};
+
diff --git a/mono/eglib/test/timer.c b/mono/eglib/test/timer.c
new file mode 100644 (file)
index 0000000..7b41f80
--- /dev/null
@@ -0,0 +1,55 @@
+#include <config.h>
+#include <glib.h>
+#include <string.h>
+#include <math.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifdef G_OS_WIN32
+#include <windows.h>
+#define sleep(t)                 Sleep((t) * 1000)
+#endif
+
+#include "test.h"
+
+RESULT
+test_timer ()
+{
+       GTimer *timer;
+       gdouble elapsed1, elapsed2;
+       gulong usec = 0;
+
+       timer = g_timer_new ();
+       sleep (1);
+       elapsed1 = g_timer_elapsed (timer, NULL);
+       if ((elapsed1 + 0.1) < 1.0)
+               return FAILED ("Elapsed time should be around 1s and was %f", elapsed1);
+
+       g_timer_stop (timer);
+       elapsed1 = g_timer_elapsed (timer, NULL);
+       elapsed2 = g_timer_elapsed (timer, &usec);
+       if (fabs (elapsed1 - elapsed2) > 0.000001)
+               return FAILED ("The elapsed times are not equal %f - %f.", elapsed1, elapsed2);
+
+       elapsed2 *= 1000000;
+       while (elapsed2 > 1000000)
+               elapsed2 -= 1000000;
+
+       if (fabs (usec - elapsed2) > 100.0)
+               return FAILED ("usecs are wrong.");
+
+       g_timer_destroy (timer);
+       return OK;
+}
+
+static Test timer_tests [] = {
+       {"g_timer", test_timer},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(timer_tests_init, timer_tests)
+
+
diff --git a/mono/eglib/test/unicode.c b/mono/eglib/test/unicode.c
new file mode 100644 (file)
index 0000000..c1c3402
--- /dev/null
@@ -0,0 +1,99 @@
+#include "test.h"
+
+/*
+ * g_unichar_type
+ */
+RESULT
+test_g_unichar_type ()
+{
+       if (g_unichar_type ('A') != G_UNICODE_UPPERCASE_LETTER)
+               return FAILED ("#1");
+       if (g_unichar_type ('a') != G_UNICODE_LOWERCASE_LETTER)
+               return FAILED ("#2");
+       if (g_unichar_type ('1') != G_UNICODE_DECIMAL_NUMBER)
+               return FAILED ("#3");
+       if (g_unichar_type (0xA3) != G_UNICODE_CURRENCY_SYMBOL)
+               return FAILED ("#4");
+       return NULL;
+}
+
+/*
+ * g_unichar_toupper
+ */
+RESULT
+test_g_unichar_toupper ()
+{
+       if (g_unichar_toupper (0) != 0)
+               return FAILED ("#0");
+       if (g_unichar_toupper ('a') != 'A')
+               return FAILED ("#1");
+       if (g_unichar_toupper ('1') != '1')
+               return FAILED ("#2");
+       if (g_unichar_toupper (0x1C4) != 0x1C4)
+               return FAILED ("#3");
+       if (g_unichar_toupper (0x1F2) != 0x1F1)
+               return FAILED ("#4");
+       if (g_unichar_toupper (0x1F3) != 0x1F1)
+               return FAILED ("#5");
+       if (g_unichar_toupper (0xFFFF) != 0xFFFF)
+               return FAILED ("#6");
+       if (g_unichar_toupper (0x10428) != 0x10400)
+               return FAILED ("#7");
+       return NULL;
+}
+
+/*
+ * g_unichar_tolower
+ */
+RESULT
+test_g_unichar_tolower ()
+{
+       if (g_unichar_tolower (0) != 0)
+               return FAILED ("#0");
+       if (g_unichar_tolower ('A') != 'a')
+               return FAILED ("#1");
+       if (g_unichar_tolower ('1') != '1')
+               return FAILED ("#2");
+       if (g_unichar_tolower (0x1C5) != 0x1C6)
+               return FAILED ("#3");
+       if (g_unichar_tolower (0x1F1) != 0x1F3)
+               return FAILED ("#4");
+       if (g_unichar_tolower (0x1F2) != 0x1F3)
+               return FAILED ("#5");
+       if (g_unichar_tolower (0xFFFF) != 0xFFFF)
+               return FAILED ("#6");
+       return NULL;
+}
+
+/*
+ * g_unichar_totitle
+ */
+RESULT
+test_g_unichar_totitle ()
+{
+       if (g_unichar_toupper (0) != 0)
+               return FAILED ("#0");
+       if (g_unichar_totitle ('a') != 'A')
+               return FAILED ("#1");
+       if (g_unichar_totitle ('1') != '1')
+               return FAILED ("#2");
+       if (g_unichar_totitle (0x1C4) != 0x1C5)
+               return FAILED ("#3");
+       if (g_unichar_totitle (0x1F2) != 0x1F2)
+               return FAILED ("#4");
+       if (g_unichar_totitle (0x1F3) != 0x1F2)
+               return FAILED ("#5");
+       if (g_unichar_toupper (0xFFFF) != 0xFFFF)
+               return FAILED ("#6");
+       return NULL;
+}
+
+static Test unicode_tests [] = {
+       {"g_unichar_type", test_g_unichar_type},
+       {"g_unichar_toupper", test_g_unichar_toupper},
+       {"g_unichar_tolower", test_g_unichar_tolower},
+       {"g_unichar_totitle", test_g_unichar_totitle},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(unicode_tests_init, unicode_tests)
diff --git a/mono/eglib/test/utf8.c b/mono/eglib/test/utf8.c
new file mode 100644 (file)
index 0000000..a924902
--- /dev/null
@@ -0,0 +1,935 @@
+#include <stdlib.h>
+
+#include "test.h"
+
+/*
+ * g_utf16_to_utf8
+ */
+
+glong
+compare_strings_utf8_pos (const gchar *expected, const gchar *actual, glong size)
+{
+       int i;
+       for (i = 0; i < size; i++)
+               if (expected [i] != actual [i])
+                       return i;
+       return -1;
+}
+
+RESULT
+compare_strings_utf8_RESULT (const gchar *expected, const gchar *actual, glong size)
+{
+       glong ret;
+
+       ret = compare_strings_utf8_pos (expected, actual, size);
+       if (ret < 0)
+               return OK;
+       return FAILED ("Incorrect output: expected '%s' but was '%s', differ at %d\n", expected, actual, ret);
+}
+
+void
+gchar_to_gunichar2 (gunichar2 ret[], const gchar *src)
+{
+       int i;
+
+       for (i = 0; src [i]; i++)
+               ret [i] = src [i];
+       ret [i] = 0;
+}
+
+RESULT
+compare_utf16_to_utf8_explicit (const gchar *expected, const gunichar2 *utf16, glong len_in, glong len_out, glong size_spec)
+{
+       GError *error;
+       gchar* ret;
+       RESULT result;
+       glong in_read, out_read;
+
+       result = NULL;
+
+       error = NULL;
+       ret = g_utf16_to_utf8 (utf16, size_spec, &in_read, &out_read, &error);
+       if (error) {
+               result = FAILED ("The error is %d %s\n", (error)->code, (error)->message);
+               g_error_free (error);
+               if (ret)
+                       g_free (ret);
+               return result;
+       }
+       if (in_read != len_in)
+               result = FAILED ("Read size is incorrect: expected %d but was %d\n", len_in, in_read);
+       else if (out_read != len_out)
+               result = FAILED ("Converted size is incorrect: expected %d but was %d\n", len_out, out_read);
+       else
+               result = compare_strings_utf8_RESULT (expected, ret, len_out);
+
+       g_free (ret);
+       if (result)
+               return result;
+
+       return OK;
+}
+
+RESULT
+compare_utf16_to_utf8 (const gchar *expected, const gunichar2 *utf16, glong len_in, glong len_out)
+{
+       RESULT result;
+
+       result = compare_utf16_to_utf8_explicit (expected, utf16, len_in, len_out, -1);
+       if (result != OK)
+               return result;
+       return compare_utf16_to_utf8_explicit (expected, utf16, len_in, len_out, len_in);
+}
+
+RESULT
+test_utf16_to_utf8 ()
+{
+       const gchar *src0 = "", *src1 = "ABCDE", *src2 = "\xE5\xB9\xB4\x27", *src3 = "\xEF\xBC\xA1", *src4 = "\xEF\xBD\x81", *src5 = "\xF0\x90\x90\x80";
+       gunichar2 str0 [] = {0}, str1 [6], str2 [] = {0x5E74, 39, 0}, str3 [] = {0xFF21, 0}, str4 [] = {0xFF41, 0}, str5 [] = {0xD801, 0xDC00, 0};
+       RESULT result;
+
+       gchar_to_gunichar2 (str1, src1);
+
+       /* empty string */
+       result = compare_utf16_to_utf8 (src0, str0, 0, 0);
+       if (result != OK)
+               return result;
+
+       result = compare_utf16_to_utf8 (src1, str1, 5, 5);
+       if (result != OK)
+               return result;
+       result = compare_utf16_to_utf8 (src2, str2, 2, 4);
+       if (result != OK)
+               return result;
+       result = compare_utf16_to_utf8 (src3, str3, 1, 3);
+       if (result != OK)
+               return result;
+       result = compare_utf16_to_utf8 (src4, str4, 1, 3);
+       if (result != OK)
+               return result;
+       result = compare_utf16_to_utf8 (src5, str5, 2, 4);
+       if (result != OK)
+               return result;
+
+       return OK;
+}
+
+/*
+ * g_utf8_to_utf16 
+ */
+
+glong
+compare_strings_utf16_pos (const gunichar2 *expected, const gunichar2 *actual, glong size)
+{
+       int i;
+       for (i = 0; i < size; i++)
+               if (expected [i] != actual [i])
+                       return i;
+       return -1;
+}
+
+RESULT
+compare_strings_utf16_RESULT (const gunichar2 *expected, const gunichar2 *actual, glong size)
+{
+       glong ret;
+
+       ret = compare_strings_utf16_pos (expected, actual, size);
+       if (ret < 0)
+               return OK;
+       return FAILED ("Incorrect output: expected '%s' but was '%s', differ at %d ('%c' x '%c')\n", expected, actual, ret, expected [ret], actual [ret]);
+}
+
+#if !defined(EGLIB_TESTS)
+#define eg_utf8_to_utf16_with_nuls g_utf8_to_utf16
+#endif
+
+RESULT
+compare_utf8_to_utf16_explicit (const gunichar2 *expected, const gchar *utf8, glong len_in, glong len_out, glong size_spec, gboolean include_nuls)
+{
+       GError *error;
+       gunichar2* ret;
+       RESULT result;
+       glong in_read, out_read;
+
+       result = NULL;
+
+       error = NULL;
+       if (include_nuls)
+               ret = eg_utf8_to_utf16_with_nuls (utf8, size_spec, &in_read, &out_read, &error);
+       else
+               ret = g_utf8_to_utf16 (utf8, size_spec, &in_read, &out_read, &error);
+
+       if (error) {
+               result = FAILED ("The error is %d %s\n", (error)->code, (error)->message);
+               g_error_free (error);
+               if (ret)
+                       g_free (ret);
+               return result;
+       }
+       if (in_read != len_in)
+               result = FAILED ("Read size is incorrect: expected %d but was %d\n", len_in, in_read);
+       else if (out_read != len_out)
+               result = FAILED ("Converted size is incorrect: expected %d but was %d\n", len_out, out_read);
+       else
+               result = compare_strings_utf16_RESULT (expected, ret, len_out);
+
+       g_free (ret);
+       if (result)
+               return result;
+
+       return OK;
+}
+
+RESULT
+compare_utf8_to_utf16_general (const gunichar2 *expected, const gchar *utf8, glong len_in, glong len_out, gboolean include_nuls)
+{
+       RESULT result;
+
+       result = compare_utf8_to_utf16_explicit (expected, utf8, len_in, len_out, -1, include_nuls);
+       if (result != OK)
+               return result;
+       return compare_utf8_to_utf16_explicit (expected, utf8, len_in, len_out, len_in, include_nuls);
+}
+
+RESULT
+compare_utf8_to_utf16 (const gunichar2 *expected, const gchar *utf8, glong len_in, glong len_out)
+{
+       return compare_utf8_to_utf16_general (expected, utf8, len_in, len_out, FALSE);
+}
+
+RESULT
+compare_utf8_to_utf16_with_nuls (const gunichar2 *expected, const gchar *utf8, glong len_in, glong len_out)
+{
+       return compare_utf8_to_utf16_explicit (expected, utf8, len_in, len_out, len_in, TRUE);
+}
+
+
+RESULT
+test_utf8_seq ()
+{
+       const gchar *src = "\xE5\xB9\xB4\x27";
+       glong in_read, out_read;
+       //gunichar2 expected [6];
+       GError *error = NULL;
+       gunichar2 *dst;
+
+       //printf ("got: %s\n", src);
+       dst = g_utf8_to_utf16 (src, (glong)strlen (src), &in_read, &out_read, &error);
+       if (error != NULL){
+               return error->message;
+       }
+
+       if (in_read != 4) {
+               return FAILED ("in_read is expected to be 4 but was %d\n", in_read);
+       }
+       if (out_read != 2) {
+               return FAILED ("out_read is expected to be 2 but was %d\n", out_read);
+       }
+       g_free (dst);
+
+       return OK;
+}
+
+RESULT
+test_utf8_to_utf16 ()
+{
+       const gchar *src0 = "", *src1 = "ABCDE", *src2 = "\xE5\xB9\xB4\x27", *src3 = "\xEF\xBC\xA1", *src4 = "\xEF\xBD\x81";
+       gunichar2 str0 [] = {0}, str1 [6], str2 [] = {0x5E74, 39, 0}, str3 [] = {0xFF21, 0}, str4 [] = {0xFF41, 0};
+       RESULT result;
+
+       gchar_to_gunichar2 (str1, src1);
+
+       /* empty string */
+       result = compare_utf8_to_utf16 (str0, src0, 0, 0);
+       if (result != OK)
+               return result;
+
+       result = compare_utf8_to_utf16 (str1, src1, 5, 5);
+       if (result != OK)
+               return result;
+       result = compare_utf8_to_utf16 (str2, src2, 4, 2);
+       if (result != OK)
+               return result;
+       result = compare_utf8_to_utf16 (str3, src3, 3, 1);
+       if (result != OK)
+               return result;
+       result = compare_utf8_to_utf16 (str4, src4, 3, 1);
+       if (result != OK)
+               return result;
+
+       return OK;
+}
+
+RESULT
+test_utf8_to_utf16_with_nuls ()
+{
+       const gchar *src0 = "", *src1 = "AB\0DE", *src2 = "\xE5\xB9\xB4\x27", *src3 = "\xEF\xBC\xA1", *src4 = "\xEF\xBD\x81";
+       gunichar2 str0 [] = {0}, str1 [] = {'A', 'B', 0, 'D', 'E', 0}, str2 [] = {0x5E74, 39, 0}, str3 [] = {0xFF21, 0}, str4 [] = {0xFF41, 0};
+       RESULT result;
+
+#if !defined(EGLIB_TESTS)
+       return OK;
+#endif
+
+       /* implicit length is forbidden */
+               if (eg_utf8_to_utf16_with_nuls (src1, -1, NULL, NULL, NULL) != NULL)
+               return FAILED ("explicit nulls must fail with -1 length\n");
+
+       /* empty string */
+       result = compare_utf8_to_utf16_with_nuls (str0, src0, 0, 0);
+       if (result != OK)
+               return result;
+
+       result = compare_utf8_to_utf16_with_nuls  (str1, src1, 5, 5);
+       if (result != OK)
+               return result;
+       result = compare_utf8_to_utf16_with_nuls  (str2, src2, 4, 2);
+       if (result != OK)
+               return result;
+       result = compare_utf8_to_utf16_with_nuls  (str3, src3, 3, 1);
+       if (result != OK)
+               return result;
+       result = compare_utf8_to_utf16_with_nuls  (str4, src4, 3, 1);
+       if (result != OK)
+               return result;
+
+       return OK;
+}
+
+typedef struct {
+       char *content;
+       size_t length;
+} convert_result_t;
+
+RESULT
+test_convert ()
+{
+       static const char *charsets[] = { "UTF-8", "UTF-16LE", "UTF-16BE", "UTF-32LE", "UTF-32BE" };
+       gsize length, converted_length, n;
+       char *content, *converted, *path;
+       convert_result_t **expected;
+       GError *err = NULL;
+       const char *srcdir;
+       gboolean loaded;
+       guint i, j, k;
+       char c;
+       
+       if (!(srcdir = getenv ("srcdir")) && !(srcdir = getenv ("PWD")))
+               return FAILED ("srcdir not defined!");
+       
+       expected = g_malloc (sizeof (convert_result_t *) * G_N_ELEMENTS (charsets));
+       
+       /* first load all our test samples... */
+       for (i = 0; i < G_N_ELEMENTS (charsets); i++) {
+               path = g_strdup_printf ("%s%c%s.txt", srcdir, G_DIR_SEPARATOR, charsets[i]);
+               loaded = g_file_get_contents (path, &content, &length, &err);
+               g_free (path);
+               
+               if (!loaded) {
+                       for (j = 0; j < i; j++) {
+                               g_free (expected[j]->content);
+                               g_free (expected[j]);
+                       }
+                       
+                       g_free (expected);
+                       
+                       return FAILED ("Failed to load content for %s: %s", charsets[i], err->message);
+               }
+               
+               expected[i] = g_malloc (sizeof (convert_result_t));
+               expected[i]->content = content;
+               expected[i]->length = length;
+       }
+       
+       /* test conversion from every charset to every other charset */
+       for (i = 0; i < G_N_ELEMENTS (charsets); i++) {
+               for (j = 0; j < G_N_ELEMENTS (charsets); j++) {
+                       converted = g_convert (expected[i]->content, expected[i]->length, charsets[j],
+                                              charsets[i], NULL, &converted_length, NULL);
+                       
+                       if (converted == NULL) {
+                               for (k = 0; k < G_N_ELEMENTS (charsets); k++) {
+                                       g_free (expected[k]->content);
+                                       g_free (expected[k]);
+                               }
+                               
+                               g_free (expected);
+                               
+                               return FAILED ("Failed to convert from %s to %s: NULL", charsets[i], charsets[j]);
+                       }
+                       
+                       if (converted_length != expected[j]->length) {
+                               length = expected[j]->length;
+                               
+                               for (k = 0; k < G_N_ELEMENTS (charsets); k++) {
+                                       g_free (expected[k]->content);
+                                       g_free (expected[k]);
+                               }
+                               
+                               g_free (converted);
+                               g_free (expected);
+                               
+                               return FAILED ("Failed to convert from %s to %s: expected %u bytes, got %u",
+                                              charsets[i], charsets[j], length, converted_length);
+                       }
+                       
+                       for (n = 0; n < converted_length; n++) {
+                               if (converted[n] != expected[j]->content[n]) {
+                                       c = expected[j]->content[n];
+                                       
+                                       for (k = 0; k < G_N_ELEMENTS (charsets); k++) {
+                                               g_free (expected[k]->content);
+                                               g_free (expected[k]);
+                                       }
+                                       
+                                       g_free (converted);
+                                       g_free (expected);
+                                       
+                                       return FAILED ("Failed to convert from %s to %s: expected 0x%x at offset %u, got 0x%x",
+                                                      charsets[i], charsets[j], c, n, converted[n]);
+                               }
+                       }
+                       
+                       g_free (converted);
+               }
+       }
+       
+       for (k = 0; k < G_N_ELEMENTS (charsets); k++) {
+               g_free (expected[k]->content);
+               g_free (expected[k]);
+       }
+       
+       g_free (expected);
+       
+       return OK;
+}
+
+
+RESULT
+test_xdigit ()
+{
+       static char test_chars[] = {
+               '0', '1', '2', '3', '4', 
+               '5', '6', '7', '8', '9', 
+               'a', 'b', 'c', 'd', 'e', 'f', 'g',
+               'A', 'B', 'C', 'D', 'E', 'F', 'G'};
+       static gint32 test_values[] = {
+               0, 1, 2, 3, 4, 
+               5, 6, 7, 8, 9, 
+               10, 11, 12, 13, 14, 15, -1,
+               10, 11, 12, 13, 14, 15, -1};
+
+               int i =0;
+
+               for (i = 0; i < sizeof(test_chars); i++)
+                       if (g_unichar_xdigit_value ((gunichar)test_chars[i]) != test_values[i])
+                               return FAILED("Incorrect value %d at index %d", test_values[i], i);
+
+               return OK;
+}
+
+static RESULT
+ucs4_to_utf16_check_result (const gunichar2 *result_str, const gunichar2 *expected_str,
+                           glong result_items_read, glong expected_items_read,
+                           glong result_items_written, glong expected_items_written,
+                           GError* result_error, gboolean expect_error)
+{
+       glong i;
+       if (result_items_read != expected_items_read)
+               return FAILED("Incorrect number of items read; expected %d, got %d", expected_items_read, result_items_read);
+       if (result_items_written != expected_items_written)
+               return FAILED("Incorrect number of items written; expected %d, got %d", expected_items_written, result_items_written);
+       if (result_error && !expect_error)
+               return FAILED("There should not be an error code.");
+       if (!result_error && expect_error)
+               return FAILED("Unexpected error object.");
+       if (expect_error && result_str)
+               return FAILED("NULL should be returned when an error occurs.");
+       if (!expect_error && !result_str)
+               return FAILED("When no error occurs NULL should not be returned.");
+       for (i=0; i<expected_items_written;i++) {
+               if (result_str [i] != expected_str [i])
+                       return FAILED("Incorrect value %d at index %d", result_str [i], i);
+       }
+       if (result_str && result_str[expected_items_written] != '\0') 
+               return FAILED("Null termination not found at the end of the string.");
+       
+       return OK;
+}
+
+RESULT
+test_ucs4_to_utf16 ()
+{
+       static gunichar str1[12] = {'H','e','l','l','o',' ','W','o','r','l','d','\0'};
+       static gunichar2 exp1[12] = {'H','e','l','l','o',' ','W','o','r','l','d','\0'};
+       static gunichar str2[3] = {'h',0x80000000,'\0'};
+       static gunichar2 exp2[2] = {'h','\0'};
+       static gunichar str3[3] = {'h',0xDA00,'\0'};
+       static gunichar str4[3] = {'h',0x10FFFF,'\0'};
+       static gunichar2 exp4[4] = {'h',0xdbff,0xdfff,'\0'};
+       static gunichar str5[7] = {0xD7FF,0xD800,0xDFFF,0xE000,0x110000,0x10FFFF,'\0'};
+       static gunichar2 exp5[5] = {0xD7FF,0xE000,0xdbff,0xdfff,'\0'};
+       static gunichar str6[2] = {0x10400, '\0'};
+       static gunichar2 exp6[3] = {0xD801, 0xDC00, '\0'};
+       static glong read_write[12] = {1,1,0,0,0,0,1,1,0,0,1,2};
+       gunichar2* res;
+       glong items_read, items_written, current_write_index;
+       GError* err=0;
+       RESULT check_result;
+       glong i;
+       
+       res = g_ucs4_to_utf16 (str1, 12, &items_read, &items_written, &err);
+       check_result = ucs4_to_utf16_check_result (res, exp1, items_read, 11, items_written, 11, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+
+       items_read = items_written = 0;
+       res = g_ucs4_to_utf16 (str2, 0, &items_read, &items_written, &err);
+       check_result = ucs4_to_utf16_check_result (res, exp2, items_read, 0, items_written, 0, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+
+       items_read = items_written = 0;
+       res = g_ucs4_to_utf16 (str2, 1, &items_read, &items_written, &err);
+       check_result = ucs4_to_utf16_check_result (res, exp2, items_read, 1, items_written, 1, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+
+       items_read = items_written = 0;
+       res = g_ucs4_to_utf16 (str2, 2, &items_read, &items_written, &err);
+       check_result = ucs4_to_utf16_check_result (res, 0, items_read, 1, items_written, 0, err, TRUE);
+       g_free (res);
+       if (check_result) return check_result;
+
+       items_read = items_written = 0;
+       err = 0;
+       res = g_ucs4_to_utf16 (str3, 2, &items_read, &items_written, &err);
+       check_result = ucs4_to_utf16_check_result (res, 0, items_read, 1, items_written, 0, err, TRUE);
+       if (check_result) return check_result;
+       g_free (res);
+
+       items_read = items_written = 0;
+       err = 0;
+       res = g_ucs4_to_utf16 (str4, 5, &items_read, &items_written, &err);
+       check_result = ucs4_to_utf16_check_result (res, exp4, items_read, 2, items_written, 3, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+
+       // This loop tests the bounds of the conversion algorithm
+       current_write_index = 0;
+       for (i=0;i<6;i++) {
+               items_read = items_written = 0;
+               err = 0;
+               res = g_ucs4_to_utf16 (&str5[i], 1, &items_read, &items_written, &err);
+               check_result = ucs4_to_utf16_check_result (res, &exp5[current_write_index], 
+                                       items_read, read_write[i*2], items_written, read_write[(i*2)+1], err, !read_write[(i*2)+1]);
+               if (check_result) return check_result;
+               g_free (res);
+               current_write_index += items_written;
+       }
+
+       items_read = items_written = 0;
+       err = 0;
+       res = g_ucs4_to_utf16 (str6, 1, &items_read, &items_written, &err);
+       check_result = ucs4_to_utf16_check_result (res, exp6, items_read, 1, items_written, 2, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+
+       return OK;
+}
+
+static RESULT
+utf16_to_ucs4_check_result (const gunichar *result_str, const gunichar *expected_str,
+                           glong result_items_read, glong expected_items_read,
+                           glong result_items_written, glong expected_items_written,
+                           GError* result_error, gboolean expect_error)
+{
+       glong i;
+       if (result_items_read != expected_items_read)
+               return FAILED("Incorrect number of items read; expected %d, got %d", expected_items_read, result_items_read);
+       if (result_items_written != expected_items_written)
+               return FAILED("Incorrect number of items written; expected %d, got %d", expected_items_written, result_items_written);
+       if (result_error && !expect_error)
+               return FAILED("There should not be an error code.");
+       if (!result_error && expect_error)
+               return FAILED("Unexpected error object.");
+       if (expect_error && result_str)
+               return FAILED("NULL should be returned when an error occurs.");
+       if (!expect_error && !result_str)
+               return FAILED("When no error occurs NULL should not be returned.");
+       for (i=0; i<expected_items_written;i++) {
+               if (result_str [i] != expected_str [i])
+                       return FAILED("Incorrect value %d at index %d", result_str [i], i);
+       }
+       if (result_str && result_str[expected_items_written] != '\0') 
+               return FAILED("Null termination not found at the end of the string.");
+       
+       return OK;
+}
+
+RESULT
+test_utf16_to_ucs4 ()
+{
+       static gunichar2 str1[12] = {'H','e','l','l','o',' ','W','o','r','l','d','\0'};
+       static gunichar exp1[12] = {'H','e','l','l','o',' ','W','o','r','l','d','\0'};
+       static gunichar2 str2[7] = {'H', 0xD800, 0xDC01,0xD800,0xDBFF,'l','\0'};
+       static gunichar exp2[3] = {'H',0x00010001,'\0'};
+       static gunichar2 str3[4] = {'H', 0xDC00 ,'l','\0'};
+       static gunichar exp3[2] = {'H','\0'};
+       static gunichar2 str4[20] = {0xDC00,0xDFFF,0xDFF,0xD800,0xDBFF,0xD800,0xDC00,0xD800,0xDFFF,
+                                    0xD800,0xE000,0xDBFF,0xDBFF,0xDBFF,0xDC00,0xDBFF,0xDFFF,0xDBFF,0xE000,'\0'};
+       static gunichar exp4[6] = {0xDFF,0x10000,0x103ff,0x10fc00,0x10FFFF,'\0'};
+       static gunichar2 str5[3] = {0xD801, 0xDC00, 0};
+       static gunichar exp5[2] = {0x10400, 0};
+       static glong read_write[33] = {1,0,0,1,0,0,1,1,1,2,1,0,2,2,1,2,2,1,2,1,0,2,1,0,2,2,1,2,2,1,2,1,0};
+       gunichar* res;
+       glong items_read, items_written, current_read_index,current_write_index;
+       GError* err=0;
+       RESULT check_result;
+       glong i;
+       
+       res = g_utf16_to_ucs4 (str1, 12, &items_read, &items_written, &err);
+       check_result = utf16_to_ucs4_check_result (res, exp1, items_read, 11, items_written, 11, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+       
+       items_read = items_written = 0;
+       res = g_utf16_to_ucs4 (str2, 0, &items_read, &items_written, &err);
+       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 0, items_written, 0, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+       
+       items_read = items_written = 0;
+       res = g_utf16_to_ucs4 (str2, 1, &items_read, &items_written, &err);
+       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 1, items_written, 1, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+       
+       items_read = items_written = 0;
+       res = g_utf16_to_ucs4 (str2, 2, &items_read, &items_written, &err);
+       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 1, items_written, 1, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+       
+       items_read = items_written = 0;
+       res = g_utf16_to_ucs4 (str2, 3, &items_read, &items_written, &err);
+       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 3, items_written, 2, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+       
+       items_read = items_written = 0;
+       res = g_utf16_to_ucs4 (str2, 4, &items_read, &items_written, &err);
+       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 3, items_written, 2, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+       
+       items_read = items_written = 0;
+       res = g_utf16_to_ucs4 (str2, 5, &items_read, &items_written, &err);
+       check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 4, items_written, 0, err, TRUE);
+       if (check_result) return check_result;
+       g_free (res);
+       
+       items_read = items_written = 0;
+       err = 0;
+       res = g_utf16_to_ucs4 (str3, 5, &items_read, &items_written, &err);
+       check_result = utf16_to_ucs4_check_result (res, exp3, items_read, 1, items_written, 0, err, TRUE);
+       if (check_result) return check_result;
+       g_free (res);
+       
+       // This loop tests the bounds of the conversion algorithm
+       current_read_index = current_write_index = 0;
+       for (i=0;i<11;i++) {
+               items_read = items_written = 0;
+               err = 0;
+               res = g_utf16_to_ucs4 (&str4[current_read_index], read_write[i*3], &items_read, &items_written, &err);
+               check_result = utf16_to_ucs4_check_result (res, &exp4[current_write_index], items_read, 
+                                            read_write[(i*3)+1], items_written, read_write[(i*3)+2], err, 
+                                            !read_write[(i*3)+2]);
+               if (check_result) return check_result;
+               g_free (res);
+               current_read_index += read_write[i*3];
+               current_write_index += items_written;
+       }
+
+       items_read = items_written = 0;
+       err = 0;
+       res = g_utf16_to_ucs4 (str5, 2, &items_read, &items_written, &err);
+       check_result = utf16_to_ucs4_check_result (res, exp5, items_read, 2, items_written, 1, err, FALSE);
+       if (check_result) return check_result;
+       g_free (res);
+
+       return OK;
+}
+RESULT
+test_utf8_strlen ()
+{
+       gchar word1 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'};//Valid, len = 5
+       gchar word2 [] = {0xF1, 0x82, 0x82, 0x82,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'};//Valid, len = 5
+       gchar word3 [] = {'h','e',0xC2, 0x82,0x45,'\0'};                                                                                //Valid, len = 4
+       gchar word4 [] = {0x62,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'};                                     //Valid, len = 5
+       
+       glong len = 0;
+       
+       //Test word1
+       len = g_utf8_strlen (word1,-1);
+       if (len != 5)
+               return FAILED ("Word1 expected length of 5, but was %i", len);
+       //Do tests with different values for max parameter.
+       len = g_utf8_strlen (word1,1);
+       if (len != 0)
+               return FAILED ("Word1, max = 1, expected length of 0, but was %i", len);
+       len = g_utf8_strlen (word1,2);
+       if (len != 1)
+               return FAILED ("Word1, max = 1, expected length of 1, but was %i", len);
+       len = g_utf8_strlen (word1,3);
+       if (len != 2)
+               return FAILED ("Word1, max = 2, expected length of 2, but was %i", len);
+               
+       //Test word2
+       len = g_utf8_strlen (word2,-1);
+       if (len != 5)
+               return FAILED ("Word2 expected length of 5, but was %i", len);
+               
+       //Test word3
+       len = g_utf8_strlen (word3,-1);
+       if (len != 4)
+               return FAILED ("Word3 expected length of 4, but was %i", len);
+               
+       //Test word4
+       len = g_utf8_strlen (word4,-1);
+       if (len != 5)
+               return FAILED ("Word4 expected length of 5, but was %i", len);
+               
+       //Test null case
+       len = g_utf8_strlen(NULL,0);
+       if (len != 0)
+               return FAILED ("Expected passing null to result in a length of 0");
+       return OK;
+}
+
+RESULT
+test_utf8_get_char()
+{
+       gchar word1 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'}; //Valid, len = 5
+
+       gunichar value = g_utf8_get_char (&word1 [0]);
+       if (value != 0x82UL)
+               return FAILED ("Expected value of 0x82, but was %x", value);
+       value = g_utf8_get_char (&word1 [2]);
+       if (value != 0x45UL)
+               return FAILED ("Expected value of 0x45, but was %x", value);
+       value = g_utf8_get_char (&word1 [3]);
+       if (value != 0x1043UL)
+               return FAILED ("Expected value of 0x1043, but was %x", value);
+       value = g_utf8_get_char (&word1 [6]);
+       if (value != 0x58UL)
+               return FAILED ("Expected value of 0x58, but was %x", value);
+       value = g_utf8_get_char (&word1 [7]);
+       if (value != 0x42082UL)
+               return FAILED ("Expected value of 0x42082, but was %x", value);
+
+       return OK;
+}
+
+RESULT
+test_utf8_next_char()
+{
+       gchar word1 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'}; //Valid, len = 5
+       gchar word2 [] = {0xF1, 0x82, 0x82, 0x82,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'}; //Valid, len = 5
+       gchar word1ExpectedValues [] = {0xC2, 0x45,0xE1, 0x58, 0xF1};
+       gchar word2ExpectedValues [] = {0xF1, 0xC2, 0x45, 0xE1, 0x58};
+       
+       gchar* ptr = word1;
+       gint count = 0;
+       //Test word1
+       while (*ptr != 0) {
+               if (count > 4)
+                       return FAILED ("Word1 has gone past its expected length");
+               if (*ptr != word1ExpectedValues[count])
+                       return FAILED ("Word1 has an incorrect next_char at index %i", count);
+               ptr = g_utf8_next_char (ptr);
+               count++;
+       }
+       
+       //Test word2
+       count = 0;
+       ptr = word2;
+       while (*ptr != 0) {
+               if (count > 4)
+                       return FAILED ("Word2 has gone past its expected length");
+               if (*ptr != word2ExpectedValues[count])
+                       return FAILED ("Word2 has an incorrect next_char at index %i", count);
+               ptr = g_utf8_next_char (ptr);
+               count++;
+       }
+       
+       return OK;
+}
+
+RESULT
+test_utf8_validate()
+{
+       gchar invalidWord1 [] = {0xC3, 0x82, 0xC1,0x90,'\0'}; //Invalid, 1nd oct Can't be 0xC0 or 0xC1
+       gchar invalidWord2 [] = {0xC1, 0x89, 0x60, '\0'}; //Invalid, 1st oct can not be 0xC1
+       gchar invalidWord3 [] = {0xC2, 0x45,0xE1, 0x81, 0x83,0x58,'\0'}; //Invalid, oct after 0xC2 must be > 0x80
+
+       gchar validWord1 [] = {0xC2, 0x82, 0xC3,0xA0,'\0'}; //Valid
+       gchar validWord2 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'}; //Valid
+       
+       const gchar* end;
+       gboolean retVal = g_utf8_validate (invalidWord1, -1, &end);
+       if (retVal != FALSE)
+               return FAILED ("Expected invalidWord1 to be invalid");
+       if (end != &invalidWord1 [2])
+               return FAILED ("Expected end parameter to be pointing to invalidWord1[2]");
+
+       end = NULL;
+       retVal = g_utf8_validate (invalidWord2, -1, &end);
+       if (retVal != FALSE)
+               return FAILED ("Expected invalidWord2 to be invalid");
+       if (end != &invalidWord2 [0])
+               return FAILED ("Expected end parameter to be pointing to invalidWord2[0]");
+
+       end = NULL;
+       retVal = g_utf8_validate (invalidWord3, -1, &end);
+       if (retVal != FALSE)
+               return FAILED ("Expected invalidWord3 to be invalid");
+       if (end != &invalidWord3 [0])
+               return FAILED ("Expected end parameter to be pointing to invalidWord3[1]");
+
+       end = NULL;
+       retVal = g_utf8_validate (validWord1, -1, &end);
+       if (retVal != TRUE)
+               return FAILED ("Expected validWord1 to be valid");
+       if (end != &validWord1 [4])
+               return FAILED ("Expected end parameter to be pointing to validWord1[4]");
+
+       end = NULL;
+       retVal = g_utf8_validate (validWord2, -1, &end);
+       if (retVal != TRUE)
+               return FAILED ("Expected validWord2 to be valid");
+       if (end != &validWord2 [11])
+               return FAILED ("Expected end parameter to be pointing to validWord2[11]");
+       return OK;
+}
+
+glong
+utf8_byteslen (const gchar *src)
+{
+       int i = 0;
+       do {
+               if (src [i] == '\0')
+                       return i;
+               i++;
+       } while (TRUE);
+}
+
+RESULT
+test_utf8_strcase_each (const gchar *src, const gchar *expected, gboolean strup)
+{
+       gchar *tmp;
+       glong len, len2;
+       RESULT r;
+
+       len = utf8_byteslen (src);
+       tmp = strup ? g_utf8_strup (src, len) : g_utf8_strdown (src, len);
+       len2 = utf8_byteslen (tmp);
+       r = compare_strings_utf8_RESULT (expected, tmp, len < len2 ? len2 : len);
+       g_free (tmp);
+       return r;
+}
+
+RESULT
+test_utf8_strup_each (const gchar *src, const gchar *expected)
+{
+       return test_utf8_strcase_each (src, expected, TRUE);
+}
+
+RESULT
+test_utf8_strdown_each (const gchar *src, const gchar *expected)
+{
+       return test_utf8_strcase_each (src, expected, FALSE);
+}
+
+/*
+ * g_utf8_strup
+ */
+RESULT
+test_utf8_strup ()
+{
+       RESULT r;
+
+       if ((r = test_utf8_strup_each ("aBc", "ABC")) != OK)
+               return r;
+       if ((r = test_utf8_strup_each ("x86-64", "X86-64")) != OK)
+               return r;
+       // U+3B1 U+392 -> U+391 U+392
+       if ((r = test_utf8_strup_each ("\xCE\xB1\xCE\x92", "\xCE\x91\xCE\x92")) != OK)
+               return r;
+       // U+FF21 -> U+FF21
+       if ((r = test_utf8_strup_each ("\xEF\xBC\xA1", "\xEF\xBC\xA1")) != OK)
+               return r;
+       // U+FF41 -> U+FF21
+       if ((r = test_utf8_strup_each ("\xEF\xBD\x81", "\xEF\xBC\xA1")) != OK)
+               return r;
+       // U+10428 -> U+10400
+       if ((r = test_utf8_strup_each ("\xF0\x90\x90\xA8", "\xF0\x90\x90\x80")) != OK)
+               return r;
+
+       return OK;
+}
+
+/*
+ * g_utf8_strdown
+ */
+RESULT
+test_utf8_strdown ()
+{
+       RESULT r;
+
+       if ((r = test_utf8_strdown_each ("aBc", "abc")) != OK)
+               return r;
+       if ((r = test_utf8_strdown_each ("X86-64", "x86-64")) != OK)
+               return r;
+       // U+391 U+3B2 -> U+3B1 U+3B2
+       if ((r = test_utf8_strdown_each ("\xCE\x91\xCE\xB2", "\xCE\xB1\xCE\xB2")) != OK)
+               return r;
+/*
+       // U+FF41 -> U+FF41
+       if ((r = test_utf8_strdown_each ("\xEF\xBC\x81", "\xEF\xBC\x81")) != OK)
+               return r;
+       // U+FF21 -> U+FF41
+       if ((r = test_utf8_strdown_each ("\xEF\xBC\xA1", "\xEF\xBD\x81")) != OK)
+               return r;
+       // U+10400 -> U+10428
+       if ((r = test_utf8_strdown_each ("\xF0\x90\x90\x80", "\xF0\x90\x90\xA8")) != OK)
+               return r;
+*/
+       return OK;
+}
+
+/*
+ * test initialization
+ */
+
+static Test utf8_tests [] = {
+       {"g_utf16_to_utf8", test_utf16_to_utf8},
+       {"g_utf8_to_utf16", test_utf8_to_utf16},
+       {"g_utf8_to_utf16_with_nuls", test_utf8_to_utf16_with_nuls},
+       {"g_utf8_seq", test_utf8_seq},
+       {"g_convert", test_convert },
+       {"g_unichar_xdigit_value", test_xdigit },
+       {"g_ucs4_to_utf16", test_ucs4_to_utf16 },
+       {"g_utf16_to_ucs4", test_utf16_to_ucs4 },
+       {"g_utf8_strlen", test_utf8_strlen },
+       {"g_utf8_get_char", test_utf8_get_char },
+       {"g_utf8_next_char", test_utf8_next_char },
+       {"g_utf8_validate", test_utf8_validate },
+       {"g_utf8_strup", test_utf8_strup},
+       {"g_utf8_strdown", test_utf8_strdown},
+       {NULL, NULL}
+};
+
+DEFINE_TEST_GROUP_INIT(utf8_tests_init, utf8_tests)
+
+
diff --git a/mono/eglib/test/whats-implemented b/mono/eglib/test/whats-implemented
new file mode 100755 (executable)
index 0000000..8a11357
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# Author: Aaron Bockover
+# Licensed under MIT/X11
+# (C) 2006 Novell
+
+if [ "x$1" = "x--help" ]; then
+       echo "Usage: $0 [--show-only-mono]"
+       echo ""
+       echo "This script prints a sorted list of GLib functions used in Mono"
+       echo "that have not yet been implemented in EGlib."
+       echo ""
+       echo "If --show-only-mono is passed, then the script will print all"
+       echo "GLib functions used in Mono, whether or not they have been"
+       echo "implemented in EGlib yet."
+       echo ""
+       echo "This script relies on the MONO_CHECKOUT environment variable."
+       echo "MONO_CHECKOUT should be set to the location of a mono checkout."
+       echo ""
+       exit 1
+fi
+
+IGNORE_FUNCTIONS="g_hash_table_lookup_node g_hash_table_foreach_remove_or_steal  g_hash_table_resize"
+
+if [ -z $MONO_CHECKOUT ]; then
+       if [ -e ../../mono.pc.in ]; then
+               MONO_CHECKOUT=../..
+       else
+               MONO_CHECKOUT=~/cvs/mono/mono
+       fi
+fi
+
+if [ ! -d $MONO_CHECKOUT ]; then 
+       echo "Cannot find mono checkout; set MONO_CHECKOUT"
+       exit 1
+fi
+
+MONO_CHECKOUT="$MONO_CHECKOUT/mono"
+RESULTS_FILE=.results
+
+(for i in `find $MONO_CHECKOUT -iregex \.*.c$`; do 
+       grep -oP "[ \t\(\)]+g_[a-z_]+[ ]{0,1}\([A-Za-z_\&\*\,\(\) ]+\)" $i | 
+               awk 'BEGIN { FS="(" } { print $1 }' |
+               sed -e 's/[^A-Za-z_]//g' 
+       done
+) > $RESULTS_FILE
+
+if [ ! "x$1" = "x--show-only-mono" ]; then
+       IMPLEMENTED_FUNCTIONS=`grep -oP "g_[a-z_]+[ ]{0,1}" ../src/glib.h | awk 'BEGIN { FS="(" } { print $1 }'`
+
+       rm -f $RESULTS_FILE.tmp
+
+       for mono_function in `cat $RESULTS_FILE`; do
+               matched="no"
+               for implemented_function in $IMPLEMENTED_FUNCTIONS; do
+                       if [ "x$mono_function" = "x$implemented_function" ]; then
+                               matched="yes"
+                               break
+                       fi
+               done
+
+               for ignore_function in $IGNORE_FUNCTIONS; do
+                       if [ "x$ignore_function" = "x$mono_function" ]; then
+                               matched="yes"
+                               break
+                       fi
+               done
+
+               if [ "x$matched" = "xno" ]; then
+                       echo $mono_function >> $RESULTS_FILE.tmp
+               fi
+       done
+
+       mv $RESULTS_FILE.tmp $RESULTS_FILE
+fi
+
+(for i in `cat $RESULTS_FILE | sort -u`; do 
+               echo "`grep -c $i $RESULTS_FILE` $i"; 
+       done;
+) | sort -nr
+
+rm $RESULTS_FILE
+
diff --git a/mono/eglib/unicode-data.h b/mono/eglib/unicode-data.h
new file mode 100644 (file)
index 0000000..1cd75f3
--- /dev/null
@@ -0,0 +1,2152 @@
+/*
+This file is automatically generated by ucd.exe.
+The source for this generator should be in Mono repository
+(mcs/class/corlib/Mono.Globalization.Unicode directory).
+*/
+
+#ifndef __UNICODE_DATA_H
+#define __UNICODE_DATA_H
+
+#include <glib.h>
+
+
+/* ======== Structures ======== */
+typedef struct {
+       guint32 codepoint;
+       guint32 upper;
+       guint32 title;
+} SimpleTitlecaseMapping;
+typedef struct {
+       guint32 start;
+       guint32 end;
+} CodePointRange;
+typedef struct {
+       guint32 upper;
+       guint32 lower;
+} SimpleCaseMapping;
+
+/* ======== Unicode Categories ======== */
+static const guint8 unicode_category_ranges_count = 11;
+static const CodePointRange unicode_category_ranges [] = {
+{0x000000, 0x003400},
+{0x004DC0, 0x004E00},
+{0x00A000, 0x00AA80},
+{0x00F900, 0x010000},
+{0x010000, 0x0104C0},
+{0x010800, 0x010A80},
+{0x012000, 0x012480},
+{0x01D000, 0x01D800},
+{0x01F000, 0x01F0C0},
+{0x02F800, 0x02FA40},
+{0x0E0000, 0x0E0200},
+{0, 0}};
+static const guint8 unicode_category_table0 [] = {
+       /* ==== 0-3400 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       29,21,21,21,23,21,21,21,22,18,21,25,21,17,21,21,
+       13,13,13,13,13,13,13,13,13,13,21,21,25,25,25,21,
+       21,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,22,21,18,24,16,
+       24,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,22,25,18,25,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       29,21,23,23,23,23,26,26,24,26,5,20,25,1,26,24,
+       26,25,15,15,24,5,26,21,24,15,5,19,15,15,15,21,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,25,9,9,9,9,9,9,9,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,25,5,5,5,5,5,5,5,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,5,9,5,9,5,9,5,9,
+       5,9,5,9,5,9,5,9,5,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,9,5,9,5,9,5,5,
+       5,9,9,5,9,5,9,9,5,9,9,9,5,5,9,9,
+       9,9,5,9,9,5,9,9,9,5,5,5,9,9,5,9,
+       9,5,9,5,9,5,9,9,5,9,5,5,9,5,9,9,
+       5,9,9,9,5,9,5,9,9,5,5,7,9,5,5,5,
+       7,7,7,7,9,8,5,9,8,5,9,8,5,9,5,9,
+       5,9,5,9,5,9,5,9,5,9,5,9,5,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       5,9,8,5,9,5,9,9,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,5,5,5,5,5,5,9,9,5,9,9,5,
+       5,9,5,9,9,9,9,5,9,5,9,5,9,5,9,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,7,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+       6,6,24,24,24,24,6,6,6,6,6,6,6,6,6,6,
+       6,6,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
+       6,6,6,6,6,24,24,24,24,24,24,24,6,24,6,24,
+       24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       9,5,9,5,6,24,9,5,0,0,6,5,5,5,21,0,
+       0,0,0,0,24,24,9,21,9,9,9,0,9,0,9,9,
+       5,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,0,9,9,9,9,9,9,9,9,9,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,9,
+       5,5,9,9,9,5,5,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       5,5,5,5,9,5,25,9,5,9,9,5,5,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,26,12,12,12,12,12,11,11,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,9,5,9,5,9,5,9,5,9,5,9,5,9,5,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,0,0,6,21,21,21,21,21,21,
+       0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,0,21,17,0,0,0,0,0,
+       0,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,17,12,
+       21,12,12,21,12,12,21,12,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,
+       7,7,7,21,21,0,0,0,0,0,0,0,0,0,0,0,
+       1,1,1,1,0,0,25,25,25,21,21,23,21,21,26,26,
+       12,12,12,12,12,12,12,12,12,12,12,21,0,0,21,21,
+       0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       6,7,7,7,7,7,7,7,7,7,7,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,0,
+       13,13,13,13,13,13,13,13,13,13,21,21,21,21,7,7,
+       12,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,21,7,12,12,12,12,12,12,12,1,11,12,
+       12,12,12,12,12,6,6,12,12,26,12,12,12,12,7,7,
+       13,13,13,13,13,13,13,13,13,13,7,7,7,26,26,7,
+       21,21,21,21,21,21,21,21,21,21,21,21,21,21,0,1,
+       7,12,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,0,0,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,12,12,12,12,12,12,12,12,12,12,
+       12,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       13,13,13,13,13,13,13,13,13,13,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,12,12,12,12,12,
+       12,12,12,12,6,6,26,21,21,21,6,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,12,12,10,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,0,0,12,7,10,10,
+       10,12,12,12,12,12,12,12,12,10,10,10,10,12,0,0,
+       7,12,12,12,12,0,0,0,7,7,7,7,7,7,7,7,
+       7,7,12,12,21,21,13,13,13,13,13,13,13,13,13,13,
+       21,6,7,0,0,0,0,0,0,0,0,7,7,7,7,7,
+       0,12,10,10,0,7,7,7,7,7,7,7,7,0,0,7,
+       7,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
+       7,0,7,0,0,0,7,7,7,7,0,0,12,7,10,10,
+       10,12,12,12,12,0,0,10,10,0,0,10,10,12,7,0,
+       0,0,0,0,0,0,0,10,0,0,0,0,7,7,0,7,
+       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
+       7,7,23,23,15,15,15,15,15,15,26,0,0,0,0,0,
+       0,12,12,10,0,7,7,7,7,7,7,0,0,0,0,7,
+       7,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
+       7,0,7,7,0,7,7,0,7,7,0,0,12,0,10,10,
+       10,12,12,0,0,0,0,12,12,0,0,12,12,12,0,0,
+       0,12,0,0,0,0,0,0,0,7,7,7,7,0,7,0,
+       0,0,0,0,0,0,13,13,13,13,13,13,13,13,13,13,
+       12,12,7,7,7,12,0,0,0,0,0,0,0,0,0,0,
+       0,12,12,10,0,7,7,7,7,7,7,7,7,7,0,7,
+       7,7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
+       7,0,7,7,0,7,7,7,7,7,0,0,12,7,10,10,
+       10,12,12,12,12,12,0,12,12,10,0,10,10,12,0,0,
+       7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
+       0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,12,10,10,0,7,7,7,7,7,7,7,7,0,0,7,
+       7,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
+       7,0,7,7,0,7,7,7,7,7,0,0,12,7,10,12,
+       10,12,12,12,12,0,0,10,10,0,0,10,10,12,0,0,
+       0,0,0,0,0,0,12,10,0,0,0,0,7,7,0,7,
+       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
+       26,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,12,7,0,7,7,7,7,7,7,0,0,0,7,7,
+       7,0,7,7,7,7,0,0,0,7,7,0,7,0,7,7,
+       0,0,0,7,7,0,0,0,7,7,7,0,0,0,7,7,
+       7,7,7,7,7,7,7,7,7,7,0,0,0,0,10,10,
+       12,10,10,0,0,0,10,10,10,0,10,10,10,12,0,0,
+       7,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,13,13,13,13,13,13,13,13,13,13,
+       15,15,15,26,26,26,26,26,26,23,26,0,0,0,0,0,
+       0,10,10,10,0,7,7,7,7,7,7,7,7,0,7,7,
+       7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
+       7,7,7,7,0,7,7,7,7,7,0,0,0,7,12,12,
+       12,10,10,10,10,0,12,12,12,0,12,12,12,12,0,0,
+       0,0,0,0,0,12,12,0,7,7,0,0,0,0,0,0,
+       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
+       0,0,0,0,0,0,0,0,15,15,15,15,15,15,15,26,
+       0,0,10,10,0,7,7,7,7,7,7,7,7,0,7,7,
+       7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
+       7,7,7,7,0,7,7,7,7,7,0,0,12,7,10,12,
+       10,10,10,10,10,0,12,10,10,0,10,10,12,12,0,0,
+       0,0,0,0,0,10,10,0,0,0,0,0,0,0,7,0,
+       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
+       0,26,26,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,10,10,0,7,7,7,7,7,7,7,7,0,7,7,
+       7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,0,0,0,7,10,10,
+       10,12,12,12,12,0,10,10,10,0,10,10,10,12,0,0,
+       0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,
+       7,7,12,12,0,0,13,13,13,13,13,13,13,13,13,13,
+       15,15,15,15,15,15,0,0,0,26,7,7,7,7,7,7,
+       0,0,10,10,0,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,0,0,0,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,0,7,7,7,7,7,7,7,7,7,0,7,0,0,
+       7,7,7,7,7,7,7,0,0,0,12,0,0,0,0,10,
+       10,10,12,12,12,0,12,0,10,10,10,10,10,10,10,10,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,10,10,21,0,0,0,0,0,0,0,0,0,0,0,
+       0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,12,7,7,12,12,12,12,12,12,12,0,0,0,0,23,
+       7,7,7,7,7,7,6,12,12,12,12,12,12,12,12,21,
+       13,13,13,13,13,13,13,13,13,13,21,21,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,7,7,0,7,0,0,7,7,0,7,0,0,7,0,0,
+       0,0,0,0,7,7,7,7,0,7,7,7,7,7,7,7,
+       0,7,7,7,0,7,0,7,0,0,7,7,0,7,7,7,
+       7,12,7,7,12,12,12,12,12,12,0,12,12,7,0,0,
+       7,7,7,7,7,0,6,0,12,12,12,12,12,12,0,0,
+       13,13,13,13,13,13,13,13,13,13,0,0,7,7,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,26,26,26,21,21,21,21,21,21,21,21,21,21,21,21,
+       21,21,21,26,26,26,26,26,12,12,26,26,26,26,26,26,
+       13,13,13,13,13,13,13,13,13,13,15,15,15,15,15,15,
+       15,15,15,15,26,12,26,12,26,12,22,18,22,18,10,10,
+       7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,
+       0,12,12,12,12,12,12,12,12,12,12,12,12,12,12,10,
+       12,12,12,12,12,21,12,12,7,7,7,7,0,0,0,0,
+       12,12,12,12,12,12,12,12,0,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,0,26,26,
+       26,26,26,26,26,26,12,26,26,26,26,26,26,0,26,26,
+       21,21,21,21,21,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,10,10,12,12,12,
+       12,10,12,12,12,12,12,12,10,12,12,10,10,12,12,7,
+       13,13,13,13,13,13,13,13,13,13,21,21,21,21,21,21,
+       7,7,7,7,7,7,10,10,12,12,7,7,7,7,12,12,
+       12,7,10,10,10,7,7,10,10,10,10,10,10,10,7,7,
+       7,12,12,12,12,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,12,10,10,12,12,10,10,10,10,10,10,12,7,10,
+       13,13,13,13,13,13,13,13,13,13,0,0,0,0,26,26,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,21,6,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,0,0,0,0,0,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,0,7,7,7,7,0,0,
+       7,7,7,7,7,7,7,0,7,0,7,7,7,7,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,0,7,7,7,7,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,0,7,7,7,7,0,0,7,7,7,7,7,7,7,0,
+       7,0,7,7,7,7,0,0,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,0,7,7,7,7,0,0,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,12,
+       26,21,21,21,21,21,21,21,21,15,15,15,15,15,15,15,
+       15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       26,26,26,26,26,26,26,26,26,26,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,
+       0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,21,21,7,
+       7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,
+       29,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,22,18,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,21,21,21,14,14,
+       14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,0,7,7,
+       7,7,12,12,12,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,12,12,12,21,21,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,12,12,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,0,7,7,
+       7,0,12,12,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,1,1,10,12,12,12,12,12,12,12,10,10,
+       10,10,10,10,10,10,12,10,10,12,12,12,12,12,12,12,
+       12,12,12,12,21,21,21,6,21,21,21,23,7,12,0,0,
+       13,13,13,13,13,13,13,13,13,13,0,0,0,0,0,0,
+       15,15,15,15,15,15,15,15,15,15,0,0,0,0,0,0,
+       21,21,21,21,21,21,17,21,21,21,21,12,12,12,29,0,
+       13,13,13,13,13,13,13,13,13,13,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,6,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,12,7,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,
+       12,12,12,10,10,10,10,12,12,10,10,10,0,0,0,0,
+       10,10,12,10,10,10,10,10,10,12,12,12,0,0,0,0,
+       26,0,0,0,21,21,13,13,13,13,13,13,13,13,13,13,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
+       7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,
+       10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+       10,7,7,7,7,7,7,7,10,10,0,0,0,0,0,0,
+       13,13,13,13,13,13,13,13,13,13,0,0,0,0,21,21,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,12,12,10,10,10,0,0,21,21,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       12,12,12,12,10,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,12,10,12,12,12,12,12,10,12,10,10,10,
+       10,10,12,10,10,7,7,7,7,7,7,7,0,0,0,0,
+       13,13,13,13,13,13,13,13,13,13,21,21,21,21,21,21,
+       21,26,26,26,26,26,26,26,26,26,26,12,12,12,12,12,
+       12,12,12,12,26,26,26,26,26,26,26,26,26,0,0,0,
+       12,12,10,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,10,12,12,12,12,10,10,12,12,10,0,0,0,7,7,
+       13,13,13,13,13,13,13,13,13,13,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,10,10,10,10,10,10,10,10,12,12,12,12,
+       12,12,12,12,10,10,12,12,0,0,0,21,21,21,21,21,
+       13,13,13,13,13,13,13,13,13,13,0,0,0,7,7,7,
+       13,13,13,13,13,13,13,13,13,13,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,6,6,6,6,6,6,21,21,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,
+       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+       6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,6,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,
+       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+       6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,12,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,5,5,5,5,5,5,5,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
+       5,5,5,5,5,5,0,0,9,9,9,9,9,9,0,0,
+       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
+       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
+       5,5,5,5,5,5,0,0,9,9,9,9,9,9,0,0,
+       5,5,5,5,5,5,5,5,0,9,0,9,0,9,0,9,
+       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,
+       5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8,
+       5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8,
+       5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8,
+       5,5,5,5,5,0,5,5,9,9,9,9,8,24,5,24,
+       24,24,5,5,5,0,5,5,9,9,9,9,8,24,24,24,
+       5,5,5,5,0,0,5,5,9,9,9,9,0,24,24,24,
+       5,5,5,5,5,5,5,5,9,9,9,9,9,24,24,24,
+       0,0,5,5,5,0,5,5,9,9,9,9,8,24,24,0,
+       29,29,29,29,29,29,29,29,29,29,29,1,1,1,1,1,
+       17,17,17,17,17,17,21,21,20,19,22,20,20,19,22,20,
+       21,21,21,21,21,21,21,21,27,28,1,1,1,1,1,29,
+       21,21,21,21,21,21,21,21,21,20,19,21,21,21,21,16,
+       16,21,21,21,25,22,18,21,21,21,21,21,21,21,21,21,
+       21,21,25,21,16,21,21,21,21,21,21,21,21,21,21,29,
+       1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
+       15,5,0,0,15,15,15,15,15,15,25,25,25,22,18,5,
+       15,15,15,15,15,15,15,15,15,15,25,25,25,22,18,0,
+       6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,
+       23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
+       23,23,23,23,23,23,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,11,
+       11,12,11,11,11,12,12,12,12,12,12,12,12,12,12,12,
+       12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       26,26,9,26,26,26,26,9,26,26,5,9,9,9,5,5,
+       9,9,9,5,26,9,26,26,26,9,9,9,9,9,26,26,
+       26,26,26,26,9,26,9,26,9,26,9,9,9,9,26,5,
+       9,9,9,9,5,7,7,7,7,5,26,26,5,5,9,9,
+       25,25,25,25,25,9,5,5,5,5,26,25,26,26,5,26,
+       0,0,0,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,9,5,14,14,14,14,0,0,0,0,0,0,0,
+       25,25,25,25,25,26,26,26,26,26,25,25,26,26,26,26,
+       25,26,26,25,26,26,25,26,26,26,26,26,26,26,25,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,25,25,
+       26,26,25,26,25,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       26,26,26,26,26,26,26,26,25,25,25,25,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       25,25,26,26,26,26,26,26,26,22,18,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,25,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,25,25,25,25,
+       25,25,26,26,26,26,26,26,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       15,15,15,15,15,15,15,15,15,15,15,15,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,15,15,15,15,15,15,
+       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,25,26,26,26,26,26,26,26,26,
+       26,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,25,25,25,25,25,25,25,25,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,25,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,
+       26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,26,26,26,26,0,26,26,26,26,0,0,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,0,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,0,26,0,26,
+       26,26,26,0,0,0,26,0,26,26,26,26,26,26,26,0,
+       0,26,26,26,26,26,26,26,22,18,22,18,22,18,22,18,
+       22,18,22,18,22,18,15,15,15,15,15,15,15,15,15,15,
+       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       15,15,15,15,26,0,0,0,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       0,26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,
+       25,25,25,25,25,22,18,25,25,25,25,0,25,0,0,0,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,22,18,22,18,22,18,22,18,22,18,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,22,18,22,18,22,18,22,18,22,18,22,18,22,
+       18,22,18,22,18,22,18,22,18,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,22,18,22,18,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,22,18,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+       25,25,25,25,25,26,26,25,25,25,25,25,25,0,0,0,
+       26,26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,
+       9,5,9,9,9,5,5,9,5,9,5,9,5,9,9,9,
+       0,5,9,5,5,9,5,5,5,5,5,5,5,6,0,0,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,5,26,26,26,26,26,26,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,21,21,21,21,15,21,21,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,6,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,0,
+       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,0,
+       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,0,
+       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,0,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       21,21,20,19,20,19,21,21,21,20,19,21,20,19,21,21,
+       21,21,21,21,21,21,21,17,21,21,17,21,20,19,21,21,
+       20,19,22,18,22,18,22,18,22,18,21,21,21,21,21,6,
+       21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,0,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,0,
+       29,21,21,21,26,6,7,14,22,18,22,18,22,18,22,18,
+       22,18,26,26,22,18,22,18,22,18,22,18,17,22,18,18,
+       26,14,14,14,14,14,14,14,14,14,12,12,12,12,12,12,
+       17,6,6,6,6,6,26,26,14,14,14,6,7,21,26,26,
+       0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,0,0,12,12,24,24,6,6,7,
+       17,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,21,6,6,6,7,
+       0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
+       0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,
+       26,26,15,15,15,15,26,26,26,26,26,26,26,26,26,26,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,
+       15,15,15,15,15,15,15,15,15,15,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,0,0,0,0,0,0,0,0,0,0,0,0,
+       26,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       15,15,15,15,15,15,15,15,15,15,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       0};
+static const guint8 unicode_category_table1 [] = {
+       /* ==== 4DC0-4E00 ==== */
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       0};
+static const guint8 unicode_category_table2 [] = {
+       /* ==== A000-AA80 ==== */
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,6,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,6,21,21,21,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       13,13,13,13,13,13,13,13,13,13,7,7,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       0,0,9,5,9,5,9,5,9,5,9,5,9,5,7,12,
+       11,11,11,21,0,0,0,0,0,0,0,0,12,12,21,6,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
+       24,24,24,24,24,24,24,6,6,6,6,6,6,6,6,6,
+       24,24,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       5,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       9,5,9,5,9,5,9,5,9,5,9,5,9,5,9,5,
+       6,5,5,5,5,5,5,5,5,9,5,9,5,9,9,5,
+       9,5,9,5,9,5,9,5,6,24,24,9,5,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,
+       7,7,12,7,7,7,12,7,7,7,7,12,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,10,10,12,12,10,26,26,26,26,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,21,21,21,21,0,0,0,0,0,0,0,0,
+       10,10,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,10,10,10,10,10,10,10,10,10,10,10,10,
+       10,10,10,10,12,0,0,0,0,0,0,0,0,0,21,21,
+       13,13,13,13,13,13,13,13,13,13,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       13,13,13,13,13,13,13,13,13,13,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,12,12,12,12,12,12,12,12,21,21,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,12,12,12,12,12,12,12,12,12,
+       12,12,10,10,0,0,0,0,0,0,0,0,0,0,0,21,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,12,12,12,12,12,12,10,
+       10,12,12,10,10,12,12,0,0,0,0,0,0,0,0,0,
+       7,7,7,12,7,7,7,7,7,7,7,7,12,10,0,0,
+       13,13,13,13,13,13,13,13,13,13,0,0,21,21,21,21,
+       0};
+static const guint8 unicode_category_table3 [] = {
+       /* ==== F900-10000 ==== */
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0,
+       0,0,0,5,5,5,5,5,0,0,0,0,0,7,12,7,
+       7,7,7,7,7,7,7,7,7,25,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,0,7,7,7,7,7,0,7,0,
+       7,7,0,7,7,0,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,22,18,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,23,26,0,0,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       21,21,21,21,21,21,21,22,18,21,0,0,0,0,0,0,
+       12,12,12,12,12,12,12,0,0,0,0,0,0,0,0,0,
+       21,17,17,16,16,22,18,22,18,22,18,22,18,22,18,22,
+       18,22,18,22,18,21,21,22,18,21,21,21,21,16,16,16,
+       21,21,21,0,21,21,21,21,17,22,18,22,18,22,18,21,
+       21,21,25,17,25,25,25,0,21,23,21,21,0,0,0,0,
+       7,7,7,7,7,0,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,1,
+       0,21,21,21,23,21,21,21,22,18,21,25,21,17,21,21,
+       13,13,13,13,13,13,13,13,13,13,21,21,25,25,25,21,
+       21,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,22,21,18,24,16,
+       24,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,22,25,18,25,22,
+       18,21,22,18,21,21,7,7,7,7,7,7,7,7,7,7,
+       6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,
+       0,0,7,7,7,7,7,7,0,0,7,7,7,7,7,7,
+       0,0,7,7,7,7,7,7,0,0,7,7,7,0,0,0,
+       23,23,25,24,26,23,23,0,26,25,25,25,25,26,26,0,
+       0,0,0,0,0,0,0,0,0,1,1,1,26,26,0};
+static const guint8 unicode_category_table4 [] = {
+       /* ==== 10000-104C0 ==== */
+       7,7,7,7,7,7,7,7,7,7,7,7,0,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,0,7,7,0,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,
+       21,21,26,0,0,0,0,15,15,15,15,15,15,15,15,15,
+       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       15,15,15,15,0,0,0,26,26,26,26,26,26,26,26,26,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,14,14,15,15,15,15,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,15,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,12,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,
+       15,15,15,15,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,14,7,7,7,7,7,7,7,7,14,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,21,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,0,0,0,0,7,7,7,7,7,7,7,7,
+       21,14,14,14,14,14,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,
+       13,13,13,13,13,13,13,13,13,13,0};
+static const guint8 unicode_category_table5 [] = {
+       /* ==== 10800-10A80 ==== */
+       7,7,7,7,7,7,0,0,7,0,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,0,7,7,0,0,0,7,0,0,7,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,15,15,15,15,0,0,0,0,0,21,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,21,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       7,12,12,12,0,12,12,0,0,0,0,0,12,12,12,12,
+       7,7,7,7,0,7,7,7,0,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,0,0,0,0,12,12,12,0,0,0,0,12,
+       15,15,15,15,15,15,15,15,0,0,0,0,0,0,0,0,
+       21,21,21,21,21,21,21,21,21,0};
+static const guint8 unicode_category_table6 [] = {
+       /* ==== 12000-12480 ==== */
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+       14,14,14,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       21,21,21,21,0};
+static const guint8 unicode_category_table7 [] = {
+       /* ==== 1D000-1D800 ==== */
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,0,0,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,10,10,12,12,12,26,26,26,10,10,10,
+       10,10,10,1,1,1,1,1,1,1,1,12,12,12,12,12,
+       12,12,12,26,26,12,12,12,12,12,12,12,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,12,12,12,12,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,12,12,12,26,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0,
+       15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+       15,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,5,
+       5,5,5,5,5,0,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,9,0,9,9,
+       0,0,9,0,0,9,9,0,0,9,9,9,9,0,9,9,
+       9,9,9,9,9,9,5,5,5,5,0,5,0,5,5,5,
+       5,5,5,5,0,5,5,5,5,5,5,5,5,5,5,5,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,9,9,0,9,9,9,9,0,0,9,9,9,
+       9,9,9,9,9,0,9,9,9,9,9,9,9,0,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,9,9,0,9,9,9,9,0,
+       9,9,9,9,9,0,9,0,0,0,9,9,9,9,9,9,
+       9,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,0,0,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,25,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,25,5,5,5,5,
+       5,5,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,25,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,25,5,5,5,5,5,5,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,25,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,25,
+       5,5,5,5,5,5,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,25,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,25,5,5,5,5,5,5,
+       9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+       9,9,9,9,9,9,9,9,9,25,5,5,5,5,5,5,
+       5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+       5,5,5,25,5,5,5,5,5,5,9,5,0,0,13,13,
+       13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
+       13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
+       13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
+       0};
+static const guint8 unicode_category_table8 [] = {
+       /* ==== 1F000-1F0C0 ==== */
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,0,0,0,0,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,
+       26,26,26,26,0};
+static const guint8 unicode_category_table9 [] = {
+       /* ==== 2F800-2FA40 ==== */
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+       7,7,7,7,7,7,7,7,7,7,7,7,7,7,0};
+static const guint8 unicode_category_table10 [] = {
+       /* ==== E0000-E0200 ==== */
+       0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       0};
+static const guint8 *unicode_category [11]  = {
+       unicode_category_table0,
+       unicode_category_table1,
+       unicode_category_table2,
+       unicode_category_table3,
+       unicode_category_table4,
+       unicode_category_table5,
+       unicode_category_table6,
+       unicode_category_table7,
+       unicode_category_table8,
+       unicode_category_table9,
+       unicode_category_table10
+};
+
+static const guint8 simple_case_map_ranges_count = 9;
+static const CodePointRange simple_case_map_ranges [] = {
+{0x000040, 0x000600},
+{0x001000, 0x0010D0},
+{0x001D00, 0x002000},
+{0x002100, 0x0021C0},
+{0x002480, 0x002500},
+{0x002C00, 0x002D80},
+{0x00A640, 0x00A7C0},
+{0x00FF20, 0x00FF80},
+{0x010400, 0x010480},
+{0, 0}};
+static const guint16 simple_upper_case_mapping_lowarea_table0 [] = {
+       /* ==== 40-600 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+       0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0x39C,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+       0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x178,
+       0,0x100,0,0x102,0,0x104,0,0x106,0,0x108,0,0x10A,0,0x10C,0,0x10E,
+       0,0x110,0,0x112,0,0x114,0,0x116,0,0x118,0,0x11A,0,0x11C,0,0x11E,
+       0,0x120,0,0x122,0,0x124,0,0x126,0,0x128,0,0x12A,0,0x12C,0,0x12E,
+       0,0x49,0,0x132,0,0x134,0,0x136,0,0,0x139,0,0x13B,0,0x13D,0,
+       0x13F,0,0x141,0,0x143,0,0x145,0,0x147,0,0,0x14A,0,0x14C,0,0x14E,
+       0,0x150,0,0x152,0,0x154,0,0x156,0,0x158,0,0x15A,0,0x15C,0,0x15E,
+       0,0x160,0,0x162,0,0x164,0,0x166,0,0x168,0,0x16A,0,0x16C,0,0x16E,
+       0,0x170,0,0x172,0,0x174,0,0x176,0,0,0x179,0,0x17B,0,0x17D,0x53,
+       0x243,0,0,0x182,0,0x184,0,0,0x187,0,0,0,0x18B,0,0,0,
+       0,0,0x191,0,0,0x1F6,0,0,0,0x198,0x23D,0,0,0,0x220,0,
+       0,0x1A0,0,0x1A2,0,0x1A4,0,0,0x1A7,0,0,0,0,0x1AC,0,0,
+       0x1AF,0,0,0,0x1B3,0,0x1B5,0,0,0x1B8,0,0,0,0x1BC,0,0x1F7,
+       0,0,0,0,0,0x1C4,0x1C4,0,0x1C7,0x1C7,0,0x1CA,0x1CA,0,0x1CD,0,
+       0x1CF,0,0x1D1,0,0x1D3,0,0x1D5,0,0x1D7,0,0x1D9,0,0x1DB,0x18E,0,0x1DE,
+       0,0x1E0,0,0x1E2,0,0x1E4,0,0x1E6,0,0x1E8,0,0x1EA,0,0x1EC,0,0x1EE,
+       0,0,0x1F1,0x1F1,0,0x1F4,0,0,0,0x1F8,0,0x1FA,0,0x1FC,0,0x1FE,
+       0,0x200,0,0x202,0,0x204,0,0x206,0,0x208,0,0x20A,0,0x20C,0,0x20E,
+       0,0x210,0,0x212,0,0x214,0,0x216,0,0x218,0,0x21A,0,0x21C,0,0x21E,
+       0,0,0,0x222,0,0x224,0,0x226,0,0x228,0,0x22A,0,0x22C,0,0x22E,
+       0,0x230,0,0x232,0,0,0,0,0,0,0,0,0x23B,0,0,0,
+       0,0,0x241,0,0,0,0,0x246,0,0x248,0,0x24A,0,0x24C,0,0x24E,
+       0x2C6F,0x2C6D,0,0x181,0x186,0,0x189,0x18A,0,0x18F,0,0x190,0,0,0,0,
+       0x193,0,0,0x194,0,0,0,0,0x197,0x196,0,0x2C62,0,0,0,0x19C,
+       0,0x2C6E,0x19D,0,0,0x19F,0,0,0,0,0,0,0,0x2C64,0,0,
+       0x1A6,0,0,0x1A9,0,0,0,0,0x1AE,0x244,0x1B1,0x1B2,0x245,0,0,0,
+       0,0,0x1B7,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0x399,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0x370,0,0x372,0,0,0,0x376,0,0,0,0x3FD,0x3FE,0x3FF,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0x386,0x388,0x389,0x38A,
+       0,0x391,0x392,0x393,0x394,0x395,0x396,0x397,0x398,0x399,0x39A,0x39B,0x39C,0x39D,0x39E,0x39F,
+       0x3A0,0x3A1,0x3A3,0x3A3,0x3A4,0x3A5,0x3A6,0x3A7,0x3A8,0x3A9,0x3AA,0x3AB,0x38C,0x38E,0x38F,0,
+       0x392,0x398,0,0,0,0x3A6,0x3A0,0x3CF,0,0x3D8,0,0x3DA,0,0x3DC,0,0x3DE,
+       0,0x3E0,0,0x3E2,0,0x3E4,0,0x3E6,0,0x3E8,0,0x3EA,0,0x3EC,0,0x3EE,
+       0x39A,0x3A1,0x3F9,0,0,0x395,0,0,0x3F7,0,0,0x3FA,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x410,0x411,0x412,0x413,0x414,0x415,0x416,0x417,0x418,0x419,0x41A,0x41B,0x41C,0x41D,0x41E,0x41F,
+       0x420,0x421,0x422,0x423,0x424,0x425,0x426,0x427,0x428,0x429,0x42A,0x42B,0x42C,0x42D,0x42E,0x42F,
+       0x400,0x401,0x402,0x403,0x404,0x405,0x406,0x407,0x408,0x409,0x40A,0x40B,0x40C,0x40D,0x40E,0x40F,
+       0,0x460,0,0x462,0,0x464,0,0x466,0,0x468,0,0x46A,0,0x46C,0,0x46E,
+       0,0x470,0,0x472,0,0x474,0,0x476,0,0x478,0,0x47A,0,0x47C,0,0x47E,
+       0,0x480,0,0,0,0,0,0,0,0,0,0x48A,0,0x48C,0,0x48E,
+       0,0x490,0,0x492,0,0x494,0,0x496,0,0x498,0,0x49A,0,0x49C,0,0x49E,
+       0,0x4A0,0,0x4A2,0,0x4A4,0,0x4A6,0,0x4A8,0,0x4AA,0,0x4AC,0,0x4AE,
+       0,0x4B0,0,0x4B2,0,0x4B4,0,0x4B6,0,0x4B8,0,0x4BA,0,0x4BC,0,0x4BE,
+       0,0,0x4C1,0,0x4C3,0,0x4C5,0,0x4C7,0,0x4C9,0,0x4CB,0,0x4CD,0x4C0,
+       0,0x4D0,0,0x4D2,0,0x4D4,0,0x4D6,0,0x4D8,0,0x4DA,0,0x4DC,0,0x4DE,
+       0,0x4E0,0,0x4E2,0,0x4E4,0,0x4E6,0,0x4E8,0,0x4EA,0,0x4EC,0,0x4EE,
+       0,0x4F0,0,0x4F2,0,0x4F4,0,0x4F6,0,0x4F8,0,0x4FA,0,0x4FC,0,0x4FE,
+       0,0x500,0,0x502,0,0x504,0,0x506,0,0x508,0,0x50A,0,0x50C,0,0x50E,
+       0,0x510,0,0x512,0,0x514,0,0x516,0,0x518,0,0x51A,0,0x51C,0,0x51E,
+       0,0x520,0,0x522,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0x531,0x532,0x533,0x534,0x535,0x536,0x537,0x538,0x539,0x53A,0x53B,0x53C,0x53D,0x53E,0x53F,
+       0x540,0x541,0x542,0x543,0x544,0x545,0x546,0x547,0x548,0x549,0x54A,0x54B,0x54C,0x54D,0x54E,0x54F,
+       0x550,0x551,0x552,0x553,0x554,0x555,0x556,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0};
+static const guint16 simple_upper_case_mapping_lowarea_table1 [] = {
+       /* ==== 1000-10D0 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0};
+static const guint16 simple_upper_case_mapping_lowarea_table2 [] = {
+       /* ==== 1D00-2000 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0xA77D,0,0,0,0x2C63,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0x1E00,0,0x1E02,0,0x1E04,0,0x1E06,0,0x1E08,0,0x1E0A,0,0x1E0C,0,0x1E0E,
+       0,0x1E10,0,0x1E12,0,0x1E14,0,0x1E16,0,0x1E18,0,0x1E1A,0,0x1E1C,0,0x1E1E,
+       0,0x1E20,0,0x1E22,0,0x1E24,0,0x1E26,0,0x1E28,0,0x1E2A,0,0x1E2C,0,0x1E2E,
+       0,0x1E30,0,0x1E32,0,0x1E34,0,0x1E36,0,0x1E38,0,0x1E3A,0,0x1E3C,0,0x1E3E,
+       0,0x1E40,0,0x1E42,0,0x1E44,0,0x1E46,0,0x1E48,0,0x1E4A,0,0x1E4C,0,0x1E4E,
+       0,0x1E50,0,0x1E52,0,0x1E54,0,0x1E56,0,0x1E58,0,0x1E5A,0,0x1E5C,0,0x1E5E,
+       0,0x1E60,0,0x1E62,0,0x1E64,0,0x1E66,0,0x1E68,0,0x1E6A,0,0x1E6C,0,0x1E6E,
+       0,0x1E70,0,0x1E72,0,0x1E74,0,0x1E76,0,0x1E78,0,0x1E7A,0,0x1E7C,0,0x1E7E,
+       0,0x1E80,0,0x1E82,0,0x1E84,0,0x1E86,0,0x1E88,0,0x1E8A,0,0x1E8C,0,0x1E8E,
+       0,0x1E90,0,0x1E92,0,0x1E94,0,0,0,0,0,0x1E60,0,0,0,0,
+       0,0x1EA0,0,0x1EA2,0,0x1EA4,0,0x1EA6,0,0x1EA8,0,0x1EAA,0,0x1EAC,0,0x1EAE,
+       0,0x1EB0,0,0x1EB2,0,0x1EB4,0,0x1EB6,0,0x1EB8,0,0x1EBA,0,0x1EBC,0,0x1EBE,
+       0,0x1EC0,0,0x1EC2,0,0x1EC4,0,0x1EC6,0,0x1EC8,0,0x1ECA,0,0x1ECC,0,0x1ECE,
+       0,0x1ED0,0,0x1ED2,0,0x1ED4,0,0x1ED6,0,0x1ED8,0,0x1EDA,0,0x1EDC,0,0x1EDE,
+       0,0x1EE0,0,0x1EE2,0,0x1EE4,0,0x1EE6,0,0x1EE8,0,0x1EEA,0,0x1EEC,0,0x1EEE,
+       0,0x1EF0,0,0x1EF2,0,0x1EF4,0,0x1EF6,0,0x1EF8,0,0x1EFA,0,0x1EFC,0,0x1EFE,
+       0x1F08,0x1F09,0x1F0A,0x1F0B,0x1F0C,0x1F0D,0x1F0E,0x1F0F,0,0,0,0,0,0,0,0,
+       0x1F18,0x1F19,0x1F1A,0x1F1B,0x1F1C,0x1F1D,0,0,0,0,0,0,0,0,0,0,
+0x1F28,0x1F29,0x1F2A,0x1F2B,0x1F2C,0x1F2D,0x1F2E,0x1F2F,0,0,0,0,0,0,0,0,
+       0x1F38,0x1F39,0x1F3A,0x1F3B,0x1F3C,0x1F3D,0x1F3E,0x1F3F,0,0,0,0,0,0,0,0,
+       0x1F48,0x1F49,0x1F4A,0x1F4B,0x1F4C,0x1F4D,0,0,0,0,0,0,0,0,0,0,
+0,0x1F59,0,0x1F5B,0,0x1F5D,0,0x1F5F,0,0,0,0,0,0,0,0,
+       0x1F68,0x1F69,0x1F6A,0x1F6B,0x1F6C,0x1F6D,0x1F6E,0x1F6F,0,0,0,0,0,0,0,0,
+       0x1FBA,0x1FBB,0x1FC8,0x1FC9,0x1FCA,0x1FCB,0x1FDA,0x1FDB,0x1FF8,0x1FF9,0x1FEA,0x1FEB,0x1FFA,0x1FFB,0,0,
+0x1F88,0x1F89,0x1F8A,0x1F8B,0x1F8C,0x1F8D,0x1F8E,0x1F8F,0,0,0,0,0,0,0,0,
+       0x1F98,0x1F99,0x1F9A,0x1F9B,0x1F9C,0x1F9D,0x1F9E,0x1F9F,0,0,0,0,0,0,0,0,
+       0x1FA8,0x1FA9,0x1FAA,0x1FAB,0x1FAC,0x1FAD,0x1FAE,0x1FAF,0,0,0,0,0,0,0,0,
+       0x1FB8,0x1FB9,0,0x1FBC,0,0,0,0,0,0,0,0,0,0,0x399,0,
+       0,0,0,0x1FCC,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x1FD8,0x1FD9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x1FE8,0x1FE9,0,0,0,0x1FEC,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0x1FFC,0,0,0,0,0,0,0,0,0,0,0,0};
+static const guint16 simple_upper_case_mapping_lowarea_table3 [] = {
+       /* ==== 2100-21C0 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x2132,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,0x2167,0x2168,0x2169,0x216A,0x216B,0x216C,0x216D,0x216E,0x216F,
+       0,0,0,0,0x2183,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0};
+static const guint16 simple_upper_case_mapping_lowarea_table4 [] = {
+       /* ==== 2480-2500 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x24B6,0x24B7,0x24B8,0x24B9,0x24BA,0x24BB,0x24BC,0x24BD,0x24BE,0x24BF,0x24C0,0x24C1,0x24C2,0x24C3,0x24C4,0x24C5,
+       0x24C6,0x24C7,0x24C8,0x24C9,0x24CA,0x24CB,0x24CC,0x24CD,0x24CE,0x24CF,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0};
+static const guint16 simple_upper_case_mapping_lowarea_table5 [] = {
+       /* ==== 2C00-2D80 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0x2C00,0x2C01,0x2C02,0x2C03,0x2C04,0x2C05,0x2C06,0x2C07,0x2C08,0x2C09,0x2C0A,0x2C0B,0x2C0C,0x2C0D,0x2C0E,0x2C0F,
+       0x2C10,0x2C11,0x2C12,0x2C13,0x2C14,0x2C15,0x2C16,0x2C17,0x2C18,0x2C19,0x2C1A,0x2C1B,0x2C1C,0x2C1D,0x2C1E,0x2C1F,
+       0x2C20,0x2C21,0x2C22,0x2C23,0x2C24,0x2C25,0x2C26,0x2C27,0x2C28,0x2C29,0x2C2A,0x2C2B,0x2C2C,0x2C2D,0x2C2E,0,
+0,0x2C60,0,0,0,0x23A,0x23E,0,0x2C67,0,0x2C69,0,0x2C6B,0,0,0,
+       0,0,0,0x2C72,0,0,0x2C75,0,0,0,0,0,0,0,0,0,
+0,0x2C80,0,0x2C82,0,0x2C84,0,0x2C86,0,0x2C88,0,0x2C8A,0,0x2C8C,0,0x2C8E,
+       0,0x2C90,0,0x2C92,0,0x2C94,0,0x2C96,0,0x2C98,0,0x2C9A,0,0x2C9C,0,0x2C9E,
+       0,0x2CA0,0,0x2CA2,0,0x2CA4,0,0x2CA6,0,0x2CA8,0,0x2CAA,0,0x2CAC,0,0x2CAE,
+       0,0x2CB0,0,0x2CB2,0,0x2CB4,0,0x2CB6,0,0x2CB8,0,0x2CBA,0,0x2CBC,0,0x2CBE,
+       0,0x2CC0,0,0x2CC2,0,0x2CC4,0,0x2CC6,0,0x2CC8,0,0x2CCA,0,0x2CCC,0,0x2CCE,
+       0,0x2CD0,0,0x2CD2,0,0x2CD4,0,0x2CD6,0,0x2CD8,0,0x2CDA,0,0x2CDC,0,0x2CDE,
+       0,0x2CE0,0,0x2CE2,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x10A0,0x10A1,0x10A2,0x10A3,0x10A4,0x10A5,0x10A6,0x10A7,0x10A8,0x10A9,0x10AA,0x10AB,0x10AC,0x10AD,0x10AE,0x10AF,
+       0x10B0,0x10B1,0x10B2,0x10B3,0x10B4,0x10B5,0x10B6,0x10B7,0x10B8,0x10B9,0x10BA,0x10BB,0x10BC,0x10BD,0x10BE,0x10BF,
+       0x10C0,0x10C1,0x10C2,0x10C3,0x10C4,0x10C5,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0};
+static const guint16 simple_upper_case_mapping_lowarea_table6 [] = {
+       /* ==== A640-A7C0 ==== */
+       0,0xA640,0,0xA642,0,0xA644,0,0xA646,0,0xA648,0,0xA64A,0,0xA64C,0,0xA64E,
+       0,0xA650,0,0xA652,0,0xA654,0,0xA656,0,0xA658,0,0xA65A,0,0xA65C,0,0xA65E,
+       0,0,0,0xA662,0,0xA664,0,0xA666,0,0xA668,0,0xA66A,0,0xA66C,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0xA680,0,0xA682,0,0xA684,0,0xA686,0,0xA688,0,0xA68A,0,0xA68C,0,0xA68E,
+       0,0xA690,0,0xA692,0,0xA694,0,0xA696,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0xA722,0,0xA724,0,0xA726,0,0xA728,0,0xA72A,0,0xA72C,0,0xA72E,
+       0,0,0,0xA732,0,0xA734,0,0xA736,0,0xA738,0,0xA73A,0,0xA73C,0,0xA73E,
+       0,0xA740,0,0xA742,0,0xA744,0,0xA746,0,0xA748,0,0xA74A,0,0xA74C,0,0xA74E,
+       0,0xA750,0,0xA752,0,0xA754,0,0xA756,0,0xA758,0,0xA75A,0,0xA75C,0,0xA75E,
+       0,0xA760,0,0xA762,0,0xA764,0,0xA766,0,0xA768,0,0xA76A,0,0xA76C,0,0xA76E,
+       0,0,0,0,0,0,0,0,0,0,0xA779,0,0xA77B,0,0,0xA77E,
+       0,0xA780,0,0xA782,0,0xA784,0,0xA786,0,0,0,0,0xA78B,0};
+static const guint16 simple_upper_case_mapping_lowarea_table7 [] = {
+       /* ==== FF20-FF80 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27,0xFF28,0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F,
+       0xFF30,0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,0xFF38,0xFF39,0xFF3A,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0};
+static const guint16 *simple_upper_case_mapping_lowarea [] = {
+       simple_upper_case_mapping_lowarea_table0,
+       simple_upper_case_mapping_lowarea_table1,
+       simple_upper_case_mapping_lowarea_table2,
+       simple_upper_case_mapping_lowarea_table3,
+       simple_upper_case_mapping_lowarea_table4,
+       simple_upper_case_mapping_lowarea_table5,
+       simple_upper_case_mapping_lowarea_table6,
+       simple_upper_case_mapping_lowarea_table7};
+static const int simple_upper_case_mapping_lowarea_table_count = 8;
+
+static const guint32 simple_upper_case_mapping_higharea_table0 [] = {
+       /* ==== 10400-10480 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0x10400,0x10401,0x10402,0x10403,0x10404,0x10405,0x10406,0x10407,
+       0x10408,0x10409,0x1040A,0x1040B,0x1040C,0x1040D,0x1040E,0x1040F,0x10410,0x10411,0x10412,0x10413,0x10414,0x10415,0x10416,0x10417,
+       0x10418,0x10419,0x1041A,0x1041B,0x1041C,0x1041D,0x1041E,0x1041F,0x10420,0x10421,0x10422,0x10423,0x10424,0x10425,0x10426,0x10427,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0};
+static const guint32 *simple_upper_case_mapping_higharea [] = {
+       simple_upper_case_mapping_higharea_table0};
+
+static const guint16 simple_lower_case_mapping_lowarea_table0 [] = {
+       /* ==== 40-600 ==== */
+       0,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+       0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+       0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x101,0,0x103,0,0x105,0,0x107,0,0x109,0,0x10B,0,0x10D,0,0x10F,0,
+       0x111,0,0x113,0,0x115,0,0x117,0,0x119,0,0x11B,0,0x11D,0,0x11F,0,
+       0x121,0,0x123,0,0x125,0,0x127,0,0x129,0,0x12B,0,0x12D,0,0x12F,0,
+       0x69,0,0x133,0,0x135,0,0x137,0,0,0x13A,0,0x13C,0,0x13E,0,0x140,
+       0,0x142,0,0x144,0,0x146,0,0x148,0,0,0x14B,0,0x14D,0,0x14F,0,
+       0x151,0,0x153,0,0x155,0,0x157,0,0x159,0,0x15B,0,0x15D,0,0x15F,0,
+       0x161,0,0x163,0,0x165,0,0x167,0,0x169,0,0x16B,0,0x16D,0,0x16F,0,
+       0x171,0,0x173,0,0x175,0,0x177,0,0xFF,0x17A,0,0x17C,0,0x17E,0,0,
+       0,0x253,0x183,0,0x185,0,0x254,0x188,0,0x256,0x257,0x18C,0,0,0x1DD,0x259,
+       0x25B,0x192,0,0x260,0x263,0,0x269,0x268,0x199,0,0,0,0x26F,0x272,0,0x275,
+       0x1A1,0,0x1A3,0,0x1A5,0,0x280,0x1A8,0,0x283,0,0,0x1AD,0,0x288,0x1B0,
+       0,0x28A,0x28B,0x1B4,0,0x1B6,0,0x292,0x1B9,0,0,0,0x1BD,0,0,0,
+       0,0,0,0,0x1C6,0x1C6,0,0x1C9,0x1C9,0,0x1CC,0x1CC,0,0x1CE,0,0x1D0,
+       0,0x1D2,0,0x1D4,0,0x1D6,0,0x1D8,0,0x1DA,0,0x1DC,0,0,0x1DF,0,
+       0x1E1,0,0x1E3,0,0x1E5,0,0x1E7,0,0x1E9,0,0x1EB,0,0x1ED,0,0x1EF,0,
+       0,0x1F3,0x1F3,0,0x1F5,0,0x195,0x1BF,0x1F9,0,0x1FB,0,0x1FD,0,0x1FF,0,
+       0x201,0,0x203,0,0x205,0,0x207,0,0x209,0,0x20B,0,0x20D,0,0x20F,0,
+       0x211,0,0x213,0,0x215,0,0x217,0,0x219,0,0x21B,0,0x21D,0,0x21F,0,
+       0x19E,0,0x223,0,0x225,0,0x227,0,0x229,0,0x22B,0,0x22D,0,0x22F,0,
+       0x231,0,0x233,0,0,0,0,0,0,0,0x2C65,0x23C,0,0x19A,0x2C66,0,
+       0,0x242,0,0x180,0x289,0x28C,0x247,0,0x249,0,0x24B,0,0x24D,0,0x24F,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x371,0,0x373,0,0,0,0x377,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0x3AC,0,0x3AD,0x3AE,0x3AF,0,0x3CC,0,0x3CD,0x3CE,
+       0,0x3B1,0x3B2,0x3B3,0x3B4,0x3B5,0x3B6,0x3B7,0x3B8,0x3B9,0x3BA,0x3BB,0x3BC,0x3BD,0x3BE,0x3BF,
+       0x3C0,0x3C1,0,0x3C3,0x3C4,0x3C5,0x3C6,0x3C7,0x3C8,0x3C9,0x3CA,0x3CB,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x3D7,
+       0,0,0,0,0,0,0,0,0x3D9,0,0x3DB,0,0x3DD,0,0x3DF,0,
+       0x3E1,0,0x3E3,0,0x3E5,0,0x3E7,0,0x3E9,0,0x3EB,0,0x3ED,0,0x3EF,0,
+       0,0,0,0,0x3B8,0,0,0x3F8,0,0x3F2,0x3FB,0,0,0x37B,0x37C,0x37D,
+       0x450,0x451,0x452,0x453,0x454,0x455,0x456,0x457,0x458,0x459,0x45A,0x45B,0x45C,0x45D,0x45E,0x45F,
+       0x430,0x431,0x432,0x433,0x434,0x435,0x436,0x437,0x438,0x439,0x43A,0x43B,0x43C,0x43D,0x43E,0x43F,
+       0x440,0x441,0x442,0x443,0x444,0x445,0x446,0x447,0x448,0x449,0x44A,0x44B,0x44C,0x44D,0x44E,0x44F,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x461,0,0x463,0,0x465,0,0x467,0,0x469,0,0x46B,0,0x46D,0,0x46F,0,
+       0x471,0,0x473,0,0x475,0,0x477,0,0x479,0,0x47B,0,0x47D,0,0x47F,0,
+       0x481,0,0,0,0,0,0,0,0,0,0x48B,0,0x48D,0,0x48F,0,
+       0x491,0,0x493,0,0x495,0,0x497,0,0x499,0,0x49B,0,0x49D,0,0x49F,0,
+       0x4A1,0,0x4A3,0,0x4A5,0,0x4A7,0,0x4A9,0,0x4AB,0,0x4AD,0,0x4AF,0,
+       0x4B1,0,0x4B3,0,0x4B5,0,0x4B7,0,0x4B9,0,0x4BB,0,0x4BD,0,0x4BF,0,
+       0x4CF,0x4C2,0,0x4C4,0,0x4C6,0,0x4C8,0,0x4CA,0,0x4CC,0,0x4CE,0,0,
+       0x4D1,0,0x4D3,0,0x4D5,0,0x4D7,0,0x4D9,0,0x4DB,0,0x4DD,0,0x4DF,0,
+       0x4E1,0,0x4E3,0,0x4E5,0,0x4E7,0,0x4E9,0,0x4EB,0,0x4ED,0,0x4EF,0,
+       0x4F1,0,0x4F3,0,0x4F5,0,0x4F7,0,0x4F9,0,0x4FB,0,0x4FD,0,0x4FF,0,
+       0x501,0,0x503,0,0x505,0,0x507,0,0x509,0,0x50B,0,0x50D,0,0x50F,0,
+       0x511,0,0x513,0,0x515,0,0x517,0,0x519,0,0x51B,0,0x51D,0,0x51F,0,
+       0x521,0,0x523,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0x561,0x562,0x563,0x564,0x565,0x566,0x567,0x568,0x569,0x56A,0x56B,0x56C,0x56D,0x56E,0x56F,
+       0x570,0x571,0x572,0x573,0x574,0x575,0x576,0x577,0x578,0x579,0x57A,0x57B,0x57C,0x57D,0x57E,0x57F,
+       0x580,0x581,0x582,0x583,0x584,0x585,0x586,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0};
+static const guint16 simple_lower_case_mapping_lowarea_table1 [] = {
+       /* ==== 1000-10D0 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x2D00,0x2D01,0x2D02,0x2D03,0x2D04,0x2D05,0x2D06,0x2D07,0x2D08,0x2D09,0x2D0A,0x2D0B,0x2D0C,0x2D0D,0x2D0E,0x2D0F,
+       0x2D10,0x2D11,0x2D12,0x2D13,0x2D14,0x2D15,0x2D16,0x2D17,0x2D18,0x2D19,0x2D1A,0x2D1B,0x2D1C,0x2D1D,0x2D1E,0x2D1F,
+       0x2D20,0x2D21,0x2D22,0x2D23,0x2D24,0x2D25,0};
+static const guint16 simple_lower_case_mapping_lowarea_table2 [] = {
+       /* ==== 1D00-2000 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x1E01,0,0x1E03,0,0x1E05,0,0x1E07,0,0x1E09,0,0x1E0B,0,0x1E0D,0,0x1E0F,0,
+       0x1E11,0,0x1E13,0,0x1E15,0,0x1E17,0,0x1E19,0,0x1E1B,0,0x1E1D,0,0x1E1F,0,
+       0x1E21,0,0x1E23,0,0x1E25,0,0x1E27,0,0x1E29,0,0x1E2B,0,0x1E2D,0,0x1E2F,0,
+       0x1E31,0,0x1E33,0,0x1E35,0,0x1E37,0,0x1E39,0,0x1E3B,0,0x1E3D,0,0x1E3F,0,
+       0x1E41,0,0x1E43,0,0x1E45,0,0x1E47,0,0x1E49,0,0x1E4B,0,0x1E4D,0,0x1E4F,0,
+       0x1E51,0,0x1E53,0,0x1E55,0,0x1E57,0,0x1E59,0,0x1E5B,0,0x1E5D,0,0x1E5F,0,
+       0x1E61,0,0x1E63,0,0x1E65,0,0x1E67,0,0x1E69,0,0x1E6B,0,0x1E6D,0,0x1E6F,0,
+       0x1E71,0,0x1E73,0,0x1E75,0,0x1E77,0,0x1E79,0,0x1E7B,0,0x1E7D,0,0x1E7F,0,
+       0x1E81,0,0x1E83,0,0x1E85,0,0x1E87,0,0x1E89,0,0x1E8B,0,0x1E8D,0,0x1E8F,0,
+       0x1E91,0,0x1E93,0,0x1E95,0,0,0,0,0,0,0,0,0,0xDF,0,
+       0x1EA1,0,0x1EA3,0,0x1EA5,0,0x1EA7,0,0x1EA9,0,0x1EAB,0,0x1EAD,0,0x1EAF,0,
+       0x1EB1,0,0x1EB3,0,0x1EB5,0,0x1EB7,0,0x1EB9,0,0x1EBB,0,0x1EBD,0,0x1EBF,0,
+       0x1EC1,0,0x1EC3,0,0x1EC5,0,0x1EC7,0,0x1EC9,0,0x1ECB,0,0x1ECD,0,0x1ECF,0,
+       0x1ED1,0,0x1ED3,0,0x1ED5,0,0x1ED7,0,0x1ED9,0,0x1EDB,0,0x1EDD,0,0x1EDF,0,
+       0x1EE1,0,0x1EE3,0,0x1EE5,0,0x1EE7,0,0x1EE9,0,0x1EEB,0,0x1EED,0,0x1EEF,0,
+       0x1EF1,0,0x1EF3,0,0x1EF5,0,0x1EF7,0,0x1EF9,0,0x1EFB,0,0x1EFD,0,0x1EFF,0,
+       0,0,0,0,0,0,0,0,0x1F00,0x1F01,0x1F02,0x1F03,0x1F04,0x1F05,0x1F06,0x1F07,
+       0,0,0,0,0,0,0,0,0x1F10,0x1F11,0x1F12,0x1F13,0x1F14,0x1F15,0,0,
+0,0,0,0,0,0,0,0,0x1F20,0x1F21,0x1F22,0x1F23,0x1F24,0x1F25,0x1F26,0x1F27,
+       0,0,0,0,0,0,0,0,0x1F30,0x1F31,0x1F32,0x1F33,0x1F34,0x1F35,0x1F36,0x1F37,
+       0,0,0,0,0,0,0,0,0x1F40,0x1F41,0x1F42,0x1F43,0x1F44,0x1F45,0,0,
+0,0,0,0,0,0,0,0,0,0x1F51,0,0x1F53,0,0x1F55,0,0x1F57,
+       0,0,0,0,0,0,0,0,0x1F60,0x1F61,0x1F62,0x1F63,0x1F64,0x1F65,0x1F66,0x1F67,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0x1F80,0x1F81,0x1F82,0x1F83,0x1F84,0x1F85,0x1F86,0x1F87,
+       0,0,0,0,0,0,0,0,0x1F90,0x1F91,0x1F92,0x1F93,0x1F94,0x1F95,0x1F96,0x1F97,
+       0,0,0,0,0,0,0,0,0x1FA0,0x1FA1,0x1FA2,0x1FA3,0x1FA4,0x1FA5,0x1FA6,0x1FA7,
+       0,0,0,0,0,0,0,0,0x1FB0,0x1FB1,0x1F70,0x1F71,0x1FB3,0,0,0,
+       0,0,0,0,0,0,0,0,0x1F72,0x1F73,0x1F74,0x1F75,0x1FC3,0,0,0,
+       0,0,0,0,0,0,0,0,0x1FD0,0x1FD1,0x1F76,0x1F77,0,0,0,0,
+       0,0,0,0,0,0,0,0,0x1FE0,0x1FE1,0x1F7A,0x1F7B,0x1FE5,0,0,0,
+       0,0,0,0,0,0,0,0,0x1F78,0x1F79,0x1F7C,0x1F7D,0x1FF3,0,0,0};
+static const guint16 simple_lower_case_mapping_lowarea_table3 [] = {
+       /* ==== 2100-21C0 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0x3C9,0,0,0,0x6B,0xE5,0,0,0,0,
+       0,0,0x214E,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177,0x2178,0x2179,0x217A,0x217B,0x217C,0x217D,0x217E,0x217F,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0x2184,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0};
+static const guint16 simple_lower_case_mapping_lowarea_table4 [] = {
+       /* ==== 2480-2500 ==== */
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0x24D0,0x24D1,0x24D2,0x24D3,0x24D4,0x24D5,0x24D6,0x24D7,0x24D8,0x24D9,
+       0x24DA,0x24DB,0x24DC,0x24DD,0x24DE,0x24DF,0x24E0,0x24E1,0x24E2,0x24E3,0x24E4,0x24E5,0x24E6,0x24E7,0x24E8,0x24E9,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0};
+static const guint16 simple_lower_case_mapping_lowarea_table5 [] = {
+       /* ==== 2C00-2D80 ==== */
+       0x2C30,0x2C31,0x2C32,0x2C33,0x2C34,0x2C35,0x2C36,0x2C37,0x2C38,0x2C39,0x2C3A,0x2C3B,0x2C3C,0x2C3D,0x2C3E,0x2C3F,
+       0x2C40,0x2C41,0x2C42,0x2C43,0x2C44,0x2C45,0x2C46,0x2C47,0x2C48,0x2C49,0x2C4A,0x2C4B,0x2C4C,0x2C4D,0x2C4E,0x2C4F,
+       0x2C50,0x2C51,0x2C52,0x2C53,0x2C54,0x2C55,0x2C56,0x2C57,0x2C58,0x2C59,0x2C5A,0x2C5B,0x2C5C,0x2C5D,0x2C5E,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0x2C61,0,0x26B,0x1D7D,0x27D,0,0,0x2C68,0,0x2C6A,0,0x2C6C,0,0x251,0x271,0x250,
+       0,0,0x2C73,0,0,0x2C76,0,0,0,0,0,0,0,0,0,0,
+0x2C81,0,0x2C83,0,0x2C85,0,0x2C87,0,0x2C89,0,0x2C8B,0,0x2C8D,0,0x2C8F,0,
+       0x2C91,0,0x2C93,0,0x2C95,0,0x2C97,0,0x2C99,0,0x2C9B,0,0x2C9D,0,0x2C9F,0,
+       0x2CA1,0,0x2CA3,0,0x2CA5,0,0x2CA7,0,0x2CA9,0,0x2CAB,0,0x2CAD,0,0x2CAF,0,
+       0x2CB1,0,0x2CB3,0,0x2CB5,0,0x2CB7,0,0x2CB9,0,0x2CBB,0,0x2CBD,0,0x2CBF,0,
+       0x2CC1,0,0x2CC3,0,0x2CC5,0,0x2CC7,0,0x2CC9,0,0x2CCB,0,0x2CCD,0,0x2CCF,0,
+       0x2CD1,0,0x2CD3,0,0x2CD5,0,0x2CD7,0,0x2CD9,0,0x2CDB,0,0x2CDD,0,0x2CDF,0,
+       0x2CE1,0,0x2CE3,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0};
+static const guint16 simple_lower_case_mapping_lowarea_table6 [] = {
+       /* ==== A640-A7C0 ==== */
+       0xA641,0,0xA643,0,0xA645,0,0xA647,0,0xA649,0,0xA64B,0,0xA64D,0,0xA64F,0,
+       0xA651,0,0xA653,0,0xA655,0,0xA657,0,0xA659,0,0xA65B,0,0xA65D,0,0xA65F,0,
+       0,0,0xA663,0,0xA665,0,0xA667,0,0xA669,0,0xA66B,0,0xA66D,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0xA681,0,0xA683,0,0xA685,0,0xA687,0,0xA689,0,0xA68B,0,0xA68D,0,0xA68F,0,
+       0xA691,0,0xA693,0,0xA695,0,0xA697,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0xA723,0,0xA725,0,0xA727,0,0xA729,0,0xA72B,0,0xA72D,0,0xA72F,0,
+       0,0,0xA733,0,0xA735,0,0xA737,0,0xA739,0,0xA73B,0,0xA73D,0,0xA73F,0,
+       0xA741,0,0xA743,0,0xA745,0,0xA747,0,0xA749,0,0xA74B,0,0xA74D,0,0xA74F,0,
+       0xA751,0,0xA753,0,0xA755,0,0xA757,0,0xA759,0,0xA75B,0,0xA75D,0,0xA75F,0,
+       0xA761,0,0xA763,0,0xA765,0,0xA767,0,0xA769,0,0xA76B,0,0xA76D,0,0xA76F,0,
+       0,0,0,0,0,0,0,0,0,0xA77A,0,0xA77C,0,0x1D79,0xA77F,0,
+       0xA781,0,0xA783,0,0xA785,0,0xA787,0,0,0,0,0xA78C,0,0};
+static const guint16 simple_lower_case_mapping_lowarea_table7 [] = {
+       /* ==== FF20-FF80 ==== */
+       0,0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47,0xFF48,0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F,
+       0xFF50,0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57,0xFF58,0xFF59,0xFF5A,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0};
+static const guint16 *simple_lower_case_mapping_lowarea [] = {
+       simple_lower_case_mapping_lowarea_table0,
+       simple_lower_case_mapping_lowarea_table1,
+       simple_lower_case_mapping_lowarea_table2,
+       simple_lower_case_mapping_lowarea_table3,
+       simple_lower_case_mapping_lowarea_table4,
+       simple_lower_case_mapping_lowarea_table5,
+       simple_lower_case_mapping_lowarea_table6,
+       simple_lower_case_mapping_lowarea_table7};
+static const int simple_lower_case_mapping_lowarea_table_count = 8;
+
+static const guint32 simple_lower_case_mapping_higharea_table0 [] = {
+       /* ==== 10400-10480 ==== */
+       0x10428,0x10429,0x1042A,0x1042B,0x1042C,0x1042D,0x1042E,0x1042F,0x10430,0x10431,0x10432,0x10433,0x10434,0x10435,0x10436,0x10437,
+       0x10438,0x10439,0x1043A,0x1043B,0x1043C,0x1043D,0x1043E,0x1043F,0x10440,0x10441,0x10442,0x10443,0x10444,0x10445,0x10446,0x10447,
+       0x10448,0x10449,0x1044A,0x1044B,0x1044C,0x1044D,0x1044E,0x1044F,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0};
+static const guint32 *simple_lower_case_mapping_higharea [] = {
+       simple_lower_case_mapping_higharea_table0};
+
+
+static const SimpleTitlecaseMapping simple_titlecase_mapping [] = {
+       {0x0001C4, 0x000000, 0x0001C5},
+       {0x0001C5, 0x0001C4, 0x0001C5},
+       {0x0001C6, 0x0001C4, 0x0001C5},
+       {0x0001C7, 0x000000, 0x0001C8},
+       {0x0001C8, 0x0001C7, 0x0001C8},
+       {0x0001C9, 0x0001C7, 0x0001C8},
+       {0x0001CA, 0x000000, 0x0001CB},
+       {0x0001CB, 0x0001CA, 0x0001CB},
+       {0x0001CC, 0x0001CA, 0x0001CB},
+       {0x0001F1, 0x000000, 0x0001F2},
+       {0x0001F2, 0x0001F1, 0x0001F2},
+       {0x0001F3, 0x0001F1, 0x0001F2}
+};
+static const guint8 simple_titlecase_mapping_count = 12;
+
+#endif
+
index 3243c12e47ba646cb3d490fea47374b23488c168..95867a3e4ca4fe233f645b950b6b8e59fbd8fac8 100644 (file)
@@ -127,6 +127,8 @@ null_gc_sources = \
 
 common_sources = \
        $(platform_sources)     \
+       appdomain.c     \
+       domain.c        \
        appdomain-icalls.h      \
        assembly.c              \
        assembly-internals.h    \
@@ -209,6 +211,7 @@ common_sources = \
        number-formatter.h      \
        number-ms.c             \
        number-ms.h             \
+       object.c        \
        object-internals.h      \
        opcodes.c               \
        property-bag.h  \
@@ -220,7 +223,6 @@ common_sources = \
        w32process.h            \
        w32process-internals.h          \
        profiler.c              \
-       profiler-events.h       \
        profiler-private.h      \
        rand.h                  \
        rand.c                  \
@@ -273,25 +275,23 @@ common_sources = \
        w32handle-namespace.c   \
        w32handle.h     \
        w32handle.c     \
-       w32error.h
+       w32error.h      \
+       reflection.c    \
+       dynamic-image.c \
+       sre.c   \
+       sre-encode.c    \
+       sre-save.c      \
+       custom-attrs.c  \
+       fdhandle.h      \
+       fdhandle.c
 
 # These source files have compile time dependencies on GC code
 gc_dependent_sources = \
-       appdomain.c     \
-       domain.c        \
        gc-stats.c      \
        gc.c            \
        monitor.c       \
        mono-hash.c     \
-       mono-conc-hash.c        \
-       object.c        \
-       dynamic-image.c \
-       sre.c   \
-       sre-encode.c    \
-       sre-save.c      \
-       custom-attrs.c  \
-       reflection.c
-
+       mono-conc-hash.c
 
 boehm_sources = \
        boehm-gc.c
@@ -350,6 +350,7 @@ libmonoruntimeinclude_HEADERS = \
        object.h                \
        opcodes.h               \
        profiler.h              \
+       profiler-events.h       \
        reflection.h            \
        row-indexes.h           \
        tokentype.h             \
index 19c44470ec7c0a033450ff1dd769b223571cdb84..2e02c9f8cff57d9cae8b746c28ccbe163c1ef2e4 100644 (file)
@@ -2587,7 +2587,6 @@ unload_thread_main (void *arg)
 
        mono_loader_lock (); //FIXME why do we need the loader lock here?
        mono_domain_lock (domain);
-#ifdef HAVE_SGEN_GC
        /*
         * We need to make sure that we don't have any remsets
         * pointing into static data of the to-be-freed domain because
@@ -2600,7 +2599,6 @@ unload_thread_main (void *arg)
        for (i = 0; i < domain->class_vtable_array->len; ++i)
                zero_static_data ((MonoVTable *)g_ptr_array_index (domain->class_vtable_array, i));
        mono_gc_collect (0);
-#endif
        for (i = 0; i < domain->class_vtable_array->len; ++i)
                clear_cached_vtable ((MonoVTable *)g_ptr_array_index (domain->class_vtable_array, i));
        deregister_reflection_info_roots (domain);
index e5b1cb0c57ad730db7c323e1ff9741ec7e3e17ac..35896715ac6ead8cd6b48aa2b7cbff950f2f7832 100644 (file)
@@ -2370,7 +2370,7 @@ static gboolean
 parse_public_key (const gchar *key, gchar** pubkey, gboolean *is_ecma)
 {
        const gchar *pkey;
-       gchar header [16], val, *arr;
+       gchar header [16], val, *arr, *endp;
        gint i, j, offset, bitlen, keylen, pkeylen;
        
        keylen = strlen (key) >> 1;
@@ -2432,16 +2432,10 @@ parse_public_key (const gchar *key, gchar** pubkey, gboolean *is_ecma)
        if (!pubkey)
                return TRUE;
                
+       arr = (gchar *)g_malloc (keylen + 4);
        /* Encode the size of the blob */
-       offset = 0;
-       if (keylen <= 127) {
-               arr = (gchar *)g_malloc (keylen + 1);
-               arr [offset++] = keylen;
-       } else {
-               arr = (gchar *)g_malloc (keylen + 2);
-               arr [offset++] = 0x80; /* 10bs */
-               arr [offset++] = keylen;
-       }
+       mono_metadata_encode_value (keylen, &arr[0], &endp);
+       offset = (gint)(endp-arr);
                
        for (i = offset, j = 0; i < keylen + offset; i++) {
                arr [i] = g_ascii_xdigit_value (key [j++]) << 4;
index 9439ebfab061919bccb7aea1c3454c4b4c39569a..e642be65561d391bdbf0bccef417f6394b531c56 100644 (file)
@@ -428,26 +428,31 @@ static gint64 gc_start_time;
 static void
 on_gc_notification (GC_EventType event)
 {
-       MonoProfilerGCEvent e = (MonoProfilerGCEvent)event;
+       MonoProfilerGCEvent e;
 
-       switch (e) {
-       case MONO_GC_EVENT_PRE_STOP_WORLD:
+       switch (event) {
+       case GC_EVENT_PRE_STOP_WORLD:
+               e = MONO_GC_EVENT_PRE_STOP_WORLD;
                MONO_GC_WORLD_STOP_BEGIN ();
                break;
 
-       case MONO_GC_EVENT_POST_STOP_WORLD:
+       case GC_EVENT_POST_STOP_WORLD:
+               e = MONO_GC_EVENT_POST_STOP_WORLD;
                MONO_GC_WORLD_STOP_END ();
                break;
 
-       case MONO_GC_EVENT_PRE_START_WORLD:
+       case GC_EVENT_PRE_START_WORLD:
+               e = MONO_GC_EVENT_PRE_START_WORLD;
                MONO_GC_WORLD_RESTART_BEGIN (1);
                break;
 
-       case MONO_GC_EVENT_POST_START_WORLD:
+       case GC_EVENT_POST_START_WORLD:
+               e = MONO_GC_EVENT_POST_START_WORLD;
                MONO_GC_WORLD_RESTART_END (1);
                break;
 
-       case MONO_GC_EVENT_START:
+       case GC_EVENT_START:
+               e = MONO_GC_EVENT_START;
                MONO_GC_BEGIN (1);
 #ifndef DISABLE_PERFCOUNTERS
                if (mono_perfcounters)
@@ -457,7 +462,8 @@ on_gc_notification (GC_EventType event)
                gc_start_time = mono_100ns_ticks ();
                break;
 
-       case MONO_GC_EVENT_END:
+       case GC_EVENT_END:
+               e = MONO_GC_EVENT_END;
                MONO_GC_END (1);
 #if defined(ENABLE_DTRACE) && defined(__sun__)
                /* This works around a dtrace -G problem on Solaris.
@@ -483,14 +489,23 @@ on_gc_notification (GC_EventType event)
                break;
        }
 
-       MONO_PROFILER_RAISE (gc_event, (e, 0));
+       switch (event) {
+       case GC_EVENT_MARK_START:
+       case GC_EVENT_MARK_END:
+       case GC_EVENT_RECLAIM_START:
+       case GC_EVENT_RECLAIM_END:
+               break;
+       default:
+               MONO_PROFILER_RAISE (gc_event, (e, 0));
+               break;
+       }
 
-       switch (e) {
-       case MONO_GC_EVENT_PRE_STOP_WORLD:
+       switch (event) {
+       case GC_EVENT_PRE_STOP_WORLD:
                mono_thread_info_suspend_lock ();
                MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED, 0));
                break;
-       case MONO_GC_EVENT_POST_START_WORLD:
+       case GC_EVENT_POST_START_WORLD:
                mono_thread_info_suspend_unlock ();
                MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_POST_START_WORLD_UNLOCKED, 0));
                break;
@@ -1156,11 +1171,8 @@ mono_gc_is_critical_method (MonoMethod *method)
  * @klass. The method will typically have an thread-local inline allocation sequence.
  * The signature of the called method is:
  *     object allocate (MonoVTable *vtable)
- * Some of the logic here is similar to mono_class_get_allocation_ftn () i object.c,
- * keep in sync.
  * The thread local alloc logic is taken from libgc/pthread_support.c.
  */
-
 MonoMethod*
 mono_gc_get_managed_allocator (MonoClass *klass, gboolean for_box, gboolean known_instance_size)
 {
index 39061bd142a1ec1e5411aaee98f7848babe99d1b..909e950c6c934c642b55c47aa2eeb21800faa031 100644 (file)
@@ -37,8 +37,10 @@ typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
 
 #ifdef ENABLE_ICALL_EXPORT
 #pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#define ICALL_DECL_EXPORT MONO_API
 #define ICALL_EXPORT MONO_API
 #else
+#define ICALL_DECL_EXPORT
 #define ICALL_EXPORT static
 #endif
 
@@ -492,7 +494,7 @@ struct MonoVTable {
  */
 struct _MonoGenericInst {
 #ifndef MONO_SMALL_CONFIG
-       guint id;                       /* unique ID for debugging */
+       gint32 id;                      /* unique ID for debugging */
 #endif
        guint type_argc    : 22;        /* number of type arguments */
        guint is_open      :  1;        /* if this is an open type */
@@ -755,17 +757,17 @@ typedef struct {
 
 typedef struct {
        guint64 new_object_count;
-       size_t initialized_class_count;
-       size_t generic_vtable_count;
+       gsize initialized_class_count;
+       gsize generic_vtable_count;
        size_t used_class_count;
        size_t method_count;
        size_t class_vtable_size;
        size_t class_static_data_size;
        size_t generic_instance_count;
-       size_t generic_class_count;
-       size_t inflated_method_count;
+       gsize generic_class_count;
+       gsize inflated_method_count;
        size_t inflated_method_count_2;
-       size_t inflated_type_count;
+       gsize inflated_type_count;
        size_t generics_metadata_size;
        size_t delegate_creations;
        size_t imt_tables_size;
index cd3f8bf703b433073663ebb089962c6306f760cf..2e3dcd73856b25bb5cf6694a8b4594c04ca3ce1d 100644 (file)
@@ -46,6 +46,7 @@
 #include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/atomic.h>
+#include <mono/utils/unlocked.h>
 #include <mono/utils/bsearch.h>
 #include <mono/utils/checked-build.h>
 
@@ -864,7 +865,7 @@ mono_class_inflate_generic_type_with_mempool (MonoImage *image, MonoType *type,
                }
        }
 
-       mono_stats.inflated_type_count++;
+       UnlockedIncrementSize (&mono_stats.inflated_type_count);
        return inflated;
 }
 
@@ -928,7 +929,7 @@ mono_class_inflate_generic_type_no_copy (MonoImage *image, MonoType *type, MonoG
        if (!inflated)
                return type;
 
-       mono_stats.inflated_type_count++;
+       UnlockedIncrementSize (&mono_stats.inflated_type_count);
        return inflated;
 }
 
@@ -1089,7 +1090,7 @@ mono_class_inflate_generic_method_full_checked (MonoMethod *method, MonoClass *k
                return (MonoMethod*)cached;
        }
 
-       mono_stats.inflated_method_count++;
+       UnlockedIncrementSize (&mono_stats.inflated_method_count);
 
        inflated_methods_size += sizeof (MonoMethodInflated);
 
@@ -3568,7 +3569,7 @@ mono_class_setup_vtable_full (MonoClass *klass, GList *in_setup)
                return;
        }
 
-       mono_stats.generic_vtable_count ++;
+       UnlockedIncrementSize (&mono_stats.generic_vtable_count);
        in_setup = g_list_prepend (in_setup, klass);
 
        if (mono_class_is_ginst (klass)) {
@@ -4902,7 +4903,7 @@ mono_class_init (MonoClass *klass)
                        goto leave;
        }
 
-       mono_stats.initialized_class_count++;
+       UnlockedIncrementSize (&mono_stats.initialized_class_count);
 
        if (mono_class_is_ginst (klass) && !mono_class_get_generic_class (klass)->is_dynamic) {
                MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
@@ -5047,10 +5048,10 @@ mono_class_init (MonoClass *klass)
                return !mono_class_has_failure (klass);
        }
 
-       mono_stats.initialized_class_count++;
+       UnlockedIncrementSize (&mono_stats.initialized_class_count);
 
        if (mono_class_is_ginst (klass) && !mono_class_get_generic_class (klass)->is_dynamic)
-               mono_stats.generic_class_count++;
+               UnlockedIncrementSize (&mono_stats.generic_class_count);
 
        if (mono_class_is_ginst (klass) || image_is_dynamic (klass->image) || !klass->type_token || (has_cached_info && !cached_info.has_nested_classes))
                klass->nested_classes_inited = TRUE;
index d522657b62f0b97efa9792ba77734e29d2882e12..d57cb52796be252c94d86cffbbc96db8bab7167c 100644 (file)
@@ -3664,3 +3664,52 @@ ves_icall_System_Runtime_InteropServices_Marshal_FreeBSTR (gpointer ptr)
 {
        mono_free_bstr (ptr);
 }
+
+void*
+mono_cominterop_get_com_interface (MonoObject *object, MonoClass *ic, MonoError *error)
+{
+       error_init (error);
+
+#ifndef DISABLE_COM
+       if (!object)
+               return NULL;
+
+       if (cominterop_object_is_rcw (object)) {
+               MonoClass *klass = NULL;
+               MonoRealProxy* real_proxy = NULL;
+               if (!object)
+                       return NULL;
+               klass = mono_object_class (object);
+               if (!mono_class_is_transparent_proxy (klass)) {
+                       mono_error_set_invalid_operation (error, "Class is not transparent");
+                       return NULL;
+               }
+
+               real_proxy = ((MonoTransparentProxy*)object)->rp;
+               if (!real_proxy) {
+                       mono_error_set_invalid_operation (error, "RealProxy is null");
+                       return NULL;
+               }
+
+               klass = mono_object_class (real_proxy);
+               if (klass != mono_class_get_interop_proxy_class ()) {
+                       mono_error_set_invalid_operation (error, "Object is not a proxy");
+                       return NULL;
+               }
+
+               if (!((MonoComInteropProxy*)real_proxy)->com_object) {
+                       mono_error_set_invalid_operation (error, "Proxy points to null COM object");
+                       return NULL;
+               }
+
+               void* com_itf = cominterop_get_interface_checked (((MonoComInteropProxy*)real_proxy)->com_object, ic, error);
+               return com_itf;
+       }
+       else {
+               void* ccw_entry = cominterop_get_ccw_checked (object, ic, error);
+               return ccw_entry;
+       }
+#else
+       g_assert_not_reached ();
+#endif
+}
index fc0e00297708d5b612828f629f18d806b9d7d291..04abc6e5fab1015ee3698302894f9f4abd5ac1b1 100644 (file)
@@ -64,4 +64,7 @@ mono_free_bstr (gpointer bstr);
 MonoClass*
 mono_class_try_get_com_object_class (void);
 
+void*
+mono_cominterop_get_com_interface (MonoObject* object, MonoClass* ic, MonoError *error);
+
 #endif /* __MONO_COMINTEROP_H__ */
index 0fecdbd66ce7415846f0609e2a095928934f0d51..a7954f721e44d8100a0fbfc3517615dac8a4dd64 100644 (file)
@@ -46,6 +46,12 @@ static GENERATE_GET_CLASS_WITH_CACHE (custom_attribute_named_argument, "System.R
 static MonoCustomAttrInfo*
 mono_custom_attrs_from_builders_handle (MonoImage *alloc_img, MonoImage *image, MonoArrayHandle cattrs);
 
+static gboolean
+bcheck_blob (const char *ptr, int bump, const char *endp, MonoError *error);
+
+static gboolean
+decode_blob_value_checked (const char *ptr, const char *endp, guint32 *size_out, const char **retp, MonoError *error);
+
 /*
  * LOCKING: Acquires the loader lock. 
  */
@@ -185,14 +191,18 @@ cattr_type_from_name (char *n, MonoImage *image, gboolean is_enum, MonoError *er
 }
 
 static MonoClass*
-load_cattr_enum_type (MonoImage *image, const char *p, const char **end, MonoError *error)
+load_cattr_enum_type (MonoImage *image, const char *p, const char *boundp, const char **end, MonoError *error)
 {
        char *n;
        MonoType *t;
-       int slen = mono_metadata_decode_value (p, &p);
-
+       guint32 slen;
        error_init (error);
 
+       if (!decode_blob_value_checked (p, boundp, &slen, &p, error))
+               return NULL;
+
+       if (boundp && slen > 0 && !bcheck_blob (p, slen - 1, boundp, error))
+               return NULL;
        n = (char *)g_memdup (p, slen + 1);
        n [slen] = 0;
        t = cattr_type_from_name (n, image, TRUE, error);
@@ -204,11 +214,13 @@ load_cattr_enum_type (MonoImage *image, const char *p, const char **end, MonoErr
 }
 
 static void*
-load_cattr_value (MonoImage *image, MonoType *t, const char *p, const char **end, MonoError *error)
+load_cattr_value (MonoImage *image, MonoType *t, const char *p, const char *boundp, const char **end, MonoError *error)
 {
-       int slen, type = t->type;
+       int type = t->type;
+       guint32 slen;
        MonoClass *tklass = t->data.klass;
 
+       g_assert (boundp);
        error_init (error);
 
 handle_enum:
@@ -217,6 +229,8 @@ handle_enum:
        case MONO_TYPE_I1:
        case MONO_TYPE_BOOLEAN: {
                MonoBoolean *bval = (MonoBoolean *)g_malloc (sizeof (MonoBoolean));
+               if (!bcheck_blob (p, 0, boundp, error))
+                       return NULL;
                *bval = *p;
                *end = p + 1;
                return bval;
@@ -225,6 +239,8 @@ handle_enum:
        case MONO_TYPE_U2:
        case MONO_TYPE_I2: {
                guint16 *val = (guint16 *)g_malloc (sizeof (guint16));
+               if (!bcheck_blob (p, 1, boundp, error))
+                       return NULL;
                *val = read16 (p);
                *end = p + 2;
                return val;
@@ -237,6 +253,8 @@ handle_enum:
        case MONO_TYPE_U4:
        case MONO_TYPE_I4: {
                guint32 *val = (guint32 *)g_malloc (sizeof (guint32));
+               if (!bcheck_blob (p, 3, boundp, error))
+                       return NULL;
                *val = read32 (p);
                *end = p + 4;
                return val;
@@ -248,12 +266,16 @@ handle_enum:
        case MONO_TYPE_U8:
        case MONO_TYPE_I8: {
                guint64 *val = (guint64 *)g_malloc (sizeof (guint64));
+               if (!bcheck_blob (p, 7, boundp, error))
+                       return NULL;
                *val = read64 (p);
                *end = p + 8;
                return val;
        }
        case MONO_TYPE_R8: {
                double *val = (double *)g_malloc (sizeof (double));
+               if (!bcheck_blob (p, 7, boundp, error))
+                       return NULL;
                readr8 (p, val);
                *end = p + 8;
                return val;
@@ -267,6 +289,8 @@ handle_enum:
                        
                        if (mono_is_corlib_image (k->image) && strcmp (k->name_space, "System") == 0 && strcmp (k->name, "DateTime") == 0){
                                guint64 *val = (guint64 *)g_malloc (sizeof (guint64));
+                               if (!bcheck_blob (p, 7, boundp, error))
+                                       return NULL;
                                *val = read64 (p);
                                *end = p + 8;
                                return val;
@@ -276,23 +300,33 @@ handle_enum:
                break;
                
        case MONO_TYPE_STRING:
+               if (!bcheck_blob (p, 0, boundp, error))
+                       return NULL;
                if (*p == (char)0xFF) {
                        *end = p + 1;
                        return NULL;
                }
-               slen = mono_metadata_decode_value (p, &p);
+               if (!decode_blob_value_checked (p, boundp, &slen, &p, error))
+                       return NULL;
+               if (slen > 0 && !bcheck_blob (p, slen - 1, boundp, error))
+                       return NULL;
                *end = p + slen;
                return mono_string_new_len_checked (mono_domain_get (), p, slen, error);
        case MONO_TYPE_CLASS: {
                MonoReflectionType *rt;
                char *n;
                MonoType *t;
+               if (!bcheck_blob (p, 0, boundp, error))
+                       return NULL;
                if (*p == (char)0xFF) {
                        *end = p + 1;
                        return NULL;
                }
 handle_type:
-               slen = mono_metadata_decode_value (p, &p);
+               if (!decode_blob_value_checked (p, boundp, &slen, &p, error))
+                       return NULL;
+               if (slen > 0 && !bcheck_blob (p, slen - 1, boundp, error))
+                       return NULL;
                n = (char *)g_memdup (p, slen + 1);
                n [slen] = 0;
                t = cattr_type_from_name (n, image, FALSE, error);
@@ -307,6 +341,8 @@ handle_type:
                return rt;
        }
        case MONO_TYPE_OBJECT: {
+               if (!bcheck_blob (p, 0, boundp, error))
+                       return NULL;
                char subt = *p++;
                MonoObject *obj;
                MonoClass *subc = NULL;
@@ -319,6 +355,8 @@ handle_type:
                        goto handle_enum;
                } else if (subt == 0x1D) {
                        MonoType simple_type = {{0}};
+                       if (!bcheck_blob (p, 0, boundp, error))
+                               return NULL;
                        int etype = *p;
                        p ++;
 
@@ -326,8 +364,8 @@ handle_type:
                        if (etype == 0x50) {
                                tklass = mono_defaults.systemtype_class;
                        } else if (etype == 0x55) {
-                               tklass = load_cattr_enum_type (image, p, &p, error);
-                               if (!mono_error_ok (error))
+                               tklass = load_cattr_enum_type (image, p, boundp, &p, error);
+                               if (!is_ok (error))
                                        return NULL;
                        } else {
                                if (etype == 0x51)
@@ -340,7 +378,10 @@ handle_type:
                } else if (subt == 0x55) {
                        char *n;
                        MonoType *t;
-                       slen = mono_metadata_decode_value (p, &p);
+                       if (!decode_blob_value_checked (p, boundp, &slen, &p, error))
+                               return NULL;
+                       if (slen > 0 && !bcheck_blob (p, slen - 1, boundp, error))
+                               return NULL;
                        n = (char *)g_memdup (p, slen + 1);
                        n [slen] = 0;
                        t = cattr_type_from_name (n, image, FALSE, error);
@@ -355,12 +396,12 @@ handle_type:
                } else {
                        g_error ("Unknown type 0x%02x for object type encoding in custom attr", subt);
                }
-               val = load_cattr_value (image, &subc->byval_arg, p, end, error);
+               val = load_cattr_value (image, &subc->byval_arg, p, boundp, end, error);
                obj = NULL;
-               if (mono_error_ok (error)) {
+               if (is_ok (error)) {
                        obj = mono_object_new_checked (mono_domain_get (), subc, error);
                        g_assert (!subc->has_references);
-                       if (mono_error_ok (error))
+                       if (is_ok (error))
                                mono_gc_memmove_atomic ((char*)obj + sizeof (MonoObject), val, mono_class_value_size (subc, NULL));
                }
 
@@ -370,6 +411,8 @@ handle_type:
        case MONO_TYPE_SZARRAY: {
                MonoArray *arr;
                guint32 i, alen, basetype;
+               if (!bcheck_blob (p, 3, boundp, error))
+                       return NULL;
                alen = read32 (p);
                p += 4;
                if (alen == 0xffffffff) {
@@ -387,6 +430,8 @@ handle_type:
                        case MONO_TYPE_I1:
                        case MONO_TYPE_BOOLEAN:
                                for (i = 0; i < alen; i++) {
+                                       if (!bcheck_blob (p, 0, boundp, error))
+                                               return NULL;
                                        MonoBoolean val = *p++;
                                        mono_array_set (arr, MonoBoolean, i, val);
                                }
@@ -395,6 +440,8 @@ handle_type:
                        case MONO_TYPE_U2:
                        case MONO_TYPE_I2:
                                for (i = 0; i < alen; i++) {
+                                       if (!bcheck_blob (p, 1, boundp, error))
+                                               return NULL;
                                        guint16 val = read16 (p);
                                        mono_array_set (arr, guint16, i, val);
                                        p += 2;
@@ -404,6 +451,8 @@ handle_type:
                        case MONO_TYPE_U4:
                        case MONO_TYPE_I4:
                                for (i = 0; i < alen; i++) {
+                                       if (!bcheck_blob (p, 3, boundp, error))
+                                               return NULL;
                                        guint32 val = read32 (p);
                                        mono_array_set (arr, guint32, i, val);
                                        p += 4;
@@ -411,6 +460,8 @@ handle_type:
                                break;
                        case MONO_TYPE_R8:
                                for (i = 0; i < alen; i++) {
+                                       if (!bcheck_blob (p, 7, boundp, error))
+                                               return NULL;
                                        double val;
                                        readr8 (p, &val);
                                        mono_array_set (arr, double, i, val);
@@ -420,6 +471,8 @@ handle_type:
                        case MONO_TYPE_U8:
                        case MONO_TYPE_I8:
                                for (i = 0; i < alen; i++) {
+                                       if (!bcheck_blob (p, 7, boundp, error))
+                                               return NULL;
                                        guint64 val = read64 (p);
                                        mono_array_set (arr, guint64, i, val);
                                        p += 8;
@@ -430,8 +483,8 @@ handle_type:
                        case MONO_TYPE_STRING:
                        case MONO_TYPE_SZARRAY:
                                for (i = 0; i < alen; i++) {
-                                       MonoObject *item = (MonoObject *)load_cattr_value (image, &tklass->byval_arg, p, &p, error);
-                                       if (!mono_error_ok (error))
+                                       MonoObject *item = (MonoObject *)load_cattr_value (image, &tklass->byval_arg, p, boundp, &p, error);
+                                       if (!is_ok (error))
                                                return NULL;
                                        mono_array_setref (arr, i, item);
                                }
@@ -449,13 +502,13 @@ handle_type:
 }
 
 static MonoObject*
-load_cattr_value_boxed (MonoDomain *domain, MonoImage *image, MonoType *t, const char* p, const char** end, MonoError *error)
+load_cattr_value_boxed (MonoDomain *domain, MonoImage *image, MonoType *t, const char* p, const char *boundp, const char** end, MonoError *error)
 {
        error_init (error);
 
        gboolean is_ref = type_is_reference (t);
 
-       void *val = load_cattr_value (image, t, p, end, error);
+       void *val = load_cattr_value (image, t, p, boundp, end, error);
        if (!is_ok (error)) {
                if (is_ref)
                        g_free (val);
@@ -576,11 +629,100 @@ mono_custom_attrs_from_builders (MonoImage *alloc_img, MonoImage *image, MonoArr
        return ainfo;
 }
 
+static void
+set_custom_attr_fmt_error (MonoError *error)
+{
+       error_init (error);
+       mono_error_set_generic_error (error, "System.Reflection", "CustomAttributeFormatException", "Binary format of the specified custom attribute was invalid.");
+}
+
+/**
+ * bcheck_blob:
+ * \param ptr a pointer into a blob
+ * \param bump how far we plan on reading past \p ptr.
+ * \param endp upper bound for \p ptr - one past the last valid value for \p ptr.
+ * \param error set on error
+ *
+ * Check that ptr+bump is below endp.  Returns TRUE on success, or FALSE on
+ * failure and sets \p error.
+ */
+static gboolean
+bcheck_blob (const char *ptr, int bump, const char *endp, MonoError *error)
+{
+       error_init (error);
+       if (ADDP_IS_GREATER_OR_OVF (ptr, bump, endp - 1)) {
+               set_custom_attr_fmt_error (error);
+               return FALSE;
+       } else
+               return TRUE;
+}
+
+/**
+ * decode_blob_size_checked:
+ * \param ptr a pointer into a blob
+ * \param endp upper bound for \p ptr - one pas the last valid value for \p ptr
+ * \param size_out on success set to the decoded size
+ * \param retp on success set to the next byte after the encoded size
+ * \param error set on error
+ *
+ * Decode an encoded size value which takes 1, 2, or 4 bytes and set \p
+ * size_out to the decoded size and \p retp to the next byte after the encoded
+ * size.  Returns TRUE on success, or FALASE on failure and sets \p error.
+ */
+static gboolean
+decode_blob_size_checked (const char *ptr, const char *endp, guint32 *size_out, const char **retp, MonoError *error)
+{
+       error_init (error);
+       if (endp && !bcheck_blob (ptr, 0, endp, error))
+               goto leave;
+       if ((*ptr & 0x80) != 0) {
+               if ((*ptr & 0x40) == 0 && !bcheck_blob (ptr, 1, endp, error))
+                       goto leave;
+               else if (!bcheck_blob (ptr, 3, endp, error))
+                       goto leave;
+       }
+       *size_out = mono_metadata_decode_blob_size (ptr, retp);
+leave:
+       return is_ok (error);
+}
+
+/**
+ * decode_blob_value_checked:
+ * \param ptr a pointer into a blob
+ * \param endp upper bound for \p ptr - one pas the last valid value for \p ptr
+ * \param value_out on success set to the decoded value
+ * \param retp on success set to the next byte after the encoded size
+ * \param error set on error
+ *
+ * Decode an encoded uint32 value which takes 1, 2, or 4 bytes and set \p
+ * value_out to the decoded value and \p retp to the next byte after the
+ * encoded value.  Returns TRUE on success, or FALASE on failure and sets \p
+ * error.
+ */
+static gboolean
+decode_blob_value_checked (const char *ptr, const char *endp, guint32 *value_out, const char **retp, MonoError *error)
+{
+       /* This similar to decode_blob_size_checked, above but delegates to
+        * mono_metadata_decode_value which is semantically different. */
+       error_init (error);
+       if (!bcheck_blob (ptr, 0, endp, error))
+               goto leave;
+       if ((*ptr & 0x80) != 0) {
+               if ((*ptr & 0x40) == 0 && !bcheck_blob (ptr, 1, endp, error))
+                       goto leave;
+               else if (!bcheck_blob (ptr, 3, endp, error))
+                       goto leave;
+       }
+       *value_out = mono_metadata_decode_value (ptr, retp);
+leave:
+       return is_ok (error);
+}
 
 static MonoObject*
 create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoError *error)
 {
        const char *p = (const char*)data;
+       const char *data_end = (const char*)data + len;
        const char *named;
        guint32 i, j, num_named;
        MonoObject *attr;
@@ -593,7 +735,7 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu
        mono_class_init (method->klass);
 
        if (!mono_verifier_verify_cattr_content (image, method, data, len, NULL)) {
-               mono_error_set_generic_error (error, "System.Reflection", "CustomAttributeFormatException", "Binary format of the specified custom attribute was invalid.");
+               set_custom_attr_fmt_error (error);
                return NULL;
        }
 
@@ -625,8 +767,8 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu
        /* skip prolog */
        p += 2;
        for (i = 0; i < mono_method_signature (method)->param_count; ++i) {
-               params [i] = load_cattr_value (image, mono_method_signature (method)->params [i], p, &p, error);
-               if (!mono_error_ok (error))
+               params [i] = load_cattr_value (image, mono_method_signature (method)->params [i], p, data_end, &p, error);
+               if (!is_ok (error))
                        goto fail;
        }
 
@@ -643,19 +785,37 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu
                goto fail;
        }
 
-       num_named = read16 (named);
-       named += 2;
+       if (named + 1 < data_end) {
+               num_named = read16 (named);
+               named += 2;
+       } else {
+               /* CoreCLR allows p == data + len */
+               if (named == data_end)
+                       num_named = 0;
+               else {
+                       set_custom_attr_fmt_error (error);
+                       goto fail;
+               }
+       }
        for (j = 0; j < num_named; j++) {
-               gint name_len;
+               guint32 name_len;
                char *name, named_type, data_type;
+               if (!bcheck_blob (named, 1, data_end, error))
+                       goto fail;
                named_type = *named++;
                data_type = *named++; /* type of data */
-               if (data_type == MONO_TYPE_SZARRAY)
+               if (data_type == MONO_TYPE_SZARRAY) {
+                       if (!bcheck_blob (named, 0, data_end, error))
+                               goto fail;
                        data_type = *named++;
+               }
                if (data_type == MONO_TYPE_ENUM) {
-                       gint type_len;
+                       guint32 type_len;
                        char *type_name;
-                       type_len = mono_metadata_decode_blob_size (named, &named);
+                       if (!decode_blob_size_checked (named, data_end, &type_len, &named, error))
+                               goto fail;
+                       if (type_len > 0 && !bcheck_blob (named, type_len - 1, data_end, error))
+                               goto fail;
                        type_name = (char *)g_malloc (type_len + 1);
                        memcpy (type_name, named, type_len);
                        type_name [type_len] = 0;
@@ -663,7 +823,10 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu
                        /* FIXME: lookup the type and check type consistency */
                        g_free (type_name);
                }
-               name_len = mono_metadata_decode_blob_size (named, &named);
+               if (!decode_blob_size_checked (named, data_end, &name_len, &named, error))
+                       goto fail;
+               if (name_len > 0 && !bcheck_blob (named, name_len - 1, data_end, error))
+                       goto fail;
                name = (char *)g_malloc (name_len + 1);
                memcpy (name, named, name_len);
                name [name_len] = 0;
@@ -680,8 +843,8 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu
                                goto fail;
                        }
 
-                       val = load_cattr_value (image, field->type, named, &named, error);
-                       if (!mono_error_ok (error)) {
+                       val = load_cattr_value (image, field->type, named, data_end, &named, error);
+                       if (!is_ok (error)) {
                                g_free (name);
                                if (!type_is_reference (field->type))
                                        g_free (val);
@@ -714,8 +877,8 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu
                        prop_type = prop->get? mono_method_signature (prop->get)->ret :
                             mono_method_signature (prop->set)->params [mono_method_signature (prop->set)->param_count - 1];
 
-                       pparams [0] = load_cattr_value (image, prop_type, named, &named, error);
-                       if (!mono_error_ok (error)) {
+                       pparams [0] = load_cattr_value (image, prop_type, named, data_end, &named, error);
+                       if (!is_ok (error)) {
                                g_free (name);
                                if (!type_is_reference (prop_type))
                                        g_free (pparams [0]);
@@ -761,6 +924,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth
        MonoClass *attrklass;
        MonoDomain *domain;
        const char *p = (const char*)data;
+       const char *data_end = p + len;
        const char *named;
        guint32 i, j, num_named;
        CattrNamedArg *arginfo = NULL;
@@ -782,21 +946,28 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth
 
        if (len < 2 || read16 (p) != 0x0001) /* Prolog */
                return;
+       /* skip prolog */
+       p += 2;
 
+       /* Parse each argument corresponding to the signature's parameters from
+        * the blob and store in typedargs.
+        */
        typedargs = mono_array_new_checked (domain, mono_get_object_class (), mono_method_signature (method)->param_count, error);
        return_if_nok (error);
 
-       /* skip prolog */
-       p += 2;
        for (i = 0; i < mono_method_signature (method)->param_count; ++i) {
                MonoObject *obj;
 
-               obj = load_cattr_value_boxed (domain, image, mono_method_signature (method)->params [i], p, &p, error);
+               obj = load_cattr_value_boxed (domain, image, mono_method_signature (method)->params [i], p, data_end, &p, error);
                return_if_nok (error);
                mono_array_setref (typedargs, i, obj);
        }
 
        named = p;
+
+       /* Parse mandatory count of named arguments (could be zero) */
+       if (!bcheck_blob (named, 1, data_end, error))
+               return;
        num_named = read16 (named);
        namedargs = mono_array_new_checked (domain, mono_get_object_class (), num_named, error);
        return_if_nok (error);
@@ -806,17 +977,25 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth
        arginfo = g_new0 (CattrNamedArg, num_named);
        *named_arg_info = arginfo;
 
+       /* Parse each named arg, and add to arginfo.  Each named argument could
+        * be a field name or a property name followed by a value. */
        for (j = 0; j < num_named; j++) {
-               gint name_len;
+               guint32 name_len;
                char *name, named_type, data_type;
-               named_type = *named++;
+               if (!bcheck_blob (named, 1, data_end, error))
+                       return;
+               named_type = *named++; /* field or property? */
                data_type = *named++; /* type of data */
-               if (data_type == MONO_TYPE_SZARRAY)
+               if (data_type == MONO_TYPE_SZARRAY) {
+                       if (!bcheck_blob (named, 0, data_end, error))
+                               return;
                        data_type = *named++;
+               }
                if (data_type == MONO_TYPE_ENUM) {
-                       gint type_len;
+                       guint32 type_len;
                        char *type_name;
-                       type_len = mono_metadata_decode_blob_size (named, &named);
+                       if (!decode_blob_size_checked (named, data_end, &type_len, &named, error))
+                               return;
                        if (ADDP_IS_GREATER_OR_OVF ((const guchar*)named, type_len, data + len))
                                goto fail;
 
@@ -827,7 +1006,9 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth
                        /* FIXME: lookup the type and check type consistency */
                        g_free (type_name);
                }
-               name_len = mono_metadata_decode_blob_size (named, &named);
+               /* named argument name: length, then name */
+               if (!decode_blob_size_checked(named, data_end, &name_len, &named, error))
+                       return;
                if (ADDP_IS_GREATER_OR_OVF ((const guchar*)named, name_len, data + len))
                        goto fail;
                name = (char *)g_malloc (name_len + 1);
@@ -835,6 +1016,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth
                name [name_len] = 0;
                named += name_len;
                if (named_type == 0x53) {
+                       /* Named arg is a field. */
                        MonoObject *obj;
                        MonoClassField *field = mono_class_get_field_from_name (attrklass, name);
 
@@ -846,7 +1028,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth
                        arginfo [j].type = field->type;
                        arginfo [j].field = field;
 
-                       obj = load_cattr_value_boxed (domain, image, field->type, named, &named, error);
+                       obj = load_cattr_value_boxed (domain, image, field->type, named, data_end, &named, error);
                        if (!is_ok (error)) {
                                g_free (name);
                                return;
@@ -854,6 +1036,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth
                        mono_array_setref (namedargs, j, obj);
 
                } else if (named_type == 0x54) {
+                       /* Named arg is a property */
                        MonoObject *obj;
                        MonoType *prop_type;
                        MonoProperty *prop = mono_class_get_property_from_name (attrklass, name);
@@ -869,7 +1052,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth
                        arginfo [j].type = prop_type;
                        arginfo [j].prop = prop;
 
-                       obj = load_cattr_value_boxed (domain, image, prop_type, named, &named, error);
+                       obj = load_cattr_value_boxed (domain, image, prop_type, named, data_end, &named, error);
                        if (!is_ok (error)) {
                                g_free (name);
                                return;
@@ -1668,7 +1851,9 @@ mono_reflection_get_custom_attrs_info_checked (MonoObjectHandle obj, MonoError *
                MonoReflectionAssemblyBuilderHandle assemblyb = MONO_HANDLE_CAST (MonoReflectionAssemblyBuilder, obj);
                MonoReflectionAssemblyHandle assembly = MONO_HANDLE_CAST (MonoReflectionAssembly, assemblyb);
                MonoArrayHandle cattrs = MONO_HANDLE_NEW_GET (MonoArray, assemblyb, cattrs);
-               cinfo = mono_custom_attrs_from_builders_handle (NULL, MONO_HANDLE_GETVAL (assembly, assembly)->image, cattrs);
+               MonoImage * image = MONO_HANDLE_GETVAL (assembly, assembly)->image;
+               g_assert (image);
+               cinfo = mono_custom_attrs_from_builders_handle (NULL, image, cattrs);
        } else if (strcmp ("TypeBuilder", klass->name) == 0) {
                MonoReflectionTypeBuilderHandle tb = MONO_HANDLE_CAST (MonoReflectionTypeBuilder, obj);
                MonoReflectionModuleBuilderHandle module = MONO_HANDLE_NEW_GET (MonoReflectionModuleBuilder, tb, module);
index 2a97148f212c44612de0764e4a1ed38ea4ea2355..de2a6970f73c52d51acec59ab9e4a6416549dab8 100644 (file)
@@ -386,12 +386,12 @@ mono_domain_create (void)
        }
        mono_appdomains_unlock ();
 
-#ifdef HAVE_BOEHM_GC
-       domain = (MonoDomain *)mono_gc_alloc_fixed (sizeof (MonoDomain), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "domain object");
-#else
-       domain = (MonoDomain *)mono_gc_alloc_fixed (sizeof (MonoDomain), domain_gc_desc, MONO_ROOT_SOURCE_DOMAIN, "domain object");
-       mono_gc_register_root ((char*)&(domain->MONO_DOMAIN_FIRST_GC_TRACKED), G_STRUCT_OFFSET (MonoDomain, MONO_DOMAIN_LAST_GC_TRACKED) - G_STRUCT_OFFSET (MonoDomain, MONO_DOMAIN_FIRST_GC_TRACKED), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "misc domain fields");
-#endif
+       if (!mono_gc_is_moving ()) {
+               domain = (MonoDomain *)mono_gc_alloc_fixed (sizeof (MonoDomain), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "domain object");
+       } else {
+               domain = (MonoDomain *)mono_gc_alloc_fixed (sizeof (MonoDomain), domain_gc_desc, MONO_ROOT_SOURCE_DOMAIN, "domain object");
+               mono_gc_register_root ((char*)&(domain->MONO_DOMAIN_FIRST_GC_TRACKED), G_STRUCT_OFFSET (MonoDomain, MONO_DOMAIN_LAST_GC_TRACKED) - G_STRUCT_OFFSET (MonoDomain, MONO_DOMAIN_FIRST_GC_TRACKED), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "misc domain fields");
+       }
        domain->shadow_serial = shadow_serial;
        domain->domain = NULL;
        domain->setup = NULL;
@@ -1208,16 +1208,13 @@ mono_domain_free (MonoDomain *domain, gboolean force)
 
        domain->setup = NULL;
 
-#ifndef HAVE_BOEHM_GC
-       mono_gc_deregister_root ((char*)&(domain->MONO_DOMAIN_FIRST_GC_TRACKED));
-#endif
+       if (mono_gc_is_moving ())
+               mono_gc_deregister_root ((char*)&(domain->MONO_DOMAIN_FIRST_GC_TRACKED));
 
        mono_appdomains_lock ();
        appdomains_list [domain->domain_id] = NULL;
        mono_appdomains_unlock ();
 
-       /* FIXME: anything else required ? */
-
        mono_gc_free_fixed (domain);
 
 #ifndef DISABLE_PERFCOUNTERS
index 344d2d6e978efe3467ab9a88b8da6f4e79875812..bb1084e981ee9b3690626d5fe3bc44b2b25ce03b 100644 (file)
@@ -24,11 +24,17 @@ typedef struct {
 } MonoILT;
 
 
+typedef enum {
+       MONO_DYN_IMAGE_TOK_NEW, /* assert if same token is registered already */
+       MONO_DYN_IMAGE_TOK_SAME_OK, /* allow collision only with the same object */
+       MONO_DYN_IMAGE_TOK_REPLACE, /* keep the new object, always */
+} MonoDynamicImageTokCollision;
+
 void
 mono_dynamic_images_init (void);
 
 void
-mono_dynamic_image_register_token (MonoDynamicImage *assembly, guint32 token, MonoObjectHandle obj);
+mono_dynamic_image_register_token (MonoDynamicImage *assembly, guint32 token, MonoObjectHandle obj, int tok_collision);
 
 gboolean
 mono_dynamic_image_is_valid_token (MonoDynamicImage *image, guint32 token);
index 211ba26266f050be64153fbbe19701171d265f6b..85fd2708111b57412ebf56997d5a28e1e9a7609a 100644 (file)
@@ -193,17 +193,33 @@ dynamic_image_unlock (MonoDynamicImage *image)
  * the Module.ResolveXXXToken () methods to work.
  */
 void
-mono_dynamic_image_register_token (MonoDynamicImage *assembly, guint32 token, MonoObjectHandle obj)
+mono_dynamic_image_register_token (MonoDynamicImage *assembly, guint32 token, MonoObjectHandle obj, int how_collide)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
+       g_assert (!MONO_HANDLE_IS_NULL (obj));
+       g_assert (strcmp (mono_handle_class (obj)->name, "EnumBuilder"));
        dynamic_image_lock (assembly);
+       MonoObject *prev = (MonoObject *)mono_g_hash_table_lookup (assembly->tokens, GUINT_TO_POINTER (token));
+       if (prev) {
+               switch (how_collide) {
+               case MONO_DYN_IMAGE_TOK_NEW:
+                       g_assert_not_reached ();
+               case MONO_DYN_IMAGE_TOK_SAME_OK:
+                       g_assert (prev == MONO_HANDLE_RAW (obj));
+                       break;
+               case MONO_DYN_IMAGE_TOK_REPLACE:
+                       break;
+               default:
+                       g_assert_not_reached ();
+               }
+       }
        mono_g_hash_table_insert (assembly->tokens, GUINT_TO_POINTER (token), MONO_HANDLE_RAW (obj));
        dynamic_image_unlock (assembly);
 }
 #else
 void
-mono_dynamic_image_register_token (MonoDynamicImage *assembly, guint32 token, MonoObjectHandle obj)
+mono_dynamic_image_register_token (MonoDynamicImage *assembly, guint32 token, MonoObjectHandle obj, int how_collide)
 {
 }
 #endif
diff --git a/mono/metadata/fdhandle.c b/mono/metadata/fdhandle.c
new file mode 100644 (file)
index 0000000..39e531b
--- /dev/null
@@ -0,0 +1,142 @@
+
+#include "fdhandle.h"
+#include "utils/mono-lazy-init.h"
+#include "utils/mono-coop-mutex.h"
+
+static GHashTable *fds;
+static MonoCoopMutex fds_mutex;
+static MonoFDHandleCallback fds_callback[MONO_FDTYPE_COUNT];
+static mono_lazy_init_t fds_init = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED;
+
+static const gchar *types_str[] = {
+       "File",
+       "Console",
+       "Pipe",
+       "Socket",
+       NULL
+};
+
+static void
+fds_remove (gpointer data)
+{
+       MonoFDHandle* fdhandle;
+
+       fdhandle = (MonoFDHandle*) data;
+       g_assert (fdhandle);
+
+       g_assert (fds_callback [fdhandle->type].close);
+       fds_callback [fdhandle->type].close (fdhandle);
+
+       mono_refcount_dec (fdhandle);
+}
+
+static void
+initialize (void)
+{
+       fds = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, fds_remove);
+       mono_coop_mutex_init (&fds_mutex);
+}
+
+void
+mono_fdhandle_register (MonoFDType type, MonoFDHandleCallback *callback)
+{
+       mono_lazy_initialize (&fds_init, initialize);
+       memcpy (&fds_callback [type], callback, sizeof (MonoFDHandleCallback));
+}
+
+static void
+fdhandle_destroy (gpointer data)
+{
+       MonoFDHandle* fdhandle;
+
+       fdhandle = (MonoFDHandle*) data;
+       g_assert (fdhandle);
+
+       g_assert (fds_callback [fdhandle->type].destroy);
+       fds_callback [fdhandle->type].destroy (fdhandle);
+}
+
+void
+mono_fdhandle_init (MonoFDHandle *fdhandle, MonoFDType type, gint fd)
+{
+       mono_refcount_init (fdhandle, fdhandle_destroy);
+       fdhandle->type = type;
+       fdhandle->fd = fd;
+}
+
+void
+mono_fdhandle_insert (MonoFDHandle *fdhandle)
+{
+       mono_coop_mutex_lock (&fds_mutex);
+
+       if (g_hash_table_lookup_extended (fds, GINT_TO_POINTER(fdhandle->fd), NULL, NULL))
+               g_error("%s: duplicate %s fd %d", __func__, types_str [fdhandle->type], fdhandle->fd);
+
+       g_hash_table_insert (fds, GINT_TO_POINTER(fdhandle->fd), fdhandle);
+
+       mono_coop_mutex_unlock (&fds_mutex);
+}
+
+gboolean
+mono_fdhandle_try_insert (MonoFDHandle *fdhandle)
+{
+       mono_coop_mutex_lock (&fds_mutex);
+
+       if (g_hash_table_lookup_extended (fds, GINT_TO_POINTER(fdhandle->fd), NULL, NULL)) {
+               /* we raced between 2 invocations of mono_fdhandle_try_insert */
+               mono_coop_mutex_unlock (&fds_mutex);
+
+               return FALSE;
+       }
+
+       g_hash_table_insert (fds, GINT_TO_POINTER(fdhandle->fd), fdhandle);
+
+       mono_coop_mutex_unlock (&fds_mutex);
+
+       return TRUE;
+}
+
+gboolean
+mono_fdhandle_lookup_and_ref (gint fd, MonoFDHandle **fdhandle)
+{
+       mono_coop_mutex_lock (&fds_mutex);
+
+       if (!g_hash_table_lookup_extended (fds, GINT_TO_POINTER(fd), NULL, (gpointer*) fdhandle)) {
+               mono_coop_mutex_unlock (&fds_mutex);
+               return FALSE;
+       }
+
+       mono_refcount_inc (*fdhandle);
+
+       mono_coop_mutex_unlock (&fds_mutex);
+
+       return TRUE;
+}
+
+void
+mono_fdhandle_unref (MonoFDHandle *fdhandle)
+{
+       mono_refcount_dec (fdhandle);
+}
+
+gboolean
+mono_fdhandle_close (gint fd)
+{
+       MonoFDHandle *fdhandle;
+       gboolean removed;
+
+       mono_coop_mutex_lock (&fds_mutex);
+
+       if (!g_hash_table_lookup_extended (fds, GINT_TO_POINTER(fd), NULL, (gpointer*) &fdhandle)) {
+               mono_coop_mutex_unlock (&fds_mutex);
+
+               return FALSE;
+       }
+
+       removed = g_hash_table_remove (fds, GINT_TO_POINTER(fdhandle->fd));
+       g_assert (removed);
+
+       mono_coop_mutex_unlock (&fds_mutex);
+
+       return TRUE;
+}
diff --git a/mono/metadata/fdhandle.h b/mono/metadata/fdhandle.h
new file mode 100644 (file)
index 0000000..e3d7e5b
--- /dev/null
@@ -0,0 +1,50 @@
+
+#ifndef __MONO_METADATA_FDHANDLE_H__
+#define __MONO_METADATA_FDHANDLE_H__
+
+#include <config.h>
+#include <glib.h>
+
+#include "utils/refcount.h"
+
+typedef enum {
+       MONO_FDTYPE_FILE,
+       MONO_FDTYPE_CONSOLE,
+       MONO_FDTYPE_PIPE,
+       MONO_FDTYPE_SOCKET,
+       MONO_FDTYPE_COUNT
+} MonoFDType;
+
+typedef struct {
+       MonoRefCount ref;
+       MonoFDType type;
+       gint fd;
+} MonoFDHandle;
+
+typedef struct {
+       void (*close) (MonoFDHandle *fdhandle);
+       void (*destroy) (MonoFDHandle *fdhandle);
+} MonoFDHandleCallback;
+
+void
+mono_fdhandle_register (MonoFDType type, MonoFDHandleCallback *callback);
+
+void
+mono_fdhandle_init (MonoFDHandle *fdhandle, MonoFDType type, gint fd);
+
+void
+mono_fdhandle_insert (MonoFDHandle *fdhandle);
+
+gboolean
+mono_fdhandle_try_insert (MonoFDHandle *fdhandle);
+
+gboolean
+mono_fdhandle_lookup_and_ref (gint fd, MonoFDHandle **fdhandle);
+
+void
+mono_fdhandle_unref (MonoFDHandle *fdhandle);
+
+gboolean
+mono_fdhandle_close (gint fd);
+
+#endif /* __MONO_METADATA_FDHANDLE_H__ */
index a6a68bde499bd28025b7d763c991735509efc26a..2cc591e8c8c7d361548c07e02d52aa0763e43e36 100644 (file)
@@ -459,7 +459,8 @@ HANDLES(ICALL(SOCK_3, "Bind_internal(intptr,System.Net.SocketAddress,int&)", ves
 HANDLES(ICALL(SOCK_4, "Blocking_internal(intptr,bool,int&)", ves_icall_System_Net_Sockets_Socket_Blocking_internal))
 HANDLES(ICALL(SOCK_5, "Close_internal(intptr,int&)", ves_icall_System_Net_Sockets_Socket_Close_internal))
 HANDLES(ICALL(SOCK_6, "Connect_internal(intptr,System.Net.SocketAddress,int&,bool)", ves_icall_System_Net_Sockets_Socket_Connect_internal))
-HANDLES(ICALL (SOCK_6a, "Disconnect_internal(intptr,bool,int&)", ves_icall_System_Net_Sockets_Socket_Disconnect_internal))
+HANDLES(ICALL(SOCK_6a, "Disconnect_internal(intptr,bool,int&)", ves_icall_System_Net_Sockets_Socket_Disconnect_internal))
+HANDLES(ICALL(SOCK_6b, "Duplicate_internal", ves_icall_System_Net_Sockets_Socket_Duplicate_internal))
 HANDLES(ICALL(SOCK_7, "GetSocketOption_arr_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,byte[]&,int&)", ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal))
 HANDLES(ICALL(SOCK_8, "GetSocketOption_obj_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object&,int&)", ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal))
 HANDLES(ICALL(SOCK_21, "IOControl_internal(intptr,int,byte[],byte[],int&)", ves_icall_System_Net_Sockets_Socket_IOControl_internal))
index e685ac227abfc4693a2fedb33903a57e6a56d574..61a6f94146588d2f175fdc83e83e760e0ea9c805 100644 (file)
@@ -1887,7 +1887,7 @@ mono_get_method_constrained_checked (MonoImage *image, guint32 token, MonoClass
 {
        error_init (error);
 
-       *cil_method = mono_get_method_from_token (image, token, NULL, context, NULL, error);
+       *cil_method = mono_get_method_checked (image, token, NULL, context, error);
        if (!*cil_method)
                return NULL;
 
index 9403e54a149ad81b16ba8f945bacddbed73718a9..cc682a9eed2d39d600efd3c48176e52dec8881f0 100644 (file)
@@ -799,12 +799,13 @@ mono_array_to_lparray (MonoArray *array)
 
        int i = 0;
        MonoClass *klass;
+       MonoError error;
 #endif
 
        if (!array)
                return NULL;
 #ifndef DISABLE_COM
-
+       error_init (&error);
        klass = array->obj.vtable->klass;
 
        switch (klass->element_class->byval_arg.type) {
@@ -813,9 +814,12 @@ mono_array_to_lparray (MonoArray *array)
                break;
        case MONO_TYPE_CLASS:
                nativeArraySize = array->max_length;
-               nativeArray = (void **)malloc(sizeof(gpointer) * nativeArraySize);
-               for(i = 0; i < nativeArraySize; ++i)    
-                       nativeArray[i] = ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal(((MonoObject **)array->vector)[i]);
+               nativeArray = (void **)g_malloc (sizeof(gpointer) * nativeArraySize);
+               for(i = 0; i < nativeArraySize; ++i) {
+                       nativeArray[i] = mono_cominterop_get_com_interface (((MonoObject **)array->vector)[i], klass->element_class, &error);
+                       if (mono_error_set_pending_exception (&error))
+                               break;
+               }
                return nativeArray;
        case MONO_TYPE_U1:
        case MONO_TYPE_BOOLEAN:
@@ -853,7 +857,6 @@ mono_free_lparray (MonoArray *array, gpointer* nativeArray)
 {
 #ifndef DISABLE_COM
        MonoClass *klass;
-       int i = 0;
 
        if (!array)
                return;
@@ -862,11 +865,8 @@ mono_free_lparray (MonoArray *array, gpointer* nativeArray)
                return;
        klass = array->obj.vtable->klass;
 
-       if (klass->element_class->byval_arg.type == MONO_TYPE_CLASS) {
-               for(i = 0; i < array->max_length; ++i)
-                       mono_marshal_free_ccw (mono_array_get (array, MonoObject*, i));
+       if (klass->element_class->byval_arg.type == MONO_TYPE_CLASS)
                g_free (nativeArray);
-       }
 #endif
 }
 
@@ -11590,7 +11590,6 @@ mono_marshal_load_type_info (MonoClass* klass)
 
        layout = mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK;
 
-       /* The mempool is protected by the loader lock */
        info = (MonoMarshalType *)mono_image_alloc0 (klass->image, MONO_SIZEOF_MARSHAL_TYPE + sizeof (MonoMarshalField) * count);
        info->num_fields = count;
        
@@ -11677,8 +11676,11 @@ mono_marshal_load_type_info (MonoClass* klass)
        info->min_align = min_align;
 
        /* Update the class's blittable info, if the layouts don't match */
-       if (info->native_size != mono_class_value_size (klass, NULL))
+       if (info->native_size != mono_class_value_size (klass, NULL)) {
+               mono_loader_lock ();
                klass->blittable = FALSE;
+               mono_loader_unlock ();
+       }
 
        /* If this is an array type, ensure that we have element info */
        if (klass->rank && !mono_marshal_is_loading_type_info (klass->element_class)) {
index e6fe9b25d0ad188eb61a7be7be1dcac149ee548b..3d86989db70470a6bfbcb0c3011ab85f73a31193 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "mempool.h"
 #include "mempool-internals.h"
+#include "utils/mono-compiler.h"
 
 /*
  * MonoMemPool is for fast allocation of memory. We free
@@ -92,9 +93,19 @@ mono_mempool_new (void)
 
 /**
  * mono_mempool_new_size:
+ *
+ *   clang's ThreadSanitizer detects races of total_bytes_allocated and pool->d.allocated throughout the functions
+ *     * mono_mempool_alloc
+ *     * mono_mempool_new_size
+ *     * mono_mempool_destroy
+ *   while these races could lead to wrong values, total_bytes_allocated is just used for debugging / reporting and since
+ *   the mempool.c functions are called quite often, a discussion led the the conclusion of ignoring these races:
+ *   https://bugzilla.xamarin.com/show_bug.cgi?id=57936
+ *
  * \param initial_size the amount of memory to initially reserve for the memory pool.
  * \returns a new memory pool with a specific initial memory reservation.
  */
+MONO_NO_SANITIZE_THREAD
 MonoMemPool *
 mono_mempool_new_size (int initial_size)
 {
@@ -120,10 +131,20 @@ mono_mempool_new_size (int initial_size)
 
 /**
  * mono_mempool_destroy:
+ *
+ *   clang's ThreadSanitizer detects races of total_bytes_allocated and pool->d.allocated throughout the functions
+ *     * mono_mempool_alloc
+ *     * mono_mempool_new_size
+ *     * mono_mempool_destroy
+ *   while these races could lead to wrong values, total_bytes_allocated is just used for debugging / reporting and since
+ *   the mempool.c functions are called quite often, a discussion led the the conclusion of ignoring these races:
+ *   https://bugzilla.xamarin.com/show_bug.cgi?id=57936
+ *
  * \param pool the memory pool to destroy
  *
  * Free all memory associated with this pool.
  */
+MONO_NO_SANITIZE_THREAD
 void
 mono_mempool_destroy (MonoMemPool *pool)
 {
@@ -251,6 +272,15 @@ get_next_size (MonoMemPool *pool, int size)
 
 /**
  * mono_mempool_alloc:
+ *
+ *   clang's ThreadSanitizer detects races of total_bytes_allocated and pool->d.allocated throughout the functions
+ *     * mono_mempool_alloc
+ *     * mono_mempool_new_size
+ *     * mono_mempool_destroy
+ *   while these races could lead to wrong values, total_bytes_allocated is just used for debugging / reporting and since
+ *   the mempool.c functions are called quite often, a discussion led the the conclusion of ignoring these races:
+ *   https://bugzilla.xamarin.com/show_bug.cgi?id=57936
+ *
  * \param pool the memory pool to use
  * \param size size of the memory block
  *
@@ -258,6 +288,7 @@ get_next_size (MonoMemPool *pool, int size)
  *
  * \returns the address of a newly allocated memory block.
  */
+MONO_NO_SANITIZE_THREAD
 gpointer
 mono_mempool_alloc (MonoMemPool *pool, guint size)
 {
index 9d0f3afcc99566b1e7a677c7ca6eb719697cd054..119da77be3d79ea710a4b18889cf41eabe3d1dec 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/object-internals.h>
+#include <mono/metadata/profiler-private.h>
 #include <mono/metadata/monitor.h>
 #include <mono/metadata/handle.h>
 #ifdef HAVE_SGEN_GC
index 133310e69216ef965510445729d7c4cc7ff13861..b41dbf4e8186eff36f490f2a4d4844b032c73295 100644 (file)
@@ -836,21 +836,11 @@ mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bit
                        break;
 
                        /*
-                        * CustomAttributeType: TypeDef, TypeRef, MethodDef, 
-                        * MemberRef and String.  
+                        * CustomAttributeType: MethodDef, MemberRef.
                         */
                case MONO_MT_CAT_IDX:
-                       /* String is a heap, if it is wide, we know the size */
-                       /* See above, nope. 
-                       if (meta->idx_string_wide){
-                               field_size = 4;
-                               break;
-                       }*/
-                       
-                       n = MAX (get_nrows (meta, MONO_TABLE_TYPEREF),
-                                get_nrows (meta, MONO_TABLE_TYPEDEF));
-                       n = MAX (n, get_nrows (meta, MONO_TABLE_METHOD));
-                       n = MAX (n, get_nrows (meta, MONO_TABLE_MEMBERREF));
+                       n = MAX (get_nrows (meta, MONO_TABLE_METHOD),
+                                        get_nrows (meta, MONO_TABLE_MEMBERREF));
 
                        /* 3 bits to encode */
                        field_size = rtsize (meta, n, 16-3);
@@ -1190,7 +1180,7 @@ mono_metadata_decode_row_col (const MonoTableInfo *t, int idx, guint col)
  * \param ptr pointer to a blob object
  * \param rptr the new position of the pointer
  *
- * This decodes a compressed size as described by 23.1.4 (a blob or user string object)
+ * This decodes a compressed size as described by 24.2.4 (#US and #Blob a blob or user string object)
  *
  * \returns the size of the blob object
  */
@@ -1532,7 +1522,7 @@ builtin_types[] = {
 #define NBUILTIN_TYPES() (sizeof (builtin_types) / sizeof (builtin_types [0]))
 
 static GHashTable *type_cache = NULL;
-static int next_generic_inst_id = 0;
+static gint32 next_generic_inst_id = 0;
 
 /* Protected by image_sets_mutex */
 static MonoImageSet *mscorlib_image_set;
@@ -3170,7 +3160,7 @@ mono_metadata_get_canonical_generic_inst (MonoGenericInst *candidate)
                int size = MONO_SIZEOF_GENERIC_INST + type_argc * sizeof (MonoType *);
                ginst = (MonoGenericInst *)mono_image_set_alloc0 (set, size);
 #ifndef MONO_SMALL_CONFIG
-               ginst->id = ++next_generic_inst_id;
+               ginst->id = InterlockedIncrement (&next_generic_inst_id);
 #endif
                ginst->is_open = is_open;
                ginst->type_argc = type_argc;
index 27ed22e4307ce8a89ea793449f38ed45ecbd6e2d..cf67e7fd15b8685f6bd1f05634215eeb419168a2 100644 (file)
@@ -71,7 +71,7 @@ mono_mlist_alloc_checked (MonoObject *data, MonoError *error)
                monolist_item_vtable = mono_class_vtable (mono_get_root_domain (), klass);
                g_assert (monolist_item_vtable);
        }
-       res = (MonoMList*)mono_object_new_fast_checked (monolist_item_vtable, error);
+       res = (MonoMList*)mono_object_new_specific_checked (monolist_item_vtable, error);
        return_val_if_nok (error, NULL);
        MONO_OBJECT_SETREF (res, data, data);
        return res;
index 391e1cd994b314899300b48c87e4c525d8bf0cec..6167cb0ca127efd96d6f3cfb66ca2d3e058c4e8f 100644 (file)
@@ -683,9 +683,6 @@ mono_delegate_ctor_with_method (MonoObjectHandle this_obj, MonoObjectHandle targ
 gboolean
 mono_delegate_ctor         (MonoObjectHandle this_obj, MonoObjectHandle target, gpointer addr, MonoError *error);
 
-void*
-mono_class_get_allocation_ftn (MonoVTable *vtable, gboolean for_box, gboolean *pass_size_in_words);
-
 void
 mono_runtime_free_method    (MonoDomain *domain, MonoMethod *method);
 
@@ -1813,9 +1810,6 @@ mono_object_new_mature (MonoVTable *vtable, MonoError *error);
 MonoObject*
 mono_object_new_fast_checked (MonoVTable *vtable, MonoError *error);
 
-MonoObject *
-ves_icall_object_new_fast (MonoVTable *vtable);
-
 MonoObject *
 mono_object_clone_checked (MonoObject *obj, MonoError *error);
 
index 375831531f6773464a0868363a37450985c6128c..dcf37e0015cf646f710a3c277e705980b25b6793 100644 (file)
@@ -141,6 +141,9 @@ DECL_OFFSET(MonoTypedRef, value)
 DECL_OFFSET(MonoThreadsSync, status)
 DECL_OFFSET(MonoThreadsSync, nest)
 
+DECL_OFFSET(MonoProfilerCallContext, method)
+DECL_OFFSET(MonoProfilerCallContext, return_value)
+
 #ifdef HAVE_SGEN_GC
 DECL_OFFSET(SgenClientThreadInfo, in_critical_region)
 DECL_OFFSET(SgenThreadInfo, tlab_next)
@@ -158,7 +161,6 @@ DECL_OFFSET(MonoMethodRuntimeGenericContext, class_vtable)
 DECL_OFFSET(MonoJitTlsData, lmf)
 DECL_OFFSET(MonoJitTlsData, class_cast_from)
 DECL_OFFSET(MonoJitTlsData, class_cast_to)
-DECL_OFFSET(MonoJitTlsData, handler_block_return_address)
 DECL_OFFSET(MonoJitTlsData, restore_stack_prot)
 
 DECL_OFFSET(MonoGSharedVtMethodRuntimeInfo, locals_size)
index 5744f45d3c42c291a155d9e4f88b276b9a44a2cf..3d3d68c8a1084a19699bea369f7b25ed57987945 100644 (file)
@@ -239,6 +239,7 @@ mono_type_initialization_init (void)
        type_initialization_hash = g_hash_table_new (NULL, NULL);
        blocked_thread_hash = g_hash_table_new (NULL, NULL);
        mono_os_mutex_init_recursive (&ldstr_section);
+       mono_register_jit_icall (ves_icall_string_alloc, "ves_icall_string_alloc", mono_create_icall_signature ("object int"), FALSE);
 }
 
 void
@@ -742,14 +743,12 @@ compute_class_bitmap (MonoClass *klass, gsize *bitmap, int size, int offset, int
                size = max_size;
        }
 
-#ifdef HAVE_SGEN_GC
-       /*An Ephemeron cannot be marked by sgen*/
-       if (!static_fields && klass->image == mono_defaults.corlib && !strcmp ("Ephemeron", klass->name)) {
+       /* An Ephemeron cannot be marked by sgen */
+       if (mono_gc_is_moving () && !static_fields && klass->image == mono_defaults.corlib && !strcmp ("Ephemeron", klass->name)) {
                *max_set = 0;
                memset (bitmap, 0, size / 8);
                return bitmap;
        }
-#endif
 
        for (p = klass; p != NULL; p = p->parent) {
                gpointer iter = NULL;
@@ -1010,19 +1009,8 @@ mono_class_compute_gc_descriptor (MonoClass *klass)
        int max_set = 0;
        gsize *bitmap;
        gsize default_bitmap [4] = {0};
-       static gboolean gcj_inited = FALSE;
        MonoGCDescriptor gc_descr;
 
-       if (!gcj_inited) {
-               mono_loader_lock ();
-
-               mono_register_jit_icall (ves_icall_object_new_fast, "ves_icall_object_new_fast", mono_create_icall_signature ("object ptr"), FALSE);
-               mono_register_jit_icall (ves_icall_string_alloc, "ves_icall_string_alloc", mono_create_icall_signature ("object int"), FALSE);
-
-               gcj_inited = TRUE;
-               mono_loader_unlock ();
-       }
-
        if (!klass->inited)
                mono_class_init (klass);
 
@@ -1932,23 +1920,22 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *klass, MonoErro
        vt->domain = domain;
 
        mono_class_compute_gc_descriptor (klass);
-               /*
-                * We can't use typed allocation in the non-root domains, since the
-                * collector needs the GC descriptor stored in the vtable even after
-                * the mempool containing the vtable is destroyed when the domain is
-                * unloaded. An alternative might be to allocate vtables in the GC
-                * heap, but this does not seem to work (it leads to crashes inside
-                * libgc). If that approach is tried, two gc descriptors need to be
-                * allocated for each class: one for the root domain, and one for all
-                * other domains. The second descriptor should contain a bit for the
-                * vtable field in MonoObject, since we can no longer assume the 
-                * vtable is reachable by other roots after the appdomain is unloaded.
-                */
-#ifdef HAVE_BOEHM_GC
-       if (domain != mono_get_root_domain () && !mono_dont_free_domains)
+       /*
+        * For Boehm:
+        * We can't use typed allocation in the non-root domains, since the
+        * collector needs the GC descriptor stored in the vtable even after
+        * the mempool containing the vtable is destroyed when the domain is
+        * unloaded. An alternative might be to allocate vtables in the GC
+        * heap, but this does not seem to work (it leads to crashes inside
+        * libgc). If that approach is tried, two gc descriptors need to be
+        * allocated for each class: one for the root domain, and one for all
+        * other domains. The second descriptor should contain a bit for the
+        * vtable field in MonoObject, since we can no longer assume the
+        * vtable is reachable by other roots after the appdomain is unloaded.
+        */
+       if (!mono_gc_is_moving () && domain != mono_get_root_domain () && !mono_dont_free_domains)
                vt->gc_descr = MONO_GC_DESCRIPTOR_NULL;
        else
-#endif
                vt->gc_descr = klass->gc_descr;
 
        gc_bits = mono_gc_get_vtable_bits (klass);
@@ -5455,16 +5442,6 @@ mono_object_new_fast_checked (MonoVTable *vtable, MonoError *error)
        return o;
 }
 
-MonoObject *
-ves_icall_object_new_fast (MonoVTable *vtable)
-{
-       MonoError error;
-       MonoObject *o = mono_object_new_fast_checked (vtable, &error);
-       mono_error_set_pending_exception (&error);
-
-       return o;
-}
-
 MonoObject*
 mono_object_new_mature (MonoVTable *vtable, MonoError *error)
 {
@@ -5484,44 +5461,6 @@ mono_object_new_mature (MonoVTable *vtable, MonoError *error)
        return o;
 }
 
-/**
- * mono_class_get_allocation_ftn:
- * \param vtable vtable
- * \param for_box the object will be used for boxing
- * \param pass_size_in_words Unused
- * \returns the allocation function appropriate for the given class.
- */
-void*
-mono_class_get_allocation_ftn (MonoVTable *vtable, gboolean for_box, gboolean *pass_size_in_words)
-{
-       MONO_REQ_GC_NEUTRAL_MODE;
-
-       *pass_size_in_words = FALSE;
-
-       if (mono_class_has_finalizer (vtable->klass) || mono_class_is_marshalbyref (vtable->klass))
-               return ves_icall_object_new_specific;
-
-       if (vtable->gc_descr != MONO_GC_DESCRIPTOR_NULL) {
-
-               return ves_icall_object_new_fast;
-
-               /* 
-                * FIXME: This is actually slower than ves_icall_object_new_fast, because
-                * of the overhead of parameter passing.
-                */
-               /*
-               *pass_size_in_words = TRUE;
-#ifdef GC_REDIRECT_TO_LOCAL
-               return GC_local_gcj_fast_malloc;
-#else
-               return GC_gcj_fast_malloc;
-#endif
-               */
-       }
-
-       return ves_icall_object_new_specific;
-}
-
 /**
  * mono_object_new_from_token:
  * \param image Context where the type_token is hosted
@@ -5620,18 +5559,18 @@ mono_array_full_copy (MonoArray *src, MonoArray *dest)
 static void
 array_full_copy_unchecked_size (MonoArray *src, MonoArray *dest, MonoClass *klass, uintptr_t size)
 {
-#ifdef HAVE_SGEN_GC
-       if (klass->element_class->valuetype) {
-               if (klass->element_class->has_references)
-                       mono_value_copy_array (dest, 0, mono_array_addr_with_size_fast (src, 0, 0), mono_array_length (src));
-               else
-                       mono_gc_memmove_atomic (&dest->vector, &src->vector, size);
+       if (mono_gc_is_moving ()) {
+               if (klass->element_class->valuetype) {
+                       if (klass->element_class->has_references)
+                               mono_value_copy_array (dest, 0, mono_array_addr_with_size_fast (src, 0, 0), mono_array_length (src));
+                       else
+                               mono_gc_memmove_atomic (&dest->vector, &src->vector, size);
+               } else {
+                       mono_array_memcpy_refs (dest, 0, src, 0, mono_array_length (src));
+               }
        } else {
-               mono_array_memcpy_refs (dest, 0, src, 0, mono_array_length (src));
+               mono_gc_memmove_atomic (&dest->vector, &src->vector, size);
        }
-#else
-       mono_gc_memmove_atomic (&dest->vector, &src->vector, size);
-#endif
 }
 
 /**
@@ -6361,31 +6300,31 @@ mono_value_box_checked (MonoDomain *domain, MonoClass *klass, gpointer value, Mo
 
        size = size - sizeof (MonoObject);
 
-#ifdef HAVE_SGEN_GC
-       g_assert (size == mono_class_value_size (klass, NULL));
-       mono_gc_wbarrier_value_copy ((char *)res + sizeof (MonoObject), value, 1, klass);
-#else
+       if (mono_gc_is_moving ()) {
+               g_assert (size == mono_class_value_size (klass, NULL));
+               mono_gc_wbarrier_value_copy ((char *)res + sizeof (MonoObject), value, 1, klass);
+       } else {
 #if NO_UNALIGNED_ACCESS
-       mono_gc_memmove_atomic ((char *)res + sizeof (MonoObject), value, size);
-#else
-       switch (size) {
-       case 1:
-               *((guint8 *) res + sizeof (MonoObject)) = *(guint8 *) value;
-               break;
-       case 2:
-               *(guint16 *)((guint8 *) res + sizeof (MonoObject)) = *(guint16 *) value;
-               break;
-       case 4:
-               *(guint32 *)((guint8 *) res + sizeof (MonoObject)) = *(guint32 *) value;
-               break;
-       case 8:
-               *(guint64 *)((guint8 *) res + sizeof (MonoObject)) = *(guint64 *) value;
-               break;
-       default:
                mono_gc_memmove_atomic ((char *)res + sizeof (MonoObject), value, size);
-       }
-#endif
+#else
+               switch (size) {
+               case 1:
+                       *((guint8 *) res + sizeof (MonoObject)) = *(guint8 *) value;
+                       break;
+               case 2:
+                       *(guint16 *)((guint8 *) res + sizeof (MonoObject)) = *(guint16 *) value;
+                       break;
+               case 4:
+                       *(guint32 *)((guint8 *) res + sizeof (MonoObject)) = *(guint32 *) value;
+                       break;
+               case 8:
+                       *(guint64 *)((guint8 *) res + sizeof (MonoObject)) = *(guint64 *) value;
+                       break;
+               default:
+                       mono_gc_memmove_atomic ((char *)res + sizeof (MonoObject), value, size);
+               }
 #endif
+       }
        if (klass->has_finalize) {
                mono_object_register_finalizer (res);
                return_val_if_nok (error, NULL);
index 7b85f00fb0c1a5512fd4a29f4dfa8708bf6def33..f0681a6b456f78bc91c020de3254381d0bb68485 100644 (file)
@@ -54,8 +54,9 @@ MONO_PROFILER_EVENT_1(assembly_loaded, AssemblyLLoaded, MonoAssembly *, assembly
 MONO_PROFILER_EVENT_1(assembly_unloading, AssemblyLUnloading, MonoAssembly *, assembly)
 MONO_PROFILER_EVENT_1(assembly_unloaded, AssemblyLUnloaded, MonoAssembly *, assembly)
 
-MONO_PROFILER_EVENT_1(method_enter, MethodEnter, MonoMethod *, method)
-MONO_PROFILER_EVENT_1(method_leave, MethodLeave, MonoMethod *, method)
+MONO_PROFILER_EVENT_2(method_enter, MethodEnter, MonoMethod *, method, MonoProfilerCallContext *, context)
+MONO_PROFILER_EVENT_2(method_leave, MethodLeave, MonoMethod *, method, MonoProfilerCallContext *, context)
+MONO_PROFILER_EVENT_2(method_tail_call, MethodTailCall, MonoMethod *, method, MonoMethod *, target)
 MONO_PROFILER_EVENT_2(method_exception_leave, MethodExceptionLeave, MonoMethod *, method, MonoObject *, exception)
 MONO_PROFILER_EVENT_1(method_free, MethodFree, MonoMethod *, method)
 MONO_PROFILER_EVENT_1(method_begin_invoke, MethodBeginInvoke, MonoMethod *, method)
index 45535bcf3d8aa7dc9d8334b704cbf5d47299184e..e8d9a61569a8fbcae6d821cc1b4b3edfa70bd029 100644 (file)
@@ -7,15 +7,17 @@
 #ifndef __MONO_PROFILER_PRIVATE_H__
 #define __MONO_PROFILER_PRIVATE_H__
 
+#include <mono/metadata/class-internals.h>
 #define MONO_PROFILER_UNSTABLE_GC_ROOTS
 #include <mono/metadata/profiler.h>
-#include <mono/utils/mono-lazy-init.h>
+#include <mono/utils/mono-context.h>
 #include <mono/utils/mono-os-mutex.h>
 #include <mono/utils/mono-os-semaphore.h>
 
 struct _MonoProfilerDesc {
        MonoProfilerHandle next;
        MonoProfiler *prof;
+       volatile gpointer cleanup_callback;
        volatile gpointer coverage_filter;
        volatile gpointer call_instrumentation_filter;
 
@@ -42,16 +44,28 @@ struct _MonoProfilerDesc {
 
 typedef struct {
        gboolean startup_done;
+
        MonoProfilerHandle profilers;
-       mono_lazy_init_t coverage_status;
+
+       gboolean code_coverage;
        mono_mutex_t coverage_mutex;
        GHashTable *coverage_hash;
+
        MonoProfilerHandle sampling_owner;
        MonoSemType sampling_semaphore;
        MonoProfilerSampleMode sample_mode;
-       uint64_t sample_freq;
+       guint32 sample_freq;
+
        gboolean allocations;
 
+       gboolean call_contexts;
+       void (*context_enable) (void);
+       gpointer (*context_get_this) (MonoProfilerCallContext *);
+       gpointer (*context_get_argument) (MonoProfilerCallContext *, guint32);
+       gpointer (*context_get_local) (MonoProfilerCallContext *, guint32);
+       gpointer (*context_get_result) (MonoProfilerCallContext *);
+       void (*context_free_buffer) (gpointer);
+
 #define _MONO_PROFILER_EVENT(name) \
        volatile gint32 name ## _count;
 #define MONO_PROFILER_EVENT_0(name, type) \
@@ -93,12 +107,30 @@ mono_profiler_installed (void)
 }
 
 MonoProfilerCoverageInfo *mono_profiler_coverage_alloc (MonoMethod *method, guint32 entries);
-void mono_profiler_coverage_free (MonoMethod *method);
 
-gboolean mono_profiler_should_instrument_method (MonoMethod *method, gboolean entry);
+struct _MonoProfilerCallContext {
+       /*
+        * Must be the first field (the JIT relies on it). Only filled out if this
+        * is a JIT frame; otherwise, zeroed.
+        */
+       MonoContext context;
+       /*
+        * A non-NULL MonoInterpFrameHandle if this is an interpreter frame.
+        */
+       gpointer interp_frame;
+       MonoMethod *method;
+       /*
+        * Points to the return value for an epilogue context. For a prologue, this
+        * is set to NULL.
+        */
+       gpointer return_value;
+};
+
+MonoProfilerCallInstrumentationFlags mono_profiler_get_call_instrumentation_flags (MonoMethod *method);
 
 gboolean mono_profiler_sampling_enabled (void);
-void mono_profiler_sampling_thread_sleep (void);
+void mono_profiler_sampling_thread_post (void);
+void mono_profiler_sampling_thread_wait (void);
 
 static inline gboolean
 mono_profiler_allocations_enabled (void)
@@ -107,7 +139,7 @@ mono_profiler_allocations_enabled (void)
 }
 
 #define _MONO_PROFILER_EVENT(name, ...) \
-       void mono_profiler_raise_ ## name (__VA_ARGS__);
+       ICALL_DECL_EXPORT void mono_profiler_raise_ ## name (__VA_ARGS__);
 #define MONO_PROFILER_EVENT_0(name, type) \
        _MONO_PROFILER_EVENT(name, void)
 #define MONO_PROFILER_EVENT_1(name, type, arg1_type, arg1_name) \
index a1e222fc1e66c2c8c39b26ac6bff50ab6c9aa88b..b10423120d43a649f8fd9a0c160a0fb3f307523f 100644 (file)
@@ -11,6 +11,7 @@
 #include <mono/metadata/profiler-private.h>
 #include <mono/utils/mono-dl.h>
 #include <mono/utils/mono-error-internals.h>
+#include <mono/utils/mono-logger-internals.h>
 
 MonoProfilerState mono_profiler_state;
 
@@ -20,24 +21,16 @@ typedef void (*MonoProfilerInitializer) (const char *);
 #define NEW_INITIALIZER_NAME "mono_profiler_init"
 
 static gboolean
-load_profiler (MonoDl *module, const char *desc, const char *suffix)
+load_profiler (MonoDl *module, const char *name, const char *desc)
 {
        if (!module)
                return FALSE;
 
-       char *old_name;
-
-       if (suffix)
-               old_name = g_strdup_printf (OLD_INITIALIZER_NAME "_%s", suffix);
-       else
-               old_name = g_strdup_printf (OLD_INITIALIZER_NAME);
-
+       char *err, *old_name = g_strdup_printf (OLD_INITIALIZER_NAME);
        MonoProfilerInitializer func;
 
-       char *err;
-
        if (!(err = mono_dl_symbol (module, old_name, (gpointer) &func))) {
-               g_warning ("Found old-style startup symbol %s; profiler has not been migrated to the new API.", old_name);
+               mono_profiler_printf_err ("Found old-style startup symbol '%s' for the '%s' profiler; it has not been migrated to the new API.", old_name, name);
                g_free (old_name);
                return FALSE;
        }
@@ -45,12 +38,7 @@ load_profiler (MonoDl *module, const char *desc, const char *suffix)
        g_free (err);
        g_free (old_name);
 
-       char *new_name;
-
-       if (suffix)
-               new_name = g_strdup_printf (NEW_INITIALIZER_NAME "_%s", suffix);
-       else
-               new_name = g_strdup_printf (NEW_INITIALIZER_NAME);
+       char *new_name = g_strdup_printf (NEW_INITIALIZER_NAME "_%s", name);
 
        if ((err = mono_dl_symbol (module, new_name, (gpointer *) &func))) {
                g_free (err);
@@ -66,7 +54,7 @@ load_profiler (MonoDl *module, const char *desc, const char *suffix)
 }
 
 static gboolean
-load_profiler_from_executable (const char *desc, const char *name)
+load_profiler_from_executable (const char *name, const char *desc)
 {
        char *err;
 
@@ -81,16 +69,16 @@ load_profiler_from_executable (const char *desc, const char *name)
        MonoDl *module = mono_dl_open (NULL, MONO_DL_EAGER, &err);
 
        if (!module) {
-               g_warning ("Could not open main executable (%s).", err);
+               mono_profiler_printf_err ("Could not open main executable: %s", err);
                g_free (err);
                return FALSE;
        }
 
-       return load_profiler (module, desc, name);
+       return load_profiler (module, name, desc);
 }
 
 static gboolean
-load_profiler_from_directory (const char *directory, const char *libname, const char *desc)
+load_profiler_from_directory (const char *directory, const char *libname, const char *name, const char *desc)
 {
        char* path;
        void *iter = NULL;
@@ -102,14 +90,14 @@ load_profiler_from_directory (const char *directory, const char *libname, const
                g_free (path);
 
                if (module)
-                       return load_profiler (module, desc, NULL);
+                       return load_profiler (module, name, desc);
        }
 
        return FALSE;
 }
 
 static gboolean
-load_profiler_from_installation (const char *libname, const char *desc)
+load_profiler_from_installation (const char *libname, const char *name, const char *desc)
 {
        char *err;
        MonoDl *module = mono_dl_open_runtime_lib (libname, MONO_DL_EAGER, &err);
@@ -117,7 +105,7 @@ load_profiler_from_installation (const char *libname, const char *desc)
        g_free (err);
 
        if (module)
-               return load_profiler (module, desc, NULL);
+               return load_profiler (module, name, desc);
 
        return FALSE;
 }
@@ -125,8 +113,6 @@ load_profiler_from_installation (const char *libname, const char *desc)
 void
 mono_profiler_load (const char *desc)
 {
-       mono_gc_base_init ();
-
        if (!desc || !strcmp ("default", desc))
                desc = "log:report";
 
@@ -139,18 +125,18 @@ mono_profiler_load (const char *desc)
        } else
                mname = g_strdup (desc);
 
-       if (!load_profiler_from_executable (desc, mname)) {
+       if (!load_profiler_from_executable (mname, desc)) {
                char *libname = g_strdup_printf ("mono-profiler-%s", mname);
-               gboolean res = load_profiler_from_installation (libname, desc);
+               gboolean res = load_profiler_from_installation (libname, mname, desc);
 
                if (!res && mono_config_get_assemblies_dir ())
-                       res = load_profiler_from_directory (mono_assembly_getrootdir (), libname, desc);
+                       res = load_profiler_from_directory (mono_assembly_getrootdir (), libname, mname, desc);
 
                if (!res)
-                       res = load_profiler_from_directory (NULL, libname, desc);
+                       res = load_profiler_from_directory (NULL, libname, mname, desc);
 
                if (!res)
-                       g_warning ("The '%s' profiler wasn't found in the main executable nor could it be loaded from '%s'.", mname, libname);
+                       mono_profiler_printf_err ("The '%s' profiler wasn't found in the main executable nor could it be loaded from '%s'.", mname, libname);
 
                g_free (libname);
        }
@@ -159,7 +145,7 @@ mono_profiler_load (const char *desc)
 }
 
 MonoProfilerHandle
-mono_profiler_install (MonoProfiler *prof)
+mono_profiler_create (MonoProfiler *prof)
 {
        MonoProfilerHandle handle = g_new0 (struct _MonoProfilerDesc, 1);
 
@@ -171,23 +157,31 @@ mono_profiler_install (MonoProfiler *prof)
        return handle;
 }
 
+void
+mono_profiler_set_cleanup_callback (MonoProfilerHandle handle, MonoProfilerCleanupCallback cb)
+{
+       InterlockedWritePointer (&handle->cleanup_callback, (gpointer) cb);
+}
+
 void
 mono_profiler_set_coverage_filter_callback (MonoProfilerHandle handle, MonoProfilerCoverageFilterCallback cb)
 {
        InterlockedWritePointer (&handle->coverage_filter, (gpointer) cb);
 }
 
-static void
-initialize_coverage (void)
+mono_bool
+mono_profiler_enable_coverage (void)
 {
+       if (mono_profiler_state.startup_done)
+               return FALSE;
+
        mono_os_mutex_init (&mono_profiler_state.coverage_mutex);
        mono_profiler_state.coverage_hash = g_hash_table_new (NULL, NULL);
-}
 
-static void
-lazy_initialize_coverage (void)
-{
-       mono_lazy_initialize (&mono_profiler_state.coverage_status, initialize_coverage);
+       if (!mono_debug_enabled ())
+               mono_debug_init (MONO_DEBUG_FORMAT_MONO);
+
+       return mono_profiler_state.code_coverage = TRUE;
 }
 
 static void
@@ -202,10 +196,11 @@ coverage_unlock (void)
        mono_os_mutex_unlock (&mono_profiler_state.coverage_mutex);
 }
 
-void
+mono_bool
 mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb)
 {
-       lazy_initialize_coverage ();
+       if (!mono_profiler_state.code_coverage)
+               return FALSE;
 
        coverage_lock ();
 
@@ -214,7 +209,7 @@ mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method,
        coverage_unlock ();
 
        if (!info)
-               return;
+               return FALSE;
 
        MonoError error;
        MonoMethodHeader *header = mono_method_get_header_checked (method, &error);
@@ -223,7 +218,7 @@ mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method,
        guint32 size;
 
        const unsigned char *start = mono_method_header_get_code (header, &size, NULL);
-       const unsigned char *end = start - size;
+       const unsigned char *end = start + size;
        MonoDebugMethodInfo *minfo = mono_debug_lookup_method (method);
 
        for (guint32 i = 0; i < info->entries; i++) {
@@ -259,12 +254,15 @@ mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method,
        }
 
        mono_metadata_free_mh (header);
+
+       return TRUE;
 }
 
 MonoProfilerCoverageInfo *
 mono_profiler_coverage_alloc (MonoMethod *method, guint32 entries)
 {
-       lazy_initialize_coverage ();
+       if (!mono_profiler_state.code_coverage)
+               return FALSE;
 
        gboolean cover = FALSE;
 
@@ -291,23 +289,6 @@ mono_profiler_coverage_alloc (MonoMethod *method, guint32 entries)
        return info;
 }
 
-void
-mono_profiler_coverage_free (MonoMethod *method)
-{
-       lazy_initialize_coverage ();
-
-       coverage_lock ();
-
-       MonoProfilerCoverageInfo *info = g_hash_table_lookup (mono_profiler_state.coverage_hash, method);
-
-       if (info) {
-               g_hash_table_remove (mono_profiler_state.coverage_hash, method);
-               g_free (info);
-       }
-
-       coverage_unlock ();
-}
-
 mono_bool
 mono_profiler_enable_sampling (MonoProfilerHandle handle)
 {
@@ -326,7 +307,7 @@ mono_profiler_enable_sampling (MonoProfilerHandle handle)
 }
 
 mono_bool
-mono_profiler_set_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint64_t freq)
+mono_profiler_set_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint32_t freq)
 {
        if (handle != mono_profiler_state.sampling_owner)
                return FALSE;
@@ -334,13 +315,13 @@ mono_profiler_set_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode
        mono_profiler_state.sample_mode = mode;
        mono_profiler_state.sample_freq = freq;
 
-       mono_os_sem_post (&mono_profiler_state.sampling_semaphore);
+       mono_profiler_sampling_thread_post ();
 
        return TRUE;
 }
 
 mono_bool
-mono_profiler_get_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint64_t *freq)
+mono_profiler_get_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint32_t *freq)
 {
        if (mode)
                *mode = mono_profiler_state.sample_mode;
@@ -358,7 +339,13 @@ mono_profiler_sampling_enabled (void)
 }
 
 void
-mono_profiler_sampling_thread_sleep (void)
+mono_profiler_sampling_thread_post (void)
+{
+       mono_os_sem_post (&mono_profiler_state.sampling_semaphore);
+}
+
+void
+mono_profiler_sampling_thread_wait (void)
 {
        mono_os_sem_wait (&mono_profiler_state.sampling_semaphore, MONO_SEM_FLAGS_NONE);
 }
@@ -369,9 +356,7 @@ mono_profiler_enable_allocations (void)
        if (mono_profiler_state.startup_done)
                return FALSE;
 
-       mono_profiler_state.allocations = TRUE;
-
-       return TRUE;
+       return mono_profiler_state.allocations = TRUE;
 }
 
 void
@@ -380,8 +365,61 @@ mono_profiler_set_call_instrumentation_filter_callback (MonoProfilerHandle handl
        InterlockedWritePointer (&handle->call_instrumentation_filter, (gpointer) cb);
 }
 
-gboolean
-mono_profiler_should_instrument_method (MonoMethod *method, gboolean entry)
+mono_bool
+mono_profiler_enable_call_context_introspection (void)
+{
+       if (mono_profiler_state.startup_done)
+               return FALSE;
+
+       mono_profiler_state.context_enable ();
+
+       return mono_profiler_state.call_contexts = TRUE;
+}
+
+void *
+mono_profiler_call_context_get_this (MonoProfilerCallContext *context)
+{
+       if (!mono_profiler_state.call_contexts)
+               return NULL;
+
+       return mono_profiler_state.context_get_this (context);
+}
+
+void *
+mono_profiler_call_context_get_argument (MonoProfilerCallContext *context, uint32_t position)
+{
+       if (!mono_profiler_state.call_contexts)
+               return NULL;
+
+       return mono_profiler_state.context_get_argument (context, position);
+}
+
+void *
+mono_profiler_call_context_get_local (MonoProfilerCallContext *context, uint32_t position)
+{
+       if (!mono_profiler_state.call_contexts)
+               return NULL;
+
+       return mono_profiler_state.context_get_local (context, position);
+}
+
+void *
+mono_profiler_call_context_get_result (MonoProfilerCallContext *context)
+{
+       if (!mono_profiler_state.call_contexts)
+               return NULL;
+
+       return mono_profiler_state.context_get_result (context);
+}
+
+void
+mono_profiler_call_context_free_buffer (void *buffer)
+{
+       mono_profiler_state.context_free_buffer (buffer);
+}
+
+MonoProfilerCallInstrumentationFlags
+mono_profiler_get_call_instrumentation_flags (MonoMethod *method)
 {
        MonoProfilerCallInstrumentationFlags flags = MONO_PROFILER_CALL_INSTRUMENTATION_NONE;
 
@@ -392,10 +430,7 @@ mono_profiler_should_instrument_method (MonoMethod *method, gboolean entry)
                        flags |= cb (handle->prof, method);
        }
 
-       if (entry)
-               return flags & MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE;
-       else
-               return flags & MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE;
+       return flags;
 }
 
 void
@@ -449,6 +484,38 @@ mono_profiler_cleanup (void)
 #undef MONO_PROFILER_EVENT_3
 #undef MONO_PROFILER_EVENT_4
 #undef _MONO_PROFILER_EVENT
+
+       MonoProfilerHandle head = mono_profiler_state.profilers;
+
+       while (head) {
+               MonoProfilerCleanupCallback cb = head->cleanup_callback;
+
+               if (cb)
+                       cb (head->prof);
+
+               MonoProfilerHandle cur = head;
+               head = head->next;
+
+               g_free (cur);
+       }
+
+       if (mono_profiler_state.code_coverage) {
+               mono_os_mutex_destroy (&mono_profiler_state.coverage_mutex);
+
+               GHashTableIter iter;
+
+               g_hash_table_iter_init (&iter, mono_profiler_state.coverage_hash);
+
+               MonoProfilerCoverageInfo *info;
+
+               while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &info))
+                       g_free (info);
+
+               g_hash_table_destroy (mono_profiler_state.coverage_hash);
+       }
+
+       if (mono_profiler_state.sampling_owner)
+               mono_os_sem_destroy (&mono_profiler_state.sampling_semaphore);
 }
 
 static void
@@ -527,3 +594,134 @@ update_callback (volatile gpointer *location, gpointer new_, volatile gint32 *co
 #undef MONO_PROFILER_EVENT_3
 #undef MONO_PROFILER_EVENT_4
 #undef _MONO_PROFILER_EVENT
+
+/*
+ * The following code is here to maintain compatibility with a few profiler API
+ * functions used by Xamarin.{Android,iOS,Mac} so that they keep working
+ * regardless of which system Mono version is used.
+ *
+ * TODO: Remove this some day if we're OK with breaking compatibility.
+ */
+
+typedef void *MonoLegacyProfiler;
+
+typedef void (*MonoLegacyProfileFunc) (MonoLegacyProfiler *prof);
+typedef void (*MonoLegacyProfileThreadFunc) (MonoLegacyProfiler *prof, uintptr_t tid);
+typedef void (*MonoLegacyProfileGCFunc) (MonoLegacyProfiler *prof, MonoProfilerGCEvent event, int generation);
+typedef void (*MonoLegacyProfileGCResizeFunc) (MonoLegacyProfiler *prof, int64_t new_size);
+typedef void (*MonoLegacyProfileJitResult) (MonoLegacyProfiler *prof, MonoMethod *method, MonoJitInfo *jinfo, int result);
+
+struct _MonoProfiler {
+       MonoProfilerHandle handle;
+       MonoLegacyProfiler *profiler;
+       MonoLegacyProfileFunc shutdown_callback;
+       MonoLegacyProfileThreadFunc thread_start, thread_end;
+       MonoLegacyProfileGCFunc gc_event;
+       MonoLegacyProfileGCResizeFunc gc_heap_resize;
+       MonoLegacyProfileJitResult jit_end2;
+};
+
+static MonoProfiler *current;
+
+MONO_API void mono_profiler_install (MonoLegacyProfiler *prof, MonoLegacyProfileFunc callback);
+MONO_API void mono_profiler_install_thread (MonoLegacyProfileThreadFunc start, MonoLegacyProfileThreadFunc end);
+MONO_API void mono_profiler_install_gc (MonoLegacyProfileGCFunc callback, MonoLegacyProfileGCResizeFunc heap_resize_callback);
+MONO_API void mono_profiler_install_jit_end (MonoLegacyProfileJitResult end);
+MONO_API void mono_profiler_set_events (int flags);
+
+static void
+shutdown_cb (MonoProfiler *prof)
+{
+       prof->shutdown_callback (prof->profiler);
+}
+
+void
+mono_profiler_install (MonoLegacyProfiler *prof, MonoLegacyProfileFunc callback)
+{
+       current = g_new0 (MonoProfiler, 1);
+       current->handle = mono_profiler_create (current);
+       current->profiler = prof;
+       current->shutdown_callback = callback;
+
+       if (callback)
+               mono_profiler_set_runtime_shutdown_end_callback (current->handle, shutdown_cb);
+}
+
+static void
+thread_start_cb (MonoProfiler *prof, uintptr_t tid)
+{
+       prof->thread_start (prof->profiler, tid);
+}
+
+static void
+thread_stop_cb (MonoProfiler *prof, uintptr_t tid)
+{
+       prof->thread_end (prof->profiler, tid);
+}
+
+void
+mono_profiler_install_thread (MonoLegacyProfileThreadFunc start, MonoLegacyProfileThreadFunc end)
+{
+       current->thread_start = start;
+       current->thread_end = end;
+
+       if (start)
+               mono_profiler_set_thread_started_callback (current->handle, thread_start_cb);
+
+       if (end)
+               mono_profiler_set_thread_stopped_callback (current->handle, thread_stop_cb);
+}
+
+static void
+gc_event_cb (MonoProfiler *prof, MonoProfilerGCEvent event, uint32_t generation)
+{
+       prof->gc_event (prof->profiler, event, generation);
+}
+
+static void
+gc_resize_cb (MonoProfiler *prof, uintptr_t size)
+{
+       prof->gc_heap_resize (prof->profiler, size);
+}
+
+void
+mono_profiler_install_gc (MonoLegacyProfileGCFunc callback, MonoLegacyProfileGCResizeFunc heap_resize_callback)
+{
+       current->gc_event = callback;
+       current->gc_heap_resize = heap_resize_callback;
+
+       if (callback)
+               mono_profiler_set_gc_event_callback (current->handle, gc_event_cb);
+
+       if (heap_resize_callback)
+               mono_profiler_set_gc_resize_callback (current->handle, gc_resize_cb);
+}
+
+static void
+jit_done_cb (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *jinfo)
+{
+       prof->jit_end2 (prof->profiler, method, jinfo, 0);
+}
+
+static void
+jit_failed_cb (MonoProfiler *prof, MonoMethod *method)
+{
+       prof->jit_end2 (prof->profiler, method, NULL, 1);
+}
+
+void
+mono_profiler_install_jit_end (MonoLegacyProfileJitResult end)
+{
+       current->jit_end2 = end;
+
+       if (end) {
+               mono_profiler_set_jit_done_callback (current->handle, jit_done_cb);
+               mono_profiler_set_jit_failed_callback (current->handle, jit_failed_cb);
+       }
+}
+
+void
+mono_profiler_set_events (int flags)
+{
+       /* Do nothing. */
+}
index 31fa4a767d48bd7ae6ffbdfb1de6895d6564346c..b6e836d3638b6d0912666f3fec8a33adf2788671 100644 (file)
@@ -27,9 +27,9 @@ MONO_BEGIN_DECLS
  * the module after it has been loaded. If the specified module has already
  * been loaded, this function has no effect.
  *
- * A module should declare an entry point like so:
+ * A module called foo should declare an entry point like so:
  *
- * void mono_profiler_init (const char *desc)
+ * void mono_profiler_init_foo (const char *desc)
  * {
  * }
  *
@@ -42,7 +42,9 @@ typedef struct _MonoProfilerDesc *MonoProfilerHandle;
 
 /*
  * Installs a profiler and returns a handle for it. The handle is used with the
- * other functions in the profiler API (e.g. for setting up callbacks).
+ * other functions in the profiler API (e.g. for setting up callbacks). The
+ * given structure pointer will be passed to all callbacks from the profiler
+ * API. It can be NULL.
  *
  * This function may only be called from your profiler's init function.
  *
@@ -54,12 +56,37 @@ typedef struct _MonoProfilerDesc *MonoProfilerHandle;
  * };
  *
  * MonoProfiler *prof = calloc (1, sizeof (MonoProfiler));
- * MonoProfilerHandle handle = mono_profiler_install (prof);
+ * MonoProfilerHandle handle = mono_profiler_create (prof);
  * mono_profiler_set_shutdown_callback (handle, my_shutdown_cb);
  *
  * This function is not async safe.
  */
-MONO_API MonoProfilerHandle mono_profiler_install (MonoProfiler *prof);
+MONO_API MonoProfilerHandle mono_profiler_create (MonoProfiler *prof);
+
+typedef void (*MonoProfilerCleanupCallback) (MonoProfiler *prof);
+
+/*
+ * Sets a profiler cleanup function. This function will be invoked at shutdown
+ * when the profiler API is cleaning up its internal structures. It's mainly
+ * intended for a profiler to free the structure pointer that was passed to
+ * mono_profiler_create, if necessary.
+ *
+ * This function is async safe.
+ */
+MONO_API void mono_profiler_set_cleanup_callback (MonoProfilerHandle handle, MonoProfilerCleanupCallback cb);
+
+/*
+ * Enables support for code coverage instrumentation. At the moment, this means
+ * enabling the debug info subsystem. If you do not call this function, you
+ * will not be able to use mono_profiler_get_coverage_data. Returns TRUE if
+ * code coverage support was enabled, or FALSE if the function was called too
+ * late for this to be possible.
+ *
+ * This function may only be called from your profiler's init function.
+ *
+ * This function is not async safe.
+ */
+MONO_API mono_bool mono_profiler_enable_coverage (void);
 
 typedef mono_bool (*MonoProfilerCoverageFilterCallback) (MonoProfiler *prof, MonoMethod *method);
 
@@ -67,7 +94,7 @@ typedef mono_bool (*MonoProfilerCoverageFilterCallback) (MonoProfiler *prof, Mon
  * Sets a code coverage filter function. The profiler API will invoke filter
  * functions from all installed profilers. If any of them return TRUE, then the
  * given method will be instrumented for coverage analysis. All filters are
- * guaranteed to be called exactly once per method, even if an earlier filter
+ * guaranteed to be called at least once per method, even if an earlier filter
  * has already returned TRUE.
  *
  * Note that filter functions must be installed before a method is compiled in
@@ -91,11 +118,16 @@ typedef void (*MonoProfilerCoverageCallback) (MonoProfiler *prof, const MonoProf
 
 /*
  * Retrieves all coverage data for the specified method and invokes the given
- * callback for each entry.
+ * callback for each entry. Source location information will only be filled out
+ * if the given method has debug info available. Returns TRUE if the given
+ * method was instrumented for code coverage; otherwise, FALSE.
+ *
+ * Please note that the structure passed to the callback is only valid for the
+ * duration of the callback.
  *
  * This function is not async safe.
  */
-MONO_API void mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb);
+MONO_API mono_bool mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb);
 
 typedef enum {
        /*
@@ -134,14 +166,14 @@ typedef enum {
 MONO_API mono_bool mono_profiler_enable_sampling (MonoProfilerHandle handle);
 
 /*
- * Sets the sampling mode and frequency (in Hz). If the calling profiler has
- * ownership over sampling settings, the settings will be changed and this
- * function will return TRUE; otherwise, it returns FALSE without changing any
- * settings.
+ * Sets the sampling mode and frequency (in Hz). The frequency must be a
+ * positive number. If the calling profiler has ownership over sampling
+ * settings, the settings will be changed and this function will return TRUE;
+ * otherwise, it returns FALSE without changing any settings.
  *
  * This function is async safe.
  */
-MONO_API mono_bool mono_profiler_set_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint64_t freq);
+MONO_API mono_bool mono_profiler_set_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint32_t freq);
 
 /*
  * Retrieves the current sampling mode and/or frequency (in Hz). Returns TRUE if
@@ -150,7 +182,7 @@ MONO_API mono_bool mono_profiler_set_sample_mode (MonoProfilerHandle handle, Mon
  *
  * This function is async safe.
  */
-MONO_API mono_bool mono_profiler_get_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint64_t *freq);
+MONO_API mono_bool mono_profiler_get_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint32_t *freq);
 
 /*
  * Enables instrumentation of GC allocations. This is necessary so that managed
@@ -167,11 +199,19 @@ MONO_API mono_bool mono_profiler_enable_allocations (void);
 
 typedef enum {
        /* Do not instrument calls. */
-       MONO_PROFILER_CALL_INSTRUMENTATION_NONE = 1 << 0,
-       /* Instrument method prologues. */
-       MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE = 1 << 1,
-       /* Instrument method epilogues. */
-       MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE = 1 << 2,
+       MONO_PROFILER_CALL_INSTRUMENTATION_NONE = 0,
+       /* Instrument method entries. */
+       MONO_PROFILER_CALL_INSTRUMENTATION_ENTER = 1 << 1,
+       /* Also capture a call context for method entries. */
+       MONO_PROFILER_CALL_INSTRUMENTATION_ENTER_CONTEXT = 1 << 2,
+       /* Instrument method exits. */
+       MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE = 1 << 3,
+       /* Also capture a call context for method exits. */
+       MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE_CONTEXT = 1 << 4,
+       /* Instrument method exits as a result of a tail call. */
+       MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL = 1 << 5,
+       /* Instrument exceptional method exits. */
+       MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE = 1 << 6,
 } MonoProfilerCallInstrumentationFlags;
 
 typedef MonoProfilerCallInstrumentationFlags (*MonoProfilerCallInstrumentationFilterCallback) (MonoProfiler *prof, MonoMethod *method);
@@ -181,21 +221,119 @@ typedef MonoProfilerCallInstrumentationFlags (*MonoProfilerCallInstrumentationFi
  * filter functions from all installed profilers. If any of them return flags
  * other than MONO_PROFILER_CALL_INSTRUMENTATION_NONE, then the given method
  * will be instrumented as requested. All filters are guaranteed to be called
- * at least once (possibly more) per method entry and exit, even if earlier
- * filters have already specified all flags.
+ * exactly once per method, even if earlier filters have already specified all
+ * flags.
  *
  * Note that filter functions must be installed before a method is compiled in
  * order to have any effect, i.e. you should register your filter function in
- * your profiler's init function.
+ * your profiler's init function. Also, if you want to instrument a method
+ * that's going to be AOT-compiled, you must attach your profiler and install a
+ * call instrumentation filter function at AOT time. This can be done in
+ * exactly the same way as you would normally, i.e. by passing the --profile
+ * option on the command line, by calling mono_profiler_load, or simply by
+ * using the profiler API as an embedder.
  *
- * Keep in mind that method instrumentation is extremely heavy and will slow
- * down most applications to a crawl. Consider using sampling instead if it
- * would work for your use case.
+ * Keep in mind that indiscriminate method instrumentation is extremely heavy
+ * and will slow down most applications to a crawl. Consider using sampling
+ * instead if it would work for your use case.
  *
  * This function is async safe.
  */
 MONO_API void mono_profiler_set_call_instrumentation_filter_callback (MonoProfilerHandle handle, MonoProfilerCallInstrumentationFilterCallback cb);
 
+/*
+ * Enables support for retrieving stack frame data from a call context. At the
+ * moment, this means enabling the debug info subsystem. If you do not call
+ * this function, you will not be able to use the call context introspection
+ * functions (they will simply return NULL). Returns TRUE if call context
+ * introspection was enabled, or FALSE if the function was called too late for
+ * this to be possible.
+ *
+ * Please note: Mono's LLVM backend does not support this feature. This means
+ * that methods with call context instrumentation will be handled by Mono's
+ * JIT even in LLVM mode. There is also a special case when Mono is compiling
+ * in LLVM-only mode: Since LLVM does not provide a way to implement call
+ * contexts, a NULL context will always be passed to enter/leave events even
+ * though this method returns TRUE.
+ *
+ * This function may only be called from your profiler's init function.
+ *
+ * This function is not async safe.
+ */
+MONO_API mono_bool mono_profiler_enable_call_context_introspection (void);
+
+typedef struct _MonoProfilerCallContext MonoProfilerCallContext;
+
+/*
+ * Given a valid call context from an enter/leave event, retrieves a pointer to
+ * the this reference for the method. Returns NULL if none exists (i.e. it's a
+ * static method) or if call context introspection was not enabled.
+ *
+ * The buffer returned by this function must be freed with
+ * mono_profiler_call_context_free_buffer.
+ *
+ * Please note that a call context is only valid for the duration of the
+ * enter/leave callback it was passed to.
+ *
+ * This function is not async safe.
+ */
+MONO_API void *mono_profiler_call_context_get_this (MonoProfilerCallContext *context);
+
+/*
+ * Given a valid call context from an enter/leave event, retrieves a pointer to
+ * the method argument at the given position. Returns NULL if position is out
+ * of bounds or if call context introspection was not enabled.
+ *
+ * The buffer returned by this function must be freed with
+ * mono_profiler_call_context_free_buffer.
+ *
+ * Please note that a call context is only valid for the duration of the
+ * enter/leave callback it was passed to.
+ *
+ * This function is not async safe.
+ */
+MONO_API void *mono_profiler_call_context_get_argument (MonoProfilerCallContext *context, uint32_t position);
+
+/*
+ * Given a valid call context from an enter/leave event, retrieves a pointer to
+ * the local variable at the given position. Returns NULL if position is out of
+ * bounds or if call context introspection was not enabled.
+ *
+ * The buffer returned by this function must be freed with
+ * mono_profiler_call_context_free_buffer.
+ *
+ * Please note that a call context is only valid for the duration of the
+ * enter/leave callback it was passed to.
+ *
+ * This function is not async safe.
+ */
+MONO_API void *mono_profiler_call_context_get_local (MonoProfilerCallContext *context, uint32_t position);
+
+/*
+ * Given a valid call context from an enter/leave event, retrieves a pointer to
+ * return value of a method. Returns NULL if the method has no return value
+ * (i.e. it returns void), if the leave event was the result of a tail call, if
+ * the function is called on a context from an enter event, or if call context
+ * introspection was not enabled.
+ *
+ * The buffer returned by this function must be freed with
+ * mono_profiler_call_context_free_buffer.
+ *
+ * Please note that a call context is only valid for the duration of the
+ * enter/leave callback it was passed to.
+ *
+ * This function is not async safe.
+ */
+MONO_API void *mono_profiler_call_context_get_result (MonoProfilerCallContext *context);
+
+/*
+ * Frees a buffer returned by one of the call context introspection functions.
+ * Passing a NULL buffer is allowed, which makes this function a no-op.
+ *
+ * This function is not async safe.
+ */
+MONO_API void mono_profiler_call_context_free_buffer (void *buffer);
+
 #ifdef MONO_PROFILER_UNSTABLE_GC_ROOTS
 typedef enum {
        /* Upper 2 bytes. */
@@ -229,18 +367,13 @@ typedef enum {
        MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING = 9,
 } MonoProfilerCodeBufferType;
 
-// Keep somewhat in sync with libgc/include/gc.h : GC_EventType.
 typedef enum {
-       MONO_GC_EVENT_START = 0,
-       MONO_GC_EVENT_MARK_START = 1,
-       MONO_GC_EVENT_MARK_END = 2,
-       MONO_GC_EVENT_RECLAIM_START = 3,
-       MONO_GC_EVENT_RECLAIM_END = 4,
-       MONO_GC_EVENT_END = 5,
        MONO_GC_EVENT_PRE_STOP_WORLD = 6,
        /* When this event arrives, the GC and suspend locks are acquired. */
        MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED = 10,
        MONO_GC_EVENT_POST_STOP_WORLD = 7,
+       MONO_GC_EVENT_START = 0,
+       MONO_GC_EVENT_END = 5,
        MONO_GC_EVENT_PRE_START_WORLD = 8,
        /* When this event arrives, the GC and suspend locks are released. */
        MONO_GC_EVENT_POST_START_WORLD_UNLOCKED = 11,
index 594556fb68a13421102fcc88566cb0dbc62c634d..bba3cda2d1cf34661a7cfd1f8cdf757fd0845524 100644 (file)
@@ -30,16 +30,21 @@ reflected_equal (gconstpointer a, gconstpointer b);
 guint
 reflected_hash (gconstpointer a);
 
-#ifdef HAVE_BOEHM_GC
-/* ReflectedEntry doesn't need to be GC tracked */
-#define ALLOC_REFENTRY g_new0 (ReflectedEntry, 1)
-#define FREE_REFENTRY(entry) g_free ((entry))
-#define REFENTRY_REQUIRES_CLEANUP
-#else
-#define ALLOC_REFENTRY (ReflectedEntry *)mono_mempool_alloc (domain->mp, sizeof (ReflectedEntry))
-/* FIXME: */
-#define FREE_REFENTRY(entry)
-#endif
+static inline ReflectedEntry*
+alloc_reflected_entry (MonoDomain *domain)
+{
+       if (!mono_gc_is_moving ())
+               return g_new0 (ReflectedEntry, 1);
+       else
+               return (ReflectedEntry *)mono_mempool_alloc (domain->mp, sizeof (ReflectedEntry));
+}
+
+static void
+free_reflected_entry (ReflectedEntry *entry)
+{
+       if (!mono_gc_is_moving ())
+               g_free (entry);
+}
 
 static inline MonoObject*
 cache_object (MonoDomain *domain, MonoClass *klass, gpointer item, MonoObject* o)
@@ -55,7 +60,7 @@ cache_object (MonoDomain *domain, MonoClass *klass, gpointer item, MonoObject* o
 
        obj = (MonoObject*) mono_conc_g_hash_table_lookup (domain->refobject_hash, &pe);
        if (obj == NULL) {
-               ReflectedEntry *e = ALLOC_REFENTRY;
+               ReflectedEntry *e = alloc_reflected_entry (domain);
                e->item = item;
                e->refclass = klass;
                mono_conc_g_hash_table_insert (domain->refobject_hash, e, o);
@@ -79,7 +84,7 @@ cache_object_handle (MonoDomain *domain, MonoClass *klass, gpointer item, MonoOb
 
        MonoObjectHandle obj = MONO_HANDLE_NEW (MonoObject, mono_conc_g_hash_table_lookup (domain->refobject_hash, &pe));
        if (MONO_HANDLE_IS_NULL (obj)) {
-               ReflectedEntry *e = ALLOC_REFENTRY;
+               ReflectedEntry *e = alloc_reflected_entry (domain);
                e->item = item;
                e->refclass = klass;
                mono_conc_g_hash_table_insert (domain->refobject_hash, e, MONO_HANDLE_RAW (o));
index ee9681e1d27dce1033d9bcbe6b2867327c2f3801..f8e9f37fb49c37774f7aa70a6ce8e5980add9a93 100644 (file)
@@ -143,7 +143,6 @@ mono_class_free_ref_info (MonoClass *klass)
        }
 }
 
-
 /**
  * mono_custom_attrs_free:
  */
@@ -156,7 +155,6 @@ mono_custom_attrs_free (MonoCustomAttrInfo *ainfo)
                g_free (ainfo);
 }
 
-
 gboolean
 reflected_equal (gconstpointer a, gconstpointer b)
 {
@@ -175,7 +173,6 @@ reflected_hash (gconstpointer a) {
        return seed;
 }
 
-
 static void
 clear_cached_object (MonoDomain *domain, gpointer o, MonoClass *klass)
 {
@@ -189,34 +186,28 @@ clear_cached_object (MonoDomain *domain, gpointer o, MonoClass *klass)
 
                if (mono_conc_g_hash_table_lookup_extended (domain->refobject_hash, &pe, &orig_pe, &orig_value)) {
                        mono_conc_g_hash_table_remove (domain->refobject_hash, &pe);
-                       FREE_REFENTRY (orig_pe);
+                       free_reflected_entry (orig_pe);
                }
        }
        mono_domain_unlock (domain);
 }
 
-#ifdef REFENTRY_REQUIRES_CLEANUP
 static void
 cleanup_refobject_hash (gpointer key, gpointer value, gpointer user_data)
 {
-       FREE_REFENTRY (key);
+       free_reflected_entry (key);
 }
-#endif
 
 void
 mono_reflection_cleanup_domain (MonoDomain *domain)
 {
        if (domain->refobject_hash) {
-/*let's avoid scanning the whole hashtable if not needed*/
-#ifdef REFENTRY_REQUIRES_CLEANUP
                mono_conc_g_hash_table_foreach (domain->refobject_hash, cleanup_refobject_hash, NULL);
-#endif
                mono_conc_g_hash_table_destroy (domain->refobject_hash);
                domain->refobject_hash = NULL;
        }
 }
 
-
 /**
  * mono_assembly_get_object:
  * \param domain an app domain
index d9a483898e7886b2739973aa57a8745b725d921b..a5ec02d480e21cb4477a3cf7e5f1eb4416465d0a 100644 (file)
@@ -383,25 +383,21 @@ sgen_client_binary_protocol_block_set_state (gpointer addr, size_t size, int old
 static void G_GNUC_UNUSED
 sgen_client_binary_protocol_mark_start (int generation)
 {
-       MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_MARK_START, generation));
 }
 
 static void G_GNUC_UNUSED
 sgen_client_binary_protocol_mark_end (int generation)
 {
-       MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_MARK_END, generation));
 }
 
 static void G_GNUC_UNUSED
 sgen_client_binary_protocol_reclaim_start (int generation)
 {
-       MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_RECLAIM_START, generation));
 }
 
 static void G_GNUC_UNUSED
 sgen_client_binary_protocol_reclaim_end (int generation)
 {
-       MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_RECLAIM_END, generation));
 }
 
 static void
@@ -690,6 +686,16 @@ sgen_client_binary_protocol_pin_stats (int objects_pinned_in_nursery, size_t byt
 {
 }
 
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_worker_finish_stats (int worker_index, int generation, gboolean forced, long long major_scan, long long los_scan, long long work_time)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_collection_end_stats (long long major_scan, long long los_scan, long long finish_stack)
+{
+}
+
 #define TLAB_ACCESS_INIT       SgenThreadInfo *__thread_info__ = (SgenThreadInfo*)mono_tls_get_sgen_thread_info ()
 #define IN_CRITICAL_REGION (__thread_info__->client_info.in_critical_region)
 
index 89f9a1fdaee0b1c09cf2c395c1b0bbecf2d8b41f..5ff236fc12edf97e008528de56ab031899af8e2b 100644 (file)
@@ -793,7 +793,8 @@ mono_dynimage_encode_typedef_or_ref_full (MonoDynamicImage *assembly, MonoType *
        if ((klass->image == &assembly->image) && (type->type != MONO_TYPE_VAR) && 
                        (type->type != MONO_TYPE_MVAR)) {
                token = MONO_TYPEDEFORREF_TYPEDEF | (MONO_HANDLE_GETVAL (tb, table_idx) << MONO_TYPEDEFORREF_BITS);
-               mono_dynamic_image_register_token (assembly, token, MONO_HANDLE_CAST (MonoObject, tb));
+               /* This function is called multiple times from sre and sre-save, so same object is okay */
+               mono_dynamic_image_register_token (assembly, token, MONO_HANDLE_CAST (MonoObject, tb), MONO_DYN_IMAGE_TOK_SAME_OK);
                goto leave;
        }
 
@@ -816,7 +817,13 @@ mono_dynimage_encode_typedef_or_ref_full (MonoDynamicImage *assembly, MonoType *
        token = MONO_TYPEDEFORREF_TYPEREF | (table->next_idx << MONO_TYPEDEFORREF_BITS); /* typeref */
        g_hash_table_insert (assembly->typeref, type, GUINT_TO_POINTER(token));
        table->next_idx ++;
-       mono_dynamic_image_register_token (assembly, token, MONO_HANDLE_CAST (MonoObject, tb));
+
+
+       if (!MONO_HANDLE_IS_NULL (tb)) {
+               /* This function is called multiple times from sre and sre-save, so same object is okay */
+               mono_dynamic_image_register_token (assembly, token, MONO_HANDLE_CAST (MonoObject, tb), MONO_DYN_IMAGE_TOK_SAME_OK);
+       }
+
 leave:
        HANDLE_FUNCTION_RETURN_VAL (token);
 }
index d36381357caaa2355b4eec5b4169ab7d4fe66f33..5d26024218b6b989b631d52daecf5db42bb53530 100644 (file)
@@ -1759,6 +1759,14 @@ fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicImage *asse
                                g_assert_not_reached ();
                        }
                        break;
+               case MONO_TABLE_TYPEREF:
+                       g_assert (!strcmp (iltoken->member->vtable->klass->name, "RuntimeType"));
+                       MonoClass *k = mono_class_from_mono_type (((MonoReflectionType*)iltoken->member)->type);
+                       MonoObject *obj = mono_class_get_ref_info_raw (k); /* FIXME use handles */
+                       g_assert (obj);
+                       g_assert (!strcmp (mono_object_class (obj)->name, "TypeBuilder"));
+                       g_assert (((MonoReflectionTypeBuilder*)obj)->module->dynamic_image != assembly);
+                       continue;
                case MONO_TABLE_MEMBERREF:
                        if (!strcmp (iltoken->member->vtable->klass->name, "MonoArrayMethod")) {
                                am = (MonoReflectionArrayMethod*)iltoken->member;
index 3beb23242fba8111191c0656cdb74a6d96d10508..649791e7beafcb4104a181e0c720a2509ea53d4b 100644 (file)
@@ -1022,7 +1022,7 @@ mono_image_insert_string (MonoReflectionModuleBuilderHandle ref_module, MonoStri
        }
 
        token = MONO_TOKEN_STRING | idx;
-       mono_dynamic_image_register_token (assembly, token, MONO_HANDLE_CAST (MonoObject, str));
+       mono_dynamic_image_register_token (assembly, token, MONO_HANDLE_CAST (MonoObject, str), MONO_DYN_IMAGE_TOK_NEW);
 
 leave:
        HANDLE_FUNCTION_RETURN_VAL (token);
@@ -1092,7 +1092,7 @@ mono_image_create_method_token (MonoDynamicImage *assembly, MonoObjectHandle obj
                g_error ("requested method token for %s\n", klass->name);
        }
 
-       mono_dynamic_image_register_token (assembly, token, obj);
+       mono_dynamic_image_register_token (assembly, token, obj, MONO_DYN_IMAGE_TOK_NEW);
        return token;
 fail:
        g_assert (!mono_error_ok (error));
@@ -1128,12 +1128,18 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
                return 0;
        }
 
+       /* This function is called from ModuleBuilder:getToken multiple times for the same objects */
+       int how_collide = MONO_DYN_IMAGE_TOK_SAME_OK;
+
        if (strcmp (klass->name, "RuntimeType") == 0) {
                MonoType *type = mono_reflection_type_handle_mono_type (MONO_HANDLE_CAST (MonoReflectionType, obj), error);
                return_val_if_nok (error, 0);
                MonoClass *mc = mono_class_from_mono_type (type);
                token = mono_metadata_token_from_dor (
                        mono_dynimage_encode_typedef_or_ref_full (assembly, type, !mono_class_is_gtd (mc) || create_open_instance));
+               /* If it's a RuntimeType now, we could have registered a
+                * TypeBuilder for it before, so replacing is okay. */
+               how_collide = MONO_DYN_IMAGE_TOK_REPLACE;
        } else if (strcmp (klass->name, "MonoCMethod") == 0 ||
                           strcmp (klass->name, "MonoMethod") == 0) {
                MonoReflectionMethodHandle m = MONO_HANDLE_CAST (MonoReflectionMethod, obj);
@@ -1152,6 +1158,7 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
                                 * FIXME: do the equivalent for Fields.
                                 */
                                token = method->token;
+                               how_collide = MONO_DYN_IMAGE_TOK_REPLACE;
                        } else {
                                /*
                                 * Each token should have a unique index, but the indexes are
@@ -1160,6 +1167,7 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
                                 */
                                method_table_idx --;
                                token = MONO_TOKEN_METHOD_DEF | method_table_idx;
+                               how_collide = MONO_DYN_IMAGE_TOK_NEW;
                        }
                } else {
                        token = mono_image_get_methodref_token (assembly, method, create_open_instance);
@@ -1172,6 +1180,7 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
                        static guint32 field_table_idx = 0xffffff;
                        field_table_idx --;
                        token = MONO_TOKEN_FIELD_DEF | field_table_idx;
+                       how_collide = MONO_DYN_IMAGE_TOK_NEW;
                } else {
                        token = mono_image_get_fieldref_token (assembly, obj, field);
                }
@@ -1184,17 +1193,12 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
                MonoReflectionSigHelperHandle s = MONO_HANDLE_CAST (MonoReflectionSigHelper, obj);
                token = MONO_TOKEN_SIGNATURE | mono_image_get_sighelper_token (assembly, s, error);
                return_val_if_nok (error, 0);
-       } else if (strcmp (klass->name, "EnumBuilder") == 0) {
-               MonoType *type = mono_reflection_type_handle_mono_type (MONO_HANDLE_CAST (MonoReflectionType, obj), error);
-               return_val_if_nok (error, 0);
-               token = mono_metadata_token_from_dor (
-                       mono_image_typedef_or_ref (assembly, type));
        } else {
                g_error ("requested token for %s\n", klass->name);
        }
 
        if (register_token)
-               mono_dynamic_image_register_token (assembly, token, obj);
+               mono_dynamic_image_register_token (assembly, token, obj, how_collide);
 
        return token;
 }
@@ -2474,7 +2478,7 @@ reflection_setup_internal_class_internal (MonoReflectionTypeBuilderHandle ref_tb
        */
        mono_image_append_class_to_reflection_info_set (klass);
 
-       mono_dynamic_image_register_token (dynamic_image, MONO_TOKEN_TYPE_DEF | table_idx, MONO_HANDLE_CAST (MonoObject, ref_tb));
+       mono_dynamic_image_register_token (dynamic_image, MONO_TOKEN_TYPE_DEF | table_idx, MONO_HANDLE_CAST (MonoObject, ref_tb), MONO_DYN_IMAGE_TOK_NEW);
 
        if ((!strcmp (klass->name, "ValueType") && !strcmp (klass->name_space, "System")) ||
                        (!strcmp (klass->name, "Object") && !strcmp (klass->name_space, "System")) ||
@@ -4337,7 +4341,9 @@ void
 ves_icall_ModuleBuilder_RegisterToken (MonoReflectionModuleBuilderHandle mb, MonoObjectHandle obj, guint32 token, MonoError *error)
 {
        error_init (error);
-       mono_dynamic_image_register_token (MONO_HANDLE_GETVAL (mb, dynamic_image), token, obj);
+       /* This function may be called by ModuleBuilder.FixupTokens to update
+        * an existing token, so replace is okay here. */
+       mono_dynamic_image_register_token (MONO_HANDLE_GETVAL (mb, dynamic_image), token, obj, MONO_DYN_IMAGE_TOK_REPLACE);
 }
 
 MonoObjectHandle
index 0a1b6b7d1164b7c9d4c623b07cc36b20d24e734b..ced0ac516efbf9a8e91c47df9fbef6ceec645bc6 100644 (file)
@@ -214,6 +214,7 @@ void mono_threads_set_shutting_down (void);
 gunichar2* mono_thread_get_name (MonoInternalThread *this_obj, guint32 *name_len);
 
 MONO_API MonoException* mono_thread_get_undeniable_exception (void);
+void mono_thread_self_abort (void);
 
 void mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, gboolean permanent, gboolean reset, MonoError *error);
 
@@ -245,8 +246,6 @@ void mono_threads_add_joinable_thread (gpointer tid);
 void mono_threads_join_threads (void);
 void mono_thread_join (gpointer tid);
 
-void mono_thread_detach_internal (MonoInternalThread *thread);
-
 void ves_icall_System_Threading_Thread_GetStackTraces (MonoArray **out_threads, MonoArray **out_stack_traces);
 
 MONO_API gpointer
index e0a7aee8edc4b6711420fb1961fd2373138bab09..97efd32c1cdac04e48296a738ee74cf9a8098346 100644 (file)
@@ -737,6 +737,149 @@ mono_thread_attach_internal (MonoThread *thread, gboolean force_attach, gboolean
        return TRUE;
 }
 
+static void
+mono_thread_detach_internal (MonoInternalThread *thread)
+{
+       gboolean removed;
+
+       g_assert (thread != NULL);
+       SET_CURRENT_OBJECT (thread);
+
+       THREAD_DEBUG (g_message ("%s: mono_thread_detach for %p (%"G_GSIZE_FORMAT")", __func__, thread, (gsize)thread->tid));
+
+#ifndef HOST_WIN32
+       mono_w32mutex_abandon ();
+#endif
+
+       if (thread->abort_state_handle) {
+               mono_gchandle_free (thread->abort_state_handle);
+               thread->abort_state_handle = 0;
+       }
+
+       thread->abort_exc = NULL;
+       thread->current_appcontext = NULL;
+
+       /*
+        * thread->synch_cs can be NULL if this was called after
+        * ves_icall_System_Threading_InternalThread_Thread_free_internal.
+        * This can happen only during shutdown.
+        * The shutting_down flag is not always set, so we can't assert on it.
+        */
+       if (thread->synch_cs)
+               LOCK_THREAD (thread);
+
+       thread->state |= ThreadState_Stopped;
+       thread->state &= ~ThreadState_Background;
+
+       if (thread->synch_cs)
+               UNLOCK_THREAD (thread);
+
+       /*
+       An interruption request has leaked to cleanup. Adjust the global counter.
+
+       This can happen is the abort source thread finds the abortee (this) thread
+       in unmanaged code. If this thread never trips back to managed code or check
+       the local flag it will be left set and positively unbalance the global counter.
+
+       Leaving the counter unbalanced will cause a performance degradation since all threads
+       will now keep checking their local flags all the time.
+       */
+       mono_thread_clear_interruption_requested (thread);
+
+       mono_threads_lock ();
+
+       if (!threads) {
+               removed = FALSE;
+       } else if (mono_g_hash_table_lookup (threads, (gpointer)thread->tid) != thread) {
+               /* We have to check whether the thread object for the
+                * tid is still the same in the table because the
+                * thread might have been destroyed and the tid reused
+                * in the meantime, in which case the tid would be in
+                * the table, but with another thread object.
+                */
+               removed = FALSE;
+       } else {
+               mono_g_hash_table_remove (threads, (gpointer)thread->tid);
+               removed = TRUE;
+       }
+
+       mono_threads_unlock ();
+
+       /* Don't close the handle here, wait for the object finalizer
+        * to do it. Otherwise, the following race condition applies:
+        *
+        * 1) Thread exits (and mono_thread_detach_internal() closes the handle)
+        *
+        * 2) Some other handle is reassigned the same slot
+        *
+        * 3) Another thread tries to join the first thread, and
+        * blocks waiting for the reassigned handle to be signalled
+        * (which might never happen).  This is possible, because the
+        * thread calling Join() still has a reference to the first
+        * thread's object.
+        */
+
+       /* if the thread is not in the hash it has been removed already */
+       if (!removed) {
+               mono_domain_unset ();
+               mono_memory_barrier ();
+
+               if (mono_thread_cleanup_fn)
+                       mono_thread_cleanup_fn (thread_get_tid (thread));
+
+               goto done;
+       }
+
+       mono_release_type_locks (thread);
+
+       /* Can happen when we attach the profiler helper thread in order to heapshot. */
+       if (!mono_thread_info_lookup (MONO_UINT_TO_NATIVE_THREAD_ID (thread->tid))->tools_thread)
+               MONO_PROFILER_RAISE (thread_stopped, (thread->tid));
+
+       mono_hazard_pointer_clear (mono_hazard_pointer_get (), 1);
+
+       /*
+        * This will signal async signal handlers that the thread has exited.
+        * The profiler callback needs this to be set, so it cannot be done earlier.
+        */
+       mono_domain_unset ();
+       mono_memory_barrier ();
+
+       if (thread == mono_thread_internal_current ())
+               mono_thread_pop_appdomain_ref ();
+
+       mono_free_static_data (thread->static_data);
+       thread->static_data = NULL;
+       ref_stack_destroy (thread->appdomain_refs);
+       thread->appdomain_refs = NULL;
+
+       g_assert (thread->suspended);
+       mono_os_event_destroy (thread->suspended);
+       g_free (thread->suspended);
+       thread->suspended = NULL;
+
+       if (mono_thread_cleanup_fn)
+               mono_thread_cleanup_fn (thread_get_tid (thread));
+
+       mono_memory_barrier ();
+
+       if (mono_gc_is_moving ()) {
+               MONO_GC_UNREGISTER_ROOT (thread->thread_pinning_ref);
+               thread->thread_pinning_ref = NULL;
+       }
+
+done:
+       SET_CURRENT_OBJECT (NULL);
+       mono_domain_unset ();
+
+       mono_thread_info_unset_internal_thread_gchandle ((MonoThreadInfo*) thread->thread_info);
+
+       /* Don't need to close the handle to this thread, even though we took a
+        * reference in mono_thread_attach (), because the GC will do it
+        * when the Thread object is finalised.
+        */
+}
+
 typedef struct {
        gint32 ref;
        MonoThread *thread;
@@ -1138,149 +1281,6 @@ mono_thread_attach (MonoDomain *domain)
        return mono_thread_attach_full (domain, FALSE);
 }
 
-void
-mono_thread_detach_internal (MonoInternalThread *thread)
-{
-       gboolean removed;
-
-       g_assert (thread != NULL);
-       SET_CURRENT_OBJECT (thread);
-
-       THREAD_DEBUG (g_message ("%s: mono_thread_detach for %p (%"G_GSIZE_FORMAT")", __func__, thread, (gsize)thread->tid));
-
-#ifndef HOST_WIN32
-       mono_w32mutex_abandon ();
-#endif
-
-       if (thread->abort_state_handle) {
-               mono_gchandle_free (thread->abort_state_handle);
-               thread->abort_state_handle = 0;
-       }
-
-       thread->abort_exc = NULL;
-       thread->current_appcontext = NULL;
-
-       /*
-        * thread->synch_cs can be NULL if this was called after
-        * ves_icall_System_Threading_InternalThread_Thread_free_internal.
-        * This can happen only during shutdown.
-        * The shutting_down flag is not always set, so we can't assert on it.
-        */
-       if (thread->synch_cs)
-               LOCK_THREAD (thread);
-
-       thread->state |= ThreadState_Stopped;
-       thread->state &= ~ThreadState_Background;
-
-       if (thread->synch_cs)
-               UNLOCK_THREAD (thread);
-
-       /*
-       An interruption request has leaked to cleanup. Adjust the global counter.
-
-       This can happen is the abort source thread finds the abortee (this) thread
-       in unmanaged code. If this thread never trips back to managed code or check
-       the local flag it will be left set and positively unbalance the global counter.
-       
-       Leaving the counter unbalanced will cause a performance degradation since all threads
-       will now keep checking their local flags all the time.
-       */
-       mono_thread_clear_interruption_requested (thread);
-
-       mono_threads_lock ();
-
-       if (!threads) {
-               removed = FALSE;
-       } else if (mono_g_hash_table_lookup (threads, (gpointer)thread->tid) != thread) {
-               /* We have to check whether the thread object for the
-                * tid is still the same in the table because the
-                * thread might have been destroyed and the tid reused
-                * in the meantime, in which case the tid would be in
-                * the table, but with another thread object.
-                */
-               removed = FALSE;
-       } else {
-               mono_g_hash_table_remove (threads, (gpointer)thread->tid);
-               removed = TRUE;
-       }
-
-       mono_threads_unlock ();
-
-       /* Don't close the handle here, wait for the object finalizer
-        * to do it. Otherwise, the following race condition applies:
-        *
-        * 1) Thread exits (and mono_thread_detach_internal() closes the handle)
-        *
-        * 2) Some other handle is reassigned the same slot
-        *
-        * 3) Another thread tries to join the first thread, and
-        * blocks waiting for the reassigned handle to be signalled
-        * (which might never happen).  This is possible, because the
-        * thread calling Join() still has a reference to the first
-        * thread's object.
-        */
-
-       /* if the thread is not in the hash it has been removed already */
-       if (!removed) {
-               mono_domain_unset ();
-               mono_memory_barrier ();
-
-               if (mono_thread_cleanup_fn)
-                       mono_thread_cleanup_fn (thread_get_tid (thread));
-
-               goto done;
-       }
-
-       mono_release_type_locks (thread);
-
-       /* Can happen when we attach the profiler helper thread in order to heapshot. */
-       if (!mono_thread_info_lookup (MONO_UINT_TO_NATIVE_THREAD_ID (thread->tid))->tools_thread)
-               MONO_PROFILER_RAISE (thread_stopped, (thread->tid));
-
-       mono_hazard_pointer_clear (mono_hazard_pointer_get (), 1);
-
-       /*
-        * This will signal async signal handlers that the thread has exited.
-        * The profiler callback needs this to be set, so it cannot be done earlier.
-        */
-       mono_domain_unset ();
-       mono_memory_barrier ();
-
-       if (thread == mono_thread_internal_current ())
-               mono_thread_pop_appdomain_ref ();
-
-       mono_free_static_data (thread->static_data);
-       thread->static_data = NULL;
-       ref_stack_destroy (thread->appdomain_refs);
-       thread->appdomain_refs = NULL;
-
-       g_assert (thread->suspended);
-       mono_os_event_destroy (thread->suspended);
-       g_free (thread->suspended);
-       thread->suspended = NULL;
-
-       if (mono_thread_cleanup_fn)
-               mono_thread_cleanup_fn (thread_get_tid (thread));
-
-       mono_memory_barrier ();
-
-       if (mono_gc_is_moving ()) {
-               MONO_GC_UNREGISTER_ROOT (thread->thread_pinning_ref);
-               thread->thread_pinning_ref = NULL;
-       }
-
-done:
-       SET_CURRENT_OBJECT (NULL);
-       mono_domain_unset ();
-
-       mono_thread_info_unset_internal_thread_gchandle ((MonoThreadInfo*) thread->thread_info);
-
-       /* Don't need to close the handle to this thread, even though we took a
-        * reference in mono_thread_attach (), because the GC will do it
-        * when the Thread object is finalised.
-        */
-}
-
 /**
  * mono_thread_detach:
  */
@@ -3947,6 +3947,14 @@ mono_threads_abort_appdomain_threads (MonoDomain *domain, int timeout)
        return TRUE;
 }
 
+void
+mono_thread_self_abort (void)
+{
+       MonoError error;
+       self_abort_internal (&error);
+       mono_error_set_pending_exception (&error);
+}
+
 /*
  * mono_thread_get_undeniable_exception:
  *
index 439bdd81a2a0d366e5f1a3fec63ac8448cbfed49..bd42451469ffb2bdc511c9262e2b6c0312f4cf81 100644 (file)
@@ -76,6 +76,7 @@
 #define WSAEHOSTDOWN               10064
 #define WSAEHOSTUNREACH            10065
 #define WSASYSCALLFAILURE          10107
+#define WSAENXIO                   100001
 
 #endif
 
index d74520f162cf8edaca9252ee3434bf402e02938e..a3ac2264f6da7addaebd76807e466a43745ce499 100644 (file)
@@ -40,6 +40,7 @@
 #include "w32file-unix-glob.h"
 #include "w32handle.h"
 #include "w32error.h"
+#include "fdhandle.h"
 #include "utils/mono-io-portability.h"
 #include "utils/mono-logger-internals.h"
 #include "utils/mono-os-mutex.h"
@@ -59,14 +60,14 @@ typedef struct {
 /* Currently used for both FILE, CONSOLE and PIPE handle types.
  * This may have to change in future. */
 typedef struct {
+       MonoFDHandle fdhandle;
        gchar *filename;
        FileShare *share_info;  /* Pointer into shared mem */
-       gint fd;
        guint32 security_attributes;
        guint32 fileaccess;
        guint32 sharemode;
        guint32 attrs;
-} MonoW32HandleFile;
+} FileHandle;
 
 typedef struct {
        gchar **namelist;
@@ -93,6 +94,63 @@ time_t_to_filetime (time_t timeval, FILETIME *filetime)
        filetime->dwHighDateTime = ticks >> 32;
 }
 
+static FileHandle*
+file_data_create (MonoFDType type, gint fd)
+{
+       FileHandle *filehandle;
+
+       filehandle = g_new0 (FileHandle, 1);
+       mono_fdhandle_init ((MonoFDHandle*) filehandle, type, fd);
+
+       return filehandle;
+}
+
+static gint
+_wapi_unlink (const gchar *pathname);
+
+static void
+file_share_release (FileShare *share_info);
+
+static void
+file_data_close (MonoFDHandle *fdhandle)
+{
+       FileHandle* filehandle;
+
+       filehandle = (FileHandle*) fdhandle;
+       g_assert (filehandle);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: closing fd %d", __func__, ((MonoFDHandle*) filehandle)->fd);
+
+       if (((MonoFDHandle*) filehandle)->type == MONO_FDTYPE_FILE && (filehandle->attrs & FILE_FLAG_DELETE_ON_CLOSE)) {
+               _wapi_unlink (filehandle->filename);
+       }
+
+       if (((MonoFDHandle*) filehandle)->type != MONO_FDTYPE_CONSOLE || ((MonoFDHandle*) filehandle)->fd > 2) {
+               if (filehandle->share_info) {
+                       file_share_release (filehandle->share_info);
+                       filehandle->share_info = NULL;
+               }
+
+               MONO_ENTER_GC_SAFE;
+               close (((MonoFDHandle*) filehandle)->fd);
+               MONO_EXIT_GC_SAFE;
+       }
+}
+
+static void
+file_data_destroy (MonoFDHandle *fdhandle)
+{
+       FileHandle *filehandle;
+
+       filehandle = (FileHandle*) fdhandle;
+       g_assert (filehandle);
+
+       if (filehandle->filename)
+               g_free (filehandle->filename);
+
+       g_free (filehandle);
+}
+
 static void
 file_share_release (FileShare *share_info)
 {
@@ -102,8 +160,10 @@ file_share_release (FileShare *share_info)
        g_assert (share_info->handle_refs > 0);
        share_info->handle_refs -= 1;
 
-       if (share_info->handle_refs == 0)
+       if (share_info->handle_refs == 0) {
                g_hash_table_remove (file_share_table, share_info);
+               // g_free (share_info);
+       }
 
        mono_coop_mutex_unlock (&file_share_mutex);
 }
@@ -803,65 +863,15 @@ _wapi_unlock_file_region (gint fd, off_t offset, off_t length)
        return TRUE;
 }
 
-static void file_close (gpointer handle, gpointer data);
-static void file_details (gpointer data);
-static const gchar* file_typename (void);
-static gsize file_typesize (void);
-static gint file_getfiletype(void);
-static gboolean file_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread);
-static gboolean file_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten);
-static gboolean file_flush(gpointer handle);
-static guint32 file_seek(gpointer handle, gint32 movedistance,
-                        gint32 *highmovedistance, gint method);
-static gboolean file_setendoffile(gpointer handle);
-static guint32 file_getfilesize(gpointer handle, guint32 *highsize);
-static gboolean file_getfiletime(gpointer handle, FILETIME *create_time,
-                                FILETIME *access_time,
-                                FILETIME *write_time);
-static gboolean file_setfiletime(gpointer handle,
-                                const FILETIME *create_time,
-                                const FILETIME *access_time,
-                                const FILETIME *write_time);
-static guint32 GetDriveTypeFromPath (const gchar *utf8_root_path_name);
-
-/* File handle is only signalled for overlapped IO */
-static MonoW32HandleOps _wapi_file_ops = {
-       file_close,             /* close */
-       NULL,                   /* signal */
-       NULL,                   /* own */
-       NULL,                   /* is_owned */
-       NULL,                   /* special_wait */
-       NULL,                   /* prewait */
-       file_details,   /* details */
-       file_typename,  /* typename */
-       file_typesize,  /* typesize */
-};
-
-static void console_close (gpointer handle, gpointer data);
-static void console_details (gpointer data);
-static const gchar* console_typename (void);
-static gsize console_typesize (void);
-static gint console_getfiletype(void);
-static gboolean console_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread);
-static gboolean console_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten);
-
-/* Console is mostly the same as file, except it can block waiting for
- * input or output
- */
-static MonoW32HandleOps _wapi_console_ops = {
-       console_close,          /* close */
-       NULL,                   /* signal */
-       NULL,                   /* own */
-       NULL,                   /* is_owned */
-       NULL,                   /* special_wait */
-       NULL,                   /* prewait */
-       console_details,        /* details */
-       console_typename,       /* typename */
-       console_typesize,       /* typesize */
-};
+static const gchar* find_typename (void)
+{
+       return "Find";
+}
 
-static const gchar* find_typename (void);
-static gsize find_typesize (void);
+static gsize find_typesize (void)
+{
+       return sizeof (MonoW32HandleFind);
+}
 
 static MonoW32HandleOps _wapi_find_ops = {
        NULL,                   /* close */
@@ -875,85 +885,6 @@ static MonoW32HandleOps _wapi_find_ops = {
        find_typesize,  /* typesize */
 };
 
-static void pipe_close (gpointer handle, gpointer data);
-static void pipe_details (gpointer data);
-static const gchar* pipe_typename (void);
-static gsize pipe_typesize (void);
-static gint pipe_getfiletype (void);
-static gboolean pipe_read (gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread);
-static gboolean pipe_write (gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten);
-
-/* Pipe handles
- */
-static MonoW32HandleOps _wapi_pipe_ops = {
-       pipe_close,             /* close */
-       NULL,                   /* signal */
-       NULL,                   /* own */
-       NULL,                   /* is_owned */
-       NULL,                   /* special_wait */
-       NULL,                   /* prewait */
-       pipe_details,   /* details */
-       pipe_typename,  /* typename */
-       pipe_typesize,  /* typesize */
-};
-
-static const struct {
-       /* File, console and pipe handles */
-       gint (*getfiletype)(void);
-       
-       /* File, console and pipe handles */
-       gboolean (*readfile)(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread);
-       gboolean (*writefile)(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten);
-       gboolean (*flushfile)(gpointer handle);
-       
-       /* File handles */
-       guint32 (*seek)(gpointer handle, gint32 movedistance,
-                       gint32 *highmovedistance, gint method);
-       gboolean (*setendoffile)(gpointer handle);
-       guint32 (*getfilesize)(gpointer handle, guint32 *highsize);
-       gboolean (*getfiletime)(gpointer handle, FILETIME *create_time,
-                               FILETIME *access_time,
-                               FILETIME *write_time);
-       gboolean (*setfiletime)(gpointer handle,
-                               const FILETIME *create_time,
-                               const FILETIME *access_time,
-                               const FILETIME *write_time);
-} io_ops[MONO_W32HANDLE_COUNT]={
-       {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-       /* file */
-       {file_getfiletype,
-        file_read, file_write,
-        file_flush, file_seek,
-        file_setendoffile,
-        file_getfilesize,
-        file_getfiletime,
-        file_setfiletime},
-       /* console */
-       {console_getfiletype,
-        console_read,
-        console_write,
-        NULL, NULL, NULL, NULL, NULL, NULL},
-       /* thread */
-       {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-       /* sem */
-       {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-       /* mutex */
-       {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-       /* event */
-       {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-       /* socket (will need at least read and write) */
-       {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-       /* find */
-       {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-       /* process */
-       {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-       /* pipe */
-       {pipe_getfiletype,
-        pipe_read,
-        pipe_write,
-        NULL, NULL, NULL, NULL, NULL, NULL},
-};
-
 static gboolean lock_while_writing = FALSE;
 
 /* Some utility functions.
@@ -1087,88 +1018,18 @@ static void _wapi_set_last_path_error_from_errno (const gchar *dir,
        }
 }
 
-/* Handle ops.
- */
-static void file_close (gpointer handle, gpointer data)
-{
-       /* FIXME: after mono_w32handle_close is coop-aware, change this to MONO_REQ_GC_UNSAFE_MODE and leave just the switch to SAFE around close() below */
-       MONO_ENTER_GC_UNSAFE;
-       MonoW32HandleFile *file_handle = (MonoW32HandleFile *)data;
-       gint fd = file_handle->fd;
-       
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: closing file handle %p [%s]", __func__, handle,
-                 file_handle->filename);
-
-       if (file_handle->attrs & FILE_FLAG_DELETE_ON_CLOSE)
-               _wapi_unlink (file_handle->filename);
-       
-       g_free (file_handle->filename);
-       
-       if (file_handle->share_info)
-               file_share_release (file_handle->share_info);
-       
-       MONO_ENTER_GC_SAFE;
-       close (fd);
-       MONO_EXIT_GC_SAFE;
-       MONO_EXIT_GC_UNSAFE;
-}
-
-static void file_details (gpointer data)
-{
-       MonoW32HandleFile *file = (MonoW32HandleFile *)data;
-       
-       g_print ("[%20s] acc: %c%c%c, shr: %c%c%c, attrs: %5u",
-                file->filename,
-                file->fileaccess&GENERIC_READ?'R':'.',
-                file->fileaccess&GENERIC_WRITE?'W':'.',
-                file->fileaccess&GENERIC_EXECUTE?'X':'.',
-                file->sharemode&FILE_SHARE_READ?'R':'.',
-                file->sharemode&FILE_SHARE_WRITE?'W':'.',
-                file->sharemode&FILE_SHARE_DELETE?'D':'.',
-                file->attrs);
-}
-
-static const gchar* file_typename (void)
-{
-       return "File";
-}
-
-static gsize file_typesize (void)
-{
-       return sizeof (MonoW32HandleFile);
-}
-
-static gint file_getfiletype(void)
-{
-       return(FILE_TYPE_DISK);
-}
-
 static gboolean
-file_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread)
+file_read(FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint32 *bytesread)
 {
-       MonoW32HandleFile *file_handle;
-       gboolean ok;
-       gint fd, ret;
+       gint ret;
        MonoThreadInfo *info = mono_thread_info_current ();
-       
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE,
-                               (gpointer *)&file_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up file handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
-       }
 
-       fd = file_handle->fd;
        if(bytesread!=NULL) {
                *bytesread=0;
        }
        
-       if(!(file_handle->fileaccess & GENERIC_READ) &&
-          !(file_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_READ access: %u",
-                         __func__, handle, file_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_READ | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_READ access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(FALSE);
@@ -1176,7 +1037,7 @@ file_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread
 
        do {
                MONO_ENTER_GC_SAFE;
-               ret = read (fd, buffer, numbytes);
+               ret = read (((MonoFDHandle*) filehandle)->fd, buffer, numbytes);
                MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR &&
                 !mono_thread_info_is_interrupt_state (info));
@@ -1184,8 +1045,7 @@ file_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread
        if(ret==-1) {
                gint err = errno;
 
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: read of handle %p error: %s", __func__,
-                         handle, strerror(err));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: read of fd %d error: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(err));
                mono_w32error_set_last (mono_w32error_unix_to_win32 (err));
                return(FALSE);
        }
@@ -1198,32 +1058,18 @@ file_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread
 }
 
 static gboolean
-file_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten)
+file_write(FileHandle *filehandle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten)
 {
-       MonoW32HandleFile *file_handle;
-       gboolean ok;
-       gint ret, fd;
+       gint ret;
        off_t current_pos = 0;
        MonoThreadInfo *info = mono_thread_info_current ();
        
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE,
-                               (gpointer *)&file_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up file handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
-       }
-
-       fd = file_handle->fd;
-       
        if(byteswritten!=NULL) {
                *byteswritten=0;
        }
        
-       if(!(file_handle->fileaccess & GENERIC_WRITE) &&
-          !(file_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
+       if(!(filehandle->fileaccess & GENERIC_WRITE) && !(filehandle->fileaccess & GENERIC_ALL)) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(FALSE);
@@ -1235,17 +1081,15 @@ file_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byt
                 * systems
                 */
                MONO_ENTER_GC_SAFE;
-               current_pos = lseek (fd, (off_t)0, SEEK_CUR);
+               current_pos = lseek (((MonoFDHandle*) filehandle)->fd, (off_t)0, SEEK_CUR);
                MONO_EXIT_GC_SAFE;
                if (current_pos == -1) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p lseek failed: %s", __func__,
-                                  handle, strerror (errno));
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d lseek failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror (errno));
                        _wapi_set_last_error_from_errno ();
                        return(FALSE);
                }
                
-               if (_wapi_lock_file_region (fd, current_pos,
-                                           numbytes) == FALSE) {
+               if (_wapi_lock_file_region (((MonoFDHandle*) filehandle)->fd, current_pos, numbytes) == FALSE) {
                        /* The error has already been set */
                        return(FALSE);
                }
@@ -1253,13 +1097,13 @@ file_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byt
                
        do {
                MONO_ENTER_GC_SAFE;
-               ret = write (fd, buffer, numbytes);
+               ret = write (((MonoFDHandle*) filehandle)->fd, buffer, numbytes);
                MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR &&
                 !mono_thread_info_is_interrupt_state (info));
        
        if (lock_while_writing) {
-               _wapi_unlock_file_region (fd, current_pos, numbytes);
+               _wapi_unlock_file_region (((MonoFDHandle*) filehandle)->fd, current_pos, numbytes);
        }
 
        if (ret == -1) {
@@ -1268,8 +1112,7 @@ file_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byt
                } else {
                        _wapi_set_last_error_from_errno ();
                                
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: write of handle %p error: %s",
-                                 __func__, handle, strerror(errno));
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: write of fd %d error: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                        return(FALSE);
                }
@@ -1280,37 +1123,22 @@ file_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byt
        return(TRUE);
 }
 
-static gboolean file_flush(gpointer handle)
+static gboolean file_flush(FileHandle *filehandle)
 {
-       MonoW32HandleFile *file_handle;
-       gboolean ok;
-       gint ret, fd;
-       
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE,
-                               (gpointer *)&file_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up file handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
-       }
-
-       fd = file_handle->fd;
+       gint ret;
 
-       if(!(file_handle->fileaccess & GENERIC_WRITE) &&
-          !(file_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_WRITE | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(FALSE);
        }
 
        MONO_ENTER_GC_SAFE;
-       ret=fsync(fd);
+       ret=fsync(((MonoFDHandle*) filehandle)->fd);
        MONO_EXIT_GC_SAFE;
        if (ret==-1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fsync of handle %p error: %s", __func__, handle,
-                         strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fsync of fd %d error: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                _wapi_set_last_error_from_errno ();
                return(FALSE);
@@ -1319,30 +1147,15 @@ static gboolean file_flush(gpointer handle)
        return(TRUE);
 }
 
-static guint32 file_seek(gpointer handle, gint32 movedistance,
+static guint32 file_seek(FileHandle *filehandle, gint32 movedistance,
                         gint32 *highmovedistance, gint method)
 {
-       MonoW32HandleFile *file_handle;
-       gboolean ok;
        gint64 offset, newpos;
-       gint whence, fd;
+       gint whence;
        guint32 ret;
-       
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE,
-                               (gpointer *)&file_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up file handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(INVALID_SET_FILE_POINTER);
-       }
-       
-       fd = file_handle->fd;
 
-       if(!(file_handle->fileaccess & GENERIC_READ) &&
-          !(file_handle->fileaccess & GENERIC_WRITE) &&
-          !(file_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_READ | GENERIC_WRITE | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(INVALID_SET_FILE_POINTER);
@@ -1380,22 +1193,20 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
        offset=movedistance;
 #endif
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: moving handle %p by %" G_GINT64_FORMAT " bytes from %d", __func__,
-                  handle, offset, whence);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: moving fd %d by %" G_GINT64_FORMAT " bytes from %d", __func__, ((MonoFDHandle*) filehandle)->fd, offset, whence);
 
 #ifdef PLATFORM_ANDROID
        /* bionic doesn't support -D_FILE_OFFSET_BITS=64 */
        MONO_ENTER_GC_SAFE;
-       newpos=lseek64(fd, offset, whence);
+       newpos=lseek64(((MonoFDHandle*) filehandle)->fd, offset, whence);
        MONO_EXIT_GC_SAFE;
 #else
        MONO_ENTER_GC_SAFE;
-       newpos=lseek(fd, offset, whence);
+       newpos=lseek(((MonoFDHandle*) filehandle)->fd, offset, whence);
        MONO_EXIT_GC_SAFE;
 #endif
        if(newpos==-1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: lseek on handle %p returned error %s",
-                         __func__, handle, strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: lseek on fd %d returned error %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                _wapi_set_last_error_from_errno ();
                return(INVALID_SET_FILE_POINTER);
@@ -1416,34 +1227,20 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
        }
 #endif
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: move of handle %p returning %" G_GUINT32_FORMAT "/%" G_GINT32_FORMAT, __func__,
-                  handle, ret, highmovedistance==NULL?0:*highmovedistance);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: move of fd %d returning %" G_GUINT32_FORMAT "/%" G_GINT32_FORMAT, __func__, ((MonoFDHandle*) filehandle)->fd, ret, highmovedistance==NULL?0:*highmovedistance);
 
        return(ret);
 }
 
-static gboolean file_setendoffile(gpointer handle)
+static gboolean file_setendoffile(FileHandle *filehandle)
 {
-       MonoW32HandleFile *file_handle;
-       gboolean ok;
        struct stat statbuf;
        off_t pos;
-       gint ret, fd;
+       gint ret;
        MonoThreadInfo *info = mono_thread_info_current ();
        
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE,
-                               (gpointer *)&file_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up file handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
-       }
-       fd = file_handle->fd;
-       
-       if(!(file_handle->fileaccess & GENERIC_WRITE) &&
-          !(file_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_WRITE | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(FALSE);
@@ -1456,22 +1253,20 @@ static gboolean file_setendoffile(gpointer handle)
         */
        
        MONO_ENTER_GC_SAFE;
-       ret=fstat(fd, &statbuf);
+       ret=fstat(((MonoFDHandle*) filehandle)->fd, &statbuf);
        MONO_EXIT_GC_SAFE;
        if(ret==-1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p fstat failed: %s", __func__,
-                          handle, strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d fstat failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                _wapi_set_last_error_from_errno ();
                return(FALSE);
        }
 
        MONO_ENTER_GC_SAFE;
-       pos=lseek(fd, (off_t)0, SEEK_CUR);
+       pos=lseek(((MonoFDHandle*) filehandle)->fd, (off_t)0, SEEK_CUR);
        MONO_EXIT_GC_SAFE;
        if(pos==-1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p lseek failed: %s", __func__,
-                         handle, strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d lseek failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                _wapi_set_last_error_from_errno ();
                return(FALSE);
@@ -1493,13 +1288,13 @@ static gboolean file_setendoffile(gpointer handle)
                 */
                do {
                        MONO_ENTER_GC_SAFE;
-                       ret = write (fd, "", 1);
+                       ret = write (((MonoFDHandle*) filehandle)->fd, "", 1);
                        MONO_EXIT_GC_SAFE;
                } while (ret == -1 && errno == EINTR &&
                         !mono_thread_info_is_interrupt_state (info));
 
                if(ret==-1) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p extend write failed: %s", __func__, handle, strerror(errno));
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d extend write failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                        _wapi_set_last_error_from_errno ();
                        return(FALSE);
@@ -1507,11 +1302,10 @@ static gboolean file_setendoffile(gpointer handle)
 
                /* And put the file position back after the write */
                MONO_ENTER_GC_SAFE;
-               ret = lseek (fd, pos, SEEK_SET);
+               ret = lseek (((MonoFDHandle*) filehandle)->fd, pos, SEEK_SET);
                MONO_EXIT_GC_SAFE;
                if (ret == -1) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p second lseek failed: %s",
-                                  __func__, handle, strerror(errno));
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d second lseek failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                        _wapi_set_last_error_from_errno ();
                        return(FALSE);
@@ -1524,13 +1318,12 @@ static gboolean file_setendoffile(gpointer handle)
         */
        do {
                MONO_ENTER_GC_SAFE;
-               ret=ftruncate(fd, pos);
+               ret=ftruncate(((MonoFDHandle*) filehandle)->fd, pos);
                MONO_EXIT_GC_SAFE;
        }
        while (ret==-1 && errno==EINTR && !mono_thread_info_is_interrupt_state (info)); 
        if(ret==-1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p ftruncate failed: %s", __func__,
-                         handle, strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d ftruncate failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
                
                _wapi_set_last_error_from_errno ();
                return(FALSE);
@@ -1539,29 +1332,14 @@ static gboolean file_setendoffile(gpointer handle)
        return(TRUE);
 }
 
-static guint32 file_getfilesize(gpointer handle, guint32 *highsize)
+static guint32 file_getfilesize(FileHandle *filehandle, guint32 *highsize)
 {
-       MonoW32HandleFile *file_handle;
-       gboolean ok;
        struct stat statbuf;
        guint32 size;
        gint ret;
-       gint fd;
        
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE,
-                               (gpointer *)&file_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up file handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(INVALID_FILE_SIZE);
-       }
-       fd = file_handle->fd;
-       
-       if(!(file_handle->fileaccess & GENERIC_READ) &&
-          !(file_handle->fileaccess & GENERIC_WRITE) &&
-          !(file_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_READ | GENERIC_WRITE | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(INVALID_FILE_SIZE);
@@ -1574,11 +1352,10 @@ static guint32 file_getfilesize(gpointer handle, guint32 *highsize)
        mono_w32error_set_last (ERROR_SUCCESS);
        
        MONO_ENTER_GC_SAFE;
-       ret = fstat(fd, &statbuf);
+       ret = fstat(((MonoFDHandle*) filehandle)->fd, &statbuf);
        MONO_EXIT_GC_SAFE;
        if (ret == -1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p fstat failed: %s", __func__,
-                          handle, strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d fstat failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                _wapi_set_last_error_from_errno ();
                return(INVALID_FILE_SIZE);
@@ -1590,11 +1367,10 @@ static guint32 file_getfilesize(gpointer handle, guint32 *highsize)
                guint64 bigsize;
                gint res;
                MONO_ENTER_GC_SAFE;
-               res = ioctl (fd, BLKGETSIZE64, &bigsize);
+               res = ioctl (((MonoFDHandle*) filehandle)->fd, BLKGETSIZE64, &bigsize);
                MONO_EXIT_GC_SAFE;
                if (res < 0) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p ioctl BLKGETSIZE64 failed: %s",
-                                  __func__, handle, strerror(errno));
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d ioctl BLKGETSIZE64 failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                        _wapi_set_last_error_from_errno ();
                        return(INVALID_FILE_SIZE);
@@ -1630,41 +1406,26 @@ static guint32 file_getfilesize(gpointer handle, guint32 *highsize)
        return(size);
 }
 
-static gboolean file_getfiletime(gpointer handle, FILETIME *create_time,
+static gboolean file_getfiletime(FileHandle *filehandle, FILETIME *create_time,
                                 FILETIME *access_time,
                                 FILETIME *write_time)
 {
-       MonoW32HandleFile *file_handle;
-       gboolean ok;
        struct stat statbuf;
        guint64 create_ticks, access_ticks, write_ticks;
-       gint ret, fd;
-       
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE,
-                               (gpointer *)&file_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up file handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
-       }
-       fd = file_handle->fd;
+       gint ret;
 
-       if(!(file_handle->fileaccess & GENERIC_READ) &&
-          !(file_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_READ access: %u",
-                         __func__, handle, file_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_READ | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_READ access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(FALSE);
        }
        
        MONO_ENTER_GC_SAFE;
-       ret=fstat(fd, &statbuf);
+       ret=fstat(((MonoFDHandle*) filehandle)->fd, &statbuf);
        MONO_EXIT_GC_SAFE;
        if(ret==-1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p fstat failed: %s", __func__, handle,
-                         strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d fstat failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                _wapi_set_last_error_from_errno ();
                return(FALSE);
@@ -1712,38 +1473,26 @@ static gboolean file_getfiletime(gpointer handle, FILETIME *create_time,
        return(TRUE);
 }
 
-static gboolean file_setfiletime(gpointer handle,
+static gboolean file_setfiletime(FileHandle *filehandle,
                                 const FILETIME *create_time G_GNUC_UNUSED,
                                 const FILETIME *access_time,
                                 const FILETIME *write_time)
 {
-       MonoW32HandleFile *file_handle;
-       gboolean ok;
        struct utimbuf utbuf;
        struct stat statbuf;
        guint64 access_ticks, write_ticks;
-       gint ret, fd;
+       gint ret;
        
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE,
-                               (gpointer *)&file_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up file handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
-       }
-       fd = file_handle->fd;
        
-       if(!(file_handle->fileaccess & GENERIC_WRITE) &&
-          !(file_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_WRITE | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(FALSE);
        }
 
-       if(file_handle->filename == NULL) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p unknown filename", __func__, handle);
+       if(filehandle->filename == NULL) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d unknown filename", __func__, ((MonoFDHandle*) filehandle)->fd);
 
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
                return(FALSE);
@@ -1753,11 +1502,10 @@ static gboolean file_setfiletime(gpointer handle,
         * the event that one of the FileTime structs is NULL
         */
        MONO_ENTER_GC_SAFE;
-       ret=fstat (fd, &statbuf);
+       ret=fstat (((MonoFDHandle*) filehandle)->fd, &statbuf);
        MONO_EXIT_GC_SAFE;
        if(ret==-1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p fstat failed: %s", __func__, handle,
-                         strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d fstat failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                mono_w32error_set_last (ERROR_INVALID_PARAMETER);
                return(FALSE);
@@ -1812,13 +1560,12 @@ static gboolean file_setfiletime(gpointer handle,
                utbuf.modtime=statbuf.st_mtime;
        }
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: setting handle %p access %ld write %ld", __func__,
-                  handle, utbuf.actime, utbuf.modtime);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: setting fd %d access %ld write %ld", __func__,
+                  ((MonoFDHandle*) filehandle)->fd, utbuf.actime, utbuf.modtime);
 
-       ret = _wapi_utime (file_handle->filename, &utbuf);
+       ret = _wapi_utime (filehandle->filename, &utbuf);
        if (ret == -1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p [%s] utime failed: %s", __func__,
-                          handle, file_handle->filename, strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d [%s] utime failed: %s", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->filename, g_strerror(errno));
 
                mono_w32error_set_last (ERROR_INVALID_PARAMETER);
                return(FALSE);
@@ -1827,73 +1574,18 @@ static gboolean file_setfiletime(gpointer handle,
        return(TRUE);
 }
 
-static void console_close (gpointer handle, gpointer data)
-{
-       /* FIXME: after mono_w32handle_close is coop-aware, change this to MONO_REQ_GC_UNSAFE_MODE and leave just the switch to SAFE around close() below */
-       MONO_ENTER_GC_UNSAFE;
-       MonoW32HandleFile *console_handle = (MonoW32HandleFile *)data;
-       gint fd = console_handle->fd;
-       
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: closing console handle %p", __func__, handle);
-
-       g_free (console_handle->filename);
-
-       if (fd > 2) {
-               if (console_handle->share_info)
-                       file_share_release (console_handle->share_info);
-               MONO_ENTER_GC_SAFE;
-               close (fd);
-               MONO_EXIT_GC_SAFE;
-       }
-       MONO_EXIT_GC_UNSAFE;
-}
-
-static void console_details (gpointer data)
-{
-       file_details (data);
-}
-
-static const gchar* console_typename (void)
-{
-       return "Console";
-}
-
-static gsize console_typesize (void)
-{
-       return sizeof (MonoW32HandleFile);
-}
-
-static gint console_getfiletype(void)
-{
-       return(FILE_TYPE_CHAR);
-}
-
 static gboolean
-console_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread)
+console_read(FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint32 *bytesread)
 {
-       MonoW32HandleFile *console_handle;
-       gboolean ok;
-       gint ret, fd;
+       gint ret;
        MonoThreadInfo *info = mono_thread_info_current ();
 
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_CONSOLE,
-                               (gpointer *)&console_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up console handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
-       }
-       fd = console_handle->fd;
-       
        if(bytesread!=NULL) {
                *bytesread=0;
        }
        
-       if(!(console_handle->fileaccess & GENERIC_READ) &&
-          !(console_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_READ access: %u",
-                          __func__, handle, console_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_READ | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_READ access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(FALSE);
@@ -1901,13 +1593,12 @@ console_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesr
        
        do {
                MONO_ENTER_GC_SAFE;
-               ret=read(fd, buffer, numbytes);
+               ret=read(((MonoFDHandle*) filehandle)->fd, buffer, numbytes);
                MONO_EXIT_GC_SAFE;
        } while (ret==-1 && errno==EINTR && !mono_thread_info_is_interrupt_state (info));
 
        if(ret==-1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: read of handle %p error: %s", __func__, handle,
-                         strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: read of fd %d error: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                _wapi_set_last_error_from_errno ();
                return(FALSE);
@@ -1921,30 +1612,17 @@ console_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesr
 }
 
 static gboolean
-console_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten)
+console_write(FileHandle *filehandle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten)
 {
-       MonoW32HandleFile *console_handle;
-       gboolean ok;
-       gint ret, fd;
+       gint ret;
        MonoThreadInfo *info = mono_thread_info_current ();
        
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_CONSOLE,
-                               (gpointer *)&console_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up console handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
-       }
-       fd = console_handle->fd;
-       
        if(byteswritten!=NULL) {
                *byteswritten=0;
        }
        
-       if(!(console_handle->fileaccess & GENERIC_WRITE) &&
-          !(console_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_WRITE access: %u", __func__, handle, console_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_WRITE | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(FALSE);
@@ -1952,7 +1630,7 @@ console_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *
        
        do {
                MONO_ENTER_GC_SAFE;
-               ret = write(fd, buffer, numbytes);
+               ret = write(((MonoFDHandle*) filehandle)->fd, buffer, numbytes);
                MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR &&
                 !mono_thread_info_is_interrupt_state (info));
@@ -1963,8 +1641,7 @@ console_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *
                } else {
                        _wapi_set_last_error_from_errno ();
                        
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: write of handle %p error: %s",
-                                  __func__, handle, strerror(errno));
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: write of fd %d error: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                        return(FALSE);
                }
@@ -1976,93 +1653,28 @@ console_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *
        return(TRUE);
 }
 
-static const gchar* find_typename (void)
-{
-       return "Find";
-}
-
-static gsize find_typesize (void)
-{
-       return sizeof (MonoW32HandleFind);
-}
-
-static void pipe_close (gpointer handle, gpointer data)
-{
-       /* FIXME: after mono_w32handle_close is coop-aware, change this to MONO_REQ_GC_UNSAFE_MODE and leave just the switch to SAFE around close() below */
-       MONO_ENTER_GC_UNSAFE;
-       MonoW32HandleFile *pipe_handle = (MonoW32HandleFile*)data;
-       gint fd = pipe_handle->fd;
-
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: closing pipe handle %p fd %d", __func__, handle, fd);
-
-       /* No filename with pipe handles */
-
-       if (pipe_handle->share_info)
-               file_share_release (pipe_handle->share_info);
-
-       MONO_ENTER_GC_SAFE;
-       close (fd);
-       MONO_EXIT_GC_SAFE;
-       MONO_EXIT_GC_UNSAFE;
-}
-
-static void pipe_details (gpointer data)
-{
-       file_details (data);
-}
-
-static const gchar* pipe_typename (void)
-{
-       return "Pipe";
-}
-
-static gsize pipe_typesize (void)
-{
-       return sizeof (MonoW32HandleFile);
-}
-
-static gint pipe_getfiletype(void)
-{
-       return(FILE_TYPE_PIPE);
-}
-
 static gboolean
-pipe_read (gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread)
+pipe_read (FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint32 *bytesread)
 {
-       MonoW32HandleFile *pipe_handle;
-       gboolean ok;
-       gint ret, fd;
+       gint ret;
        MonoThreadInfo *info = mono_thread_info_current ();
 
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_PIPE,
-                               (gpointer *)&pipe_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up pipe handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
-       }
-       fd = pipe_handle->fd;
-
        if(bytesread!=NULL) {
                *bytesread=0;
        }
        
-       if(!(pipe_handle->fileaccess & GENERIC_READ) &&
-          !(pipe_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_READ access: %u",
-                         __func__, handle, pipe_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_READ | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_READ access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(FALSE);
        }
        
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: reading up to %" G_GUINT32_FORMAT " bytes from pipe %p", __func__,
-                  numbytes, handle);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: reading up to %" G_GUINT32_FORMAT " bytes from pipe %d", __func__, numbytes, ((MonoFDHandle*) filehandle)->fd);
 
        do {
                MONO_ENTER_GC_SAFE;
-               ret=read(fd, buffer, numbytes);
+               ret=read(((MonoFDHandle*) filehandle)->fd, buffer, numbytes);
                MONO_EXIT_GC_SAFE;
        } while (ret==-1 && errno==EINTR && !mono_thread_info_is_interrupt_state (info));
                
@@ -2072,14 +1684,13 @@ pipe_read (gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesrea
                } else {
                        _wapi_set_last_error_from_errno ();
                        
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: read of handle %p error: %s", __func__,
-                                 handle, strerror(errno));
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: read of fd %d error: %s", __func__,((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                        return(FALSE);
                }
        }
        
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: read %d bytes from pipe %p", __func__, ret, handle);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: read %d bytes from pipe %d", __func__, ret, ((MonoFDHandle*) filehandle)->fd);
 
        if(bytesread!=NULL) {
                *bytesread=ret;
@@ -2089,41 +1700,27 @@ pipe_read (gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesrea
 }
 
 static gboolean
-pipe_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten)
+pipe_write(FileHandle *filehandle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten)
 {
-       MonoW32HandleFile *pipe_handle;
-       gboolean ok;
-       gint ret, fd;
+       gint ret;
        MonoThreadInfo *info = mono_thread_info_current ();
        
-       ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_PIPE,
-                               (gpointer *)&pipe_handle);
-       if(ok==FALSE) {
-               g_warning ("%s: error looking up pipe handle %p", __func__,
-                          handle);
-               mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
-       }
-       fd = pipe_handle->fd;
-       
        if(byteswritten!=NULL) {
                *byteswritten=0;
        }
        
-       if(!(pipe_handle->fileaccess & GENERIC_WRITE) &&
-          !(pipe_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_WRITE access: %u", __func__, handle, pipe_handle->fileaccess);
+       if(!(filehandle->fileaccess & (GENERIC_WRITE | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
 
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
                return(FALSE);
        }
        
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: writing up to %" G_GUINT32_FORMAT " bytes to pipe %p", __func__,
-                  numbytes, handle);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: writing up to %" G_GUINT32_FORMAT " bytes to pipe %d", __func__, numbytes, ((MonoFDHandle*) filehandle)->fd);
 
        do {
                MONO_ENTER_GC_SAFE;
-               ret = write (fd, buffer, numbytes);
+               ret = write (((MonoFDHandle*) filehandle)->fd, buffer, numbytes);
                MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR &&
                 !mono_thread_info_is_interrupt_state (info));
@@ -2134,8 +1731,7 @@ pipe_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byt
                } else {
                        _wapi_set_last_error_from_errno ();
                        
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: write of handle %p error: %s", __func__,
-                                 handle, strerror(errno));
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: write of fd %d error: %s", __func__,((MonoFDHandle*) filehandle)->fd, g_strerror(errno));
 
                        return(FALSE);
                }
@@ -2226,6 +1822,7 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode,
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%" PRIx32 ", file has sharing = NONE", __func__, fileaccess);
 
                        file_share_release (*share_info);
+                       *share_info = NULL;
                        
                        return(FALSE);
                }
@@ -2238,6 +1835,7 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode,
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%" PRIx32 ", file has sharing: 0x%" PRIx32, __func__, fileaccess, file_existing_share);
 
                        file_share_release (*share_info);
+                       *share_info = NULL;
                
                        return(FALSE);
                }
@@ -2250,6 +1848,7 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode,
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Access mode prevents open: requested share: 0x%" PRIx32 ", file has access: 0x%" PRIx32, __func__, sharemode, file_existing_access);
 
                        file_share_release (*share_info);
+                       *share_info = NULL;
                
                        return(FALSE);
                }
@@ -2279,6 +1878,7 @@ share_allows_delete (struct stat *statbuf, FileShare **share_info)
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%" PRIx32 ", file has sharing = NONE", __func__, (*share_info)->access);
 
                        file_share_release (*share_info);
+                       *share_info = NULL;
 
                        return(FALSE);
                }
@@ -2288,6 +1888,7 @@ share_allows_delete (struct stat *statbuf, FileShare **share_info)
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Share mode prevents open: requested access: 0x%" PRIx32 ", file has sharing: 0x%" PRIx32, __func__, (*share_info)->access, file_existing_share);
 
                        file_share_release (*share_info);
+                       *share_info = NULL;
 
                        return(FALSE);
                }
@@ -2301,8 +1902,8 @@ share_allows_delete (struct stat *statbuf, FileShare **share_info)
 gpointer
 mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode, guint32 createmode, guint32 attrs)
 {
-       MonoW32HandleFile file_handle = {0};
-       gpointer handle;
+       FileHandle *filehandle;
+       MonoFDType type;
        gint flags=convert_flags(fileaccess, createmode);
        /*mode_t perms=convert_perms(sharemode);*/
        /* we don't use sharemode, because that relates to sharing of
@@ -2313,7 +1914,6 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
        mode_t perms=0666;
        gchar *filename;
        gint fd, ret;
-       MonoW32HandleType handle_type;
        struct stat statbuf;
 
        if (attrs & FILE_ATTRIBUTE_TEMPORARY)
@@ -2359,81 +1959,77 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
        }
        
        if (fd == -1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Error opening file %s: %s", __func__, filename,
-                         strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Error opening file %s: %s", __func__, filename, g_strerror(errno));
                _wapi_set_last_path_error_from_errno (NULL, filename);
                g_free (filename);
 
                return(INVALID_HANDLE_VALUE);
        }
 
-       if (fd >= mono_w32handle_fd_reserve) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: File descriptor is too big", __func__);
-
-               mono_w32error_set_last (ERROR_TOO_MANY_OPEN_FILES);
-               
-               MONO_ENTER_GC_SAFE;
-               close (fd);
-               MONO_EXIT_GC_SAFE;
-               g_free (filename);
-               
-               return(INVALID_HANDLE_VALUE);
-       }
-
        MONO_ENTER_GC_SAFE;
        ret = fstat (fd, &statbuf);
        MONO_EXIT_GC_SAFE;
        if (ret == -1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fstat error of file %s: %s", __func__,
-                          filename, strerror (errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fstat error of file %s: %s", __func__, filename, g_strerror (errno));
                _wapi_set_last_error_from_errno ();
-               g_free (filename);
                MONO_ENTER_GC_SAFE;
                close (fd);
                MONO_EXIT_GC_SAFE;
-               
+
                return(INVALID_HANDLE_VALUE);
        }
 
-       if (share_allows_open (&statbuf, sharemode, fileaccess,
-                        &file_handle.share_info) == FALSE) {
-               mono_w32error_set_last (ERROR_SHARING_VIOLATION);
+#ifndef S_ISFIFO
+#define S_ISFIFO(m) ((m & S_IFIFO) != 0)
+#endif
+       if (S_ISFIFO (statbuf.st_mode)) {
+               type = MONO_FDTYPE_PIPE;
+               /* maintain invariant that pipes have no filename */
                g_free (filename);
+               filename = NULL;
+       } else if (S_ISCHR (statbuf.st_mode)) {
+               type = MONO_FDTYPE_CONSOLE;
+       } else {
+               type = MONO_FDTYPE_FILE;
+       }
+
+       filehandle = file_data_create (type, fd);
+       filehandle->filename = filename;
+       filehandle->fileaccess = fileaccess;
+       filehandle->sharemode = sharemode;
+       filehandle->attrs = attrs;
+
+       if (!share_allows_open (&statbuf, filehandle->sharemode, filehandle->fileaccess, &filehandle->share_info)) {
+               mono_w32error_set_last (ERROR_SHARING_VIOLATION);
                MONO_ENTER_GC_SAFE;
-               close (fd);
+               close (((MonoFDHandle*) filehandle)->fd);
                MONO_EXIT_GC_SAFE;
                
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
                return (INVALID_HANDLE_VALUE);
        }
-       if (file_handle.share_info == NULL) {
+       if (!filehandle->share_info) {
                /* No space, so no more files can be opened */
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: No space in the share table", __func__);
 
                mono_w32error_set_last (ERROR_TOO_MANY_OPEN_FILES);
                MONO_ENTER_GC_SAFE;
-               close (fd);
+               close (((MonoFDHandle*) filehandle)->fd);
                MONO_EXIT_GC_SAFE;
-               g_free (filename);
                
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
                return(INVALID_HANDLE_VALUE);
        }
-       
-       file_handle.filename = filename;
-       
-       file_handle.fd = fd;
-       file_handle.fileaccess=fileaccess;
-       file_handle.sharemode=sharemode;
-       file_handle.attrs=attrs;
 
 #ifdef HAVE_POSIX_FADVISE
        if (attrs & FILE_FLAG_SEQUENTIAL_SCAN) {
                MONO_ENTER_GC_SAFE;
-               posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
+               posix_fadvise (((MonoFDHandle*) filehandle)->fd, 0, 0, POSIX_FADV_SEQUENTIAL);
                MONO_EXIT_GC_SAFE;
        }
        if (attrs & FILE_FLAG_RANDOM_ACCESS) {
                MONO_ENTER_GC_SAFE;
-               posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM);
+               posix_fadvise (((MonoFDHandle*) filehandle)->fd, 0, 0, POSIX_FADV_RANDOM);
                MONO_EXIT_GC_SAFE;
        }
 #endif
@@ -2441,56 +2037,27 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
 #ifdef F_RDAHEAD
        if (attrs & FILE_FLAG_SEQUENTIAL_SCAN) {
                MONO_ENTER_GC_SAFE;
-               fcntl(fd, F_RDAHEAD, 1);
+               fcntl(((MonoFDHandle*) filehandle)->fd, F_RDAHEAD, 1);
                MONO_EXIT_GC_SAFE;
        }
 #endif
 
-#ifndef S_ISFIFO
-#define S_ISFIFO(m) ((m & S_IFIFO) != 0)
-#endif
-       if (S_ISFIFO (statbuf.st_mode)) {
-               handle_type = MONO_W32HANDLE_PIPE;
-               /* maintain invariant that pipes have no filename */
-               file_handle.filename = NULL;
-               g_free (filename);
-               filename = NULL;
-       } else if (S_ISCHR (statbuf.st_mode)) {
-               handle_type = MONO_W32HANDLE_CONSOLE;
-       } else {
-               handle_type = MONO_W32HANDLE_FILE;
-       }
+       mono_fdhandle_insert ((MonoFDHandle*) filehandle);
 
-       MONO_ENTER_GC_SAFE; /* FIXME: mono_w32handle_new_fd should be updated with coop transitions */
-       handle = mono_w32handle_new_fd (handle_type, fd, &file_handle);
-       MONO_EXIT_GC_SAFE;
-       if (handle == INVALID_HANDLE_VALUE) {
-               g_warning ("%s: error creating file handle", __func__);
-               g_free (filename);
-               MONO_ENTER_GC_SAFE;
-               close (fd);
-               MONO_EXIT_GC_SAFE;
-               
-               mono_w32error_set_last (ERROR_GEN_FAILURE);
-               return(INVALID_HANDLE_VALUE);
-       }
-       
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning handle %p", __func__, handle);
-       
-       return(handle);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning handle %p", __func__, GINT_TO_POINTER(((MonoFDHandle*) filehandle)->fd));
+
+       return GINT_TO_POINTER(((MonoFDHandle*) filehandle)->fd);
 }
 
 gboolean
 mono_w32file_close (gpointer handle)
 {
-       gboolean res;
-       MONO_ENTER_GC_SAFE;
-       /* FIXME: we transition here and not in file_close, pipe_close,
-        * console_close because w32handle_close is not coop aware yet, but it
-        * calls back into w32file. */
-       res = mono_w32handle_close (handle);
-       MONO_EXIT_GC_SAFE;
-       return res;
+       if (!mono_fdhandle_close (GPOINTER_TO_INT (handle))) {
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               return FALSE;
+       }
+
+       return TRUE;
 }
 
 gboolean mono_w32file_delete(const gunichar2 *name)
@@ -2644,8 +2211,10 @@ MoveFile (gunichar2 *name, gunichar2 *dest_name)
                mono_w32error_set_last (ERROR_SHARING_VIOLATION);
                return FALSE;
        }
-       if (shareinfo)
+       if (shareinfo) {
                file_share_release (shareinfo);
+               shareinfo = NULL;
+       }
 
        result = _wapi_rename (utf8_name, utf8_dest_name);
        errno_copy = errno;
@@ -2879,7 +2448,7 @@ CopyFile (const gunichar2 *name, const gunichar2 *dest_name, gboolean fail_if_ex
        ret_utime = utime (utf8_dest, &dest_time);
        MONO_EXIT_GC_SAFE;
        if (ret_utime == -1)
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: file [%s] utime failed: %s", __func__, utf8_dest, strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: file [%s] utime failed: %s", __func__, utf8_dest, g_strerror(errno));
        
        g_free (utf8_src);
        g_free (utf8_dest);
@@ -2970,14 +2539,11 @@ replace_cleanup:
        return ret;
 }
 
-static MonoCoopMutex stdhandle_mutex;
-
 static gpointer
 _wapi_stdhandle_create (gint fd, const gchar *name)
 {
-       gpointer handle;
        gint flags;
-       MonoW32HandleFile file_handle = {0};
+       FileHandle *filehandle;
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating standard handle type %s, fd %d", __func__, name, fd);
 
@@ -2990,52 +2556,52 @@ _wapi_stdhandle_create (gint fd, const gchar *name)
                /* Invalid fd.  Not really much point checking for EBADF
                 * specifically
                 */
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fcntl error on fd %d: %s", __func__, fd, strerror(errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fcntl error on fd %d: %s", __func__, fd, g_strerror(errno));
 
                mono_w32error_set_last (mono_w32error_unix_to_win32 (errno));
                return INVALID_HANDLE_VALUE;
        }
 
+       filehandle = file_data_create (MONO_FDTYPE_CONSOLE, fd);
+       filehandle->filename = g_strdup(name);
+
        switch (flags & (O_RDONLY|O_WRONLY|O_RDWR)) {
        case O_RDONLY:
-               file_handle.fileaccess = GENERIC_READ;
+               filehandle->fileaccess = GENERIC_READ;
                break;
        case O_WRONLY:
-               file_handle.fileaccess = GENERIC_WRITE;
+               filehandle->fileaccess = GENERIC_WRITE;
                break;
        case O_RDWR:
-               file_handle.fileaccess = GENERIC_READ | GENERIC_WRITE;
+               filehandle->fileaccess = GENERIC_READ | GENERIC_WRITE;
                break;
        default:
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't figure out flags 0x%x", __func__, flags);
-               file_handle.fileaccess = 0;
+               filehandle->fileaccess = 0;
                break;
        }
 
-       file_handle.fd = fd;
-       file_handle.filename = g_strdup(name);
        /* some default security attributes might be needed */
-       file_handle.security_attributes = 0;
+       filehandle->security_attributes = 0;
 
        /* Apparently input handles can't be written to.  (I don't
         * know if output or error handles can't be read from.)
         */
        if (fd == 0)
-               file_handle.fileaccess &= ~GENERIC_WRITE;
+               filehandle->fileaccess &= ~GENERIC_WRITE;
 
-       file_handle.sharemode = 0;
-       file_handle.attrs = 0;
+       filehandle->sharemode = 0;
+       filehandle->attrs = 0;
 
-       handle = mono_w32handle_new_fd (MONO_W32HANDLE_CONSOLE, fd, &file_handle);
-       if (handle == INVALID_HANDLE_VALUE) {
-               g_warning ("%s: error creating file handle", __func__);
-               mono_w32error_set_last (ERROR_GEN_FAILURE);
-               return INVALID_HANDLE_VALUE;
+       if (!mono_fdhandle_try_insert ((MonoFDHandle*) filehandle)) {
+               /* we raced between 2 invocations of _wapi_stdhandle_create */
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return GINT_TO_POINTER(fd);
        }
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning handle %p", __func__, handle);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning handle %p", __func__, GINT_TO_POINTER(((MonoFDHandle*) filehandle)->fd));
 
-       return handle;
+       return GINT_TO_POINTER(((MonoFDHandle*) filehandle)->fd);
 }
 
 enum {
@@ -3047,11 +2613,9 @@ enum {
 static gpointer
 mono_w32file_get_std_handle (gint stdhandle)
 {
-       MonoW32HandleFile *file_handle;
-       gpointer handle;
+       FileHandle **filehandle;
        gint fd;
        const gchar *name;
-       gboolean ok;
        
        switch(stdhandle) {
        case STD_INPUT_HANDLE:
@@ -3073,164 +2637,260 @@ mono_w32file_get_std_handle (gint stdhandle)
                g_assert_not_reached ();
        }
 
-       handle = GINT_TO_POINTER (fd);
-
-       mono_coop_mutex_lock (&stdhandle_mutex);
+       if (!mono_fdhandle_lookup_and_ref(fd, (MonoFDHandle**) &filehandle)) {
+               gpointer handle;
 
-       ok = mono_w32handle_lookup (handle, MONO_W32HANDLE_CONSOLE,
-                                 (gpointer *)&file_handle);
-       if (ok == FALSE) {
-               /* Need to create this console handle */
                handle = _wapi_stdhandle_create (fd, name);
-               
                if (handle == INVALID_HANDLE_VALUE) {
                        mono_w32error_set_last (ERROR_NO_MORE_FILES);
-                       goto done;
+                       return INVALID_HANDLE_VALUE;
                }
        }
-       
-  done:
-       mono_coop_mutex_unlock (&stdhandle_mutex);
 
-       return(handle);
+       return GINT_TO_POINTER (fd);
 }
 
 gboolean
 mono_w32file_read (gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread)
 {
-       MonoW32HandleType type;
+       FileHandle *filehandle;
+       gboolean ret;
 
-       type = mono_w32handle_get_type (handle);
-       
-       if(io_ops[type].readfile==NULL) {
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
+               return FALSE;
        }
-       
-       return(io_ops[type].readfile (handle, buffer, numbytes, bytesread));
+
+       switch (((MonoFDHandle*) filehandle)->type) {
+       case MONO_FDTYPE_FILE:
+               ret = file_read(filehandle, buffer, numbytes, bytesread);
+               break;
+       case MONO_FDTYPE_CONSOLE:
+               ret = console_read(filehandle, buffer, numbytes, bytesread);
+               break;
+       case MONO_FDTYPE_PIPE:
+               ret = pipe_read(filehandle, buffer, numbytes, bytesread);
+               break;
+       default:
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return FALSE;
+       }
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 gboolean
 mono_w32file_write (gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten)
 {
-       MonoW32HandleType type;
+       FileHandle *filehandle;
+       gboolean ret;
 
-       type = mono_w32handle_get_type (handle);
-       
-       if(io_ops[type].writefile==NULL) {
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
+               return FALSE;
        }
-       
-       return(io_ops[type].writefile (handle, buffer, numbytes, byteswritten));
+
+       switch (((MonoFDHandle*) filehandle)->type) {
+       case MONO_FDTYPE_FILE:
+               ret = file_write(filehandle, buffer, numbytes, byteswritten);
+               break;
+       case MONO_FDTYPE_CONSOLE:
+               ret = console_write(filehandle, buffer, numbytes, byteswritten);
+               break;
+       case MONO_FDTYPE_PIPE:
+               ret = pipe_write(filehandle, buffer, numbytes, byteswritten);
+               break;
+       default:
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return FALSE;
+       }
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 gboolean
 mono_w32file_flush (gpointer handle)
 {
-       MonoW32HandleType type;
+       FileHandle *filehandle;
+       gboolean ret;
 
-       type = mono_w32handle_get_type (handle);
-       
-       if(io_ops[type].flushfile==NULL) {
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
+               return FALSE;
        }
-       
-       return(io_ops[type].flushfile (handle));
+
+       switch (((MonoFDHandle*) filehandle)->type) {
+       case MONO_FDTYPE_FILE:
+               ret = file_flush(filehandle);
+               break;
+       default:
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return FALSE;
+       }
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 gboolean
 mono_w32file_truncate (gpointer handle)
 {
-       MonoW32HandleType type;
+       FileHandle *filehandle;
+       gboolean ret;
 
-       type = mono_w32handle_get_type (handle);
-       
-       if (io_ops[type].setendoffile == NULL) {
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
+               return FALSE;
        }
-       
-       return(io_ops[type].setendoffile (handle));
+
+       switch (((MonoFDHandle*) filehandle)->type) {
+       case MONO_FDTYPE_FILE:
+               ret = file_setendoffile(filehandle);
+               break;
+       default:
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return FALSE;
+       }
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 guint32
 mono_w32file_seek (gpointer handle, gint32 movedistance, gint32 *highmovedistance, guint32 method)
 {
-       MonoW32HandleType type;
+       FileHandle *filehandle;
+       guint32 ret;
 
-       type = mono_w32handle_get_type (handle);
-       
-       if (io_ops[type].seek == NULL) {
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(INVALID_SET_FILE_POINTER);
+               return INVALID_SET_FILE_POINTER;
        }
-       
-       return(io_ops[type].seek (handle, movedistance, highmovedistance,
-                                 method));
+
+       switch (((MonoFDHandle*) filehandle)->type) {
+       case MONO_FDTYPE_FILE:
+               ret = file_seek(filehandle, movedistance, highmovedistance, method);
+               break;
+       default:
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return INVALID_SET_FILE_POINTER;
+       }
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 gint
 mono_w32file_get_type(gpointer handle)
 {
-       MonoW32HandleType type;
+       FileHandle *filehandle;
+       gint ret;
 
-       type = mono_w32handle_get_type (handle);
-       
-       if (io_ops[type].getfiletype == NULL) {
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FILE_TYPE_UNKNOWN);
+               return FILE_TYPE_UNKNOWN;
        }
-       
-       return(io_ops[type].getfiletype ());
+
+       switch (((MonoFDHandle*) filehandle)->type) {
+       case MONO_FDTYPE_FILE:
+               ret = FILE_TYPE_DISK;
+               break;
+       case MONO_FDTYPE_CONSOLE:
+               ret = FILE_TYPE_CHAR;
+               break;
+       case MONO_FDTYPE_PIPE:
+               ret = FILE_TYPE_PIPE;
+               break;
+       default:
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return FILE_TYPE_UNKNOWN;
+       }
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 static guint32
 GetFileSize(gpointer handle, guint32 *highsize)
 {
-       MonoW32HandleType type;
+       FileHandle *filehandle;
+       guint32 ret;
 
-       type = mono_w32handle_get_type (handle);
-       
-       if (io_ops[type].getfilesize == NULL) {
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(INVALID_FILE_SIZE);
+               return INVALID_FILE_SIZE;
        }
-       
-       return(io_ops[type].getfilesize (handle, highsize));
+
+       switch (((MonoFDHandle*) filehandle)->type) {
+       case MONO_FDTYPE_FILE:
+               ret = file_getfilesize(filehandle, highsize);
+               break;
+       default:
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return INVALID_FILE_SIZE;
+       }
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 gboolean
 mono_w32file_get_times(gpointer handle, FILETIME *create_time, FILETIME *access_time, FILETIME *write_time)
 {
-       MonoW32HandleType type;
+       FileHandle *filehandle;
+       gboolean ret;
 
-       type = mono_w32handle_get_type (handle);
-       
-       if (io_ops[type].getfiletime == NULL) {
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
+               return FALSE;
        }
-       
-       return(io_ops[type].getfiletime (handle, create_time, access_time,
-                                        write_time));
+
+       switch (((MonoFDHandle*) filehandle)->type) {
+       case MONO_FDTYPE_FILE:
+               ret = file_getfiletime(filehandle, create_time, access_time, write_time);
+               break;
+       default:
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return FALSE;
+       }
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 gboolean
 mono_w32file_set_times(gpointer handle, const FILETIME *create_time, const FILETIME *access_time, const FILETIME *write_time)
 {
-       MonoW32HandleType type;
+       FileHandle *filehandle;
+       gboolean ret;
 
-       type = mono_w32handle_get_type (handle);
-       
-       if (io_ops[type].setfiletime == NULL) {
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
-               return(FALSE);
+               return FALSE;
        }
-       
-       return(io_ops[type].setfiletime (handle, create_time, access_time,
-                                        write_time));
+
+       switch (((MonoFDHandle*) filehandle)->type) {
+       case MONO_FDTYPE_FILE:
+               ret = file_setfiletime(filehandle, create_time, access_time, write_time);
+               break;
+       default:
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return FALSE;
+       }
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 /* A tick is a 100-nanosecond interval.  File time epoch is Midnight,
@@ -3936,10 +3596,7 @@ mono_w32file_set_cwd (const gunichar2 *path)
 gboolean
 mono_w32file_create_pipe (gpointer *readpipe, gpointer *writepipe, guint32 size)
 {
-       MonoW32HandleFile pipe_read_handle = {0};
-       MonoW32HandleFile pipe_write_handle = {0};
-       gpointer read_handle;
-       gpointer write_handle;
+       FileHandle *read_filehandle, *write_filehandle;
        gint filedes[2];
        gint ret;
        
@@ -3948,68 +3605,30 @@ mono_w32file_create_pipe (gpointer *readpipe, gpointer *writepipe, guint32 size)
        MONO_ENTER_GC_SAFE;
        ret=pipe (filedes);
        MONO_EXIT_GC_SAFE;
-       if(ret==-1) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Error creating pipe: %s", __func__,
-                          strerror (errno));
-               
+       if (ret==-1) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Error creating pipe: (%d) %s",
+                       __func__, errno, g_strerror (errno));
+
                _wapi_set_last_error_from_errno ();
-               return(FALSE);
+               return FALSE;
        }
 
-       if (filedes[0] >= mono_w32handle_fd_reserve ||
-           filedes[1] >= mono_w32handle_fd_reserve) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: File descriptor is too big", __func__);
-
-               mono_w32error_set_last (ERROR_TOO_MANY_OPEN_FILES);
-               
-               MONO_ENTER_GC_SAFE;
-               close (filedes[0]);
-               close (filedes[1]);
-               MONO_EXIT_GC_SAFE;
-               
-               return(FALSE);
-       }
-       
        /* filedes[0] is open for reading, filedes[1] for writing */
 
-       pipe_read_handle.fd = filedes [0];
-       pipe_read_handle.fileaccess = GENERIC_READ;
-       read_handle = mono_w32handle_new_fd (MONO_W32HANDLE_PIPE, filedes[0],
-                                          &pipe_read_handle);
-       if (read_handle == INVALID_HANDLE_VALUE) {
-               g_warning ("%s: error creating pipe read handle", __func__);
-               MONO_ENTER_GC_SAFE;
-               close (filedes[0]);
-               close (filedes[1]);
-               MONO_EXIT_GC_SAFE;
-               mono_w32error_set_last (ERROR_GEN_FAILURE);
-               
-               return(FALSE);
-       }
-       
-       pipe_write_handle.fd = filedes [1];
-       pipe_write_handle.fileaccess = GENERIC_WRITE;
-       write_handle = mono_w32handle_new_fd (MONO_W32HANDLE_PIPE, filedes[1],
-                                           &pipe_write_handle);
-       if (write_handle == INVALID_HANDLE_VALUE) {
-               g_warning ("%s: error creating pipe write handle", __func__);
+       read_filehandle = file_data_create (MONO_FDTYPE_PIPE, filedes[0]);
+       read_filehandle->fileaccess = GENERIC_READ;
 
-               MONO_ENTER_GC_SAFE;
-               mono_w32handle_close (read_handle);
-               
-               close (filedes[0]);
-               close (filedes[1]);
-               MONO_EXIT_GC_SAFE;
-               mono_w32error_set_last (ERROR_GEN_FAILURE);
-               
-               return(FALSE);
-       }
-       
-       *readpipe = read_handle;
-       *writepipe = write_handle;
+       write_filehandle = file_data_create (MONO_FDTYPE_PIPE, filedes[1]);
+       write_filehandle->fileaccess = GENERIC_WRITE;
+
+       mono_fdhandle_insert ((MonoFDHandle*) read_filehandle);
+       mono_fdhandle_insert ((MonoFDHandle*) write_filehandle);
+
+       *readpipe = GINT_TO_POINTER(((MonoFDHandle*) read_filehandle)->fd);
+       *writepipe = GINT_TO_POINTER(((MonoFDHandle*) write_filehandle)->fd);
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Returning pipe: read handle %p, write handle %p",
-                  __func__, read_handle, write_handle);
+               __func__, GINT_TO_POINTER(((MonoFDHandle*) read_filehandle)->fd), GINT_TO_POINTER(((MonoFDHandle*) write_filehandle)->fd));
 
        return(TRUE);
 }
@@ -4563,7 +4182,7 @@ mono_w32file_get_disk_free_space (const gunichar2 *path_name, guint64 *free_byte
 
        if (ret == -1) {
                _wapi_set_last_error_from_errno ();
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: statvfs failed: %s", __func__, strerror (errno));
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: statvfs failed: %s", __func__, g_strerror (errno));
                return(FALSE);
        }
 
@@ -4952,18 +4571,25 @@ mono_w32file_get_volume_information (const gunichar2 *path, gunichar2 *volumenam
 static gboolean
 LockFile (gpointer handle, guint32 offset_low, guint32 offset_high, guint32 length_low, guint32 length_high)
 {
-       MonoW32HandleFile *file_handle;
+       FileHandle *filehandle;
+       gboolean ret;
        off_t offset, length;
 
-       if (!mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE, (gpointer *)&file_handle)) {
-               g_warning ("%s: error looking up file handle %p", __func__, handle);
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               return FALSE;
+       }
+
+       if (((MonoFDHandle*) filehandle)->type != MONO_FDTYPE_FILE) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
                return FALSE;
        }
 
-       if (!(file_handle->fileaccess & GENERIC_READ) && !(file_handle->fileaccess & GENERIC_WRITE) && !(file_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
+       if (!(filehandle->fileaccess & (GENERIC_READ | GENERIC_WRITE | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
                return FALSE;
        }
 
@@ -4971,38 +4597,48 @@ LockFile (gpointer handle, guint32 offset_low, guint32 offset_high, guint32 leng
        offset = ((gint64)offset_high << 32) | offset_low;
        length = ((gint64)length_high << 32) | length_low;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Locking handle %p, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__,
-                 handle, (gint64) offset, (gint64) length);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Locking fd %d, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__, ((MonoFDHandle*) filehandle)->fd, (gint64) offset, (gint64) length);
 #else
        if (offset_high > 0 || length_high > 0) {
                mono_w32error_set_last (ERROR_INVALID_PARAMETER);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
                return FALSE;
        }
+
        offset = offset_low;
        length = length_low;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Locking handle %p, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__,
-                 handle, (gint64) offset, (gint64) length);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Locking fd %d, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__, ((MonoFDHandle*) filehandle)->fd, (gint64) offset, (gint64) length);
 #endif
 
-       return _wapi_lock_file_region (GPOINTER_TO_UINT(handle), offset, length);
+       ret = _wapi_lock_file_region (((MonoFDHandle*) filehandle)->fd, offset, length);
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 static gboolean
 UnlockFile (gpointer handle, guint32 offset_low, guint32 offset_high, guint32 length_low, guint32 length_high)
 {
-       MonoW32HandleFile *file_handle;
+       FileHandle *filehandle;
+       gboolean ret;
        off_t offset, length;
 
-       if (!mono_w32handle_lookup (handle, MONO_W32HANDLE_FILE, (gpointer *)&file_handle)) {
-               g_warning ("%s: error looking up file handle %p", __func__, handle);
+       if (!mono_fdhandle_lookup_and_ref(GPOINTER_TO_INT(handle), (MonoFDHandle**) &filehandle)) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
                return FALSE;
        }
 
-       if (!(file_handle->fileaccess & GENERIC_READ) && !(file_handle->fileaccess & GENERIC_WRITE) && !(file_handle->fileaccess & GENERIC_ALL)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
+       if (((MonoFDHandle*) filehandle)->type != MONO_FDTYPE_FILE) {
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+               return FALSE;
+       }
+
+       if (!(filehandle->fileaccess & (GENERIC_READ | GENERIC_WRITE | GENERIC_ALL))) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess);
                mono_w32error_set_last (ERROR_ACCESS_DENIED);
+               mono_fdhandle_unref ((MonoFDHandle*) filehandle);
                return FALSE;
        }
 
@@ -5010,33 +4646,35 @@ UnlockFile (gpointer handle, guint32 offset_low, guint32 offset_high, guint32 le
        offset = ((gint64)offset_high << 32) | offset_low;
        length = ((gint64)length_high << 32) | length_low;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unlocking handle %p, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__,
-                 handle, (gint64) offset, (gint64) length);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unlocking fd %d, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__, ((MonoFDHandle*) filehandle)->fd, (gint64) offset, (gint64) length);
 #else
        offset = offset_low;
        length = length_low;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unlocking handle %p, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__, handle, (gint64) offset, (gint64) length);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Unlocking fd %p, offset %" G_GINT64_FORMAT ", length %" G_GINT64_FORMAT, __func__, ((MonoFDHandle*) filehandle)->fd, (gint64) offset, (gint64) length);
 #endif
 
-       return _wapi_unlock_file_region (GPOINTER_TO_UINT(handle), offset, length);
+       ret = _wapi_unlock_file_region (((MonoFDHandle*) filehandle)->fd, offset, length);
+
+       mono_fdhandle_unref ((MonoFDHandle*) filehandle);
+       return ret;
 }
 
 void
 mono_w32file_init (void)
 {
-       mono_coop_mutex_init (&stdhandle_mutex);
-       mono_coop_mutex_init (&file_share_mutex);
+       MonoFDHandleCallback file_data_callbacks = {
+               .close = file_data_close,
+               .destroy = file_data_destroy
+       };
+
+       mono_fdhandle_register (MONO_FDTYPE_FILE, &file_data_callbacks);
+       mono_fdhandle_register (MONO_FDTYPE_CONSOLE, &file_data_callbacks);
+       mono_fdhandle_register (MONO_FDTYPE_PIPE, &file_data_callbacks);
 
-       mono_w32handle_register_ops (MONO_W32HANDLE_FILE,    &_wapi_file_ops);
-       mono_w32handle_register_ops (MONO_W32HANDLE_CONSOLE, &_wapi_console_ops);
-       mono_w32handle_register_ops (MONO_W32HANDLE_FIND,    &_wapi_find_ops);
-       mono_w32handle_register_ops (MONO_W32HANDLE_PIPE,    &_wapi_pipe_ops);
+       mono_coop_mutex_init (&file_share_mutex);
 
-/*     mono_w32handle_register_capabilities (MONO_W32HANDLE_FILE, */
-/*                                         MONO_W32HANDLE_CAP_WAIT); */
-/*     mono_w32handle_register_capabilities (MONO_W32HANDLE_CONSOLE, */
-/*                                         MONO_W32HANDLE_CAP_WAIT); */
+       mono_w32handle_register_ops (MONO_W32HANDLE_FIND, &_wapi_find_ops);
 
        if (g_hasenv ("MONO_STRICT_IO_EMULATION"))
                lock_while_writing = TRUE;
index 296a84d6a47055af2eddaecfb48ce827f1b93eb0..325767f52434e9fbcb91aa60963c18d518354651 100644 (file)
@@ -1065,24 +1065,22 @@ MonoBoolean
 ves_icall_System_IO_MonoIO_DuplicateHandle (HANDLE source_process_handle, HANDLE source_handle,
                HANDLE target_process_handle, HANDLE *target_handle, gint32 access, gint32 inherit, gint32 options, gint32 *error)
 {
-       /* This is only used on Windows */
+#ifndef HOST_WIN32
+       *target_handle = mono_w32handle_duplicate (source_handle);
+#else
        gboolean ret;
-       
-#ifdef HOST_WIN32
+
        MONO_ENTER_GC_SAFE;
        ret=DuplicateHandle (source_process_handle, source_handle, target_process_handle, target_handle, access, inherit, options);
        MONO_EXIT_GC_SAFE;
-#else
-       *target_handle = mono_w32handle_duplicate (source_handle);
-       ret = TRUE;
-#endif
 
-       if(ret==FALSE) {
+       if (!ret) {
                *error = mono_w32error_get_last ();
                /* FIXME: throw an exception? */
                return(FALSE);
        }
-       
+#endif
+
        return(TRUE);
 }
 
index 35a5dd93d87663884e7cb43bd2cfdba27547b8dc..98d4ace6d62593b62e3b0e1be6ace694f8333ff6 100644 (file)
@@ -51,10 +51,7 @@ static MonoW32HandleOps *handle_ops [MONO_W32HANDLE_COUNT];
 #define SLOT_OFFSET(x) (x % HANDLE_PER_SLOT)
 
 static MonoW32HandleBase *private_handles [SLOT_MAX];
-static guint32 private_handles_count = 0;
-static guint32 private_handles_slots_count = 0;
-
-guint32 mono_w32handle_fd_reserve;
+static guint32 private_handles_size = 0;
 
 /*
  * This is an internal handle which is used for handling waiting for multiple handles.
@@ -68,20 +65,6 @@ static mono_mutex_t scan_mutex;
 
 static gboolean shutting_down = FALSE;
 
-static gboolean
-type_is_fd (MonoW32HandleType type)
-{
-       switch (type) {
-       case MONO_W32HANDLE_FILE:
-       case MONO_W32HANDLE_CONSOLE:
-       case MONO_W32HANDLE_SOCKET:
-       case MONO_W32HANDLE_PIPE:
-               return TRUE;
-       default:
-               return FALSE;
-       }
-}
-
 static gboolean
 mono_w32handle_lookup_data (gpointer handle, MonoW32HandleBase **handle_data)
 {
@@ -279,19 +262,6 @@ mono_w32handle_init (void)
        g_assert ((sizeof (handle_ops) / sizeof (handle_ops[0]))
                  == MONO_W32HANDLE_COUNT);
 
-       /* This is needed by the code in mono_w32handle_new_internal */
-       mono_w32handle_fd_reserve = (eg_getdtablesize () + (HANDLE_PER_SLOT - 1)) & ~(HANDLE_PER_SLOT - 1);
-
-       do {
-               /*
-                * The entries in private_handles reserved for fds are allocated lazily to
-                * save memory.
-                */
-
-               private_handles_count += HANDLE_PER_SLOT;
-               private_handles_slots_count ++;
-       } while(mono_w32handle_fd_reserve > private_handles_count);
-
        mono_os_mutex_init (&scan_mutex);
 
        mono_os_cond_init (&global_signal_cond);
@@ -315,22 +285,6 @@ mono_w32handle_cleanup (void)
 static gsize
 mono_w32handle_ops_typesize (MonoW32HandleType type);
 
-static void mono_w32handle_init_handle (MonoW32HandleBase *handle,
-                              MonoW32HandleType type, gpointer handle_specific)
-{
-       g_assert (handle->ref == 0);
-
-       handle->type = type;
-       handle->signalled = FALSE;
-       handle->ref = 1;
-
-       mono_os_cond_init (&handle->signal_cond);
-       mono_os_mutex_init (&handle->signal_mutex);
-
-       if (handle_specific)
-               handle->specific = g_memdup (handle_specific, mono_w32handle_ops_typesize (type));
-}
-
 /*
  * mono_w32handle_new_internal:
  * @type: Init handle to this type
@@ -352,15 +306,16 @@ static guint32 mono_w32handle_new_internal (MonoW32HandleType type,
         * descriptors
         */
 
-       if (last < mono_w32handle_fd_reserve) {
-               last = mono_w32handle_fd_reserve;
+       if (last == 0) {
+               /* We need to go from 1 since a handle of value 0 can be considered invalid in managed code */
+               last = 1;
        } else {
                retry = TRUE;
        }
 
 again:
        count = last;
-       for(i = SLOT_INDEX (count); i < private_handles_slots_count; i++) {
+       for(i = SLOT_INDEX (count); i < private_handles_size; i++) {
                if (private_handles [i]) {
                        for (k = SLOT_OFFSET (count); k < HANDLE_PER_SLOT; k++) {
                                MonoW32HandleBase *handle = &private_handles [i][k];
@@ -368,7 +323,18 @@ again:
                                if(handle->type == MONO_W32HANDLE_UNUSED) {
                                        last = count + 1;
 
-                                       mono_w32handle_init_handle (handle, type, handle_specific);
+                                       g_assert (handle->ref == 0);
+
+                                       handle->type = type;
+                                       handle->signalled = FALSE;
+                                       handle->ref = 1;
+
+                                       mono_os_cond_init (&handle->signal_cond);
+                                       mono_os_mutex_init (&handle->signal_mutex);
+
+                                       if (handle_specific)
+                                               handle->specific = g_memdup (handle_specific, mono_w32handle_ops_typesize (type));
+
                                        return (count);
                                }
                                count++;
@@ -376,108 +342,50 @@ again:
                }
        }
 
-       if(retry && last > mono_w32handle_fd_reserve) {
+       if (retry) {
                /* Try again from the beginning */
-               last = mono_w32handle_fd_reserve;
+               last = 1;
+               retry = FALSE;
                goto again;
        }
 
        /* Will need to expand the array.  The caller will sort it out */
 
-       return(0);
+       return G_MAXUINT32;
 }
 
 gpointer
 mono_w32handle_new (MonoW32HandleType type, gpointer handle_specific)
 {
-       guint32 handle_idx = 0;
+       guint32 handle_idx;
        gpointer handle;
 
        g_assert (!shutting_down);
 
-       g_assert(!type_is_fd(type));
-
        mono_os_mutex_lock (&scan_mutex);
 
-       while ((handle_idx = mono_w32handle_new_internal (type, handle_specific)) == 0) {
+       while ((handle_idx = mono_w32handle_new_internal (type, handle_specific)) == G_MAXUINT32) {
                /* Try and expand the array, and have another go */
-               int idx = SLOT_INDEX (private_handles_count);
-               if (idx >= SLOT_MAX) {
-                       break;
-               }
+               if (private_handles_size >= SLOT_MAX) {
+                       mono_os_mutex_unlock (&scan_mutex);
 
-               private_handles [idx] = g_new0 (MonoW32HandleBase, HANDLE_PER_SLOT);
+                       /* We ran out of slots */
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to create %s handle", __func__, mono_w32handle_ops_typename (type));
+                       return INVALID_HANDLE_VALUE;
+               }
 
-               private_handles_count += HANDLE_PER_SLOT;
-               private_handles_slots_count ++;
+               private_handles [private_handles_size ++] = g_new0 (MonoW32HandleBase, HANDLE_PER_SLOT);
        }
 
        mono_os_mutex_unlock (&scan_mutex);
 
-       if (handle_idx == 0) {
-               /* We ran out of slots */
-               handle = INVALID_HANDLE_VALUE;
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to create %s handle", __func__, mono_w32handle_ops_typename (type));
-               goto done;
-       }
-
-       /* Make sure we left the space for fd mappings */
-       g_assert (handle_idx >= mono_w32handle_fd_reserve);
-
        handle = GUINT_TO_POINTER (handle_idx);
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: create %s handle %p", __func__, mono_w32handle_ops_typename (type), handle);
 
-done:
        return(handle);
 }
 
-gpointer mono_w32handle_new_fd (MonoW32HandleType type, int fd,
-                             gpointer handle_specific)
-{
-       MonoW32HandleBase *handle_data;
-       int fd_index, fd_offset;
-
-       g_assert (!shutting_down);
-
-       g_assert(type_is_fd(type));
-
-       if (fd >= mono_w32handle_fd_reserve) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to create %s handle, fd is too big", __func__, mono_w32handle_ops_typename (type));
-
-               return(GUINT_TO_POINTER (INVALID_HANDLE_VALUE));
-       }
-
-       fd_index = SLOT_INDEX (fd);
-       fd_offset = SLOT_OFFSET (fd);
-
-       mono_os_mutex_lock (&scan_mutex);
-       /* Initialize the array entries on demand */
-       if (!private_handles [fd_index]) {
-               if (!private_handles [fd_index])
-                       private_handles [fd_index] = g_new0 (MonoW32HandleBase, HANDLE_PER_SLOT);
-       }
-
-       handle_data = &private_handles [fd_index][fd_offset];
-
-       if (handle_data->type != MONO_W32HANDLE_UNUSED) {
-               mono_os_mutex_unlock (&scan_mutex);
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to create %s handle, fd is already in use", __func__, mono_w32handle_ops_typename (type));
-               /* FIXME: clean up this handle?  We can't do anything
-                * with the fd, cos thats the new one
-                */
-               return(GUINT_TO_POINTER (INVALID_HANDLE_VALUE));
-       }
-
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: create %s handle %p", __func__, mono_w32handle_ops_typename (type), GUINT_TO_POINTER(fd));
-
-       mono_w32handle_init_handle (handle_data, type, handle_specific);
-
-       mono_os_mutex_unlock (&scan_mutex);
-
-       return(GUINT_TO_POINTER(fd));
-}
-
 static gboolean
 mono_w32handle_ref_core (gpointer handle, MonoW32HandleBase *handle_data);
 
@@ -496,8 +404,6 @@ mono_w32handle_duplicate (gpointer handle)
                return handle;
        if (!mono_w32handle_lookup_data (handle, &handle_data))
                return INVALID_HANDLE_VALUE;
-       if (handle == (gpointer) 0 && handle_data->type != MONO_W32HANDLE_CONSOLE)
-               return handle;
 
        if (!mono_w32handle_ref_core (handle, handle_data))
                g_error ("%s: failed to ref handle %p", __func__, handle);
@@ -515,14 +421,6 @@ mono_w32handle_close (gpointer handle)
                return FALSE;
        if (!mono_w32handle_lookup_data (handle, &handle_data))
                return FALSE;
-       if (handle == (gpointer) 0 && handle_data->type != MONO_W32HANDLE_CONSOLE) {
-               /* Problem: because we map file descriptors to the
-                * same-numbered handle we can't tell the difference
-                * between a bogus handle and the handle to stdin.
-                * Assume that it's the console handle if that handle
-                * exists... */
-               return FALSE;
-       }
 
        destroy = mono_w32handle_unref_core (handle, handle_data);
        if (destroy)
@@ -562,7 +460,7 @@ mono_w32handle_foreach (gboolean (*on_each)(gpointer handle, gpointer data, gpoi
 
        mono_os_mutex_lock (&scan_mutex);
 
-       for (i = SLOT_INDEX (0); i < private_handles_slots_count; i++) {
+       for (i = SLOT_INDEX (0); i < private_handles_size; i++) {
                if (!private_handles [i])
                        continue;
                for (k = SLOT_OFFSET (0); k < HANDLE_PER_SLOT; k++) {
@@ -730,15 +628,6 @@ mono_w32handle_unref (gpointer handle)
                w32handle_destroy (handle);
 }
 
-static void
-mono_w32handle_ops_close (gpointer handle, gpointer data);
-
-void
-mono_w32handle_force_close (gpointer handle, gpointer data)
-{
-       mono_w32handle_ops_close (handle, data);
-}
-
 void
 mono_w32handle_register_ops (MonoW32HandleType type, MonoW32HandleOps *ops)
 {
@@ -779,24 +668,6 @@ static void (*_wapi_handle_ops_get_close_func (MonoW32HandleType type))(gpointer
        return (NULL);
 }
 
-static void
-mono_w32handle_ops_close (gpointer handle, gpointer data)
-{
-       MonoW32HandleBase *handle_data;
-       MonoW32HandleType type;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return;
-       }
-
-       type = handle_data->type;
-
-       if (handle_ops[type] != NULL &&
-           handle_ops[type]->close != NULL) {
-               handle_ops[type]->close (handle, data);
-       }
-}
-
 static void
 mono_w32handle_ops_details (MonoW32HandleType type, gpointer data)
 {
index b7df9a8810e50fbd9a1400cbdf9e443e0cbf732e..24d547952f7c8039df781a670cb3273d44758e1b 100644 (file)
 
 typedef enum {
        MONO_W32HANDLE_UNUSED = 0,
-       MONO_W32HANDLE_FILE,
-       MONO_W32HANDLE_CONSOLE,
-       MONO_W32HANDLE_THREAD,
        MONO_W32HANDLE_SEM,
        MONO_W32HANDLE_MUTEX,
        MONO_W32HANDLE_EVENT,
-       MONO_W32HANDLE_SOCKET,
        MONO_W32HANDLE_FIND,
        MONO_W32HANDLE_PROCESS,
-       MONO_W32HANDLE_PIPE,
        MONO_W32HANDLE_NAMEDMUTEX,
        MONO_W32HANDLE_NAMEDSEM,
        MONO_W32HANDLE_NAMEDEVENT,
@@ -99,8 +94,6 @@ typedef enum {
        MONO_W32HANDLE_CAP_SPECIAL_WAIT = 0x08,
 } MonoW32HandleCapability;
 
-extern guint32 mono_w32handle_fd_reserve;
-
 void
 mono_w32handle_init (void);
 
@@ -113,9 +106,6 @@ mono_w32handle_register_ops (MonoW32HandleType type, MonoW32HandleOps *ops);
 gpointer
 mono_w32handle_new (MonoW32HandleType type, gpointer handle_specific);
 
-gpointer
-mono_w32handle_new_fd (MonoW32HandleType type, int fd, gpointer handle_specific);
-
 gpointer
 mono_w32handle_duplicate (gpointer handle);
 
@@ -143,9 +133,6 @@ mono_w32handle_register_capabilities (MonoW32HandleType type, MonoW32HandleCapab
 gboolean
 mono_w32handle_test_capabilities (gpointer handle, MonoW32HandleCapability caps);
 
-void
-mono_w32handle_force_close (gpointer handle, gpointer data);
-
 void
 mono_w32handle_set_signal_state (gpointer handle, gboolean state, gboolean broadcast);
 
index 57340e9ed5ae5420cc572ab06bc88cfee7d0150d..280c3a9213d0a90fd528961ca4c14d878eba7d76 100644 (file)
@@ -1945,7 +1945,7 @@ process_create (const gunichar2 *appname, const gunichar2 *cmdline,
                dup2 (err_fd, 2);
 
                /* Close all file descriptors */
-               for (i = mono_w32handle_fd_reserve - 1; i > 2; i--)
+               for (i = eg_getdtablesize() - 1; i > 2; i--)
                        close (i);
 
 #ifdef DEBUG_ENABLED
index 5122fdf5ed1573a7dc05d877b8709c1aba11441d..cf9fb28e466950607f2eee6c681d9ce86c009f40 100644 (file)
@@ -148,4 +148,7 @@ mono_w32socket_get_last_error (void);
 gint32
 mono_w32socket_convert_error (gint error);
 
+gboolean
+mono_w32socket_duplicate (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle);
+
 #endif // __MONO_METADATA_W32SOCKET_INTERNALS_H__
index 87743377324bc01c406342ed181dd3d7229d36ff..bc1b5ccd818d44f09bfa459f94156f2aaaae2b22 100644 (file)
 #include "w32socket.h"
 #include "w32socket-internals.h"
 #include "w32error.h"
-#include "w32handle.h"
+#include "fdhandle.h"
 #include "utils/mono-logger-internals.h"
 #include "utils/mono-poll.h"
 
 typedef struct {
-       int domain;
-       int type;
-       int protocol;
-       int saved_error;
-       int still_readable;
-} MonoW32HandleSocket;
+       MonoFDHandle fdhandle;
+       gint domain;
+       gint type;
+       gint protocol;
+       gint saved_error;
+       gint still_readable;
+} SocketHandle;
+
+static SocketHandle*
+socket_data_create (MonoFDType type, gint fd)
+{
+       SocketHandle *sockethandle;
+
+       sockethandle = g_new0 (SocketHandle, 1);
+       mono_fdhandle_init ((MonoFDHandle*) sockethandle, type, fd);
 
-static guint32 in_cleanup = 0;
+       return sockethandle;
+}
 
 static void
-socket_close (gpointer handle, gpointer data)
+socket_data_close (MonoFDHandle *fdhandle)
 {
-       int ret;
-       MonoW32HandleSocket *socket_handle = (MonoW32HandleSocket *)data;
-       MonoThreadInfo *info = mono_thread_info_current ();
+       MonoThreadInfo *info;
+       SocketHandle* sockethandle;
+       gint ret;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: closing socket handle %p", __func__, handle);
+       sockethandle = (SocketHandle*) fdhandle;
+       g_assert (sockethandle);
 
-       /* Shutdown the socket for reading, to interrupt any potential
-        * receives that may be blocking for data.  See bug 75705. */
-       shutdown (GPOINTER_TO_UINT (handle), SHUT_RD);
+       info = mono_thread_info_current ();
 
-       do {
-               ret = close (GPOINTER_TO_UINT(handle));
-       } while (ret == -1 && errno == EINTR &&
-                !mono_thread_info_is_interrupt_state (info));
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: closing fd %d", __func__, ((MonoFDHandle*) sockethandle)->fd);
 
+       /* Shutdown the socket for reading, to interrupt any potential
+        * receives that may be blocking for data.  See bug 75705. */
+       MONO_ENTER_GC_SAFE;
+       shutdown (((MonoFDHandle*) sockethandle)->fd, SHUT_RD);
+       MONO_EXIT_GC_SAFE;
+
+retry_close:
+       MONO_ENTER_GC_SAFE;
+       ret = close (((MonoFDHandle*) sockethandle)->fd);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
-               gint errnum = errno;
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: close error: %s", __func__, g_strerror (errno));
-               if (!in_cleanup)
-                       mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               if (errno == EINTR && !mono_thread_info_is_interrupt_state (info))
+                       goto retry_close;
        }
 
-       if (!in_cleanup)
-               socket_handle->saved_error = 0;
+       sockethandle->saved_error = 0;
 }
 
 static void
-socket_details (gpointer data)
+socket_data_destroy (MonoFDHandle *fdhandle)
 {
-       /* FIXME: do something */
-}
+       SocketHandle *sockethandle;
 
-static const gchar*
-socket_typename (void)
-{
-       return "Socket";
-}
+       sockethandle = (SocketHandle*) fdhandle;
+       g_assert (sockethandle);
 
-static gsize
-socket_typesize (void)
-{
-       return sizeof (MonoW32HandleSocket);
+       g_free (sockethandle);
 }
 
-static MonoW32HandleOps ops = {
-       socket_close,    /* close */
-       NULL,            /* signal */
-       NULL,            /* own */
-       NULL,            /* is_owned */
-       NULL,            /* special_wait */
-       NULL,            /* prewait */
-       socket_details,  /* details */
-       socket_typename, /* typename */
-       socket_typesize, /* typesize */
-};
-
 void
 mono_w32socket_initialize (void)
 {
-       mono_w32handle_register_ops (MONO_W32HANDLE_SOCKET, &ops);
-}
-
-static gboolean
-cleanup_close (gpointer handle, gpointer data, gpointer user_data)
-{
-       if (mono_w32handle_get_type (handle) == MONO_W32HANDLE_SOCKET)
-               mono_w32handle_force_close (handle, data);
+       MonoFDHandleCallback socket_data_callbacks = {
+               .close = socket_data_close,
+               .destroy = socket_data_destroy
+       };
 
-       return FALSE;
+       mono_fdhandle_register (MONO_FDTYPE_SOCKET, &socket_data_callbacks);
 }
 
 void
 mono_w32socket_cleanup (void)
 {
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: cleaning up", __func__);
-
-       in_cleanup = 1;
-       mono_w32handle_foreach (cleanup_close, NULL);
-       in_cleanup = 0;
 }
 
 SOCKET
 mono_w32socket_accept (SOCKET sock, struct sockaddr *addr, socklen_t *addrlen, gboolean blocking)
 {
-       gpointer handle;
-       gpointer new_handle;
-       MonoW32HandleSocket *socket_handle;
-       MonoW32HandleSocket new_socket_handle;
-       SOCKET new_fd;
+       SocketHandle *sockethandle, *accepted_socket_data;
        MonoThreadInfo *info;
+       gint accepted_fd;
 
        if (addr != NULL && *addrlen < sizeof(struct sockaddr)) {
                mono_w32socket_set_last_error (WSAEFAULT);
                return INVALID_SOCKET;
        }
 
-       handle = GUINT_TO_POINTER (sock);
-       if (!mono_w32handle_lookup (handle, MONO_W32HANDLE_SOCKET, (gpointer *)&socket_handle)) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return INVALID_SOCKET;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return INVALID_SOCKET;
        }
 
        info = mono_thread_info_current ();
 
        do {
-               new_fd = accept (sock, addr, addrlen);
-       } while (new_fd == -1 && errno == EINTR && !mono_thread_info_is_interrupt_state (info));
+               MONO_ENTER_GC_SAFE;
+               accepted_fd = accept (((MonoFDHandle*) sockethandle)->fd, addr, addrlen);
+               MONO_EXIT_GC_SAFE;
+       } while (accepted_fd == -1 && errno == EINTR && !mono_thread_info_is_interrupt_state (info));
 
-       if (new_fd == -1) {
-               gint errnum = errno;
+       if (accepted_fd == -1) {
+               gint error = mono_w32socket_convert_error (errno);
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: accept error: %s", __func__, g_strerror(errno));
-               mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_w32socket_set_last_error (error);
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return INVALID_SOCKET;
        }
 
-       if (new_fd >= mono_w32handle_fd_reserve) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: File descriptor is too big", __func__);
-
-               mono_w32socket_set_last_error (WSASYSCALLFAILURE);
+       accepted_socket_data = socket_data_create (MONO_FDTYPE_SOCKET, accepted_fd);
+       accepted_socket_data->domain = sockethandle->domain;
+       accepted_socket_data->type = sockethandle->type;
+       accepted_socket_data->protocol = sockethandle->protocol;
+       accepted_socket_data->still_readable = 1;
 
-               close (new_fd);
+       mono_fdhandle_insert ((MonoFDHandle*) accepted_socket_data);
 
-               return INVALID_SOCKET;
-       }
-
-       new_socket_handle.domain = socket_handle->domain;
-       new_socket_handle.type = socket_handle->type;
-       new_socket_handle.protocol = socket_handle->protocol;
-       new_socket_handle.still_readable = 1;
-
-       new_handle = mono_w32handle_new_fd (MONO_W32HANDLE_SOCKET, new_fd,
-                                         &new_socket_handle);
-       if(new_handle == INVALID_HANDLE_VALUE) {
-               g_warning ("%s: error creating socket handle", __func__);
-               mono_w32socket_set_last_error (ERROR_GEN_FAILURE);
-               return INVALID_SOCKET;
-       }
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning accepted handle %p", __func__, GINT_TO_POINTER(((MonoFDHandle*) accepted_socket_data)->fd));
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning newly accepted socket handle %p with",
-                  __func__, new_handle);
-
-       return new_fd;
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+       return ((MonoFDHandle*) accepted_socket_data)->fd;
 }
 
 int
 mono_w32socket_connect (SOCKET sock, const struct sockaddr *addr, int addrlen, gboolean blocking)
 {
-       gpointer handle;
-       MonoW32HandleSocket *socket_handle;
+       SocketHandle *sockethandle;
+       gint ret;
+
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
 
-       handle = GUINT_TO_POINTER (sock);
-       if (!mono_w32handle_lookup (handle, MONO_W32HANDLE_SOCKET, (gpointer *)&socket_handle)) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
-       if (connect (sock, addr, addrlen) == -1) {
+       MONO_ENTER_GC_SAFE;
+       ret = connect (((MonoFDHandle*) sockethandle)->fd, addr, addrlen);
+       MONO_EXIT_GC_SAFE;
+       if (ret == -1) {
                MonoThreadInfo *info;
                mono_pollfd fds;
                gint errnum, so_error;
@@ -251,29 +234,41 @@ mono_w32socket_connect (SOCKET sock, const struct sockaddr *addr, int addrlen, g
                        if (errnum != WSAEWOULDBLOCK) {
                                /* ECONNRESET means the socket was closed by another thread */
                                /* Async close on mac raises ECONNABORTED. */
-                               socket_handle->saved_error = errnum;
+                               sockethandle->saved_error = errnum;
                        }
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return SOCKET_ERROR;
                }
 
                info = mono_thread_info_current ();
 
-               fds.fd = sock;
+               fds.fd = ((MonoFDHandle*) sockethandle)->fd;
                fds.events = MONO_POLLOUT;
-               while (mono_poll (&fds, 1, -1) == -1 && !mono_thread_info_is_interrupt_state (info)) {
+               for (;;) {
+                       MONO_ENTER_GC_SAFE;
+                       ret = mono_poll (&fds, 1, -1);
+                       MONO_EXIT_GC_SAFE;
+                       if (ret != -1 || mono_thread_info_is_interrupt_state (info))
+                               break;
+
                        if (errno != EINTR) {
                                gint errnum = errno;
                                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: connect poll error: %s", __func__, g_strerror (errno));
                                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+                               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                                return SOCKET_ERROR;
                        }
                }
 
                len = sizeof(so_error);
-               if (getsockopt (sock, SOL_SOCKET, SO_ERROR, &so_error, &len) == -1) {
+               MONO_ENTER_GC_SAFE;
+               ret = getsockopt (((MonoFDHandle*) sockethandle)->fd, SOL_SOCKET, SO_ERROR, &so_error, &len);
+               MONO_EXIT_GC_SAFE;
+               if (ret == -1) {
                        gint errnum = errno;
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: connect getsockopt error: %s", __func__, g_strerror (errno));
                        mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return SOCKET_ERROR;
                }
 
@@ -281,16 +276,18 @@ mono_w32socket_connect (SOCKET sock, const struct sockaddr *addr, int addrlen, g
                        gint errnum = mono_w32socket_convert_error (so_error);
 
                        /* Need to save this socket error */
-                       socket_handle->saved_error = errnum;
+                       sockethandle->saved_error = errnum;
 
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: connect getsockopt returned error: %s",
                                   __func__, g_strerror (so_error));
 
                        mono_w32socket_set_last_error (errnum);
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return SOCKET_ERROR;
                }
        }
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
@@ -303,21 +300,27 @@ mono_w32socket_recv (SOCKET sock, char *buf, int len, int flags, gboolean blocki
 int
 mono_w32socket_recvfrom (SOCKET sock, char *buf, int len, int flags, struct sockaddr *from, socklen_t *fromlen, gboolean blocking)
 {
-       gpointer handle;
-       MonoW32HandleSocket *socket_handle;
+       SocketHandle *sockethandle;
        int ret;
        MonoThreadInfo *info;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (!mono_w32handle_lookup (handle, MONO_W32HANDLE_SOCKET, (gpointer *)&socket_handle)) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
        info = mono_thread_info_current ();
 
        do {
-               ret = recvfrom (sock, buf, len, flags, from, fromlen);
+               MONO_ENTER_GC_SAFE;
+               ret = recvfrom (((MonoFDHandle*) sockethandle)->fd, buf, len, flags, from, fromlen);
+               MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR && !mono_thread_info_is_interrupt_state (info));
 
        if (ret == 0 && len > 0) {
@@ -339,7 +342,7 @@ mono_w32socket_recvfrom (SOCKET sock, char *buf, int len, int flags, struct sock
                 * still_readable != 1 then shutdown
                 * (SHUT_RD|SHUT_RDWR) has been called locally.
                 */
-               if (socket_handle->still_readable != 1) {
+               if (sockethandle->still_readable != 1) {
                        ret = -1;
                        errno = EINTR;
                }
@@ -349,8 +352,10 @@ mono_w32socket_recvfrom (SOCKET sock, char *buf, int len, int flags, struct sock
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: recv error: %s", __func__, g_strerror(errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return ret;
 }
 
@@ -377,18 +382,22 @@ msghdr_iov_free (struct msghdr *hdr)
 int
 mono_w32socket_recvbuffers (SOCKET sock, WSABUF *buffers, guint32 count, guint32 *received, guint32 *flags, gpointer overlapped, gpointer complete, gboolean blocking)
 {
-       MonoW32HandleSocket *socket_handle;
+       SocketHandle *sockethandle;
        MonoThreadInfo *info;
-       gpointer handle;
        gint ret;
        struct msghdr hdr;
 
        g_assert (overlapped == NULL);
        g_assert (complete == NULL);
 
-       handle = GUINT_TO_POINTER (sock);
-       if (!mono_w32handle_lookup (handle, MONO_W32HANDLE_SOCKET, (gpointer *)&socket_handle)) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
@@ -397,14 +406,16 @@ mono_w32socket_recvbuffers (SOCKET sock, WSABUF *buffers, guint32 count, guint32
        wsabuf_to_msghdr (buffers, count, &hdr);
 
        do {
-               ret = recvmsg (sock, &hdr, *flags);
+               MONO_ENTER_GC_SAFE;
+               ret = recvmsg (((MonoFDHandle*) sockethandle)->fd, &hdr, *flags);
+               MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR && !mono_thread_info_is_interrupt_state (info));
 
        msghdr_iov_free (&hdr);
 
        if (ret == 0) {
                /* see mono_w32socket_recvfrom */
-               if (socket_handle->still_readable != 1) {
+               if (sockethandle->still_readable != 1) {
                        ret = -1;
                        errno = EINTR;
                }
@@ -414,32 +425,41 @@ mono_w32socket_recvbuffers (SOCKET sock, WSABUF *buffers, guint32 count, guint32
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: recvmsg error: %s", __func__, g_strerror(errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
        *received = ret;
        *flags = hdr.msg_flags;
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
 int
 mono_w32socket_send (SOCKET sock, char *buf, int len, int flags, gboolean blocking)
 {
-       gpointer handle;
+       SocketHandle *sockethandle;
        int ret;
        MonoThreadInfo *info;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
        info = mono_thread_info_current ();
 
        do {
-               ret = send (sock, buf, len, flags);
+               MONO_ENTER_GC_SAFE;
+               ret = send (((MonoFDHandle*) sockethandle)->fd, buf, len, flags);
+               MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR && !mono_thread_info_is_interrupt_state (info));
 
        if (ret == -1) {
@@ -450,42 +470,55 @@ mono_w32socket_send (SOCKET sock, char *buf, int len, int flags, gboolean blocki
                /* At least linux returns EAGAIN/EWOULDBLOCK when the timeout has been set on
                 * a blocking socket. See bug #599488 */
                if (errnum == EAGAIN) {
-                       ret = fcntl (sock, F_GETFL, 0);
+                       MONO_ENTER_GC_SAFE;
+                       ret = fcntl (((MonoFDHandle*) sockethandle)->fd, F_GETFL, 0);
+                       MONO_EXIT_GC_SAFE;
                        if (ret != -1 && (ret & O_NONBLOCK) == 0)
                                errnum = ETIMEDOUT;
                }
 #endif /* O_NONBLOCK */
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return ret;
 }
 
 int
 mono_w32socket_sendto (SOCKET sock, const char *buf, int len, int flags, const struct sockaddr *to, int tolen, gboolean blocking)
 {
-       gpointer handle;
+       SocketHandle *sockethandle;
        int ret;
        MonoThreadInfo *info;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
        info = mono_thread_info_current ();
 
        do {
-               ret = sendto (sock, buf, len, flags, to, tolen);
+               MONO_ENTER_GC_SAFE;
+               ret = sendto (((MonoFDHandle*) sockethandle)->fd, buf, len, flags, to, tolen);
+               MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR &&  !mono_thread_info_is_interrupt_state (info));
 
        if (ret == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: send error: %s", __func__, g_strerror (errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return ret;
 }
 
@@ -494,15 +527,20 @@ mono_w32socket_sendbuffers (SOCKET sock, WSABUF *buffers, guint32 count, guint32
 {
        struct msghdr hdr;
        MonoThreadInfo *info;
-       gpointer handle;
+       SocketHandle *sockethandle;
        gint ret;
 
        g_assert (overlapped == NULL);
        g_assert (complete == NULL);
 
-       handle = GUINT_TO_POINTER (sock);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
@@ -511,7 +549,9 @@ mono_w32socket_sendbuffers (SOCKET sock, WSABUF *buffers, guint32 count, guint32
        wsabuf_to_msghdr (buffers, count, &hdr);
 
        do {
-               ret = sendmsg (sock, &hdr, flags);
+               MONO_ENTER_GC_SAFE;
+               ret = sendmsg (((MonoFDHandle*) sockethandle)->fd, &hdr, flags);
+               MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR && !mono_thread_info_is_interrupt_state (info));
 
        msghdr_iov_free (&hdr);
@@ -520,10 +560,12 @@ mono_w32socket_sendbuffers (SOCKET sock, WSABUF *buffers, guint32 count, guint32
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: sendmsg error: %s", __func__, g_strerror (errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
        *sent = ret;
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
@@ -533,7 +575,7 @@ BOOL
 mono_w32socket_transmit_file (SOCKET sock, gpointer file_handle, TRANSMIT_FILE_BUFFERS *buffers, guint32 flags, gboolean blocking)
 {
        MonoThreadInfo *info;
-       gpointer handle;
+       SocketHandle *sockethandle;
        gint file;
        gssize ret;
 #if defined(HAVE_SENDFILE) && (defined(__linux__) || defined(DARWIN))
@@ -542,17 +584,24 @@ mono_w32socket_transmit_file (SOCKET sock, gpointer file_handle, TRANSMIT_FILE_B
        gchar *buffer;
 #endif
 
-       handle = GUINT_TO_POINTER (sock);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
-               return FALSE;
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
        }
 
        /* Write the header */
        if (buffers != NULL && buffers->Head != NULL && buffers->HeadLength > 0) {
-               ret = mono_w32socket_send (sock, buffers->Head, buffers->HeadLength, 0, FALSE);
-               if (ret == SOCKET_ERROR)
+               ret = mono_w32socket_send (((MonoFDHandle*) sockethandle)->fd, buffers->Head, buffers->HeadLength, 0, FALSE);
+               if (ret == SOCKET_ERROR) {
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return FALSE;
+               }
        }
 
        info = mono_thread_info_current ();
@@ -560,35 +609,44 @@ mono_w32socket_transmit_file (SOCKET sock, gpointer file_handle, TRANSMIT_FILE_B
        file = GPOINTER_TO_INT (file_handle);
 
 #if defined(HAVE_SENDFILE) && (defined(__linux__) || defined(DARWIN))
+       MONO_ENTER_GC_SAFE;
        ret = fstat (file, &statbuf);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                gint errnum = errno;
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
        do {
+               MONO_ENTER_GC_SAFE;
 #ifdef __linux__
-               ret = sendfile (sock, file, NULL, statbuf.st_size);
+               ret = sendfile (((MonoFDHandle*) sockethandle)->fd, file, NULL, statbuf.st_size);
 #elif defined(DARWIN)
                /* TODO: header/tail could be sent in the 5th argument */
                /* TODO: Might not send the entire file for non-blocking sockets */
-               ret = sendfile (file, sock, 0, &statbuf.st_size, NULL, 0);
+               ret = sendfile (file, ((MonoFDHandle*) sockethandle)->fd, 0, &statbuf.st_size, NULL, 0);
 #endif
+               MONO_EXIT_GC_SAFE;
        } while (ret != -1 && errno == EINTR && !mono_thread_info_is_interrupt_state (info));
 #else
        buffer = g_malloc (SF_BUFFER_SIZE);
 
        do {
                do {
+                       MONO_ENTER_GC_SAFE;
                        ret = read (file, buffer, SF_BUFFER_SIZE);
+                       MONO_EXIT_GC_SAFE;
                } while (ret == -1 && errno == EINTR && !mono_thread_info_is_interrupt_state (info));
 
                if (ret == -1 || ret == 0)
                        break;
 
                do {
-                       ret = send (sock, buffer, ret, 0); /* short sends? enclose this in a loop? */
+                       MONO_ENTER_GC_SAFE;
+                       ret = send (((MonoFDHandle*) sockethandle)->fd, buffer, ret, 0); /* short sends? enclose this in a loop? */
+                       MONO_EXIT_GC_SAFE;
                } while (ret == -1 && errno == EINTR && !mono_thread_info_is_interrupt_state (info));
        } while (ret != -1 && errno == EINTR && !mono_thread_info_is_interrupt_state (info));
 
@@ -598,59 +656,55 @@ mono_w32socket_transmit_file (SOCKET sock, gpointer file_handle, TRANSMIT_FILE_B
        if (ret == -1) {
                gint errnum = errno;
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return FALSE;
        }
 
        /* Write the tail */
        if (buffers != NULL && buffers->Tail != NULL && buffers->TailLength > 0) {
-               ret = mono_w32socket_send (sock, buffers->Tail, buffers->TailLength, 0, FALSE);
-               if (ret == SOCKET_ERROR)
+               ret = mono_w32socket_send (((MonoFDHandle*) sockethandle)->fd, buffers->Tail, buffers->TailLength, 0, FALSE);
+               if (ret == SOCKET_ERROR) {
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return FALSE;
+               }
        }
 
        if ((flags & TF_DISCONNECT) == TF_DISCONNECT)
-               mono_w32handle_close (handle);
+               mono_w32socket_close (((MonoFDHandle*) sockethandle)->fd);
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return TRUE;
 }
 
 SOCKET
 mono_w32socket_socket (int domain, int type, int protocol)
 {
-       MonoW32HandleSocket socket_handle = {0};
-       gpointer handle;
-       SOCKET sock;
-
-       socket_handle.domain = domain;
-       socket_handle.type = type;
-       socket_handle.protocol = protocol;
-       socket_handle.still_readable = 1;
-
-       sock = socket (domain, type, protocol);
-       if (sock == -1 && domain == AF_INET && type == SOCK_RAW &&
-           protocol == 0) {
-               /* Retry with protocol == 4 (see bug #54565) */
-               // https://bugzilla.novell.com/show_bug.cgi?id=MONO54565
-               socket_handle.protocol = 4;
-               sock = socket (AF_INET, SOCK_RAW, 4);
-       }
+       SocketHandle *sockethandle;
+       gint fd;
+
+retry_socket:
+       MONO_ENTER_GC_SAFE;
+       fd = socket (domain, type, protocol);
+       MONO_EXIT_GC_SAFE;
+       if (fd == -1) {
+               if (domain == AF_INET && type == SOCK_RAW && protocol == 0) {
+                       /* Retry with protocol == 4 (see bug #54565) */
+                       // https://bugzilla.novell.com/show_bug.cgi?id=MONO54565
+                       protocol = 4;
+                       goto retry_socket;
+               }
 
-       if (sock == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: socket error: %s", __func__, g_strerror (errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
                return INVALID_SOCKET;
        }
 
-       if (sock >= mono_w32handle_fd_reserve) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: File descriptor is too big (%d >= %d)",
-                          __func__, sock, mono_w32handle_fd_reserve);
-
-               mono_w32socket_set_last_error (WSASYSCALLFAILURE);
-               close (sock);
-
-               return INVALID_SOCKET;
-       }
+       sockethandle = socket_data_create(MONO_FDTYPE_SOCKET, fd);
+       sockethandle->domain = domain;
+       sockethandle->type = type;
+       sockethandle->protocol = protocol;
+       sockethandle->still_readable = 1;
 
        /* .net seems to set this by default for SOCK_STREAM, not for
         * SOCK_DGRAM (see bug #36322)
@@ -670,111 +724,142 @@ mono_w32socket_socket (int domain, int type, int protocol)
        {
                int ret, true_ = 1;
 
-               ret = setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &true_, sizeof (true_));
+               MONO_ENTER_GC_SAFE;
+               ret = setsockopt (((MonoFDHandle*) sockethandle)->fd, SOL_SOCKET, SO_REUSEADDR, &true_, sizeof (true_));
+               MONO_EXIT_GC_SAFE;
                if (ret == -1) {
-                       close (sock);
                        gint errnum = errno;
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Error setting SO_REUSEADDR", __func__);
                        mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+
+                       MONO_ENTER_GC_SAFE;
+                       close (((MonoFDHandle*) sockethandle)->fd);
+                       MONO_EXIT_GC_SAFE;
+
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return INVALID_SOCKET;
                }
        }
 
+       mono_fdhandle_insert ((MonoFDHandle*) sockethandle);
 
-       handle = mono_w32handle_new_fd (MONO_W32HANDLE_SOCKET, sock, &socket_handle);
-       if (handle == INVALID_HANDLE_VALUE) {
-               g_warning ("%s: error creating socket handle", __func__);
-               mono_w32socket_set_last_error (WSASYSCALLFAILURE);
-               close (sock);
-               return INVALID_SOCKET;
-       }
-
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning socket handle %p", __func__, handle);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning socket handle %p", __func__, GINT_TO_POINTER(((MonoFDHandle*) sockethandle)->fd));
 
-       return sock;
+       return ((MonoFDHandle*) sockethandle)->fd;
 }
 
 gint
 mono_w32socket_bind (SOCKET sock, struct sockaddr *addr, socklen_t addrlen)
 {
-       gpointer handle;
+       SocketHandle *sockethandle;
        int ret;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
-       ret = bind (sock, addr, addrlen);
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       MONO_ENTER_GC_SAFE;
+       ret = bind (((MonoFDHandle*) sockethandle)->fd, addr, addrlen);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: bind error: %s", __func__, g_strerror(errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
 gint
 mono_w32socket_getpeername (SOCKET sock, struct sockaddr *name, socklen_t *namelen)
 {
-       gpointer handle;
+       SocketHandle *sockethandle;
        gint ret;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
-       ret = getpeername (sock, name, namelen);
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       MONO_ENTER_GC_SAFE;
+       ret = getpeername (((MonoFDHandle*) sockethandle)->fd, name, namelen);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: getpeername error: %s", __func__, g_strerror (errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
 gint
 mono_w32socket_getsockname (SOCKET sock, struct sockaddr *name, socklen_t *namelen)
 {
-       gpointer handle;
+       SocketHandle *sockethandle;
        gint ret;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
-       ret = getsockname (sock, name, namelen);
+       MONO_ENTER_GC_SAFE;
+       ret = getsockname (((MonoFDHandle*) sockethandle)->fd, name, namelen);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: getsockname error: %s", __func__, g_strerror (errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
 gint
 mono_w32socket_getsockopt (SOCKET sock, gint level, gint optname, gpointer optval, socklen_t *optlen)
 {
-       gpointer handle;
+       SocketHandle *sockethandle;
        gint ret;
        struct timeval tv;
        gpointer tmp_val;
-       MonoW32HandleSocket *socket_handle;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (!mono_w32handle_lookup (handle, MONO_W32HANDLE_SOCKET, (gpointer *)&socket_handle)) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
@@ -785,11 +870,14 @@ mono_w32socket_getsockopt (SOCKET sock, gint level, gint optname, gpointer optva
                *optlen = sizeof (tv);
        }
 
-       ret = getsockopt (sock, level, optname, tmp_val, optlen);
+       MONO_ENTER_GC_SAFE;
+       ret = getsockopt (((MonoFDHandle*) sockethandle)->fd, level, optname, tmp_val, optlen);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: getsockopt error: %s", __func__, g_strerror (errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
@@ -801,19 +889,20 @@ mono_w32socket_getsockopt (SOCKET sock, gint level, gint optname, gpointer optva
        if (optname == SO_ERROR) {
                if (*((int *)optval) != 0) {
                        *((int *) optval) = mono_w32socket_convert_error (*((int *)optval));
-                       socket_handle->saved_error = *((int *)optval);
+                       sockethandle->saved_error = *((int *)optval);
                } else {
-                       *((int *)optval) = socket_handle->saved_error;
+                       *((int *)optval) = sockethandle->saved_error;
                }
        }
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
 gint
 mono_w32socket_setsockopt (SOCKET sock, gint level, gint optname, const gpointer optval, socklen_t optlen)
 {
-       gpointer handle;
+       SocketHandle *sockethandle;
        gint ret;
        gpointer tmp_val;
 #if defined (__linux__)
@@ -822,9 +911,14 @@ mono_w32socket_setsockopt (SOCKET sock, gint level, gint optname, const gpointer
 #endif
        struct timeval tv;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
@@ -851,11 +945,14 @@ mono_w32socket_setsockopt (SOCKET sock, gint level, gint optname, const gpointer
        }
 #endif
 
-       ret = setsockopt (sock, level, optname, tmp_val, optlen);
+       MONO_ENTER_GC_SAFE;
+       ret = setsockopt (((MonoFDHandle*) sockethandle)->fd, level, optname, tmp_val, optlen);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: setsockopt error: %s", __func__, g_strerror (errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
@@ -865,71 +962,94 @@ mono_w32socket_setsockopt (SOCKET sock, gint level, gint optname, const gpointer
                int type;
                socklen_t type_len = sizeof (type);
 
-               if (!getsockopt (sock, level, SO_TYPE, &type, &type_len)) {
-                       if (type == SOCK_DGRAM || type == SOCK_STREAM)
-                               setsockopt (sock, level, SO_REUSEPORT, tmp_val, optlen);
+               MONO_ENTER_GC_SAFE;
+               ret = getsockopt (((MonoFDHandle*) sockethandle)->fd, level, SO_TYPE, &type, &type_len);
+               MONO_EXIT_GC_SAFE;
+               if (!ret) {
+                       if (type == SOCK_DGRAM || type == SOCK_STREAM) {
+                               MONO_ENTER_GC_SAFE;
+                               setsockopt (((MonoFDHandle*) sockethandle)->fd, level, SO_REUSEPORT, tmp_val, optlen);
+                               MONO_EXIT_GC_SAFE;
+                       }
                }
        }
 #endif
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return ret;
 }
 
 gint
 mono_w32socket_listen (SOCKET sock, gint backlog)
 {
-       gpointer handle;
+       SocketHandle *sockethandle;
        gint ret;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
-       ret = listen (sock, backlog);
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       MONO_ENTER_GC_SAFE;
+       ret = listen (((MonoFDHandle*) sockethandle)->fd, backlog);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: listen error: %s", __func__, g_strerror (errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
 gint
 mono_w32socket_shutdown (SOCKET sock, gint how)
 {
-       MonoW32HandleSocket *socket_handle;
-       gpointer handle;
+       SocketHandle *sockethandle;
        gint ret;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (!mono_w32handle_lookup (handle, MONO_W32HANDLE_SOCKET, (gpointer *)&socket_handle)) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
        if (how == SHUT_RD || how == SHUT_RDWR)
-               socket_handle->still_readable = 0;
+               sockethandle->still_readable = 0;
 
-       ret = shutdown (sock, how);
+       MONO_ENTER_GC_SAFE;
+       ret = shutdown (((MonoFDHandle*) sockethandle)->fd, how);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: shutdown error: %s", __func__, g_strerror (errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return ret;
 }
 
 gint
 mono_w32socket_disconnect (SOCKET sock, gboolean reuse)
 {
-       MonoW32HandleSocket *socket_handle;
-       gpointer handle;
+       SocketHandle *sockethandle;
        SOCKET newsock;
        gint ret;
 
@@ -939,17 +1059,25 @@ mono_w32socket_disconnect (SOCKET sock, gboolean reuse)
         * SOCK_STREAM, SOCK_SEQPACKET or SOCK_RDM (according to msdn)
         * if we really wanted to */
 
-       handle = GUINT_TO_POINTER (sock);
-       if (!mono_w32handle_lookup (handle, MONO_W32HANDLE_SOCKET, (gpointer *)&socket_handle)) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
-       newsock = socket (socket_handle->domain, socket_handle->type, socket_handle->protocol);
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       MONO_ENTER_GC_SAFE;
+       newsock = socket (sockethandle->domain, sockethandle->type, sockethandle->protocol);
+       MONO_EXIT_GC_SAFE;
        if (newsock == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: socket error: %s", __func__, g_strerror (errnum));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
@@ -958,32 +1086,46 @@ mono_w32socket_disconnect (SOCKET sock, gboolean reuse)
         * should not be a race condition between the old fd being
         * closed and the new socket fd being copied over */
        do {
-               ret = dup2 (newsock, sock);
+               MONO_ENTER_GC_SAFE;
+               ret = dup2 (newsock, ((MonoFDHandle*) sockethandle)->fd);
+               MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EAGAIN);
 
        if (ret == -1) {
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: dup2 error: %s", __func__, g_strerror (errnum));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
+       MONO_ENTER_GC_SAFE;
        close (newsock);
+       MONO_EXIT_GC_SAFE;
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
 static gboolean
 extension_disconect (SOCKET sock, OVERLAPPED *overlapped, guint32 flags, guint32 reserved)
 {
-       return mono_w32socket_disconnect (sock, flags & TF_REUSE_SOCKET) == 0;
+       gboolean ret;
+       MONO_ENTER_GC_UNSAFE;
+       ret = mono_w32socket_disconnect (sock, flags & TF_REUSE_SOCKET) == 0;
+       MONO_EXIT_GC_UNSAFE;
+       return ret;
 }
 
 static gboolean
 extension_transmit_file (SOCKET sock, gpointer file_handle, guint32 bytes_to_write, guint32 bytes_per_send,
        OVERLAPPED *ol, TRANSMIT_FILE_BUFFERS *buffers, guint32 flags)
 {
-       return mono_w32socket_transmit_file (sock, file_handle, buffers, flags, FALSE);
+       gboolean ret;
+       MONO_ENTER_GC_UNSAFE;
+       ret = mono_w32socket_transmit_file (sock, file_handle, buffers, flags, FALSE);
+       MONO_EXIT_GC_UNSAFE;
+       return ret;
 }
 
 static struct {
@@ -998,13 +1140,18 @@ static struct {
 gint
 mono_w32socket_ioctl (SOCKET sock, gint32 command, gchar *input, gint inputlen, gchar *output, gint outputlen, glong *written)
 {
-       gpointer handle;
+       SocketHandle *sockethandle;
        gint ret;
        gchar *buffer;
 
-       handle = GUINT_TO_POINTER (sock);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
@@ -1017,18 +1164,21 @@ mono_w32socket_ioctl (SOCKET sock, gint32 command, gchar *input, gint inputlen,
                         * actually set an error here...
                         */
                        mono_w32socket_set_last_error (WSAEINVAL);
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return SOCKET_ERROR;
                }
 
                if (outputlen < sizeof(gpointer)) {
                        /* Or here... */
                        mono_w32socket_set_last_error (WSAEINVAL);
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return SOCKET_ERROR;
                }
 
                if (output == NULL) {
                        /* Or here */
                        mono_w32socket_set_last_error (WSAEINVAL);
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return SOCKET_ERROR;
                }
 
@@ -1037,11 +1187,13 @@ mono_w32socket_ioctl (SOCKET sock, gint32 command, gchar *input, gint inputlen,
                        if (memcmp (guid, &extension_functions[i].guid, sizeof(GUID)) == 0) {
                                memcpy (output, &extension_functions[i].func, sizeof(gpointer));
                                *written = sizeof(gpointer);
+                               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                                return 0;
                        }
                }
 
                mono_w32socket_set_last_error (WSAEINVAL);
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
@@ -1050,14 +1202,18 @@ mono_w32socket_ioctl (SOCKET sock, gint32 command, gchar *input, gint inputlen,
 
                if (inputlen < 3 * sizeof (guint32)) {
                        mono_w32socket_set_last_error (WSAEINVAL);
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return SOCKET_ERROR;
                }
 
                onoff = *((guint32*) input);
 
-               ret = setsockopt (sock, SOL_SOCKET, SO_KEEPALIVE, &onoff, sizeof (guint32));
+               MONO_ENTER_GC_SAFE;
+               ret = setsockopt (((MonoFDHandle*) sockethandle)->fd, SOL_SOCKET, SO_KEEPALIVE, &onoff, sizeof (guint32));
+               MONO_EXIT_GC_SAFE;
                if (ret < 0) {
                        mono_w32socket_set_last_error (mono_w32socket_convert_error (errno));
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return SOCKET_ERROR;
                }
 
@@ -1074,40 +1230,51 @@ mono_w32socket_ioctl (SOCKET sock, gint32 command, gchar *input, gint inputlen,
                        keepalivetime /= 1000;
                        if (keepalivetime == 0 || rem >= 500)
                                keepalivetime++;
-                       ret = setsockopt (sock, IPPROTO_TCP, TCP_KEEPIDLE, &keepalivetime, sizeof (guint32));
+                       MONO_ENTER_GC_SAFE;
+                       ret = setsockopt (((MonoFDHandle*) sockethandle)->fd, IPPROTO_TCP, TCP_KEEPIDLE, &keepalivetime, sizeof (guint32));
+                       MONO_EXIT_GC_SAFE;
                        if (ret == 0) {
                                rem = keepaliveinterval % 1000;
                                keepaliveinterval /= 1000;
                                if (keepaliveinterval == 0 || rem >= 500)
                                        keepaliveinterval++;
-                               ret = setsockopt (sock, IPPROTO_TCP, TCP_KEEPINTVL, &keepaliveinterval, sizeof (guint32));
+                               MONO_ENTER_GC_SAFE;
+                               ret = setsockopt (((MonoFDHandle*) sockethandle)->fd, IPPROTO_TCP, TCP_KEEPINTVL, &keepaliveinterval, sizeof (guint32));
+                               MONO_EXIT_GC_SAFE;
                        }
                        if (ret != 0) {
                                mono_w32socket_set_last_error (mono_w32socket_convert_error (errno));
+                               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                                return SOCKET_ERROR;
                        }
 
+                       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                        return 0;
                }
 #endif
 
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return 0;
        }
 
        buffer = inputlen > 0 ? (gchar*) g_memdup (input, inputlen) : NULL;
 
-       ret = ioctl (sock, command, buffer);
+       MONO_ENTER_GC_SAFE;
+       ret = ioctl (((MonoFDHandle*) sockethandle)->fd, command, buffer);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                g_free (buffer);
 
                gint errnum = errno;
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: WSAIoctl error: %s", __func__, g_strerror (errno));
                mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
        if (!buffer) {
                *written = 0;
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return 0;
        }
 
@@ -1123,42 +1290,65 @@ mono_w32socket_ioctl (SOCKET sock, gint32 command, gchar *input, gint inputlen,
        g_free (buffer);
        *written = inputlen;
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
 gboolean
 mono_w32socket_close (SOCKET sock)
 {
-       return mono_w32handle_close (GINT_TO_POINTER (sock));
+       if (!mono_fdhandle_close (sock)) {
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               return FALSE;
+       }
+
+       return TRUE;
 }
 
 gint
-mono_w32socket_set_blocking (SOCKET socket, gboolean blocking)
+mono_w32socket_set_blocking (SOCKET sock, gboolean blocking)
 {
 #ifdef O_NONBLOCK
+       SocketHandle *sockethandle;
        gint ret;
-       gpointer handle;
 
-       handle = GINT_TO_POINTER (socket);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
        /* This works better than ioctl(...FIONBIO...)
         * on Linux (it causes connect to return
         * EINPROGRESS, but the ioctl doesn't seem to) */
-       ret = fcntl (socket, F_GETFL, 0);
-       if (ret != -1)
-               ret = fcntl (socket, F_SETFL, blocking ? (ret & (~O_NONBLOCK)) : (ret | (O_NONBLOCK)));
+       MONO_ENTER_GC_SAFE;
+       ret = fcntl (((MonoFDHandle*) sockethandle)->fd, F_GETFL, 0);
+       MONO_EXIT_GC_SAFE;
+       if (ret == -1) {
+               gint errnum = mono_w32socket_convert_error (errno);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fcntl(F_GETFL) error: %s", __func__, g_strerror (errno));
+               mono_w32socket_set_last_error (errnum);
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               return SOCKET_ERROR;
+       }
 
+       MONO_ENTER_GC_SAFE;
+       ret = fcntl (((MonoFDHandle*) sockethandle)->fd, F_SETFL, blocking ? (ret & (~O_NONBLOCK)) : (ret | (O_NONBLOCK)));
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
-               gint errnum = errno;
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: ioctl error: %s", __func__, g_strerror (errno));
-               mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               gint errnum = mono_w32socket_convert_error (errno);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fcntl(F_SETFL) error: %s", __func__, g_strerror (errno));
+               mono_w32socket_set_last_error (errnum);
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 #else
        mono_w32socket_set_last_error (ERROR_NOT_SUPPORTED);
@@ -1167,14 +1357,19 @@ mono_w32socket_set_blocking (SOCKET socket, gboolean blocking)
 }
 
 gint
-mono_w32socket_get_available (SOCKET socket, guint64 *amount)
+mono_w32socket_get_available (SOCKET sock, guint64 *amount)
 {
+       SocketHandle *sockethandle;
        gint ret;
-       gpointer handle;
 
-       handle = GINT_TO_POINTER (socket);
-       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_SOCKET) {
-               mono_w32socket_set_last_error (WSAENOTSOCK);
+       if (!mono_fdhandle_lookup_and_ref(sock, (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (WSAENOTSOCK);
+               return SOCKET_ERROR;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (WSAENOTSOCK);
                return SOCKET_ERROR;
        }
 
@@ -1190,18 +1385,30 @@ mono_w32socket_get_available (SOCKET socket, guint64 *amount)
        // the ip buffer.
 
        socklen_t optlen = sizeof (int);
-       ret = getsockopt (socket, SOL_SOCKET, SO_NREAD, (gulong*) amount, &optlen);
+       MONO_ENTER_GC_SAFE;
+       ret = getsockopt (((MonoFDHandle*) sockethandle)->fd, SOL_SOCKET, SO_NREAD, (gulong*) amount, &optlen);
+       MONO_EXIT_GC_SAFE;
+       if (ret == -1) {
+               gint errnum = mono_w32socket_convert_error (errno);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: getsockopt error: %s", __func__, g_strerror (errno));
+               mono_w32socket_set_last_error (errnum);
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               return SOCKET_ERROR;
+       }
 #else
-       ret = ioctl (socket, FIONREAD, (gulong*) amount);
-#endif
-
+       MONO_ENTER_GC_SAFE;
+       ret = ioctl (((MonoFDHandle*) sockethandle)->fd, FIONREAD, (gulong*) amount);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
-               gint errnum = errno;
+               gint errnum = mono_w32socket_convert_error (errno);
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: ioctl error: %s", __func__, g_strerror (errno));
-               mono_w32socket_set_last_error (mono_w32socket_convert_error (errnum));
+               mono_w32socket_set_last_error (errnum);
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
                return SOCKET_ERROR;
        }
+#endif
 
+       mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
        return 0;
 }
 
@@ -1324,6 +1531,9 @@ mono_w32socket_convert_error (gint error)
        case ENODEV: return WSAENETDOWN;
 #ifdef EPROTOTYPE
        case EPROTOTYPE: return WSAEPROTOTYPE;
+#endif
+#ifdef ENXIO
+       case ENXIO: return WSAENXIO;
 #endif
        default:
                g_error ("%s: no translation into winsock error for (%d) \"%s\"", __func__, error, g_strerror (error));
@@ -1345,3 +1555,23 @@ ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto, Mo
        return FALSE;
 #endif
 }
+
+gboolean
+mono_w32socket_duplicate (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle)
+{
+       SocketHandle *sockethandle;
+
+       if (!mono_fdhandle_lookup_and_ref (GPOINTER_TO_INT(handle), (MonoFDHandle**) &sockethandle)) {
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               return FALSE;
+       }
+
+       if (((MonoFDHandle*) sockethandle)->type != MONO_FDTYPE_SOCKET) {
+               mono_fdhandle_unref ((MonoFDHandle*) sockethandle);
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               return FALSE;
+       }
+
+       *duplicate_handle = handle;
+       return TRUE;
+}
index a3f8d410583248e150c7a930fa068255ad35624f..4f7cc8cdcf555f28ffbf37a6a7c6807192bdeaf6 100644 (file)
@@ -137,15 +137,19 @@ SOCKET mono_w32socket_accept (SOCKET s, struct sockaddr *addr, socklen_t *addrle
 {
        MonoInternalThread *curthread = mono_thread_internal_current ();
        SOCKET newsock = INVALID_SOCKET;
+       MONO_ENTER_GC_SAFE;
        ALERTABLE_SOCKET_CALL (FD_ACCEPT_BIT, blocking, TRUE, newsock, accept, s, addr, addrlen);
+       MONO_EXIT_GC_SAFE;
        return newsock;
 }
 
 int mono_w32socket_connect (SOCKET s, const struct sockaddr *name, int namelen, gboolean blocking)
 {
        int ret = SOCKET_ERROR;
+       MONO_ENTER_GC_SAFE;
        ALERTABLE_SOCKET_CALL (FD_CONNECT_BIT, blocking, FALSE, ret, connect, s, name, namelen);
        ret = WSAGetLastError () != 0 ? SOCKET_ERROR : 0;
+       MONO_EXIT_GC_SAFE;
        return ret;
 }
 
@@ -153,42 +157,54 @@ int mono_w32socket_recv (SOCKET s, char *buf, int len, int flags, gboolean block
 {
        MonoInternalThread *curthread = mono_thread_internal_current ();
        int ret = SOCKET_ERROR;
+       MONO_ENTER_GC_SAFE;
        ALERTABLE_SOCKET_CALL (FD_READ_BIT, blocking, TRUE, ret, recv, s, buf, len, flags);
+       MONO_EXIT_GC_SAFE;
        return ret;
 }
 
 int mono_w32socket_recvfrom (SOCKET s, char *buf, int len, int flags, struct sockaddr *from, socklen_t *fromlen, gboolean blocking)
 {
        int ret = SOCKET_ERROR;
+       MONO_ENTER_GC_SAFE;
        ALERTABLE_SOCKET_CALL (FD_READ_BIT, blocking, TRUE, ret, recvfrom, s, buf, len, flags, from, fromlen);
+       MONO_EXIT_GC_SAFE;
        return ret;
 }
 
 int mono_w32socket_recvbuffers (SOCKET s, WSABUF *lpBuffers, guint32 dwBufferCount, guint32 *lpNumberOfBytesRecvd, guint32 *lpFlags, gpointer lpOverlapped, gpointer lpCompletionRoutine, gboolean blocking)
 {
        int ret = SOCKET_ERROR;
+       MONO_ENTER_GC_SAFE;
        ALERTABLE_SOCKET_CALL (FD_READ_BIT, blocking, TRUE, ret, WSARecv, s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags, lpOverlapped, lpCompletionRoutine);
+       MONO_EXIT_GC_SAFE;
        return ret;
 }
 
 int mono_w32socket_send (SOCKET s, char *buf, int len, int flags, gboolean blocking)
 {
        int ret = SOCKET_ERROR;
+       MONO_ENTER_GC_SAFE;
        ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, FALSE, ret, send, s, buf, len, flags);
+       MONO_EXIT_GC_SAFE;
        return ret;
 }
 
 int mono_w32socket_sendto (SOCKET s, const char *buf, int len, int flags, const struct sockaddr *to, int tolen, gboolean blocking)
 {
        int ret = SOCKET_ERROR;
+       MONO_ENTER_GC_SAFE;
        ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, FALSE, ret, sendto, s, buf, len, flags, to, tolen);
+       MONO_EXIT_GC_SAFE;
        return ret;
 }
 
 int mono_w32socket_sendbuffers (SOCKET s, WSABUF *lpBuffers, guint32 dwBufferCount, guint32 *lpNumberOfBytesRecvd, guint32 lpFlags, gpointer lpOverlapped, gpointer lpCompletionRoutine, gboolean blocking)
 {
        int ret = SOCKET_ERROR;
+       MONO_ENTER_GC_SAFE;
        ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, FALSE, ret, WSASend, s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags, lpOverlapped, lpCompletionRoutine);
+       MONO_EXIT_GC_SAFE;
        return ret;
 }
 
@@ -197,12 +213,17 @@ BOOL mono_w32socket_transmit_file (SOCKET hSocket, gpointer hFile, TRANSMIT_FILE
 {
        LOGDEBUG (g_message ("%06d - Performing %s TransmitFile () on socket %d", GetCurrentThreadId (), blocking ? "blocking" : "non-blocking", hSocket));
 
-       int error = 0;
+       int error = 0, ret;
+
+       MONO_ENTER_GC_SAFE;
+
        if (blocking) {
                OVERLAPPED overlapped = { 0 };
                overlapped.hEvent = WSACreateEvent ();
-               if (overlapped.hEvent == WSA_INVALID_EVENT)
-                       return FALSE;
+               if (overlapped.hEvent == WSA_INVALID_EVENT) {
+                       ret = FALSE;
+                       goto done;
+               }
                if (!TransmitFile (hSocket, hFile, 0, 0, &overlapped, lpTransmitBuffers, dwReserved)) {
                        error = WSAGetLastError ();
                        if (error == WSA_IO_PENDING) {
@@ -230,7 +251,11 @@ BOOL mono_w32socket_transmit_file (SOCKET hSocket, gpointer hFile, TRANSMIT_FILE
                blocking ? "blocking" : "non-blocking", hSocket, error == 0, error));
        WSASetLastError (error);
 
-       return error == 0;
+       ret = error == 0;
+
+done:
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 #endif /* #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */
 
@@ -243,6 +268,8 @@ mono_w32socket_disconnect (SOCKET sock, gboolean reuse)
        DWORD output_bytes;
        gint ret;
 
+       MONO_ENTER_GC_SAFE;
+
        /* Use the SIO_GET_EXTENSION_FUNCTION_POINTER to determine
         * the address of the disconnect method without taking
         * a hard dependency on a single provider
@@ -259,36 +286,54 @@ mono_w32socket_disconnect (SOCKET sock, gboolean reuse)
        GUID disconnect_guid = WSAID_DISCONNECTEX;
        ret = WSAIoctl (sock, SIO_GET_EXTENSION_FUNCTION_POINTER, &disconnect_guid, sizeof (GUID), &disconnect, sizeof (LPFN_DISCONNECTEX), &output_bytes, NULL, NULL);
        if (ret == 0) {
-               if (!disconnect (sock, NULL, reuse ? TF_REUSE_SOCKET : 0, 0))
-                       return WSAGetLastError ();
+               if (!disconnect (sock, NULL, reuse ? TF_REUSE_SOCKET : 0, 0)) {
+                       ret = WSAGetLastError ();
+                       goto done;
+               }
 
-               return 0;
+               ret = 0;
+               goto done;
        }
 
        GUID transmit_file_guid = WSAID_TRANSMITFILE;
        ret = WSAIoctl (sock, SIO_GET_EXTENSION_FUNCTION_POINTER, &transmit_file_guid, sizeof (GUID), &transmit_file, sizeof (LPFN_TRANSMITFILE), &output_bytes, NULL, NULL);
        if (ret == 0) {
-               if (!transmit_file (sock, NULL, 0, 0, NULL, NULL, TF_DISCONNECT | (reuse ? TF_REUSE_SOCKET : 0)))
-                       return WSAGetLastError ();
+               if (!transmit_file (sock, NULL, 0, 0, NULL, NULL, TF_DISCONNECT | (reuse ? TF_REUSE_SOCKET : 0))) {
+                       ret = WSAGetLastError ();
+                       goto done;
+               }
 
-               return 0;
+               ret = 0;
+               goto done;
        }
 
-       return ERROR_NOT_SUPPORTED;
+       ret = ERROR_NOT_SUPPORTED;
+
+done:
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 #endif /* #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */
 
 gint
 mono_w32socket_set_blocking (SOCKET sock, gboolean blocking)
 {
+       gint ret;
        gulong nonblocking_long = !blocking;
-       return ioctlsocket (sock, FIONBIO, &nonblocking_long);
+       MONO_ENTER_GC_SAFE;
+       ret = ioctlsocket (sock, FIONBIO, &nonblocking_long);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 gint
 mono_w32socket_get_available (SOCKET sock, guint64 *amount)
 {
-       return ioctlsocket (sock, FIONREAD, (int*) amount);
+       gint ret;
+       MONO_ENTER_GC_SAFE;
+       ret = ioctlsocket (sock, FIONREAD, (int*) amount);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 void
@@ -315,3 +360,15 @@ ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto, Mo
        error_init (error);
        return TRUE;
 }
+
+gboolean
+mono_w32socket_duplicate (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle)
+{
+       gboolean ret;
+
+       MONO_ENTER_GC_SAFE;
+       ret = DuplicateHandle (GetCurrentProcess(), handle, GINT_TO_POINTER(targetProcessId), duplicate_handle, 0, 0, 0x00000002 /* DUPLICATE_SAME_ACCESS */);
+       MONO_EXIT_GC_SAFE;
+
+       return ret;
+}
index bd802a67bb1c2c1f7c07a14c70e3b1e9f8a8c468..9c0053455829860be455830da6f617c57ffb73c4 100644 (file)
@@ -116,61 +116,101 @@ create_sockaddr_from_handle (MonoObjectHandle saddr_obj, socklen_t *sa_size, gin
 static SOCKET
 mono_w32socket_socket (int domain, int type, int protocol)
 {
-       return WSASocket (domain, type, protocol, NULL, 0, WSA_FLAG_OVERLAPPED);
+       SOCKET ret;
+       MONO_ENTER_GC_SAFE;
+       ret = WSASocket (domain, type, protocol, NULL, 0, WSA_FLAG_OVERLAPPED);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 static gint
 mono_w32socket_bind (SOCKET sock, struct sockaddr *addr, socklen_t addrlen)
 {
-       return bind (sock, addr, addrlen);
+       gint ret;
+       MONO_ENTER_GC_SAFE;
+       ret = bind (sock, addr, addrlen);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 static gint
 mono_w32socket_getpeername (SOCKET sock, struct sockaddr *name, socklen_t *namelen)
 {
-       return getpeername (sock, name, namelen);
+       gint ret;
+       MONO_ENTER_GC_SAFE;
+       ret = getpeername (sock, name, namelen);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 static gint
 mono_w32socket_getsockname (SOCKET sock, struct sockaddr *name, socklen_t *namelen)
 {
-       return getsockname (sock, name, namelen);
+       gint ret;
+       MONO_ENTER_GC_SAFE;
+       ret = getsockname (sock, name, namelen);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 static gint
 mono_w32socket_getsockopt (SOCKET sock, gint level, gint optname, gpointer optval, socklen_t *optlen)
 {
-       return getsockopt (sock, level, optname, optval, optlen);
+       gint ret;
+       MONO_ENTER_GC_SAFE;
+       ret = getsockopt (sock, level, optname, optval, optlen);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 static gint
 mono_w32socket_setsockopt (SOCKET sock, gint level, gint optname, const gpointer optval, socklen_t optlen)
 {
-       return setsockopt (sock, level, optname, optval, optlen);
+       gint ret;
+       MONO_ENTER_GC_SAFE;
+       ret = setsockopt (sock, level, optname, optval, optlen);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 static gint
 mono_w32socket_listen (SOCKET sock, gint backlog)
 {
-       return listen (sock, backlog);
+       gint ret;
+       MONO_ENTER_GC_SAFE;
+       ret = listen (sock, backlog);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 static gint
 mono_w32socket_shutdown (SOCKET sock, gint how)
 {
-       return shutdown (sock, how);
+       gint ret;
+       MONO_ENTER_GC_SAFE;
+       ret = shutdown (sock, how);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 static gint
 mono_w32socket_ioctl (SOCKET sock, gint32 command, gchar *input, gint inputlen, gchar *output, gint outputlen, glong *written)
 {
-       return WSAIoctl (sock, command, input, inputlen, output, outputlen, written, NULL, NULL);
+       gint ret;
+       MONO_ENTER_GC_SAFE;
+       ret = WSAIoctl (sock, command, input, inputlen, output, outputlen, written, NULL, NULL);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 static gboolean
 mono_w32socket_close (SOCKET sock)
 {
-       return CloseHandle (sock);
+       gboolean ret;
+       MONO_ENTER_GC_SAFE;
+       ret = CloseHandle (sock);
+       MONO_EXIT_GC_SAFE;
+       return ret;
 }
 
 #endif /* HOST_WIN32 */
@@ -745,9 +785,7 @@ ves_icall_System_Net_Sockets_Socket_Close_internal (gsize sock, gint32 *werror,
         * polling system does not notify when the socket is closed */
        mono_threadpool_io_remove_socket (GPOINTER_TO_INT (sock));
 
-       MONO_ENTER_GC_SAFE;
        mono_w32socket_close ((SOCKET) sock);
-       MONO_EXIT_GC_SAFE;
 }
 
 gint32
@@ -805,10 +843,7 @@ ves_icall_System_Net_Sockets_Socket_Accept_internal (gsize sock, gint32 *werror,
                return NULL;
        }
 
-       MONO_ENTER_GC_SAFE;
        newsock = mono_w32socket_accept (sock, NULL, 0, blocking);
-       MONO_EXIT_GC_SAFE;
-
        if (newsock == INVALID_SOCKET)
                *werror = mono_w32socket_get_last_error ();
 
@@ -830,12 +865,7 @@ ves_icall_System_Net_Sockets_Socket_Listen_internal(gsize sock, guint32 backlog,
        error_init (error);
        *werror = 0;
 
-       MONO_ENTER_GC_SAFE;
-
        ret = mono_w32socket_listen (sock, backlog);
-
-       MONO_EXIT_GC_SAFE;
-
        if (ret == SOCKET_ERROR)
                *werror = mono_w32socket_get_last_error ();
 }
@@ -1031,12 +1061,7 @@ ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal (gsize sock, gint32 a
        }
        sa = (salen <= 128) ? (gchar *)alloca (salen) : (gchar *)g_malloc0 (salen);
 
-       MONO_ENTER_GC_SAFE;
-
        ret = mono_w32socket_getsockname (sock, (struct sockaddr *)sa, &salen);
-
-       MONO_EXIT_GC_SAFE;
-       
        if (ret == SOCKET_ERROR) {
                *werror = mono_w32socket_get_last_error ();
                if (salen > 128)
@@ -1070,12 +1095,7 @@ ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal (gsize sock, gint32
        sa = (salen <= 128) ? (gchar *)alloca (salen) : (gchar *)g_malloc0 (salen);
        /* Note: linux returns just 2 for AF_UNIX. Always. */
 
-       MONO_ENTER_GC_SAFE;
-
        ret = mono_w32socket_getpeername (sock, (struct sockaddr *)sa, &salen);
-
-       MONO_EXIT_GC_SAFE;
-
        if (ret == SOCKET_ERROR) {
                *werror = mono_w32socket_get_last_error ();
                if (salen > 128)
@@ -1358,10 +1378,7 @@ ves_icall_System_Net_Sockets_Socket_Connect_internal (gsize sock, MonoObjectHand
                return;
        }
 
-       MONO_ENTER_GC_SAFE;
        ret = mono_w32socket_connect (sock, sa, sa_size, blocking);
-       MONO_EXIT_GC_SAFE;
-
        if (ret == SOCKET_ERROR)
                *werror = mono_w32socket_get_last_error ();
 
@@ -1389,9 +1406,7 @@ ves_icall_System_Net_Sockets_Socket_Disconnect_internal (gsize sock, MonoBoolean
                return;
        }
 
-       MONO_ENTER_GC_SAFE;
        *werror = mono_w32socket_disconnect (sock, reuse);
-       MONO_EXIT_GC_SAFE;
 
        mono_thread_info_uninstall_interrupt (&interrupted);
        if (interrupted)
@@ -1399,6 +1414,20 @@ ves_icall_System_Net_Sockets_Socket_Disconnect_internal (gsize sock, MonoBoolean
 }
 #endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */
 
+MonoBoolean
+ves_icall_System_Net_Sockets_Socket_Duplicate_internal (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle, gint32 *werror, MonoError *error)
+{
+       error_init (error);
+
+       *werror = 0;
+       if (!mono_w32socket_duplicate (handle, targetProcessId, duplicate_handle)) {
+               *werror = mono_w32error_get_last ();
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
 gint32
 ves_icall_System_Net_Sockets_Socket_Receive_internal (gsize sock, MonoArrayHandle buffer, gint32 offset, gint32 count, gint32 flags, gint32 *werror, gboolean blocking, MonoError *error)
 {
@@ -1428,9 +1457,7 @@ ves_icall_System_Net_Sockets_Socket_Receive_internal (gsize sock, MonoArrayHandl
        uint32_t gchandle;
        gchar *buf = MONO_ARRAY_HANDLE_PIN (buffer, gchar, offset, &gchandle);
 
-       MONO_ENTER_GC_SAFE;
        ret = mono_w32socket_recv (sock, buf, count, recvflags, blocking);
-       MONO_EXIT_GC_SAFE;
 
        mono_gchandle_free (gchandle);
        
@@ -1475,9 +1502,7 @@ ves_icall_System_Net_Sockets_Socket_Receive_array_internal (gsize sock, MonoArra
        uint32_t gchandle;
        WSABUF *wsabufs = MONO_ARRAY_HANDLE_PIN (buffers, WSABUF, 0, &gchandle);
 
-       MONO_ENTER_GC_SAFE;
        ret = mono_w32socket_recvbuffers (sock, wsabufs, count, &recv, &recvflags, NULL, NULL, blocking);
-       MONO_EXIT_GC_SAFE;
 
        mono_gchandle_free (gchandle);
 
@@ -1534,9 +1559,7 @@ ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal (gsize sock, MonoArrayH
        uint32_t gchandle;
        buf = MONO_ARRAY_HANDLE_PIN (buffer, gchar, offset, &gchandle);
 
-       MONO_ENTER_GC_SAFE;
        ret = mono_w32socket_recvfrom (sock, buf, count, recvflags, sa, &sa_size, blocking);
-       MONO_EXIT_GC_SAFE;
 
        mono_gchandle_free (gchandle);
 
@@ -1606,9 +1629,7 @@ ves_icall_System_Net_Sockets_Socket_Send_internal (gsize sock, MonoArrayHandle b
        uint32_t gchandle;
        gchar *buf = MONO_ARRAY_HANDLE_PIN (buffer, gchar, offset, &gchandle);
 
-       MONO_ENTER_GC_SAFE;
        ret = mono_w32socket_send (sock, buf, count, sendflags, blocking);
-       MONO_EXIT_GC_SAFE;
 
        mono_gchandle_free (gchandle);
 
@@ -1653,9 +1674,7 @@ ves_icall_System_Net_Sockets_Socket_Send_array_internal (gsize sock, MonoArrayHa
        uint32_t gchandle;
        WSABUF *wsabufs = MONO_ARRAY_HANDLE_PIN (buffers, WSABUF, 0, &gchandle);
 
-       MONO_ENTER_GC_SAFE;
        ret = mono_w32socket_sendbuffers (sock, wsabufs, count, &sent, sendflags, NULL, NULL, blocking);
-       MONO_EXIT_GC_SAFE;
 
        mono_gchandle_free (gchandle);
 
@@ -1715,9 +1734,7 @@ ves_icall_System_Net_Sockets_Socket_SendTo_internal (gsize sock, MonoArrayHandle
        uint32_t gchandle;
        gchar *buf = MONO_ARRAY_HANDLE_PIN (buffer, gchar, offset, &gchandle);
 
-       MONO_ENTER_GC_SAFE;
        ret = mono_w32socket_sendto (sock, buf, count, sendflags, sa, sa_size, blocking);
-       MONO_EXIT_GC_SAFE;
 
        mono_gchandle_free (gchandle);
 
@@ -1965,8 +1982,6 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal (gsize sock, gi
                return;
        }
 
-       MONO_ENTER_GC_SAFE;
-
        /* No need to deal with MulticastOption names here, because
         * you cant getsockopt AddMembership or DropMembership (the
         * int getsockopt will error, causing an exception)
@@ -1992,8 +2007,6 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal (gsize sock, gi
                ret = mono_w32socket_getsockopt (sock, system_level, system_name, &val, &valsize);
        }
 
-       MONO_EXIT_GC_SAFE;
-
        if (ret == SOCKET_ERROR) {
                *werror = mono_w32socket_get_last_error ();
                return;
@@ -2111,12 +2124,8 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal (gsize sock, gi
        uint32_t gchandle;
        guchar *buf = MONO_ARRAY_HANDLE_PIN (byte_val, guchar, 0, &gchandle);
 
-       MONO_ENTER_GC_SAFE;
-
        ret = mono_w32socket_getsockopt (sock, system_level, system_name, buf, &valsize);
 
-       MONO_EXIT_GC_SAFE;
-
        mono_gchandle_free (gchandle);
 
        if (ret == SOCKET_ERROR)
@@ -2425,13 +2434,8 @@ ves_icall_System_Net_Sockets_Socket_Shutdown_internal (gsize sock, gint32 how, g
                return;
        }
 
-       MONO_ENTER_GC_SAFE;
-
        /* Currently, the values for how (recv=0, send=1, both=2) match the BSD API */
        ret = mono_w32socket_shutdown (sock, how);
-
-       MONO_EXIT_GC_SAFE;
-
        if (ret == SOCKET_ERROR)
                *werror = mono_w32socket_get_last_error ();
 
@@ -2476,12 +2480,8 @@ ves_icall_System_Net_Sockets_Socket_IOControl_internal (gsize sock, gint32 code,
                o_buffer = MONO_ARRAY_HANDLE_PIN (output, gchar, 0, &o_gchandle);
        }
 
-       MONO_ENTER_GC_SAFE;
-
        ret = mono_w32socket_ioctl (sock, code, i_buffer, i_len, o_buffer, o_len, &output_bytes);
 
-       MONO_EXIT_GC_SAFE;
-
        if (i_gchandle)
                mono_gchandle_free (i_gchandle);
        if (o_gchandle)
@@ -2709,14 +2709,14 @@ ves_icall_System_Net_Dns_GetHostByAddr_internal (MonoStringHandle addr, MonoStri
 
        g_free (address);
 
-       MONO_ENTER_GC_SAFE;
-
        switch (family) {
        case AF_INET: {
 #if HAVE_SOCKADDR_IN_SIN_LEN
                saddr.sin_len = sizeof (saddr);
 #endif
+               MONO_ENTER_GC_SAFE;
                ret = getnameinfo ((struct sockaddr*)&saddr, sizeof (saddr), hostname, sizeof (hostname), NULL, 0, 0) == 0;
+               MONO_EXIT_GC_SAFE;
                break;
        }
 #ifdef HAVE_STRUCT_SOCKADDR_IN6
@@ -2724,7 +2724,9 @@ ves_icall_System_Net_Dns_GetHostByAddr_internal (MonoStringHandle addr, MonoStri
 #if HAVE_SOCKADDR_IN6_SIN_LEN
                saddr6.sin6_len = sizeof (saddr6);
 #endif
+               MONO_ENTER_GC_SAFE;
                ret = getnameinfo ((struct sockaddr*)&saddr6, sizeof (saddr6), hostname, sizeof (hostname), NULL, 0, 0) == 0;
+               MONO_EXIT_GC_SAFE;
                break;
        }
 #endif
@@ -2732,8 +2734,6 @@ ves_icall_System_Net_Dns_GetHostByAddr_internal (MonoStringHandle addr, MonoStri
                g_assert_not_reached ();
        }
 
-       MONO_EXIT_GC_SAFE;
-
        if (!ret)
                return FALSE;
 
@@ -2807,9 +2807,7 @@ ves_icall_System_Net_Sockets_Socket_SendFile_internal (gsize sock, MonoStringHan
                buffers.TailLength = mono_array_handle_length (post_buffer);
        }
 
-       MONO_ENTER_GC_SAFE;
        ret = mono_w32socket_transmit_file (sock, file, &buffers, flags, blocking);
-       MONO_EXIT_GC_SAFE;
 
        if (pre_buffer_gchandle)
                mono_gchandle_free (pre_buffer_gchandle);
index 1788e2175bd517655a0c2125a03587ec53b7b38d..9fcd2341d7825e05b7aeb5065ce87acc0d2f94d0 100644 (file)
@@ -278,6 +278,9 @@ ves_icall_System_Net_Sockets_Socket_Poll_internal (gsize sock, gint mode, gint t
 void
 ves_icall_System_Net_Sockets_Socket_Disconnect_internal (gsize sock, MonoBoolean reuse, gint32 *werror, MonoError *error);
 
+MonoBoolean
+ves_icall_System_Net_Sockets_Socket_Duplicate_internal (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle, gint32 *werror, MonoError *error);
+
 gboolean
 ves_icall_System_Net_Sockets_Socket_SendFile_internal (gsize sock, MonoStringHandle filename,
                                                       MonoArrayHandle pre_buffer, MonoArrayHandle post_buffer,
index 427956296ab3d03998acbb2b8dc49b09b3b49670..848f75d3fe1544ed2dedbd459355d7c30a563280 100755 (executable)
@@ -488,12 +488,14 @@ common_sources = \
        type-checking.c \
        lldb.h                  \
        lldb.c  \
-       memory-access.c
+       memory-access.c \
+       mini-profiler.c
 
 test_sources =                         \
        basic-calls.cs          \
        basic-long.cs           \
        bench.cs                \
+       builtin-types.cs        \
        objects.cs              \
        arrays.cs               \
        basic-float.cs          \
@@ -519,6 +521,7 @@ regtests_UNIVERSAL = \
        basic-float.exe \
        basic-long.exe \
        basic-calls.exe \
+       builtin-types.exe \
        objects.exe \
        arrays.exe \
        basic-math.exe \
@@ -533,7 +536,7 @@ regtests_UNIVERSAL = \
 regtests_DISABLED = 
 
 if FULL_AOT_TESTS
-regtests_DISABLED += 
+regtests_DISABLED += builtin-types.exe
 endif
 
 regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL))
@@ -651,6 +654,9 @@ basic-simd.exe: basic-simd.cs TestDriver.dll
 basic-vectors.exe: basic-vectors.cs TestDriver.dll
        $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/System.Numerics.dll -r:$(CLASS)/System.Numerics.Vectors.dll
 
+builtin-types.exe: builtin-types.cs TestDriver.dll
+       $(MCS) -out:$@ $(CSFLAGS) -define:ARCH_$(shell echo $$((8 * $(SIZEOF_VOID_P)))) $< -r:TestDriver.dll
+
 nacl.exe: nacl.cs TestDriver.dll
        $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
 
index a9a477767b6c6f34dee6e1a1689090df86220bb6..c2dd1b28eebe419ab43ba79e3b25c250012db779 100644 (file)
@@ -6741,10 +6741,6 @@ emit_trampolines (MonoAotCompile *acfg)
 #ifdef DISABLE_REMOTING
                        if (tramp_type == MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING)
                                continue;
-#endif
-#ifndef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
-                       if (tramp_type == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD)
-                               continue;
 #endif
                        mono_arch_create_generic_trampoline ((MonoTrampolineType)tramp_type, &info, acfg->aot_opts.use_trampolines_page? 2: TRUE);
                        emit_trampoline (acfg, acfg->got_offset, info);
@@ -6825,11 +6821,6 @@ emit_trampolines (MonoAotCompile *acfg)
                        }
                }
 
-#ifdef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD_AOT
-               mono_arch_create_handler_block_trampoline (&info, TRUE);
-               emit_trampoline (acfg, acfg->got_offset, info);
-#endif
-
                if (mono_aot_mode_is_interp (&acfg->aot_opts)) {
                        mono_arch_get_enter_icall_trampoline (&info);
                        emit_trampoline (acfg, acfg->got_offset, info);
@@ -11631,7 +11622,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
 #ifdef ENABLE_LLVM
        if (acfg->llvm) {
                llvm_acfg = acfg;
-               mono_llvm_create_aot_module (acfg->image->assembly, acfg->global_prefix, TRUE, acfg->aot_opts.static_link, acfg->aot_opts.llvm_only);
+               mono_llvm_create_aot_module (acfg->image->assembly, acfg->global_prefix, acfg->nshared_got_entries, TRUE, acfg->aot_opts.static_link, acfg->aot_opts.llvm_only);
        }
 #endif
 
index 7b28d8db4a28bc9c6df49dd5a331c5c54216c924..01c2fe883933e8922c563f7ba899d0e22c4de338 100644 (file)
@@ -3005,6 +3005,7 @@ decode_exception_debug_info (MonoAotModule *amodule, MonoDomain *domain,
                                g_slist_free (nesting [i]);
                        g_free (nesting);
                }
+               jinfo->from_llvm = 1;
        } else {
                len = mono_jit_info_size (flags, num_clauses, num_holes);
                jinfo = (MonoJitInfo *)alloc0_jit_info_data (domain, len, async);
@@ -4633,24 +4634,6 @@ mono_aot_get_method_checked (MonoDomain *domain, MonoMethod *method, MonoError *
        return code;
 }
 
-/*
- * mono_aot_get_method:
- *
- *   Return a pointer to the AOTed native code for METHOD if it can be found,
- * NULL otherwise.
- * On platforms with function pointers, this doesn't return a function pointer.
- */
-gpointer
-mono_aot_get_method (MonoDomain *domain, MonoMethod *method)
-{
-       MonoError error;
-
-       gpointer res = mono_aot_get_method_checked (domain, method, &error);
-       /* This is external only, so its ok to raise here */
-       mono_error_raise_exception (&error); /* OK to throw, external only without a good alternative */
-       return res;
-}
-
 /**
  * Same as mono_aot_get_method, but we try to avoid loading any metadata from the
  * method.
index 36c7a15a3e8fe91e1c44ebe8d40cf6546c441994..7f3dafea5c602ab31d1db9590fca9253b7f2a265 100644 (file)
@@ -4,6 +4,7 @@ using System.Linq;
 using System.Reflection;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
+using System.Collections;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 
@@ -485,4 +486,16 @@ class Tests
                m.Invoke (arr, null);
                return 0;
        }
+
+       public static int test_0_fault_clauses () {
+               object [] data = { 1, 2, 3 };
+               int [] expected = { 1, 2, 3 };
+
+               try {
+                       Action d = delegate () { data.Cast<IEnumerable> ().GetEnumerator ().MoveNext (); };
+                       d ();
+               } catch (Exception ex) {
+               }
+               return 0;
+       }
 }
diff --git a/mono/mini/builtin-types.cs b/mono/mini/builtin-types.cs
new file mode 100644 (file)
index 0000000..ff4f689
--- /dev/null
@@ -0,0 +1,2396 @@
+// #define ARCH_32
+#define NINT_JIT_OPTIMIZED
+
+using System;
+using System.Diagnostics;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+
+public class BuiltinTests {
+       static int test_0_nint_ctor ()
+       {
+               var x = new nint (10);
+               var y = new nint (x);
+               var z = new nint (new nint (20));
+               if ((int)x != 10)
+                       return 1;
+               if ((int)y != 10)
+                       return 2;
+               if ((int)z != 20)
+                       return 3;
+               return 0;
+       }
+
+       static int test_0_nint_casts ()
+       {
+               var x = (nint)10;
+               var y = (nint)20L;
+
+               if ((int)x != 10)
+                       return 1;
+               if ((long)x != 10L)
+                       return 2;
+               if ((int)y != 20)
+                       return 3;
+               if ((long)y != 20L)
+                       return 4;
+               return 0;
+       }
+
+       static int test_0_nint_plus ()
+       {
+               var x = (nint)10;
+               var z = +x;
+               if ((int)z != 10)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_neg ()
+       {
+               var x = (nint)10;
+               var z = -x;
+               if ((int)z != -10)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_comp ()
+       {
+               var x = (nint)10;
+               var z = ~x;
+               if ((int)z != ~10)
+                       return 1;
+               return 0;
+       }
+
+#if FALSE
+       static int test_0_nint_inc ()
+       {
+               var x = (nint)10;
+               ++x;
+               if ((int)x != 11)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_dec ()
+       {
+               var x = (nint)10;
+               --x;
+               if ((int)x != 9)
+                       return 1;
+               return 0;
+       }
+#endif
+
+       static int test_0_nint_add ()
+       {
+               var x = (nint)10;
+               var y = (nint)20;
+               var z = x + y;
+               if ((int)z != 30)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_sub ()
+       {
+               var x = (nint)10;
+               var y = (nint)20;
+               var z = x - y;
+               if ((int)z != -10)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_mul ()
+       {
+               var x = (nint)10;
+               var y = (nint)20;
+               var z = x * y;
+               if ((int)z != 200)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_div ()
+       {
+               var x = (nint)30;
+               var y = (nint)3;
+               var z = x / y;
+               if ((int)z != 10)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_rem ()
+       {
+               var x = (nint)22;
+               var y = (nint)10;
+               var z = x % y;
+               if ((int)z != 2)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_and ()
+       {
+               var x = (nint)0x30;
+               var y = (nint)0x11;
+               var z = x & y;
+               if ((int)z != 0x10)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_or ()
+       {
+               var x = (nint)0x0F;
+               var y = (nint)0xF0;
+               var z = x | y;
+               if ((int)z != 0xFF)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_xor ()
+       {
+               var x = (nint)0xFF;
+               var y = (nint)0xF0;
+               var z = x ^ y;
+               if ((int)z != 0x0F)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_shl ()
+       {
+               var x = (nint)10;
+               var z = x << 2;
+               if ((int)z != 40)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_shr ()
+       {
+               var x = (nint)10;
+               var z = x >> 2;
+               if ((int)z != 2)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nint_cmp_same_val ()
+       {
+               var x = (nint)10;
+               var y = (nint)10;
+               if (!(x == y))
+                       return 1;
+               if (x != y)
+                       return 2;
+               if (x < y)
+                       return 3;
+               if (x > y)
+                       return 4;
+               if (!(x <= y))
+                       return 5;
+               if (!(x >= y))
+                       return 6;
+               return 0;
+       }
+
+       static int test_0_nint_cmp_small_val ()
+       {
+               var x = (nint)5;
+               var y = (nint)10;
+               if (x == y)
+                       return 1;
+               if (!(x != y))
+                       return 2;
+               if (!(x < y))
+                       return 3;
+               if (x > y)
+                       return 4;
+               if (!(x <= y))
+                       return 5;
+               if (x >= y)
+                       return 6;
+               return 0;
+       }
+
+       static int test_0_nint_cmp_large_val ()
+       {
+               var x = (nint)20;
+               var y = (nint)10;
+               if (x == y)
+                       return 1;
+               if (!(x != y))
+                       return 2;
+               if (x < y)
+                       return 3;
+               if (!(x > y))
+                       return 4;
+               if (x <= y)
+                       return 1;
+               if (!(x >= y))
+                       return 1;
+               return 0;
+       }
+
+       // static int test_0_nint_call_boxed_equals ()
+       // {
+       //      object x = new nint (10);
+       //      object y = new nint (10);
+       //      if (!x.Equals (y))
+       //              return 1;
+       //      return 0;
+       // }
+
+       static int test_0_nint_call_boxed_funs ()
+       {
+               object x = new nint (10);
+               object y = new nint (10);
+               if (x.GetHashCode () == 0)
+                       return 2;
+               if (x.ToString () != "10")
+                       return 3;
+               return 0;
+       }
+
+       public int test_0_nint_unboxed_member_calls ()
+       {
+               var x = (nint)10;
+#if FALSE
+               if (!x.Equals (x))
+                       return 1;
+#endif
+               if (x != nint.Parse ("10"))
+                       return 2;
+               return 0;
+       }
+
+       static int test_0_nuint_ctor ()
+       {
+               var x = new nuint (10u);
+               var y = new nuint (x);
+               var z = new nuint (new nuint (20u));
+               if ((uint)x != 10)
+                       return 1;
+               if ((uint)y != 10)
+                       return 2;
+               if ((uint)z != 20)
+                       return 3;
+               return 0;
+       }
+
+       static int test_0_nuint_casts ()
+       {
+               var x = (nuint)10;
+               var y = (nuint)20L;
+
+               if ((uint)x != 10)
+                       return 1;
+               if ((ulong)x != 10L)
+                       return 2;
+               if ((uint)y != 20)
+                       return 3;
+               if ((ulong)y != 20L)
+                       return 4;
+               return 0;
+       }
+
+       static int test_0_nuint_plus ()
+       {
+               var x = (nuint)10;
+               var z = +x;
+               if ((uint)z != 10)
+                       return 1;
+               return 0;
+       }
+
+       // static int test_0_nuint_neg ()
+       // {
+       //      var x = (nuint)10;
+       //      var z = -x;
+       //      if ((uint)z != -10)
+       //              return 1;
+       //      return 0;
+       // }
+
+       static int test_0_nuint_comp ()
+       {
+               var x = (nuint)10;
+               var z = ~x;
+               if ((uint)z != ~10u)
+                       return 1;
+               return 0;
+       }
+
+#if FALSE
+       static int test_0_nuint_inc ()
+       {
+               var x = (nuint)10;
+               ++x;
+               if ((uint)x != 11)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_dec ()
+       {
+               var x = (nuint)10;
+               --x;
+               if ((uint)x != 9)
+                       return 1;
+               return 0;
+       }
+#endif
+
+       static int test_0_nuint_add ()
+       {
+               var x = (nuint)10;
+               var y = (nuint)20;
+               var z = x + y;
+               if ((uint)z != 30)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_sub ()
+       {
+               var x = (nuint)20;
+               var y = (nuint)5;
+               var z = x - y;
+               if ((uint)z != 15)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_mul ()
+       {
+               var x = (nuint)10;
+               var y = (nuint)20;
+               var z = x * y;
+               if ((uint)z != 200)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_div ()
+       {
+               var x = (nuint)30;
+               var y = (nuint)3;
+               var z = x / y;
+               if ((uint)z != 10)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_rem ()
+       {
+               var x = (nuint)22;
+               var y = (nuint)10;
+               var z = x % y;
+               if ((uint)z != 2)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_and ()
+       {
+               var x = (nuint)0x30;
+               var y = (nuint)0x11;
+               var z = x & y;
+               if ((uint)z != 0x10)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_or ()
+       {
+               var x = (nuint)0x0F;
+               var y = (nuint)0xF0;
+               var z = x | y;
+               if ((uint)z != 0xFF)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_xor ()
+       {
+               var x = (nuint)0xFF;
+               var y = (nuint)0xF0;
+               var z = x ^ y;
+               if ((uint)z != 0x0F)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_shl ()
+       {
+               var x = (nuint)10;
+               var z = x << 2;
+               if ((uint)z != 40)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_shr ()
+       {
+               var x = (nuint)10;
+               var z = x >> 2;
+               if ((uint)z != 2)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nuint_cmp_same_val ()
+       {
+               var x = (nuint)10;
+               var y = (nuint)10;
+               if (!(x == y))
+                       return 1;
+               if (x != y)
+                       return 2;
+               if (x < y)
+                       return 3;
+               if (x > y)
+                       return 4;
+               if (!(x <= y))
+                       return 5;
+               if (!(x >= y))
+                       return 6;
+               return 0;
+       }
+
+       static int test_0_nuint_cmp_small_val ()
+       {
+               var x = (nuint)5;
+               var y = (nuint)10;
+               if (x == y)
+                       return 1;
+               if (!(x != y))
+                       return 2;
+               if (!(x < y))
+                       return 3;
+               if (x > y)
+                       return 4;
+               if (!(x <= y))
+                       return 5;
+               if (x >= y)
+                       return 6;
+               return 0;
+       }
+
+       static int test_0_nuint_cmp_large_val ()
+       {
+               var x = (nuint)20;
+               var y = (nuint)10;
+               if (x == y)
+                       return 1;
+               if (!(x != y))
+                       return 2;
+               if (x < y)
+                       return 3;
+               if (!(x > y))
+                       return 4;
+               if (x <= y)
+                       return 1;
+               if (!(x >= y))
+                       return 1;
+               return 0;
+       }
+
+       // static int test_0_nuint_call_boxed_equals ()
+       // {
+       //      object x = new nuint (10);
+       //      object y = new nuint (10);
+       //      if (!x.Equals (y))
+       //              return 1;
+       //      return 0;
+       // }
+
+       static int test_0_nuint_call_boxed_funs ()
+       {
+               object x = new nuint (10u);
+               object y = new nuint (10u);
+               if (x.GetHashCode () == 0)
+                       return 2;
+               if (x.ToString () != "10")
+                       return 3;
+               return 0;
+       }
+
+       public int test_0_nuint_unboxed_member_calls ()
+       {
+               var x = (nuint)10;
+#if FALSE
+               if (!x.Equals (x))
+                       return 1;
+#endif
+               if (x != nuint.Parse ("10"))
+                       return 2;
+               return 0;
+       }
+
+       static int test_0_nfloat_ctor ()
+       {
+               var x = new nfloat (10.0f);
+               var y = new nfloat (x);
+               var z = new nfloat (new nfloat (20f));
+               if ((float)x != 10f)
+                       return 1;
+               if ((float)y != 10f)
+                       return 2;
+               if ((float)z != 20f)
+                       return 3;
+               return 0;
+       }
+
+       static int test_0_nfloat_casts ()
+       {
+               var x = (nfloat)10f;
+
+               if ((float)x != 10f)
+                       return 1;
+               if ((double)x != 10)
+                       return 2;
+#if FALSE
+               var y = (nfloat)20;
+               if ((float)y != 20f)
+                       return 3;
+               if ((double)y != 20)
+                       return 4;
+#endif
+               return 0;
+       }
+
+       static int test_0_nfloat_plus ()
+       {
+               var x = (nfloat)10f;
+               var z = +x;
+               if ((float)z != 10f)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nfloat_neg ()
+       {
+               var x = (nfloat)10f;
+               var z = -x;
+               if ((float)z != -10f)
+                       return 1;
+               return 0;
+       }
+
+#if FALSE
+       static int test_0_nfloat_inc ()
+       {
+               var x = (nfloat)10f;
+               ++x;
+               if ((float)x != 11f) {
+                       Console.WriteLine ((float)x);
+                       return 1;
+               }
+               return 0;
+       }
+
+       static int test_0_nfloat_dec ()
+       {
+               var x = (nfloat)10f;
+               --x;
+               if ((float)x != 9f) {
+                       Console.WriteLine ((float)x);
+                       return 1;
+               }
+               return 0;
+       }
+#endif
+
+       static int test_0_nfloat_add ()
+       {
+               var x = (nfloat)10f;
+               var y = (nfloat)20f;
+               var z = x + y;
+               if ((float)z != 30f)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nfloat_sub ()
+       {
+               var x = (nfloat)10f;
+               var y = (nfloat)20f;
+               var z = x - y;
+               if ((float)z != -10f)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nfloat_mul ()
+       {
+               var x = (nfloat)10f;
+               var y = (nfloat)20f;
+               var z = x * y;
+               if ((float)z != 200f)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nfloat_div ()
+       {
+               var x = (nfloat)30f;
+               var y = (nfloat)3f;
+               var z = x / y;
+               if ((float)z != 10f)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nfloat_rem ()
+       {
+               var x = (nfloat)22f;
+               var y = (nfloat)10f;
+               var z = x % y;
+               if ((float)z != 2f)
+                       return 1;
+               return 0;
+       }
+
+       static int test_0_nfloat_cmp_same_val ()
+       {
+               var x = (nfloat)10f;
+               var y = (nfloat)10f;
+               if (!(x == y))
+                       return 1;
+               if (x != y)
+                       return 2;
+               if (x < y)
+                       return 3;
+               if (x > y)
+                       return 4;
+               if (!(x <= y))
+                       return 5;
+               if (!(x >= y))
+                       return 6;
+               return 0;
+       }
+
+       static int test_0_nfloat_cmp_small_val ()
+       {
+               var x = (nfloat)5f;
+               var y = (nfloat)10f;
+               if (x == y)
+                       return 1;
+               if (!(x != y))
+                       return 2;
+               if (!(x < y))
+                       return 3;
+               if (x > y)
+                       return 4;
+               if (!(x <= y))
+                       return 5;
+               if (x >= y)
+                       return 6;
+               return 0;
+       }
+
+       static int test_0_nfloat_cmp_large_val ()
+       {
+               var x = (nfloat)20f;
+               var y = (nfloat)10f;
+               if (x == y)
+                       return 1;
+               if (!(x != y))
+                       return 2;
+               if (x < y)
+                       return 3;
+               if (!(x > y))
+                       return 4;
+               if (x <= y)
+                       return 1;
+               if (!(x >= y))
+                       return 1;
+               return 0;
+       }
+
+       /* fails on arm64 */
+#if FALSE
+       static int test_0_nfloat_cmp_left_nan ()
+       {
+               var x = (nfloat)float.NaN;
+               var y = (nfloat)10f;
+               if (x == y)
+                       return 1;
+               if (!(x != y))
+                       return 2;
+               if (x < y)
+                       return 3;
+               if (x > y)
+                       return 4;
+               if (x <= y)
+                       return 1;
+               if (x >= y)
+                       return 1;
+               return 0;
+       }
+
+
+       static int test_0_nfloat_cmp_right_nan ()
+       {
+               var x = (nfloat)10f;
+               var y = (nfloat)float.NaN;
+               if (x == y)
+                       return 1;
+               if (!(x != y))
+                       return 2;
+               if (x < y)
+                       return 3;
+               if (x > y)
+                       return 4;
+               if (x <= y)
+                       return 1;
+               if (x >= y)
+                       return 1;
+               return 0;
+       }
+#endif
+
+       // static int test_0_nfloat_call_boxed_equals ()
+       // {
+       //      object x = new nfloat (10f);
+       //      object y = new nfloat (10f);
+       //      if (!x.Equals (y))
+       //              return 1;
+       //      return 0;
+       // }
+
+       static int test_0_nfloat_call_boxed_funs ()
+       {
+               object x = new nfloat (10f);
+               object y = new nfloat (10f);
+               if (x.GetHashCode () == 0)
+                       return 2;
+               if (x.ToString () != "10")
+                       return 3;
+               return 0;
+       }
+
+       public int test_0_nfloat_unboxed_member_calls ()
+       {
+               var x = (nfloat)10f;
+#if FALSE
+               if (!x.Equals (x))
+                       return 1;
+#endif
+               if (x != nfloat.Parse ("10"))
+                       return 2;
+               return 0;
+       }
+
+       public static int Main (String[] args) {
+               return TestDriver.RunTests (typeof (BuiltinTests), args);
+       }
+}
+
+
+// !!! WARNING - GENERATED CODE - DO NOT EDIT !!!
+//
+// Generated by NativeTypes.tt, a T4 template.
+//
+// NativeTypes.cs: basic types with 32 or 64 bit sizes:
+//
+//   - nint
+//   - nuint
+//   - nfloat
+//
+// Authors:
+//   Aaron Bockover <abock@xamarin.com>
+//
+// Copyright 2013 Xamarin, Inc. All rights reserved.
+//
+
+namespace System
+{
+       [Serializable]
+       [DebuggerDisplay ("{v,nq}")]
+       public unsafe struct nint : IFormattable, IConvertible, IComparable, IComparable<nint>, IEquatable <nint>
+       {
+               internal nint (nint v) { this.v = v.v; }
+               public nint (Int32 v) { this.v = v; }
+
+#if ARCH_32
+               public static readonly int Size = 4;
+
+               public static readonly nint MaxValue = Int32.MaxValue;
+               public static readonly nint MinValue = Int32.MinValue;
+
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
+               internal Int32 v;
+
+               public nint (Int64 v) { this.v = (Int32)v; }
+#else
+               public static readonly int Size = 8;
+
+               public static readonly nint MaxValue = (nint) Int64.MaxValue; // 64-bit only codepath
+               public static readonly nint MinValue = (nint) Int64.MinValue; // 64-bit only codepath
+
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
+               internal Int64 v;
+
+               public nint (Int64 v) { this.v = v; }
+#endif
+
+               public static explicit operator nint (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v.v);
+#else
+                       return new nint ((long)v.v);
+#endif
+               }
+
+               public static explicit operator nuint (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v.v);
+#else
+                       return new nuint ((ulong)v.v);
+#endif
+               }
+
+               public static explicit operator nint (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v.v);
+#else
+                       return new nint ((long)v.v);
+#endif
+               }
+
+               public static implicit operator nfloat (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v.v);
+#else
+                       return new nfloat ((double)v.v);
+#endif
+               }
+
+               public static explicit operator nint (IntPtr v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint (*((int *)&v));
+#else
+                       return new nint (*((long *)&v));
+#endif
+               }
+
+               public static explicit operator IntPtr (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return *((IntPtr *)&v.v);
+#else
+                       return *((IntPtr *)&v.v);
+#endif
+               }
+
+               public static implicit operator nint (sbyte v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static explicit operator sbyte (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (sbyte)v.v;
+#else
+                       return (sbyte)v.v;
+#endif
+               }
+
+               public static implicit operator nint (byte v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static explicit operator byte (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (byte)v.v;
+#else
+                       return (byte)v.v;
+#endif
+               }
+
+               public static implicit operator nint (char v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static explicit operator char (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (char)v.v;
+#else
+                       return (char)v.v;
+#endif
+               }
+
+               public static implicit operator nint (short v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static explicit operator short (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (short)v.v;
+#else
+                       return (short)v.v;
+#endif
+               }
+
+               public static explicit operator nint (ushort v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static explicit operator ushort (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (ushort)v.v;
+#else
+                       return (ushort)v.v;
+#endif
+               }
+
+               public static implicit operator nint (int v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static explicit operator int (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (int)v.v;
+#else
+                       return (int)v.v;
+#endif
+               }
+
+               public static explicit operator nint (uint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static explicit operator uint (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (uint)v.v;
+#else
+                       return (uint)v.v;
+#endif
+               }
+
+               public static explicit operator nint (long v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static implicit operator long (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (long)v.v;
+#else
+                       return (long)v.v;
+#endif
+               }
+
+               public static explicit operator nint (ulong v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static explicit operator ulong (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (ulong)v.v;
+#else
+                       return (ulong)v.v;
+#endif
+               }
+
+               public static explicit operator nint (float v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static implicit operator float (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (float)v.v;
+#else
+                       return (float)v.v;
+#endif
+               }
+
+               public static explicit operator nint (double v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static implicit operator double (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (double)v.v;
+#else
+                       return (double)v.v;
+#endif
+               }
+
+               public static explicit operator nint (decimal v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nint ((int)v);
+#else
+                       return new nint ((long)v);
+#endif
+               }
+
+               public static implicit operator decimal (nint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (decimal)v.v;
+#else
+                       return (decimal)v.v;
+#endif
+               }
+
+#if NINT_JIT_OPTIMIZED
+               public static nint operator + (nint v) { throw new NotImplementedException (); }
+               public static nint operator - (nint v) { throw new NotImplementedException (); }
+               public static nint operator ~ (nint v) { throw new NotImplementedException (); }
+#else
+               public static nint operator + (nint v) { return new nint (+v.v); }
+               public static nint operator - (nint v) { return new nint (-v.v); }
+               public static nint operator ~ (nint v) { return new nint (~v.v); }
+#endif
+
+#if NINT_JIT_OPTIMIZED
+               public static nint operator ++ (nint v) { throw new NotImplementedException (); }
+               public static nint operator -- (nint v) { throw new NotImplementedException (); }
+#else
+               public static nint operator ++ (nint v) { return new nint (v.v + 1); }
+               public static nint operator -- (nint v) { return new nint (v.v - 1); }
+#endif
+
+#if NINT_JIT_OPTIMIZED
+               public static nint operator + (nint l, nint r) { throw new NotImplementedException (); }
+               public static nint operator - (nint l, nint r) { throw new NotImplementedException (); }
+               public static nint operator * (nint l, nint r) { throw new NotImplementedException (); }
+               public static nint operator / (nint l, nint r) { throw new NotImplementedException (); }
+               public static nint operator % (nint l, nint r) { throw new NotImplementedException (); }
+               public static nint operator & (nint l, nint r) { throw new NotImplementedException (); }
+               public static nint operator | (nint l, nint r) { throw new NotImplementedException (); }
+               public static nint operator ^ (nint l, nint r) { throw new NotImplementedException (); }
+
+               public static nint operator << (nint l, int r) { throw new NotImplementedException (); }
+               public static nint operator >> (nint l, int r) { throw new NotImplementedException (); }
+#else
+               public static nint operator + (nint l, nint r) { return new nint (l.v + r.v); }
+               public static nint operator - (nint l, nint r) { return new nint (l.v - r.v); }
+               public static nint operator * (nint l, nint r) { return new nint (l.v * r.v); }
+               public static nint operator / (nint l, nint r) { return new nint (l.v / r.v); }
+               public static nint operator % (nint l, nint r) { return new nint (l.v % r.v); }
+               public static nint operator & (nint l, nint r) { return new nint (l.v & r.v); }
+               public static nint operator | (nint l, nint r) { return new nint (l.v | r.v); }
+               public static nint operator ^ (nint l, nint r) { return new nint (l.v ^ r.v); }
+
+               public static nint operator << (nint l, int r) { return new nint (l.v << r); }
+               public static nint operator >> (nint l, int r) { return new nint (l.v >> r); }
+#endif
+
+#if NINT_JIT_OPTIMIZED
+               public static bool operator == (nint l, nint r) { throw new NotImplementedException (); }
+               public static bool operator != (nint l, nint r) { throw new NotImplementedException (); }
+               public static bool operator <  (nint l, nint r) { throw new NotImplementedException (); }
+               public static bool operator >  (nint l, nint r) { throw new NotImplementedException (); }
+               public static bool operator <= (nint l, nint r) { throw new NotImplementedException (); }
+               public static bool operator >= (nint l, nint r) { throw new NotImplementedException (); }
+#else
+               public static bool operator == (nint l, nint r) { return l.v == r.v; }
+               public static bool operator != (nint l, nint r) { return l.v != r.v; }
+               public static bool operator <  (nint l, nint r) { return l.v < r.v; }
+               public static bool operator >  (nint l, nint r) { return l.v > r.v; }
+               public static bool operator <= (nint l, nint r) { return l.v <= r.v; }
+               public static bool operator >= (nint l, nint r) { return l.v >= r.v; }
+#endif
+
+               public int CompareTo (nint value) { return v.CompareTo (value.v); }
+               public int CompareTo (object value)
+               {
+                       if (value is nint)
+                               return v.CompareTo (((nint) value).v);
+                       return v.CompareTo (value);
+               }
+               public bool Equals (nint obj) { return v.Equals (obj.v); }
+               public override bool Equals (object obj)
+               {
+                       if (obj is nint)
+                               return v.Equals (((nint) obj).v);
+                       return v.Equals (obj);
+               }
+               public override int GetHashCode () { return v.GetHashCode (); }
+
+#if ARCH_32
+               public static nint Parse (string s, IFormatProvider provider) { return (nint)Int32.Parse (s, provider); }
+               public static nint Parse (string s, NumberStyles style) { return (nint)Int32.Parse (s, style); }
+               public static nint Parse (string s) { return (nint)Int32.Parse (s); }
+               public static nint Parse (string s, NumberStyles style, IFormatProvider provider) {
+                       return (nint)Int32.Parse (s, style, provider);
+               }
+
+               public static bool TryParse (string s, out nint result)
+               {
+                       Int32 v;
+                       var r = Int32.TryParse (s, out v);
+                       result = (nint)v;
+                       return r;
+               }
+
+               public static bool TryParse (string s, NumberStyles style, IFormatProvider provider, out nint result)
+               {
+                       Int32 v;
+                       var r = Int32.TryParse (s, style, provider, out v);
+                       result = (nint)v;
+                       return r;
+               }
+#else
+               public static nint Parse (string s, IFormatProvider provider) { return (nint)Int64.Parse (s, provider); }
+               public static nint Parse (string s, NumberStyles style) { return (nint)Int64.Parse (s, style); }
+               public static nint Parse (string s) { return (nint)Int64.Parse (s); }
+               public static nint Parse (string s, NumberStyles style, IFormatProvider provider) {
+                       return (nint)Int64.Parse (s, style, provider);
+               }
+
+               public static bool TryParse (string s, out nint result)
+               {
+                       Int64 v;
+                       var r = Int64.TryParse (s, out v);
+                       result = (nint)v;
+                       return r;
+               }
+
+               public static bool TryParse (string s, NumberStyles style, IFormatProvider provider, out nint result)
+               {
+                       Int64 v;
+                       var r = Int64.TryParse (s, style, provider, out v);
+                       result = (nint)v;
+                       return r;
+               }
+#endif
+
+               public override string ToString () { return v.ToString (); }
+               public string ToString (IFormatProvider provider) { return v.ToString (provider); }
+               public string ToString (string format) { return v.ToString (format); }
+               public string ToString (string format, IFormatProvider provider) { return v.ToString (format, provider); }
+
+               public TypeCode GetTypeCode () { return v.GetTypeCode (); }
+
+               bool     IConvertible.ToBoolean  (IFormatProvider provider) { return ((IConvertible)v).ToBoolean (provider); }
+               byte     IConvertible.ToByte     (IFormatProvider provider) { return ((IConvertible)v).ToByte (provider); }
+               char     IConvertible.ToChar     (IFormatProvider provider) { return ((IConvertible)v).ToChar (provider); }
+               DateTime IConvertible.ToDateTime (IFormatProvider provider) { return ((IConvertible)v).ToDateTime (provider); }
+               decimal  IConvertible.ToDecimal  (IFormatProvider provider) { return ((IConvertible)v).ToDecimal (provider); }
+               double   IConvertible.ToDouble   (IFormatProvider provider) { return ((IConvertible)v).ToDouble (provider); }
+               short    IConvertible.ToInt16    (IFormatProvider provider) { return ((IConvertible)v).ToInt16 (provider); }
+               int      IConvertible.ToInt32    (IFormatProvider provider) { return ((IConvertible)v).ToInt32 (provider); }
+               long     IConvertible.ToInt64    (IFormatProvider provider) { return ((IConvertible)v).ToInt64 (provider); }
+               sbyte    IConvertible.ToSByte    (IFormatProvider provider) { return ((IConvertible)v).ToSByte (provider); }
+               float    IConvertible.ToSingle   (IFormatProvider provider) { return ((IConvertible)v).ToSingle (provider); }
+               ushort   IConvertible.ToUInt16   (IFormatProvider provider) { return ((IConvertible)v).ToUInt16 (provider); }
+               uint     IConvertible.ToUInt32   (IFormatProvider provider) { return ((IConvertible)v).ToUInt32 (provider); }
+               ulong    IConvertible.ToUInt64   (IFormatProvider provider) { return ((IConvertible)v).ToUInt64 (provider); }
+
+               object IConvertible.ToType (Type targetType, IFormatProvider provider) {
+                       return ((IConvertible)v).ToType (targetType, provider);
+               }
+
+               public static void CopyArray (IntPtr source, nint [] destination, int startIndex, int length)
+               {
+                       if (source == IntPtr.Zero)
+                               throw new ArgumentNullException ("source");
+                       if (destination == null)
+                               throw new ArgumentNullException ("destination");
+                       if (destination.Rank != 1)
+                               throw new ArgumentException ("destination", "array is multi-dimensional");
+                       if (startIndex < 0)
+                               throw new ArgumentException ("startIndex", "must be >= 0");
+                       if (length < 0)
+                               throw new ArgumentException ("length", "must be >= 0");
+                       if (startIndex + length > destination.Length)
+                               throw new ArgumentException ("length", "startIndex + length > destination.Length");
+
+                       for (int i = 0; i < length; i++)
+                               destination [i + startIndex] = (nint)Marshal.ReadIntPtr (source, i * nint.Size);
+               }
+
+               public static void CopyArray (nint [] source, int startIndex, IntPtr destination, int length)
+               {
+                       if (source == null)
+                               throw new ArgumentNullException ("source");
+                       if (destination == IntPtr.Zero)
+                               throw new ArgumentNullException ("destination");
+                       if (source.Rank != 1)
+                               throw new ArgumentException ("source", "array is multi-dimensional");
+                       if (startIndex < 0)
+                               throw new ArgumentException ("startIndex", "must be >= 0");
+                       if (length < 0)
+                               throw new ArgumentException ("length", "must be >= 0");
+                       if (startIndex + length > source.Length)
+                               throw new ArgumentException ("length", "startIndex + length > source.Length");
+
+                       for (int i = 0; i < length; i++)
+                               Marshal.WriteIntPtr (destination, i * nint.Size, (IntPtr)source [i + startIndex]);
+               }
+       }
+       [Serializable]
+       [DebuggerDisplay ("{v,nq}")]
+       public unsafe struct nuint : IFormattable, IConvertible, IComparable, IComparable<nuint>, IEquatable <nuint>
+       {
+               internal nuint (nuint v) { this.v = v.v; }
+               public nuint (UInt32 v) { this.v = v; }
+
+#if ARCH_32
+               public static readonly int Size = 4;
+
+               public static readonly nuint MaxValue = UInt32.MaxValue;
+               public static readonly nuint MinValue = UInt32.MinValue;
+
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
+               internal UInt32 v;
+
+               public nuint (UInt64 v) { this.v = (UInt32)v; }
+#else
+               public static readonly int Size = 8;
+
+               public static readonly nuint MaxValue = (nuint) UInt64.MaxValue; // 64-bit only codepath
+               public static readonly nuint MinValue = (nuint) UInt64.MinValue; // 64-bit only codepath
+
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
+               internal UInt64 v;
+
+               public nuint (UInt64 v) { this.v = v; }
+#endif
+
+               public static explicit operator nuint (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v.v);
+#else
+                       return new nuint ((ulong)v.v);
+#endif
+               }
+
+               public static implicit operator nfloat (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v.v);
+#else
+                       return new nfloat ((double)v.v);
+#endif
+               }
+
+               public static explicit operator nuint (IntPtr v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint (*((uint *)&v));
+#else
+                       return new nuint (*((ulong *)&v));
+#endif
+               }
+
+               public static explicit operator IntPtr (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return *((IntPtr *)&v.v);
+#else
+                       return *((IntPtr *)&v.v);
+#endif
+               }
+
+               public static explicit operator nuint (sbyte v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static explicit operator sbyte (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (sbyte)v.v;
+#else
+                       return (sbyte)v.v;
+#endif
+               }
+
+               public static implicit operator nuint (byte v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static explicit operator byte (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (byte)v.v;
+#else
+                       return (byte)v.v;
+#endif
+               }
+
+               public static implicit operator nuint (char v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static explicit operator char (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (char)v.v;
+#else
+                       return (char)v.v;
+#endif
+               }
+
+               public static explicit operator nuint (short v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static explicit operator short (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (short)v.v;
+#else
+                       return (short)v.v;
+#endif
+               }
+
+               public static implicit operator nuint (ushort v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static explicit operator ushort (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (ushort)v.v;
+#else
+                       return (ushort)v.v;
+#endif
+               }
+
+               public static explicit operator nuint (int v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static explicit operator int (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (int)v.v;
+#else
+                       return (int)v.v;
+#endif
+               }
+
+               public static implicit operator nuint (uint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static explicit operator uint (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (uint)v.v;
+#else
+                       return (uint)v.v;
+#endif
+               }
+
+               public static explicit operator nuint (long v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static explicit operator long (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (long)v.v;
+#else
+                       return (long)v.v;
+#endif
+               }
+
+               public static explicit operator nuint (ulong v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static implicit operator ulong (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (ulong)v.v;
+#else
+                       return (ulong)v.v;
+#endif
+               }
+
+               public static explicit operator nuint (float v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static implicit operator float (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (float)v.v;
+#else
+                       return (float)v.v;
+#endif
+               }
+
+               public static explicit operator nuint (double v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static implicit operator double (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (double)v.v;
+#else
+                       return (double)v.v;
+#endif
+               }
+
+               public static explicit operator nuint (decimal v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nuint ((uint)v);
+#else
+                       return new nuint ((ulong)v);
+#endif
+               }
+
+               public static implicit operator decimal (nuint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (decimal)v.v;
+#else
+                       return (decimal)v.v;
+#endif
+               }
+
+#if NINT_JIT_OPTIMIZED
+               public static nuint operator + (nuint v) { throw new NotImplementedException (); }
+               public static nuint operator ~ (nuint v) { throw new NotImplementedException (); }
+#else
+               public static nuint operator + (nuint v) { return new nuint (+v.v); }
+               public static nuint operator ~ (nuint v) { return new nuint (~v.v); }
+#endif
+
+#if NINT_JIT_OPTIMIZED
+               public static nuint operator ++ (nuint v) { throw new NotImplementedException (); }
+               public static nuint operator -- (nuint v) { throw new NotImplementedException (); }
+#else
+               public static nuint operator ++ (nuint v) { return new nuint (v.v + 1); }
+               public static nuint operator -- (nuint v) { return new nuint (v.v - 1); }
+#endif
+
+#if NINT_JIT_OPTIMIZED
+               public static nuint operator + (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static nuint operator - (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static nuint operator * (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static nuint operator / (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static nuint operator % (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static nuint operator & (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static nuint operator | (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static nuint operator ^ (nuint l, nuint r) { throw new NotImplementedException (); }
+
+               public static nuint operator << (nuint l, int r) { throw new NotImplementedException (); }
+               public static nuint operator >> (nuint l, int r) { throw new NotImplementedException (); }
+#else
+               public static nuint operator + (nuint l, nuint r) { return new nuint (l.v + r.v); }
+               public static nuint operator - (nuint l, nuint r) { return new nuint (l.v - r.v); }
+               public static nuint operator * (nuint l, nuint r) { return new nuint (l.v * r.v); }
+               public static nuint operator / (nuint l, nuint r) { return new nuint (l.v / r.v); }
+               public static nuint operator % (nuint l, nuint r) { return new nuint (l.v % r.v); }
+               public static nuint operator & (nuint l, nuint r) { return new nuint (l.v & r.v); }
+               public static nuint operator | (nuint l, nuint r) { return new nuint (l.v | r.v); }
+               public static nuint operator ^ (nuint l, nuint r) { return new nuint (l.v ^ r.v); }
+
+               public static nuint operator << (nuint l, int r) { return new nuint (l.v << r); }
+               public static nuint operator >> (nuint l, int r) { return new nuint (l.v >> r); }
+#endif
+
+#if NINT_JIT_OPTIMIZED
+               public static bool operator == (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static bool operator != (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static bool operator <  (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static bool operator >  (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static bool operator <= (nuint l, nuint r) { throw new NotImplementedException (); }
+               public static bool operator >= (nuint l, nuint r) { throw new NotImplementedException (); }
+#else
+               public static bool operator == (nuint l, nuint r) { return l.v == r.v; }
+               public static bool operator != (nuint l, nuint r) { return l.v != r.v; }
+               public static bool operator <  (nuint l, nuint r) { return l.v < r.v; }
+               public static bool operator >  (nuint l, nuint r) { return l.v > r.v; }
+               public static bool operator <= (nuint l, nuint r) { return l.v <= r.v; }
+               public static bool operator >= (nuint l, nuint r) { return l.v >= r.v; }
+#endif
+
+               public int CompareTo (nuint value) { return v.CompareTo (value.v); }
+               public int CompareTo (object value)
+               {
+                       if (value is nuint)
+                               return v.CompareTo (((nuint) value).v);
+                       return v.CompareTo (value);
+               }
+               public bool Equals (nuint obj) { return v.Equals (obj.v); }
+               public override bool Equals (object obj)
+               {
+                       if (obj is nuint)
+                               return v.Equals (((nuint) obj).v);
+                       return v.Equals (obj);
+               }
+               public override int GetHashCode () { return v.GetHashCode (); }
+
+#if ARCH_32
+               public static nuint Parse (string s, IFormatProvider provider) { return (nuint)UInt32.Parse (s, provider); }
+               public static nuint Parse (string s, NumberStyles style) { return (nuint)UInt32.Parse (s, style); }
+               public static nuint Parse (string s) { return (nuint)UInt32.Parse (s); }
+               public static nuint Parse (string s, NumberStyles style, IFormatProvider provider) {
+                       return (nuint)UInt32.Parse (s, style, provider);
+               }
+
+               public static bool TryParse (string s, out nuint result)
+               {
+                       UInt32 v;
+                       var r = UInt32.TryParse (s, out v);
+                       result = (nuint)v;
+                       return r;
+               }
+
+               public static bool TryParse (string s, NumberStyles style, IFormatProvider provider, out nuint result)
+               {
+                       UInt32 v;
+                       var r = UInt32.TryParse (s, style, provider, out v);
+                       result = (nuint)v;
+                       return r;
+               }
+#else
+               public static nuint Parse (string s, IFormatProvider provider) { return (nuint)UInt64.Parse (s, provider); }
+               public static nuint Parse (string s, NumberStyles style) { return (nuint)UInt64.Parse (s, style); }
+               public static nuint Parse (string s) { return (nuint)UInt64.Parse (s); }
+               public static nuint Parse (string s, NumberStyles style, IFormatProvider provider) {
+                       return (nuint)UInt64.Parse (s, style, provider);
+               }
+
+               public static bool TryParse (string s, out nuint result)
+               {
+                       UInt64 v;
+                       var r = UInt64.TryParse (s, out v);
+                       result = (nuint)v;
+                       return r;
+               }
+
+               public static bool TryParse (string s, NumberStyles style, IFormatProvider provider, out nuint result)
+               {
+                       UInt64 v;
+                       var r = UInt64.TryParse (s, style, provider, out v);
+                       result = (nuint)v;
+                       return r;
+               }
+#endif
+
+               public override string ToString () { return v.ToString (); }
+               public string ToString (IFormatProvider provider) { return v.ToString (provider); }
+               public string ToString (string format) { return v.ToString (format); }
+               public string ToString (string format, IFormatProvider provider) { return v.ToString (format, provider); }
+
+               public TypeCode GetTypeCode () { return v.GetTypeCode (); }
+
+               bool     IConvertible.ToBoolean  (IFormatProvider provider) { return ((IConvertible)v).ToBoolean (provider); }
+               byte     IConvertible.ToByte     (IFormatProvider provider) { return ((IConvertible)v).ToByte (provider); }
+               char     IConvertible.ToChar     (IFormatProvider provider) { return ((IConvertible)v).ToChar (provider); }
+               DateTime IConvertible.ToDateTime (IFormatProvider provider) { return ((IConvertible)v).ToDateTime (provider); }
+               decimal  IConvertible.ToDecimal  (IFormatProvider provider) { return ((IConvertible)v).ToDecimal (provider); }
+               double   IConvertible.ToDouble   (IFormatProvider provider) { return ((IConvertible)v).ToDouble (provider); }
+               short    IConvertible.ToInt16    (IFormatProvider provider) { return ((IConvertible)v).ToInt16 (provider); }
+               int      IConvertible.ToInt32    (IFormatProvider provider) { return ((IConvertible)v).ToInt32 (provider); }
+               long     IConvertible.ToInt64    (IFormatProvider provider) { return ((IConvertible)v).ToInt64 (provider); }
+               sbyte    IConvertible.ToSByte    (IFormatProvider provider) { return ((IConvertible)v).ToSByte (provider); }
+               float    IConvertible.ToSingle   (IFormatProvider provider) { return ((IConvertible)v).ToSingle (provider); }
+               ushort   IConvertible.ToUInt16   (IFormatProvider provider) { return ((IConvertible)v).ToUInt16 (provider); }
+               uint     IConvertible.ToUInt32   (IFormatProvider provider) { return ((IConvertible)v).ToUInt32 (provider); }
+               ulong    IConvertible.ToUInt64   (IFormatProvider provider) { return ((IConvertible)v).ToUInt64 (provider); }
+
+               object IConvertible.ToType (Type targetType, IFormatProvider provider) {
+                       return ((IConvertible)v).ToType (targetType, provider);
+               }
+
+               public static void CopyArray (IntPtr source, nuint [] destination, int startIndex, int length)
+               {
+                       if (source == IntPtr.Zero)
+                               throw new ArgumentNullException ("source");
+                       if (destination == null)
+                               throw new ArgumentNullException ("destination");
+                       if (destination.Rank != 1)
+                               throw new ArgumentException ("destination", "array is multi-dimensional");
+                       if (startIndex < 0)
+                               throw new ArgumentException ("startIndex", "must be >= 0");
+                       if (length < 0)
+                               throw new ArgumentException ("length", "must be >= 0");
+                       if (startIndex + length > destination.Length)
+                               throw new ArgumentException ("length", "startIndex + length > destination.Length");
+
+                       for (int i = 0; i < length; i++)
+                               destination [i + startIndex] = (nuint)Marshal.ReadIntPtr (source, i * nuint.Size);
+               }
+
+               public static void CopyArray (nuint [] source, int startIndex, IntPtr destination, int length)
+               {
+                       if (source == null)
+                               throw new ArgumentNullException ("source");
+                       if (destination == IntPtr.Zero)
+                               throw new ArgumentNullException ("destination");
+                       if (source.Rank != 1)
+                               throw new ArgumentException ("source", "array is multi-dimensional");
+                       if (startIndex < 0)
+                               throw new ArgumentException ("startIndex", "must be >= 0");
+                       if (length < 0)
+                               throw new ArgumentException ("length", "must be >= 0");
+                       if (startIndex + length > source.Length)
+                               throw new ArgumentException ("length", "startIndex + length > source.Length");
+
+                       for (int i = 0; i < length; i++)
+                               Marshal.WriteIntPtr (destination, i * nuint.Size, (IntPtr)source [i + startIndex]);
+               }
+       }
+       [Serializable]
+       [DebuggerDisplay ("{v,nq}")]
+       public unsafe struct nfloat : IFormattable, IConvertible, IComparable, IComparable<nfloat>, IEquatable <nfloat>
+       {
+               internal nfloat (nfloat v) { this.v = v.v; }
+               public nfloat (Single v) { this.v = v; }
+
+#if ARCH_32
+               public static readonly int Size = 4;
+
+               public static readonly nfloat MaxValue = Single.MaxValue;
+               public static readonly nfloat MinValue = Single.MinValue;
+               public static readonly nfloat Epsilon = (nfloat)Single.Epsilon;
+               public static readonly nfloat NaN = (nfloat)Single.NaN;
+               public static readonly nfloat NegativeInfinity = (nfloat)Single.NegativeInfinity;
+               public static readonly nfloat PositiveInfinity = (nfloat)Single.PositiveInfinity;
+
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
+               internal Single v;
+
+               public nfloat (Double v) { this.v = (Single)v; }
+#else
+               public static readonly int Size = 8;
+
+               public static readonly nfloat MaxValue = (nfloat) Double.MaxValue; // 64-bit only codepath
+               public static readonly nfloat MinValue = (nfloat) Double.MinValue; // 64-bit only codepath
+               public static readonly nfloat Epsilon = (nfloat)Double.Epsilon;
+               public static readonly nfloat NaN = (nfloat)Double.NaN;
+               public static readonly nfloat NegativeInfinity = (nfloat)Double.NegativeInfinity;
+               public static readonly nfloat PositiveInfinity = (nfloat)Double.PositiveInfinity;
+
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
+               internal Double v;
+
+               public nfloat (Double v) { this.v = v; }
+#endif
+
+               public static explicit operator nfloat (IntPtr v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat (*((float *)&v));
+#else
+                       return new nfloat (*((double *)&v));
+#endif
+               }
+
+               public static explicit operator IntPtr (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return *((IntPtr *)&v.v);
+#else
+                       return *((IntPtr *)&v.v);
+#endif
+               }
+
+               public static implicit operator nfloat (sbyte v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator sbyte (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (sbyte)v.v;
+#else
+                       return (sbyte)v.v;
+#endif
+               }
+
+               public static implicit operator nfloat (byte v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator byte (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (byte)v.v;
+#else
+                       return (byte)v.v;
+#endif
+               }
+
+               public static implicit operator nfloat (char v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator char (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (char)v.v;
+#else
+                       return (char)v.v;
+#endif
+               }
+
+               public static implicit operator nfloat (short v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator short (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (short)v.v;
+#else
+                       return (short)v.v;
+#endif
+               }
+
+               public static implicit operator nfloat (ushort v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator ushort (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (ushort)v.v;
+#else
+                       return (ushort)v.v;
+#endif
+               }
+
+               public static implicit operator nfloat (int v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator int (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (int)v.v;
+#else
+                       return (int)v.v;
+#endif
+               }
+
+               public static implicit operator nfloat (uint v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator uint (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (uint)v.v;
+#else
+                       return (uint)v.v;
+#endif
+               }
+
+               public static implicit operator nfloat (long v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator long (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (long)v.v;
+#else
+                       return (long)v.v;
+#endif
+               }
+
+               public static implicit operator nfloat (ulong v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator ulong (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (ulong)v.v;
+#else
+                       return (ulong)v.v;
+#endif
+               }
+
+               public static implicit operator nfloat (float v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator float (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (float)v.v;
+#else
+                       return (float)v.v;
+#endif
+               }
+
+               public static explicit operator nfloat (double v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static implicit operator double (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (double)v.v;
+#else
+                       return (double)v.v;
+#endif
+               }
+
+               public static explicit operator nfloat (decimal v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return new nfloat ((float)v);
+#else
+                       return new nfloat ((double)v);
+#endif
+               }
+
+               public static explicit operator decimal (nfloat v)
+               {
+#if NINT_JIT_OPTIMIZED
+                       throw new NotImplementedException ();
+#elif ARCH_32
+                       return (decimal)v.v;
+#else
+                       return (decimal)v.v;
+#endif
+               }
+
+#if NINT_JIT_OPTIMIZED
+               public static nfloat operator + (nfloat v) { throw new NotImplementedException (); }
+               public static nfloat operator - (nfloat v) { throw new NotImplementedException (); }
+#else
+               public static nfloat operator + (nfloat v) { return new nfloat (+v.v); }
+               public static nfloat operator - (nfloat v) { return new nfloat (-v.v); }
+#endif
+
+#if NINT_JIT_OPTIMIZED
+               public static nfloat operator ++ (nfloat v) { throw new NotImplementedException (); }
+               public static nfloat operator -- (nfloat v) { throw new NotImplementedException (); }
+#else
+               public static nfloat operator ++ (nfloat v) { return new nfloat (v.v + 1); }
+               public static nfloat operator -- (nfloat v) { return new nfloat (v.v - 1); }
+#endif
+
+#if NINT_JIT_OPTIMIZED
+               public static nfloat operator + (nfloat l, nfloat r) { throw new NotImplementedException (); }
+               public static nfloat operator - (nfloat l, nfloat r) { throw new NotImplementedException (); }
+               public static nfloat operator * (nfloat l, nfloat r) { throw new NotImplementedException (); }
+               public static nfloat operator / (nfloat l, nfloat r) { throw new NotImplementedException (); }
+               public static nfloat operator % (nfloat l, nfloat r) { throw new NotImplementedException (); }
+#else
+               public static nfloat operator + (nfloat l, nfloat r) { return new nfloat (l.v + r.v); }
+               public static nfloat operator - (nfloat l, nfloat r) { return new nfloat (l.v - r.v); }
+               public static nfloat operator * (nfloat l, nfloat r) { return new nfloat (l.v * r.v); }
+               public static nfloat operator / (nfloat l, nfloat r) { return new nfloat (l.v / r.v); }
+               public static nfloat operator % (nfloat l, nfloat r) { return new nfloat (l.v % r.v); }
+#endif
+
+#if NINT_JIT_OPTIMIZED
+               public static bool operator == (nfloat l, nfloat r) { throw new NotImplementedException (); }
+               public static bool operator != (nfloat l, nfloat r) { throw new NotImplementedException (); }
+               public static bool operator <  (nfloat l, nfloat r) { throw new NotImplementedException (); }
+               public static bool operator >  (nfloat l, nfloat r) { throw new NotImplementedException (); }
+               public static bool operator <= (nfloat l, nfloat r) { throw new NotImplementedException (); }
+               public static bool operator >= (nfloat l, nfloat r) { throw new NotImplementedException (); }
+#else
+               public static bool operator == (nfloat l, nfloat r) { return l.v == r.v; }
+               public static bool operator != (nfloat l, nfloat r) { return l.v != r.v; }
+               public static bool operator <  (nfloat l, nfloat r) { return l.v < r.v; }
+               public static bool operator >  (nfloat l, nfloat r) { return l.v > r.v; }
+               public static bool operator <= (nfloat l, nfloat r) { return l.v <= r.v; }
+               public static bool operator >= (nfloat l, nfloat r) { return l.v >= r.v; }
+#endif
+
+               public int CompareTo (nfloat value) { return v.CompareTo (value.v); }
+               public int CompareTo (object value)
+               {
+                       if (value is nfloat)
+                               return v.CompareTo (((nfloat) value).v);
+                       return v.CompareTo (value);
+               }
+               public bool Equals (nfloat obj) { return v.Equals (obj.v); }
+               public override bool Equals (object obj)
+               {
+                       if (obj is nfloat)
+                               return v.Equals (((nfloat) obj).v);
+                       return v.Equals (obj);
+               }
+               public override int GetHashCode () { return v.GetHashCode (); }
+
+#if ARCH_32
+               public static bool IsNaN              (nfloat f) { return Single.IsNaN ((Single)f); }
+               public static bool IsInfinity         (nfloat f) { return Single.IsInfinity ((Single)f); }
+               public static bool IsPositiveInfinity (nfloat f) { return Single.IsPositiveInfinity ((Single)f); }
+               public static bool IsNegativeInfinity (nfloat f) { return Single.IsNegativeInfinity ((Single)f); }
+
+               public static nfloat Parse (string s, IFormatProvider provider) { return (nfloat)Single.Parse (s, provider); }
+               public static nfloat Parse (string s, NumberStyles style) { return (nfloat)Single.Parse (s, style); }
+               public static nfloat Parse (string s) { return (nfloat)Single.Parse (s); }
+               public static nfloat Parse (string s, NumberStyles style, IFormatProvider provider) {
+                       return (nfloat)Single.Parse (s, style, provider);
+               }
+
+               public static bool TryParse (string s, out nfloat result)
+               {
+                       Single v;
+                       var r = Single.TryParse (s, out v);
+                       result = (nfloat)v;
+                       return r;
+               }
+
+               public static bool TryParse (string s, NumberStyles style, IFormatProvider provider, out nfloat result)
+               {
+                       Single v;
+                       var r = Single.TryParse (s, style, provider, out v);
+                       result = (nfloat)v;
+                       return r;
+               }
+#else
+               public static bool IsNaN              (nfloat f) { return Double.IsNaN ((Double)f); }
+               public static bool IsInfinity         (nfloat f) { return Double.IsInfinity ((Double)f); }
+               public static bool IsPositiveInfinity (nfloat f) { return Double.IsPositiveInfinity ((Double)f); }
+               public static bool IsNegativeInfinity (nfloat f) { return Double.IsNegativeInfinity ((Double)f); }
+
+               public static nfloat Parse (string s, IFormatProvider provider) { return (nfloat)Double.Parse (s, provider); }
+               public static nfloat Parse (string s, NumberStyles style) { return (nfloat)Double.Parse (s, style); }
+               public static nfloat Parse (string s) { return (nfloat)Double.Parse (s); }
+               public static nfloat Parse (string s, NumberStyles style, IFormatProvider provider) {
+                       return (nfloat)Double.Parse (s, style, provider);
+               }
+
+               public static bool TryParse (string s, out nfloat result)
+               {
+                       Double v;
+                       var r = Double.TryParse (s, out v);
+                       result = (nfloat)v;
+                       return r;
+               }
+
+               public static bool TryParse (string s, NumberStyles style, IFormatProvider provider, out nfloat result)
+               {
+                       Double v;
+                       var r = Double.TryParse (s, style, provider, out v);
+                       result = (nfloat)v;
+                       return r;
+               }
+#endif
+
+               public override string ToString () { return v.ToString (); }
+               public string ToString (IFormatProvider provider) { return v.ToString (provider); }
+               public string ToString (string format) { return v.ToString (format); }
+               public string ToString (string format, IFormatProvider provider) { return v.ToString (format, provider); }
+
+               public TypeCode GetTypeCode () { return v.GetTypeCode (); }
+
+               bool     IConvertible.ToBoolean  (IFormatProvider provider) { return ((IConvertible)v).ToBoolean (provider); }
+               byte     IConvertible.ToByte     (IFormatProvider provider) { return ((IConvertible)v).ToByte (provider); }
+               char     IConvertible.ToChar     (IFormatProvider provider) { return ((IConvertible)v).ToChar (provider); }
+               DateTime IConvertible.ToDateTime (IFormatProvider provider) { return ((IConvertible)v).ToDateTime (provider); }
+               decimal  IConvertible.ToDecimal  (IFormatProvider provider) { return ((IConvertible)v).ToDecimal (provider); }
+               double   IConvertible.ToDouble   (IFormatProvider provider) { return ((IConvertible)v).ToDouble (provider); }
+               short    IConvertible.ToInt16    (IFormatProvider provider) { return ((IConvertible)v).ToInt16 (provider); }
+               int      IConvertible.ToInt32    (IFormatProvider provider) { return ((IConvertible)v).ToInt32 (provider); }
+               long     IConvertible.ToInt64    (IFormatProvider provider) { return ((IConvertible)v).ToInt64 (provider); }
+               sbyte    IConvertible.ToSByte    (IFormatProvider provider) { return ((IConvertible)v).ToSByte (provider); }
+               float    IConvertible.ToSingle   (IFormatProvider provider) { return ((IConvertible)v).ToSingle (provider); }
+               ushort   IConvertible.ToUInt16   (IFormatProvider provider) { return ((IConvertible)v).ToUInt16 (provider); }
+               uint     IConvertible.ToUInt32   (IFormatProvider provider) { return ((IConvertible)v).ToUInt32 (provider); }
+               ulong    IConvertible.ToUInt64   (IFormatProvider provider) { return ((IConvertible)v).ToUInt64 (provider); }
+
+               object IConvertible.ToType (Type targetType, IFormatProvider provider) {
+                       return ((IConvertible)v).ToType (targetType, provider);
+               }
+
+               public static void CopyArray (IntPtr source, nfloat [] destination, int startIndex, int length)
+               {
+                       if (source == IntPtr.Zero)
+                               throw new ArgumentNullException ("source");
+                       if (destination == null)
+                               throw new ArgumentNullException ("destination");
+                       if (destination.Rank != 1)
+                               throw new ArgumentException ("destination", "array is multi-dimensional");
+                       if (startIndex < 0)
+                               throw new ArgumentException ("startIndex", "must be >= 0");
+                       if (length < 0)
+                               throw new ArgumentException ("length", "must be >= 0");
+                       if (startIndex + length > destination.Length)
+                               throw new ArgumentException ("length", "startIndex + length > destination.Length");
+
+                       for (int i = 0; i < length; i++)
+                               destination [i + startIndex] = (nfloat)Marshal.ReadIntPtr (source, i * nfloat.Size);
+               }
+
+               public static void CopyArray (nfloat [] source, int startIndex, IntPtr destination, int length)
+               {
+                       if (source == null)
+                               throw new ArgumentNullException ("source");
+                       if (destination == IntPtr.Zero)
+                               throw new ArgumentNullException ("destination");
+                       if (source.Rank != 1)
+                               throw new ArgumentException ("source", "array is multi-dimensional");
+                       if (startIndex < 0)
+                               throw new ArgumentException ("startIndex", "must be >= 0");
+                       if (length < 0)
+                               throw new ArgumentException ("length", "must be >= 0");
+                       if (startIndex + length > source.Length)
+                               throw new ArgumentException ("length", "startIndex + length > source.Length");
+
+                       for (int i = 0; i < length; i++)
+                               Marshal.WriteIntPtr (destination, i * nfloat.Size, (IntPtr)source [i + startIndex]);
+               }
+       }
+}
index f1dfac557bc157bf11c15acfe64b25f2242c580b..d35a867778fe49e99c74ab07296a3d58d6bc935b 100755 (executable)
@@ -792,3 +792,5 @@ gc_param_slot_liveness_def: len:0
 
 generic_class_init: src1:A len:32 clob:c
 get_last_error: dest:i len:32
+
+fill_prof_call_ctx: src1:i len:128
index 25e5f931118c65462120eb35e4050e4535ad5f88..e6a91fc176d13fc9474efdeb53841cdfb7097ec4 100644 (file)
@@ -404,3 +404,5 @@ atomic_store_r4: dest:b src1:f len:80
 atomic_store_r8: dest:b src1:f len:32
 
 generic_class_init: src1:a len:44 clob:c
+
+fill_prof_call_ctx: src1:i len:128
index c0651233eb50b02114232ec6ebf5e84ce6bcfea0..230a975dbe348bc43711c24276613744530c5e0f 100644 (file)
@@ -480,3 +480,5 @@ atomic_store_r8: dest:b src1:f len:24
 
 generic_class_init: src1:a len:44 clob:c
 gc_safe_point: src1:i len:12 clob:c
+
+fill_prof_call_ctx: src1:i len:128
index 280eda7c0ac58340e2b49a6bc15e289592bbf1b3..870b10b2397506dfdbfb087005e84c8e459018e7 100644 (file)
@@ -651,3 +651,5 @@ gc_spill_slot_liveness_def: len:0
 gc_param_slot_liveness_def: len:0
 get_sp: dest:i len:6
 set_sp: src1:i len:6
+
+fill_prof_call_ctx: src1:i len:128
index 8c1a71e147fe75ddbeaae4af024179139d90d1fd..30874eb3cf3572ab48f24d98b7a058e13ce5b8a0 100644 (file)
@@ -241,7 +241,7 @@ mono_debug_close_method (MonoCompile *cfg)
        jit->code_start = cfg->native_code;
        jit->epilogue_begin = cfg->epilog_begin;
        jit->code_size = cfg->code_len;
-       jit->has_var_info = debug_options.mdb_optimizations != 0;
+       jit->has_var_info = debug_options.mdb_optimizations || MONO_CFG_PROFILE_CALL_CONTEXT (cfg);
 
        if (jit->epilogue_begin)
                   record_line_number (info, jit->epilogue_begin, header->code_size);
index 102158e4fdab6144dd37a4f8ee8baf089c2d3fc6..b625580c1fe4c347fedcc46b41f7473db085cc88 100644 (file)
@@ -595,11 +595,6 @@ typedef struct {
        MonoClass *klass;
 } EventInfo;
 
-/* Dummy structure used for the profiler callbacks */
-typedef struct {
-       void* dummy;
-} DebuggerProfiler;
-
 typedef struct {
        guint8 *buf, *p, *end;
 } Buffer;
@@ -700,8 +695,6 @@ static MonoCoopCond debugger_thread_exited_cond;
 /* Mutex for the cond var above */
 static MonoCoopMutex debugger_thread_exited_mutex;
 
-static DebuggerProfiler debugger_profiler;
-
 /* The single step request instance */
 static SingleStepReq *ss_req;
 
@@ -999,7 +992,7 @@ mono_debugger_agent_init (void)
        mono_coop_mutex_init (&debugger_thread_exited_mutex);
        mono_coop_cond_init (&debugger_thread_exited_cond);
 
-       MonoProfilerHandle prof = mono_profiler_install ((MonoProfiler*)&debugger_profiler);
+       MonoProfilerHandle prof = mono_profiler_create (NULL);
        mono_profiler_set_runtime_shutdown_end_callback (prof, runtime_shutdown);
        mono_profiler_set_runtime_initialized_callback (prof, runtime_initialized);
        mono_profiler_set_domain_loaded_callback (prof, appdomain_load);
index 750aa206b992f47a3edd1f041041b090c3e04068..f8d485292afd01fb50f4b7e7fc14c08e261704bd 100644 (file)
@@ -512,6 +512,11 @@ mini_regression (MonoImage *image, int verbose, int *total_run)
                }
        } else {
                for (opt = 0; opt < G_N_ELEMENTS (opt_sets); ++opt) {
+                       /* builtin-types.cs needs OPT_INTRINS enabled */
+                       if (!strcmp ("builtin-types", image->assembly_name))
+                               if (!(opt_sets [opt] & MONO_OPT_INTRINS))
+                                       continue;
+
                        mini_regression_step (image, verbose, total_run, &total,
                                        opt_sets [opt] & ~exclude,
                                        timer, domain);
@@ -1584,9 +1589,7 @@ mono_main (int argc, char* argv[])
        guint32 opt, action = DO_EXEC, recompilation_times = 1;
        MonoGraphOptions mono_graph_options = (MonoGraphOptions)0;
        int mini_verbose = 0;
-       gboolean enable_profile = FALSE;
        char *trace_options = NULL;
-       char *profile_options = NULL;
        char *aot_options = NULL;
        char *forced_version = NULL;
        GPtrArray *agents = NULL;
@@ -1797,11 +1800,9 @@ mono_main (int argc, char* argv[])
                } else if (strcmp (argv [i], "--jitmap") == 0) {
                        mono_enable_jit_map ();
                } else if (strcmp (argv [i], "--profile") == 0) {
-                       enable_profile = TRUE;
-                       profile_options = NULL;
+                       mini_add_profiler_argument (NULL);
                } else if (strncmp (argv [i], "--profile=", 10) == 0) {
-                       enable_profile = TRUE;
-                       profile_options = argv [i] + 10;
+                       mini_add_profiler_argument (argv [i] + 10);
                } else if (strncmp (argv [i], "--agent=", 8) == 0) {
                        if (agents == NULL)
                                agents = g_ptr_array_new ();
@@ -2011,10 +2012,6 @@ mono_main (int argc, char* argv[])
        /* Set rootdir before loading config */
        mono_set_rootdir ();
 
-       if (enable_profile) {
-               mini_profiler_enable_with_options (profile_options);
-       }
-
        mono_attach_parse_options (attach_options);
 
        if (trace_options != NULL){
@@ -2381,6 +2378,12 @@ mono_jit_set_aot_mode (MonoAotMode mode)
        }
 }
 
+mono_bool
+mono_jit_aot_compiling (void)
+{
+       return mono_compile_aot;
+}
+
 /**
  * mono_jit_set_trace_options:
  * \param options string representing the trace options
index 88eac7edb4550f5cfbea080941a36a37afc95da7..09c94309b70353d96b20dcc7a676d4e01665515b 100644 (file)
@@ -2820,4 +2820,80 @@ END:
        pop
        ret
   }
+
+  .method public static int32 test_2_fault () cil managed
+  {
+       .maxstack 16
+       .locals init (int32 V_0)
+    IL_0000:  ldc.i4.0
+    IL_0001:  stloc.0
+    .try
+    {
+      .try
+      {
+        IL_0002:  newobj     instance void [mscorlib]System.Exception::.ctor()
+        IL_0007:  throw
+               leave.s    IL_0018
+      }  // end .try
+         fault
+      {
+        IL_0009:  ldloc.0
+        IL_000a:  ldc.i4.1
+        IL_000b:  add
+        IL_000c:  stloc.0
+                                 endfinally
+      }  // end handler
+      IL_000f:  leave.s    IL_0018
+
+    }  // end .try
+    catch [mscorlib]System.Object
+    {
+      IL_0011:  pop
+      IL_0012:  ldloc.0
+      IL_0013:  ldc.i4.1
+      IL_0014:  add
+      IL_0015:  stloc.0
+      IL_0016:  leave.s    IL_0018
+
+    }  // end handler
+    IL_0018:  ldloc.0
+       ret
+       }
+
+  .method public static int32 test_0_fault_no_exception () cil managed
+  {
+       .maxstack 16
+       .locals init (int32 V_0)
+    IL_0000:  ldc.i4.0
+    IL_0001:  stloc.0
+    .try
+    {
+      .try
+      {
+               leave.s    IL_0018
+      }  // end .try
+         fault
+      {
+        IL_0009:  ldloc.0
+        IL_000a:  ldc.i4.1
+        IL_000b:  add
+        IL_000c:  stloc.0
+                                 endfinally
+      }  // end handler
+      IL_000f:  leave.s    IL_0018
+
+    }  // end .try
+    catch [mscorlib]System.Object
+    {
+      IL_0011:  pop
+      IL_0012:  ldloc.0
+      IL_0013:  ldc.i4.1
+      IL_0014:  add
+      IL_0015:  stloc.0
+      IL_0016:  leave.s    IL_0018
+
+    }  // end handler
+    IL_0018:  ldloc.0
+       ret
+       }
 }
index b5cf20dfde120e02d353ad7e69e64c3b82788dd6..97ade6b06f10f397386f4d14140010f138b8309d 100644 (file)
 #define ALIGN_PTR_TO(ptr,align) (gpointer)((((gssize)(ptr)) + (align - 1)) & (~(align - 1)))
 #define ROUND_DOWN(VALUE,SIZE) ((VALUE) & ~((SIZE) - 1))
 
-#if defined(TARGET_AMD64) && !defined(HOST_WIN32) && !defined(__APPLE__)
-#define USE_ELF_WRITER 1
-#define USE_ELF_RELA 1
-#endif
-
-#if defined(TARGET_X86) && !defined(HOST_WIN32) && !defined(__APPLE__)
-#define USE_ELF_WRITER 1
-#endif
-
-#if defined(TARGET_ARM) && !defined(TARGET_MACH) && !defined(HOST_WIN32)
-//#define USE_ELF_WRITER 1
-#endif
-
-#if defined(__mips__)
-#define USE_ELF_WRITER 1
-#endif
-
-#if defined(TARGET_X86) && defined(__APPLE__)
-//#define USE_MACH_WRITER
-#endif
-
-#if defined(USE_ELF_WRITER) || defined(USE_MACH_WRITER)
-#define USE_BIN_WRITER 1
-#endif
-
 #ifdef USE_BIN_WRITER
 
 typedef struct _BinSymbol BinSymbol;
index 3da1717d3e3d56e7791748e64c1bf88b302bed3c..0c34246422e8b90c7c397a1647be7d7b0d962bb0 100644 (file)
 
 typedef struct _MonoImageWriter MonoImageWriter;
 
+#if defined(TARGET_AMD64) && !defined(HOST_WIN32) && !defined(__APPLE__)
+#define USE_ELF_WRITER 1
+#define USE_ELF_RELA 1
+#endif
+
+#if defined(TARGET_X86) && !defined(HOST_WIN32) && !defined(__APPLE__)
+#define USE_ELF_WRITER 1
+#endif
+
+#if defined(TARGET_ARM) && !defined(TARGET_MACH) && !defined(HOST_WIN32)
+//#define USE_ELF_WRITER 1
+#endif
+
+#if defined(__mips__)
+#define USE_ELF_WRITER 1
+#endif
+
+#if defined(TARGET_X86) && defined(__APPLE__)
+//#define USE_MACH_WRITER
+#endif
+
+#if defined(USE_ELF_WRITER) || defined(USE_MACH_WRITER)
+#define USE_BIN_WRITER 1
+#endif
+
 /* Relocation types */
 #define R_ARM_CALL 28
 #define R_ARM_JUMP24 29
index 60d91afd44426284352754e64eef1793af91821f..894747e23d0880ad15f6705c40a2dde3d49d6a84 100644 (file)
@@ -54,7 +54,7 @@ typedef struct {
 #endif
 } stackval;
 
-typedef struct _MonoInvocation MonoInvocation;
+typedef struct _InterpFrame InterpFrame;
 
 typedef void (*MonoFuncV) (void);
 typedef void (*MonoPIFunc) (MonoFuncV callme, void *margs);
@@ -63,14 +63,14 @@ typedef void (*MonoPIFunc) (MonoFuncV callme, void *margs);
  * Structure representing a method transformed for the interpreter 
  * This is domain specific
  */
-typedef struct _RuntimeMethod
+typedef struct _InterpMethod
 {
        /* NOTE: These first two elements (method and
           next_jit_code_hash) must be in the same order and at the
           same offset as in MonoJitInfo, because of the jit_code_hash
           internal hash table in MonoDomain. */
        MonoMethod *method;
-       struct _RuntimeMethod *next_jit_code_hash;
+       struct _InterpMethod *next_jit_code_hash;
        guint32 locals_size;
        guint32 args_size;
        guint32 stack_size;
@@ -96,11 +96,12 @@ typedef struct _RuntimeMethod
        MonoType **param_types;
        MonoJitInfo *jinfo;
        MonoDomain *domain;
-} RuntimeMethod;
+       MonoProfilerCallInstrumentationFlags prof_flags;
+} InterpMethod;
 
-struct _MonoInvocation {
-       MonoInvocation *parent; /* parent */
-       RuntimeMethod  *runtime_method; /* parent */
+struct _InterpFrame {
+       InterpFrame *parent; /* parent */
+       InterpMethod  *imethod; /* parent */
        MonoMethod     *method; /* parent */
        stackval       *retval; /* parent */
        char           *args;
@@ -117,9 +118,9 @@ struct _MonoInvocation {
 
 typedef struct {
        MonoDomain *original_domain;
-       MonoInvocation *base_frame;
-       MonoInvocation *current_frame;
-       MonoInvocation *env_frame;
+       InterpFrame *base_frame;
+       InterpFrame *current_frame;
+       InterpFrame *env_frame;
        jmp_buf *current_env;
        unsigned char search_for_handler;
        unsigned char managed_code;
@@ -127,7 +128,7 @@ typedef struct {
        /* Resume state for resuming execution in mixed mode */
        gboolean       has_resume_state;
        /* Frame to resume execution at */
-       MonoInvocation *handler_frame;
+       InterpFrame *handler_frame;
        /* IP to resume execution at */
        gpointer handler_ip;
 } ThreadContext;
@@ -136,12 +137,12 @@ extern int mono_interp_traceopt;
 extern GSList *jit_classes;
 
 MonoException *
-mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context);
+mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context);
 
 void
 mono_interp_transform_init (void);
 
-RuntimeMethod *
-mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoError *error);
+InterpMethod *
+mono_interp_get_imethod (MonoDomain *domain, MonoMethod *method, MonoError *error);
 
 #endif /* __MONO_MINI_INTERPRETER_INTERNALS_H__ */
index bf3a62195ec70951795373bcee354f143f208b45..fccce6b3411211e47139f783249bb0032de10225 100644 (file)
 #endif
 
 static inline void
-init_frame (MonoInvocation *frame, MonoInvocation *parent_frame, RuntimeMethod *rmethod, stackval *method_args, stackval *method_retval)
+init_frame (InterpFrame *frame, InterpFrame *parent_frame, InterpMethod *rmethod, stackval *method_args, stackval *method_retval)
 {
        frame->parent = parent_frame;
        frame->stack_args = method_args;
        frame->retval = method_retval;
-       frame->runtime_method = rmethod;
+       frame->imethod = rmethod;
        frame->ex = NULL;
        frame->ip = NULL;
        frame->invoke_trap = 0;
 }
 
 #define INIT_FRAME(frame,parent_frame,method_args,method_retval,domain,mono_method,error) do { \
-       RuntimeMethod *_rmethod = mono_interp_get_runtime_method ((domain), (mono_method), (error));    \
+       InterpMethod *_rmethod = mono_interp_get_imethod ((domain), (mono_method), (error));    \
        init_frame ((frame), (parent_frame), _rmethod, (method_args), (method_retval)); \
        } while (0)
 
@@ -108,18 +108,18 @@ GSList *jit_classes;
 /* If TRUE, interpreted code will be interrupted at function entry/backward branches */
 static gboolean ss_enabled;
 
-void ves_exec_method (MonoInvocation *frame);
+void ves_exec_method (InterpFrame *frame);
 
-static char* dump_frame (MonoInvocation *inv);
-static MonoArray *get_trace_ips (MonoDomain *domain, MonoInvocation *top);
-static void ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception, int exit_at_finally);
+static char* dump_frame (InterpFrame *inv);
+static MonoArray *get_trace_ips (MonoDomain *domain, InterpFrame *top);
+static void ves_exec_method_with_context (InterpFrame *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception, int exit_at_finally);
 
-typedef void (*ICallMethod) (MonoInvocation *frame);
+typedef void (*ICallMethod) (InterpFrame *frame);
 
 static guint32 die_on_exception = 0;
 static MonoNativeTlsKey thread_context_id;
 
-static char* dump_args (MonoInvocation *inv);
+static char* dump_args (InterpFrame *inv);
 
 #define DEBUG_INTERP 0
 #define COUNT_OPS 0
@@ -154,16 +154,16 @@ db_match_method (gpointer data, gpointer user_data)
 }
 
 static void
-debug_enter (MonoInvocation *frame, int *tracing)
+debug_enter (InterpFrame *frame, int *tracing)
 {
        if (db_methods) {
-               g_list_foreach (db_methods, db_match_method, (gpointer)frame->runtime_method->method);
+               g_list_foreach (db_methods, db_match_method, (gpointer)frame->imethod->method);
                if (break_on_method)
                        *tracing = nested_trace ? (global_tracing = 2, 3) : 2;
                break_on_method = 0;
        }
        if (*tracing) {
-               MonoMethod *method = frame->runtime_method->method;
+               MonoMethod *method = frame->imethod->method;
                char *mn, *args = dump_args (frame);
                debug_indent_level++;
                output_indent ();
@@ -173,8 +173,6 @@ debug_enter (MonoInvocation *frame, int *tracing)
                g_print  ("%s)\n", args);
                g_free (args);
        }
-       if (mono_profiler_should_instrument_method (frame->runtime_method->method, TRUE))
-               MONO_PROFILER_RAISE (method_enter, (frame->runtime_method->method));
 }
 
 
@@ -183,21 +181,19 @@ debug_enter (MonoInvocation *frame, int *tracing)
                char *mn, *args;        \
                args = dump_retval (frame);     \
                output_indent ();       \
-               mn = mono_method_full_name (frame->runtime_method->method, FALSE); \
+               mn = mono_method_full_name (frame->imethod->method, FALSE); \
                g_print  ("(%p) Leaving %s", mono_thread_internal_current (),  mn);     \
                g_free (mn); \
                g_print  (" => %s\n", args);    \
                g_free (args);  \
                debug_indent_level--;   \
                if (tracing == 3) global_tracing = 0; \
-       }       \
-       if (mono_profiler_should_instrument_method (frame->runtime_method->method, FALSE)) \
-               MONO_PROFILER_RAISE (method_enter, (frame->runtime_method->method));
+       }
 
 #else
 
 int mono_interp_traceopt = 0;
-static void debug_enter (MonoInvocation *frame, int *tracing)
+static void debug_enter (InterpFrame *frame, int *tracing)
 {
 }
 #define DEBUG_LEAVE()
@@ -246,14 +242,14 @@ ves_real_abort (int line, MonoMethod *mh,
 
 #define ves_abort() \
        do {\
-               ves_real_abort(__LINE__, frame->runtime_method->method, ip, frame->stack, sp); \
+               ves_real_abort(__LINE__, frame->imethod->method, ip, frame->stack, sp); \
                THROW_EX (mono_get_exception_execution_engine (NULL), ip); \
        } while (0);
 
-static RuntimeMethod*
-lookup_runtime_method (MonoDomain *domain, MonoMethod *method)
+static InterpMethod*
+lookup_imethod (MonoDomain *domain, MonoMethod *method)
 {
-       RuntimeMethod *rtm;
+       InterpMethod *rtm;
        MonoJitDomainInfo *info;
 
        info = domain_jit_info (domain);
@@ -263,10 +259,10 @@ lookup_runtime_method (MonoDomain *domain, MonoMethod *method)
        return rtm;
 }
 
-RuntimeMethod*
-mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoError *error)
+InterpMethod*
+mono_interp_get_imethod (MonoDomain *domain, MonoMethod *method, MonoError *error)
 {
-       RuntimeMethod *rtm;
+       InterpMethod *rtm;
        MonoJitDomainInfo *info;
        MonoMethodSignature *sig;
        int i;
@@ -282,7 +278,7 @@ mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoErro
 
        sig = mono_method_signature (method);
 
-       rtm = mono_domain_alloc0 (domain, sizeof (RuntimeMethod));
+       rtm = mono_domain_alloc0 (domain, sizeof (InterpMethod));
        rtm->method = method;
        rtm->domain = domain;
        rtm->param_count = sig->param_count;
@@ -297,6 +293,8 @@ mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoErro
                mono_internal_hash_table_insert (&info->interp_code_hash, method, rtm);
        mono_domain_jit_code_hash_unlock (domain);
 
+       rtm->prof_flags = mono_profiler_get_call_instrumentation_flags (rtm->method);
+
        return rtm;
 }
 
@@ -305,7 +303,7 @@ mono_interp_create_trampoline (MonoDomain *domain, MonoMethod *method, MonoError
 {
        if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
                method = mono_marshal_get_synchronized_wrapper (method);
-       return mono_interp_get_runtime_method (domain, method, error);
+       return mono_interp_get_imethod (domain, method, error);
 }
 
 /*
@@ -317,7 +315,7 @@ mono_interp_create_trampoline (MonoDomain *domain, MonoMethod *method, MonoError
  * be able to do stack walks.
  */
 static void
-interp_push_lmf (MonoLMFExt *ext, MonoInvocation *frame)
+interp_push_lmf (MonoLMFExt *ext, InterpFrame *frame)
 {
        memset (ext, 0, sizeof (MonoLMFExt));
        ext->interp_exit = TRUE;
@@ -332,17 +330,17 @@ interp_pop_lmf (MonoLMFExt *ext)
        mono_pop_lmf (&ext->lmf);
 }
 
-static inline RuntimeMethod*
-get_virtual_method (RuntimeMethod *runtime_method, MonoObject *obj)
+static inline InterpMethod*
+get_virtual_method (InterpMethod *imethod, MonoObject *obj)
 {
-       MonoMethod *m = runtime_method->method;
-       MonoDomain *domain = runtime_method->domain;
-       RuntimeMethod *ret = NULL;
+       MonoMethod *m = imethod->method;
+       MonoDomain *domain = imethod->domain;
+       InterpMethod *ret = NULL;
        MonoError error;
 
 #ifndef DISABLE_REMOTING
        if (mono_object_is_transparent_proxy (obj)) {
-               ret = mono_interp_get_runtime_method (domain, mono_marshal_get_remoting_invoke (m), &error);
+               ret = mono_interp_get_imethod (domain, mono_marshal_get_remoting_invoke (m), &error);
                mono_error_assert_ok (&error);
                return ret;
        }
@@ -350,10 +348,10 @@ get_virtual_method (RuntimeMethod *runtime_method, MonoObject *obj)
 
        if ((m->flags & METHOD_ATTRIBUTE_FINAL) || !(m->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
                if (m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) {
-                       ret = mono_interp_get_runtime_method (domain, mono_marshal_get_synchronized_wrapper (m), &error);
+                       ret = mono_interp_get_imethod (domain, mono_marshal_get_synchronized_wrapper (m), &error);
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                } else {
-                       ret = runtime_method;
+                       ret = imethod;
                }
                return ret;
        }
@@ -386,14 +384,15 @@ get_virtual_method (RuntimeMethod *runtime_method, MonoObject *obj)
                virtual_method = mono_marshal_get_synchronized_wrapper (virtual_method);
        }
 
-       RuntimeMethod *virtual_runtime_method = mono_interp_get_runtime_method (domain, virtual_method, &error);
+       InterpMethod *virtual_imethod = mono_interp_get_imethod (domain, virtual_method, &error);
        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-       return virtual_runtime_method;
+       return virtual_imethod;
 }
 
 static void inline
-stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvoke)
+stackval_from_data (MonoType *type_, stackval *result, char *data, gboolean pinvoke)
 {
+       MonoType *type = mini_native_type_replace_type (type_);
        if (type->byref) {
                switch (type->type) {
                case MONO_TYPE_OBJECT:
@@ -481,8 +480,9 @@ stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvo
 }
 
 static void inline
-stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke)
+stackval_to_data (MonoType *type_, stackval *val, char *data, gboolean pinvoke)
 {
+       MonoType *type = mini_native_type_replace_type (type_);
        if (type->byref) {
                gpointer *p = (gpointer*)data;
                *p = val->data.p;
@@ -583,11 +583,11 @@ stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke)
 }
 
 static void
-fill_in_trace (MonoException *exception, MonoInvocation *frame)
+fill_in_trace (MonoException *exception, InterpFrame *frame)
 {
        MonoError error;
        char *stack_trace = dump_frame (frame);
-       MonoDomain *domain = frame->runtime_method->domain;
+       MonoDomain *domain = frame->imethod->domain;
        (exception)->stack_trace = mono_string_new_checked (domain, stack_trace, &error);
        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
        (exception)->trace_ips = get_trace_ips (domain, frame);
@@ -603,13 +603,14 @@ fill_in_trace (MonoException *exception, MonoInvocation *frame)
                if (!rethrow) { \
                        FILL_IN_TRACE(frame->ex, frame);        \
                } \
+               MONO_PROFILER_RAISE (exception_throw, ((MonoObject *) exception));      \
                goto handle_exception;  \
        } while (0)
 
 #define THROW_EX(exception,ex_ip) THROW_EX_GENERAL ((exception), (ex_ip), FALSE)
 
 static MonoObject*
-ves_array_create (MonoInvocation *frame, MonoDomain *domain, MonoClass *klass, MonoMethodSignature *sig, stackval *values)
+ves_array_create (InterpFrame *frame, MonoDomain *domain, MonoClass *klass, MonoMethodSignature *sig, stackval *values)
 {
        uintptr_t *lengths;
        intptr_t *lower_bounds;
@@ -640,7 +641,7 @@ ves_array_create (MonoInvocation *frame, MonoDomain *domain, MonoClass *klass, M
 }
 
 static gint32
-ves_array_calculate_index (MonoArray *ao, stackval *sp, MonoInvocation *frame, gboolean safe)
+ves_array_calculate_index (MonoArray *ao, stackval *sp, InterpFrame *frame, gboolean safe)
 {
        g_assert (!frame->ex);
        MonoClass *ac = ((MonoObject *) ao)->vtable->klass;
@@ -670,7 +671,7 @@ ves_array_calculate_index (MonoArray *ao, stackval *sp, MonoInvocation *frame, g
 }
 
 static void
-ves_array_set (MonoInvocation *frame)
+ves_array_set (InterpFrame *frame)
 {
        stackval *sp = frame->stack_args + 1;
 
@@ -698,12 +699,12 @@ ves_array_set (MonoInvocation *frame)
        gint32 esize = mono_array_element_size (ac);
        gpointer ea = mono_array_addr_with_size (ao, esize, pos);
 
-       MonoType *mt = mono_method_signature (frame->runtime_method->method)->params [ac->rank];
+       MonoType *mt = mono_method_signature (frame->imethod->method)->params [ac->rank];
        stackval_to_data (mt, &sp [ac->rank], ea, FALSE);
 }
 
 static void
-ves_array_get (MonoInvocation *frame, gboolean safe)
+ves_array_get (InterpFrame *frame, gboolean safe)
 {
        stackval *sp = frame->stack_args + 1;
 
@@ -720,12 +721,12 @@ ves_array_get (MonoInvocation *frame, gboolean safe)
        gint32 esize = mono_array_element_size (ac);
        gpointer ea = mono_array_addr_with_size (ao, esize, pos);
 
-       MonoType *mt = mono_method_signature (frame->runtime_method->method)->ret;
+       MonoType *mt = mono_method_signature (frame->imethod->method)->ret;
        stackval_from_data (mt, frame->retval, ea, FALSE);
 }
 
 static gpointer
-ves_array_element_address (MonoInvocation *frame, MonoClass *required_type, MonoArray *ao, stackval *sp, gboolean needs_typecheck)
+ves_array_element_address (InterpFrame *frame, MonoClass *required_type, MonoArray *ao, stackval *sp, gboolean needs_typecheck)
 {
        MonoClass *ac = ((MonoObject *) ao)->vtable->klass;
 
@@ -753,17 +754,17 @@ interp_walk_stack_with_ctx (MonoInternalStackWalk func, MonoContext *ctx, MonoUn
        if (!context)
                return;
 
-       MonoInvocation *frame = context->current_frame;
+       InterpFrame *frame = context->current_frame;
 
        while (frame) {
                MonoStackFrameInfo fi;
                memset (&fi, 0, sizeof (MonoStackFrameInfo));
 
                /* TODO: hack to make some asserts happy. */
-               fi.ji = (MonoJitInfo *) frame->runtime_method;
+               fi.ji = (MonoJitInfo *) frame->imethod;
 
-               if (frame->runtime_method)
-                       fi.method = fi.actual_method = frame->runtime_method->method;
+               if (frame->imethod)
+                       fi.method = fi.actual_method = frame->imethod->method;
 
                if (!fi.method || (fi.method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) || (fi.method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME))) {
                        fi.il_offset = -1;
@@ -785,7 +786,7 @@ interp_walk_stack_with_ctx (MonoInternalStackWalk func, MonoContext *ctx, MonoUn
 
 static MonoPIFunc mono_interp_enter_icall_trampoline = NULL;
 
-static InterpMethodArguments* build_args_from_sig (MonoMethodSignature *sig, MonoInvocation *frame)
+static InterpMethodArguments* build_args_from_sig (MonoMethodSignature *sig, InterpFrame *frame)
 {
        InterpMethodArguments *margs = g_malloc0 (sizeof (InterpMethodArguments));
 
@@ -974,11 +975,11 @@ static InterpMethodArguments* build_args_from_sig (MonoMethodSignature *sig, Mon
 }
 
 static void 
-ves_pinvoke_method (MonoInvocation *frame, MonoMethodSignature *sig, MonoFuncV addr, gboolean string_ctor, ThreadContext *context)
+ves_pinvoke_method (InterpFrame *frame, MonoMethodSignature *sig, MonoFuncV addr, gboolean string_ctor, ThreadContext *context)
 {
        jmp_buf env;
-       MonoInvocation *old_frame = context->current_frame;
-       MonoInvocation *old_env_frame = context->env_frame;
+       InterpFrame *old_frame = context->current_frame;
+       InterpFrame *old_env_frame = context->env_frame;
        jmp_buf *old_env = context->current_env;
        MonoLMFExt ext;
 
@@ -994,7 +995,7 @@ ves_pinvoke_method (MonoInvocation *frame, MonoMethodSignature *sig, MonoFuncV a
        context->env_frame = frame;
        context->current_env = &env;
 
-       g_assert (!frame->runtime_method);
+       g_assert (!frame->imethod);
        if (!mono_interp_enter_icall_trampoline) {
                if (mono_aot_only) {
                        mono_interp_enter_icall_trampoline = mono_aot_get_trampoline ("enter_icall_trampoline");
@@ -1049,7 +1050,7 @@ mono_interp_init_delegate (MonoDelegate *del)
        if (del->method)
                return;
        /* shouldn't need a write barrier because we don't write a MonoObject into the field */
-       del->method = ((RuntimeMethod *) del->method_ptr)->method;
+       del->method = ((InterpMethod *) del->method_ptr)->method;
 }
 
 /*
@@ -1058,9 +1059,9 @@ mono_interp_init_delegate (MonoDelegate *del)
  * provided by the runtime and is primarily used for the methods of delegates.
  */
 static void
-ves_runtime_method (MonoInvocation *frame, ThreadContext *context)
+ves_imethod (InterpFrame *frame, ThreadContext *context)
 {
-       MonoMethod *method = frame->runtime_method->method;
+       MonoMethod *method = frame->imethod->method;
        const char *name = method->name;
        MonoObject *obj = (MonoObject*) frame->stack_args->data.p;
        MonoObject *isinst_obj;
@@ -1165,10 +1166,10 @@ dump_stackval (GString *str, stackval *s, MonoType *type)
 
 #if DEBUG_INTERP
 static char*
-dump_retval (MonoInvocation *inv)
+dump_retval (InterpFrame *inv)
 {
        GString *str = g_string_new ("");
-       MonoType *ret = mono_method_signature (inv->runtime_method->method)->ret;
+       MonoType *ret = mono_method_signature (inv->imethod->method)->ret;
 
        if (ret->type != MONO_TYPE_VOID)
                dump_stackval (str, inv->retval, ret);
@@ -1178,17 +1179,17 @@ dump_retval (MonoInvocation *inv)
 #endif
 
 static char*
-dump_args (MonoInvocation *inv)
+dump_args (InterpFrame *inv)
 {
        GString *str = g_string_new ("");
        int i;
-       MonoMethodSignature *signature = mono_method_signature (inv->runtime_method->method);
+       MonoMethodSignature *signature = mono_method_signature (inv->imethod->method);
        
        if (signature->param_count == 0 && !signature->hasthis)
                return g_string_free (str, FALSE);
 
        if (signature->hasthis) {
-               MonoMethod *method = inv->runtime_method->method;
+               MonoMethod *method = inv->imethod->method;
                dump_stackval (str, inv->stack_args, &method->klass->byval_arg);
        }
 
@@ -1199,7 +1200,7 @@ dump_args (MonoInvocation *inv)
 }
  
 static char*
-dump_frame (MonoInvocation *inv)
+dump_frame (InterpFrame *inv)
 {
        GString *str = g_string_new ("");
        int i;
@@ -1207,8 +1208,8 @@ dump_frame (MonoInvocation *inv)
        MonoError error;
 
        for (i = 0; inv; inv = inv->parent) {
-               if (inv->runtime_method != NULL) {
-                       MonoMethod *method = inv->runtime_method->method;
+               if (inv->imethod != NULL) {
+                       MonoMethod *method = inv->imethod->method;
                        MonoClass *k;
 
                        int codep = 0;
@@ -1226,7 +1227,7 @@ dump_frame (MonoInvocation *inv)
                                if (hd != NULL) {
                                        if (inv->ip) {
                                                opname = mono_interp_opname [*inv->ip];
-                                               codep = inv->ip - inv->runtime_method->code;
+                                               codep = inv->ip - inv->imethod->code;
                                                source = g_strdup_printf ("%s:%d // (TODO: proper stacktrace)", method->name, codep);
                                        } else 
                                                opname = "";
@@ -1253,23 +1254,23 @@ dump_frame (MonoInvocation *inv)
 }
 
 static MonoArray *
-get_trace_ips (MonoDomain *domain, MonoInvocation *top)
+get_trace_ips (MonoDomain *domain, InterpFrame *top)
 {
        int i;
        MonoArray *res;
-       MonoInvocation *inv;
+       InterpFrame *inv;
        MonoError error;
 
        for (i = 0, inv = top; inv; inv = inv->parent)
-               if (inv->runtime_method != NULL)
+               if (inv->imethod != NULL)
                        ++i;
 
        res = mono_array_new_checked (domain, mono_defaults.int_class, 2 * i, &error);
        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
 
        for (i = 0, inv = top; inv; inv = inv->parent)
-               if (inv->runtime_method != NULL) {
-                       mono_array_set (res, gpointer, i, inv->runtime_method);
+               if (inv->imethod != NULL) {
+                       mono_array_set (res, gpointer, i, inv->imethod);
                        ++i;
                        mono_array_set (res, gpointer, i, (gpointer)inv->ip);
                        ++i;
@@ -1361,7 +1362,7 @@ get_trace_ips (MonoDomain *domain, MonoInvocation *top)
 MonoObject*
 mono_interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error)
 {
-       MonoInvocation frame;
+       InterpFrame frame;
        ThreadContext * volatile context = mono_native_tls_get_value (thread_context_id);
        MonoObject *retval = NULL;
        MonoMethodSignature *sig = mono_method_signature (method);
@@ -1369,7 +1370,7 @@ mono_interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoOb
        stackval result;
        stackval *args;
        ThreadContext context_struct;
-       MonoInvocation *old_frame = NULL;
+       InterpFrame *old_frame = NULL;
        jmp_buf env;
 
        error_init (error);
@@ -1444,7 +1445,7 @@ mono_interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoOb
 }
 
 typedef struct {
-       RuntimeMethod *rmethod;
+       InterpMethod *rmethod;
        gpointer this_arg;
        gpointer res;
        gpointer args [16];
@@ -1455,11 +1456,11 @@ typedef struct {
 static void
 interp_entry (InterpEntryData *data)
 {
-       MonoInvocation frame;
-       RuntimeMethod *rmethod = data->rmethod;
+       InterpFrame frame;
+       InterpMethod *rmethod = data->rmethod;
        ThreadContext *context = mono_native_tls_get_value (thread_context_id);
        ThreadContext context_struct;
-       MonoInvocation *old_frame;
+       InterpFrame *old_frame;
        stackval result;
        stackval *args;
        MonoMethod *method;
@@ -1648,8 +1649,8 @@ interp_entry (InterpEntryData *data)
 static stackval * 
 do_icall (ThreadContext *context, int op, stackval *sp, gpointer ptr)
 {
-       MonoInvocation *old_frame = context->current_frame;
-       MonoInvocation *old_env_frame = context->env_frame;
+       InterpFrame *old_frame = context->current_frame;
+       InterpFrame *old_env_frame = context->env_frame;
        jmp_buf *old_env = context->current_env;
        jmp_buf env;
 
@@ -1735,7 +1736,7 @@ do_icall (ThreadContext *context, int op, stackval *sp, gpointer ptr)
 }
 
 static stackval *
-do_jit_call (stackval *sp, unsigned char *vt_sp, ThreadContext *context, MonoInvocation *frame, RuntimeMethod *rmethod)
+do_jit_call (stackval *sp, unsigned char *vt_sp, ThreadContext *context, InterpFrame *frame, InterpMethod *rmethod)
 {
        MonoMethodSignature *sig;
        MonoFtnDesc ftndesc;
@@ -1946,7 +1947,7 @@ do_jit_call (stackval *sp, unsigned char *vt_sp, ThreadContext *context, MonoInv
 }
 
 static void
-do_debugger_tramp (void (*tramp) (void), MonoInvocation *frame)
+do_debugger_tramp (void (*tramp) (void), InterpFrame *frame)
 {
        MonoLMFExt ext;
        interp_push_lmf (&ext, frame);
@@ -1955,14 +1956,14 @@ do_debugger_tramp (void (*tramp) (void), MonoInvocation *frame)
 }
 
 static void
-do_transform_method (MonoInvocation *frame, ThreadContext *context)
+do_transform_method (InterpFrame *frame, ThreadContext *context)
 {
        MonoLMFExt ext;
 
        /* Use the parent frame as the current frame is not complete yet */
        interp_push_lmf (&ext, frame->parent);
 
-       frame->ex = mono_interp_transform_method (frame->runtime_method, context);
+       frame->ex = mono_interp_transform_method (frame->imethod, context);
        context->managed_code = 1;
 
        interp_pop_lmf (&ext);
@@ -2060,15 +2061,15 @@ do_transform_method (MonoInvocation *frame, ThreadContext *context)
        interp_entry (&data); \
        }
 
-#define ARGLIST0 RuntimeMethod *rmethod
-#define ARGLIST1 gpointer arg1, RuntimeMethod *rmethod
-#define ARGLIST2 gpointer arg1, gpointer arg2, RuntimeMethod *rmethod
-#define ARGLIST3 gpointer arg1, gpointer arg2, gpointer arg3, RuntimeMethod *rmethod
-#define ARGLIST4 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, RuntimeMethod *rmethod
-#define ARGLIST5 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, RuntimeMethod *rmethod
-#define ARGLIST6 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, RuntimeMethod *rmethod
-#define ARGLIST7 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, RuntimeMethod *rmethod
-#define ARGLIST8 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, gpointer arg8, RuntimeMethod *rmethod
+#define ARGLIST0 InterpMethod *rmethod
+#define ARGLIST1 gpointer arg1, InterpMethod *rmethod
+#define ARGLIST2 gpointer arg1, gpointer arg2, InterpMethod *rmethod
+#define ARGLIST3 gpointer arg1, gpointer arg2, gpointer arg3, InterpMethod *rmethod
+#define ARGLIST4 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, InterpMethod *rmethod
+#define ARGLIST5 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, InterpMethod *rmethod
+#define ARGLIST6 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, InterpMethod *rmethod
+#define ARGLIST7 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, InterpMethod *rmethod
+#define ARGLIST8 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, gpointer arg8, InterpMethod *rmethod
 
 static void interp_entry_static_0 (ARGLIST0) INTERP_ENTRY0 (NULL, NULL, rmethod)
 static void interp_entry_static_1 (ARGLIST1) INTERP_ENTRY1 (NULL, NULL, rmethod)
@@ -2135,7 +2136,7 @@ mono_interp_create_method_pointer (MonoMethod *method, MonoError *error)
        gpointer addr;
        MonoMethodSignature *sig = mono_method_signature (method);
        MonoMethod *wrapper;
-       RuntimeMethod *rmethod = mono_interp_get_runtime_method (mono_domain_get (), method, error);
+       InterpMethod *rmethod = mono_interp_get_imethod (mono_domain_get (), method, error);
 
        /* HACK: method_ptr of delegate should point to a runtime method*/
        if (method->wrapper_type && method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD)
@@ -2206,7 +2207,7 @@ static int opcode_counts[512];
                } \
                sp->data.l = 0; \
                output_indent (); \
-               char *mn = mono_method_full_name (frame->runtime_method->method, FALSE); \
+               char *mn = mono_method_full_name (frame->imethod->method, FALSE); \
                g_print ("(%p) %s -> ", mono_thread_internal_current (), mn); \
                g_free (mn); \
                mono_interp_dis_mintop(rtm->code, ip); \
@@ -2240,14 +2241,14 @@ static int opcode_counts[512];
  * If EXIT_AT_FINALLY is not -1, exit after exiting the finally clause with that index.
  */
 static void 
-ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception, int exit_at_finally)
+ves_exec_method_with_context (InterpFrame *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception, int exit_at_finally)
 {
-       MonoInvocation child_frame;
+       InterpFrame child_frame;
        GSList *finally_ips = NULL;
        const unsigned short *endfinally_ip = NULL;
        const unsigned short *ip = NULL;
        register stackval *sp;
-       RuntimeMethod *rtm;
+       InterpMethod *rtm;
 #if DEBUG_INTERP
        gint tracing = global_tracing;
        unsigned char *vtalloc;
@@ -2275,10 +2276,10 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
 
        debug_enter (frame, &tracing);
 
-       if (!frame->runtime_method->transformed) {
+       if (!frame->imethod->transformed) {
                context->managed_code = 0;
 #if DEBUG_INTERP
-               char *mn = mono_method_full_name (frame->runtime_method->method, TRUE);
+               char *mn = mono_method_full_name (frame->imethod->method, TRUE);
                g_print ("(%p) Transforming %s\n", mono_thread_internal_current (), mn);
                g_free (mn);
 #endif
@@ -2291,7 +2292,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                }
        }
 
-       rtm = frame->runtime_method;
+       rtm = frame->imethod;
        if (!start_with_ip ) {
                frame->args = alloca (rtm->alloca_size);
                memset (frame->args, 0, rtm->alloca_size);
@@ -2331,6 +2332,9 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                MINT_IN_CASE(MINT_NOP)
                        ++ip;
                        MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_NIY)
+                       g_error ("mint_niy: instruction not implemented yet.  This shouldn't happen.");
+                       MINT_IN_BREAK;
                MINT_IN_CASE(MINT_BREAK)
                        ++ip;
                        do_debugger_tramp (mono_debugger_agent_user_break, frame);
@@ -2436,7 +2440,11 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_JMP) {
-                       RuntimeMethod *new_method = rtm->data_items [* (guint16 *)(ip + 1)];
+                       InterpMethod *new_method = rtm->data_items [* (guint16 *)(ip + 1)];
+
+                       if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL)
+                               MONO_PROFILER_RAISE (method_tail_call, (frame->imethod->method, new_method->method));
+
                        if (!new_method->transformed) {
                                frame->ip = ip;
                                frame->ex = mono_interp_transform_method (new_method, context);
@@ -2446,7 +2454,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        ip += 2;
                        if (new_method->alloca_size > rtm->alloca_size)
                                g_error ("MINT_JMP to method which needs more stack space (%d > %d)", new_method->alloca_size, rtm->alloca_size); 
-                       rtm = frame->runtime_method = new_method;
+                       rtm = frame->imethod = new_method;
                        vt_sp = (unsigned char *) sp + rtm->stack_size;
 #if DEBUG_INTERP
                        vtalloc = vt_sp;
@@ -2466,7 +2474,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        ip += 2;
                        --sp;
                        --endsp;
-                       child_frame.runtime_method = sp->data.p;
+                       child_frame.imethod = sp->data.p;
 
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
@@ -2479,12 +2487,12 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
 #ifndef DISABLE_REMOTING
                        /* `this' can be NULL for string:.ctor */
                        if (csignature->hasthis && sp->data.p && mono_object_is_transparent_proxy (sp->data.p)) {
-                               child_frame.runtime_method = mono_interp_get_runtime_method (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.runtime_method->method), &error);
+                               child_frame.imethod = mono_interp_get_imethod (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.imethod->method), &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        } else
 #endif
-                       if (child_frame.runtime_method->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
-                               child_frame.runtime_method = mono_interp_get_runtime_method (rtm->domain, mono_marshal_get_native_wrapper (child_frame.runtime_method->method, FALSE, FALSE), &error);
+                       if (child_frame.imethod->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
+                               child_frame.imethod = mono_interp_get_imethod (rtm->domain, mono_marshal_get_native_wrapper (child_frame.imethod->method, FALSE, FALSE), &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
 
@@ -2535,7 +2543,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        --sp;
                        --endsp;
                        code = sp->data.p;
-                       child_frame.runtime_method = NULL;
+                       child_frame.imethod = NULL;
 
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
@@ -2579,20 +2587,20 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
 
                        frame->ip = ip;
                        
-                       child_frame.runtime_method = rtm->data_items [* (guint16 *)(ip + 1)];
+                       child_frame.imethod = rtm->data_items [* (guint16 *)(ip + 1)];
                        ip += 2;
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
                        /* decrement by the actual number of args */
-                       sp -= child_frame.runtime_method->param_count;
-                       if (child_frame.runtime_method->hasthis)
+                       sp -= child_frame.imethod->param_count;
+                       if (child_frame.imethod->hasthis)
                                --sp;
                        child_frame.stack_args = sp;
 
 #ifndef DISABLE_REMOTING
                        /* `this' can be NULL for string:.ctor */
-                       if (child_frame.runtime_method->hasthis && !child_frame.runtime_method->method->klass->valuetype && sp->data.p && mono_object_is_transparent_proxy (sp->data.p)) {
-                               child_frame.runtime_method = mono_interp_get_runtime_method (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.runtime_method->method), &error);
+                       if (child_frame.imethod->hasthis && !child_frame.imethod->method->klass->valuetype && sp->data.p && mono_object_is_transparent_proxy (sp->data.p)) {
+                               child_frame.imethod = mono_interp_get_imethod (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.imethod->method), &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
 #endif
@@ -2624,14 +2632,14 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                MINT_IN_CASE(MINT_VCALL) {
                        frame->ip = ip;
                        
-                       child_frame.runtime_method = rtm->data_items [* (guint16 *)(ip + 1)];
+                       child_frame.imethod = rtm->data_items [* (guint16 *)(ip + 1)];
                        ip += 2;
 
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
                        /* decrement by the actual number of args */
-                       sp -= child_frame.runtime_method->param_count;
-                       if (child_frame.runtime_method->hasthis) {
+                       sp -= child_frame.imethod->param_count;
+                       if (child_frame.imethod->hasthis) {
                                --sp;
                                MonoObject *this_arg = sp->data.p;
                                if (!this_arg)
@@ -2640,8 +2648,8 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        child_frame.stack_args = sp;
 
 #ifndef DISABLE_REMOTING
-                       if (child_frame.runtime_method->hasthis && !child_frame.runtime_method->method->klass->valuetype && mono_object_is_transparent_proxy (sp->data.p)) {
-                               child_frame.runtime_method = mono_interp_get_runtime_method (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.runtime_method->method), &error);
+                       if (child_frame.imethod->hasthis && !child_frame.imethod->method->klass->valuetype && mono_object_is_transparent_proxy (sp->data.p)) {
+                               child_frame.imethod = mono_interp_get_imethod (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.imethod->method), &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
 #endif
@@ -2668,7 +2676,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                }
 
                MINT_IN_CASE(MINT_JIT_CALL) {
-                       RuntimeMethod *rmethod = rtm->data_items [* (guint16 *)(ip + 1)];
+                       InterpMethod *rmethod = rtm->data_items [* (guint16 *)(ip + 1)];
                        frame->ip = ip;
                        ip += 2;
                        sp = do_jit_call (sp, vt_sp, context, frame, rmethod);
@@ -2700,20 +2708,20 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        
                        token = * (unsigned short *)(ip + 1);
                        ip += 2;
-                       child_frame.runtime_method = rtm->data_items [token];
+                       child_frame.imethod = rtm->data_items [token];
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
 
                        /* decrement by the actual number of args */
-                       sp -= child_frame.runtime_method->param_count + 1;
+                       sp -= child_frame.imethod->param_count + 1;
                        child_frame.stack_args = sp;
                        this_arg = sp->data.p;
                        if (!this_arg)
                                THROW_EX (mono_get_exception_null_reference(), ip - 2);
-                       child_frame.runtime_method = get_virtual_method (child_frame.runtime_method, this_arg);
+                       child_frame.imethod = get_virtual_method (child_frame.imethod, this_arg);
 
                        MonoClass *this_class = this_arg->vtable->klass;
-                       if (this_class->valuetype && child_frame.runtime_method->method->klass->valuetype) {
+                       if (this_class->valuetype && child_frame.imethod->method->klass->valuetype) {
                                /* unbox */
                                gpointer *unboxed = mono_object_unbox (this_arg);
                                sp [0].data.p = unboxed;
@@ -2755,20 +2763,20 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        
                        token = * (unsigned short *)(ip + 1);
                        ip += 2;
-                       child_frame.runtime_method = rtm->data_items [token];
+                       child_frame.imethod = rtm->data_items [token];
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
 
                        /* decrement by the actual number of args */
-                       sp -= child_frame.runtime_method->param_count + 1;
+                       sp -= child_frame.imethod->param_count + 1;
                        child_frame.stack_args = sp;
                        this_arg = sp->data.p;
                        if (!this_arg)
                                THROW_EX (mono_get_exception_null_reference(), ip - 2);
-                       child_frame.runtime_method = get_virtual_method (child_frame.runtime_method, this_arg);
+                       child_frame.imethod = get_virtual_method (child_frame.imethod, this_arg);
 
                        MonoClass *this_class = this_arg->vtable->klass;
-                       if (this_class->valuetype && child_frame.runtime_method->method->klass->valuetype) {
+                       if (this_class->valuetype && child_frame.imethod->method->klass->valuetype) {
                                gpointer *unboxed = mono_object_unbox (this_arg);
                                sp [0].data.p = unboxed;
                        }
@@ -2798,7 +2806,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_CALLRUN)
-                       ves_runtime_method (frame, context);
+                       ves_imethod (frame, context);
                        if (frame->ex) {
                                rtm = NULL;
                                goto handle_exception;
@@ -2812,7 +2820,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        goto exit_frame;
                MINT_IN_CASE(MINT_RET_VOID)
                        if (sp > frame->stack)
-                               g_warning ("ret.void: more values on stack: %d %s", sp-frame->stack, mono_method_full_name (frame->runtime_method->method, TRUE));
+                               g_warning ("ret.void: more values on stack: %d %s", sp-frame->stack, mono_method_full_name (frame->imethod->method, TRUE));
                        goto exit_frame;
                MINT_IN_CASE(MINT_RET_VT)
                        i32 = READ32(ip + 1);
@@ -3524,9 +3532,9 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        child_frame.ip = NULL;
                        child_frame.ex = NULL;
 
-                       child_frame.runtime_method = rtm->data_items [token];
-                       csig = mono_method_signature (child_frame.runtime_method->method);
-                       newobj_class = child_frame.runtime_method->method->klass;
+                       child_frame.imethod = rtm->data_items [token];
+                       csig = mono_method_signature (child_frame.imethod->method);
+                       newobj_class = child_frame.imethod->method->klass;
                        /*if (profiling_classes) {
                                guint count = GPOINTER_TO_UINT (g_hash_table_lookup (profiling_classes, newobj_class));
                                count++;
@@ -3610,6 +3618,15 @@ array_constructed:
                        ++sp;
                        MINT_IN_BREAK;
                }
+               MINT_IN_CASE(MINT_NEWOBJ_MAGIC) {
+                       guint32 token;
+
+                       frame->ip = ip;
+                       token = * (guint16 *)(ip + 1);
+                       ip += 2;
+
+                       MINT_IN_BREAK;
+               }
                MINT_IN_CASE(MINT_CASTCLASS)
                        c = rtm->data_items [*(guint16 *)(ip + 1)];
                        if ((o = sp [-1].data.p)) {
@@ -3955,7 +3972,7 @@ array_constructed:
                        c = rtm->data_items [* (guint16 *)(ip + 1)];
                        guint16 offset = * (guint16 *)(ip + 2);
 
-                       if (c->byval_arg.type == MONO_TYPE_VALUETYPE && !c->enumtype) {
+                       if (c->byval_arg.type == MONO_TYPE_VALUETYPE && !c->enumtype && !(mono_class_is_magic_int (c) || mono_class_is_magic_float (c))) {
                                int size = mono_class_value_size (c, NULL);
                                sp [-1 - offset].data.p = mono_value_box_checked (rtm->domain, c, sp [-1 - offset].data.p, &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
@@ -4427,7 +4444,7 @@ array_constructed:
                                goto main_loop;
                        }
                        if (frame->ex)
-                               goto handle_fault;
+                               goto handle_catch;
                        ves_abort();
                        MINT_IN_BREAK;
                MINT_IN_CASE(MINT_LEAVE) /* Fall through */
@@ -4490,8 +4507,8 @@ array_constructed:
                MINT_IN_CASE(MINT_MONO_RETOBJ)
                        ++ip;
                        sp--;
-                       stackval_from_data (mono_method_signature (frame->runtime_method->method)->ret, frame->retval, sp->data.p,
-                            mono_method_signature (frame->runtime_method->method)->pinvoke);
+                       stackval_from_data (mono_method_signature (frame->imethod->method)->ret, frame->retval, sp->data.p,
+                            mono_method_signature (frame->imethod->method)->pinvoke);
                        if (sp > frame->stack)
                                g_warning ("retobj: more values on stack: %d", sp-frame->stack);
                        goto exit_frame;
@@ -4591,6 +4608,15 @@ array_constructed:
        --sp; \
        sp [-1].data.i = sp [-1].data.datamem op sp [0].data.datamem; \
        ++ip;
+
+#define RELOP_FP(datamem, op, noorder) \
+       --sp; \
+       if (isunordered (sp [-1].data.datamem, sp [0].data.datamem)) \
+               sp [-1].data.i = noorder; \
+       else \
+               sp [-1].data.i = sp [-1].data.datamem op sp [0].data.datamem; \
+       ++ip;
+
                MINT_IN_CASE(MINT_CEQ_I4)
                        RELOP(i, ==);
                        MINT_IN_BREAK;
@@ -4602,12 +4628,16 @@ array_constructed:
                        RELOP(l, ==);
                        MINT_IN_BREAK;
                MINT_IN_CASE(MINT_CEQ_R8)
-                       --sp; 
-                       if (isunordered (sp [-1].data.f, sp [0].data.f))
-                               sp [-1].data.i = 0;
-                       else
-                               sp [-1].data.i = sp [-1].data.f == sp [0].data.f;
-                       ++ip;
+                       RELOP_FP(f, ==, 0);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CNE_I4)
+                       RELOP(i, !=);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CNE_I8)
+                       RELOP(l, !=);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CNE_R8)
+                       RELOP_FP(f, !=, 0);
                        MINT_IN_BREAK;
                MINT_IN_CASE(MINT_CGT_I4)
                        RELOP(i, >);
@@ -4616,12 +4646,16 @@ array_constructed:
                        RELOP(l, >);
                        MINT_IN_BREAK;
                MINT_IN_CASE(MINT_CGT_R8)
-                       --sp; 
-                       if (isunordered (sp [-1].data.f, sp [0].data.f))
-                               sp [-1].data.i = 0;
-                       else
-                               sp [-1].data.i = sp [-1].data.f > sp [0].data.f;
-                       ++ip;
+                       RELOP_FP(f, >, 0);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CGE_I4)
+                       RELOP(i, >=);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CGE_I8)
+                       RELOP(l, >=);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CGE_R8)
+                       RELOP_FP(f, >=, 0);
                        MINT_IN_BREAK;
 
 #define RELOP_CAST(datamem, op, type) \
@@ -4629,6 +4663,13 @@ array_constructed:
        sp [-1].data.i = (type)sp [-1].data.datamem op (type)sp [0].data.datamem; \
        ++ip;
 
+               MINT_IN_CASE(MINT_CGE_UN_I4)
+                       RELOP_CAST(l, >=, guint32);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CGE_UN_I8)
+                       RELOP_CAST(l, >=, guint64);
+                       MINT_IN_BREAK;
+
                MINT_IN_CASE(MINT_CGT_UN_I4)
                        RELOP_CAST(i, >, guint32);
                        MINT_IN_BREAK;
@@ -4636,12 +4677,7 @@ array_constructed:
                        RELOP_CAST(l, >, guint64);
                        MINT_IN_BREAK;
                MINT_IN_CASE(MINT_CGT_UN_R8)
-                       --sp; 
-                       if (isunordered (sp [-1].data.f, sp [0].data.f))
-                               sp [-1].data.i = 1;
-                       else
-                               sp [-1].data.i = sp [-1].data.f > sp [0].data.f;
-                       ++ip;
+                       RELOP_FP(f, >, 1);
                        MINT_IN_BREAK;
                MINT_IN_CASE(MINT_CLT_I4)
                        RELOP(i, <);
@@ -4650,12 +4686,7 @@ array_constructed:
                        RELOP(l, <);
                        MINT_IN_BREAK;
                MINT_IN_CASE(MINT_CLT_R8)
-                       --sp; 
-                       if (isunordered (sp [-1].data.f, sp [0].data.f))
-                               sp [-1].data.i = 0;
-                       else
-                               sp [-1].data.i = sp [-1].data.f < sp [0].data.f;
-                       ++ip;
+                       RELOP_FP(f, <, 0);
                        MINT_IN_BREAK;
                MINT_IN_CASE(MINT_CLT_UN_I4)
                        RELOP_CAST(i, <, guint32);
@@ -4664,13 +4695,28 @@ array_constructed:
                        RELOP_CAST(l, <, guint64);
                        MINT_IN_BREAK;
                MINT_IN_CASE(MINT_CLT_UN_R8)
-                       --sp; 
-                       if (isunordered (sp [-1].data.f, sp [0].data.f))
-                               sp [-1].data.i = 1;
-                       else
-                               sp [-1].data.i = sp [-1].data.f < sp [0].data.f;
-                       ++ip;
+                       RELOP_FP(f, <, 1);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CLE_I4)
+                       RELOP(i, <=);
                        MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CLE_I8)
+                       RELOP(l, <=);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CLE_UN_I4)
+                       RELOP_CAST(l, <=, guint32);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CLE_UN_I8)
+                       RELOP_CAST(l, <=, guint64);
+                       MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_CLE_R8)
+                       RELOP_FP(f, <=, 0);
+                       MINT_IN_BREAK;
+
+#undef RELOP
+#undef RELOP_FP
+#undef RELOP_CAST
+
                MINT_IN_CASE(MINT_LDFTN) {
                        sp->data.p = rtm->data_items [* (guint16 *)(ip + 1)];
                        ++sp;
@@ -4678,7 +4724,7 @@ array_constructed:
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_LDVIRTFTN) {
-                       RuntimeMethod *m = rtm->data_items [* (guint16 *)(ip + 1)];
+                       InterpMethod *m = rtm->data_items [* (guint16 *)(ip + 1)];
                        ip += 2;
                        --sp;
                        if (!sp->data.p)
@@ -4764,6 +4810,26 @@ array_constructed:
                        MINT_IN_BREAK;
                }
 
+               MINT_IN_CASE(MINT_PROF_ENTER) {
+                       ip += 1;
+
+                       if (MONO_PROFILER_ENABLED (method_enter)) {
+                               MonoProfilerCallContext *prof_ctx = NULL;
+
+                               if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_ENTER_CONTEXT) {
+                                       prof_ctx = g_new0 (MonoProfilerCallContext, 1);
+                                       prof_ctx->interp_frame = frame;
+                                       prof_ctx->method = frame->imethod->method;
+                               }
+
+                               MONO_PROFILER_RAISE (method_enter, (frame->imethod->method, prof_ctx));
+
+                               g_free (prof_ctx);
+                       }
+
+                       MINT_IN_BREAK;
+               }
+
                MINT_IN_CASE(MINT_LDARGA)
                        sp->data.p = frame->args + * (guint16 *)(ip + 1);
                        ip += 2;
@@ -4838,7 +4904,7 @@ array_constructed:
 
                        int len = sp [-1].data.i;
                        sp [-1].data.p = alloca (len);
-                       MonoMethodHeader *header = mono_method_get_header_checked (frame->runtime_method->method, &error);
+                       MonoMethodHeader *header = mono_method_get_header_checked (frame->imethod->method, &error);
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        if (header && header->init_locals)
                                memset (sp [-1].data.p, 0, len);
@@ -4918,7 +4984,7 @@ array_constructed:
        {
                int i;
                guint32 ip_offset;
-               MonoInvocation *inv;
+               InterpFrame *inv;
                MonoExceptionClause *clause;
                /*char *message;*/
                MonoObject *ex_obj;
@@ -4934,19 +5000,19 @@ array_constructed:
 
                for (inv = frame; inv; inv = inv->parent) {
                        MonoMethod *method;
-                       if (inv->runtime_method == NULL)
+                       if (inv->imethod == NULL)
                                continue;
-                       method = inv->runtime_method->method;
+                       method = inv->imethod->method;
                        if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
                                continue;
                        if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME))
                                continue;
                        if (inv->ip == NULL)
                                continue;
-                       ip_offset = inv->ip - inv->runtime_method->code;
+                       ip_offset = inv->ip - inv->imethod->code;
                        inv->ex_handler = NULL; /* clear this in case we are trhowing an exception while handling one  - this one wins */
-                       for (i = 0; i < inv->runtime_method->num_clauses; ++i) {
-                               clause = &inv->runtime_method->clauses [i];
+                       for (i = 0; i < inv->imethod->num_clauses; ++i) {
+                               clause = &inv->imethod->clauses [i];
 #if DEBUG_INTERP
                                g_print ("* clause [%d]: %p\n", i, clause);
 #endif
@@ -4958,18 +5024,18 @@ array_constructed:
                                        if (tracing)
                                                g_print ("* Filter found at '%s'\n", method->name);
 #endif
-                                       MonoInvocation dup_frame;
+                                       InterpFrame dup_frame;
                                        stackval retval;
-                                       memcpy (&dup_frame, inv, sizeof (MonoInvocation));
+                                       memcpy (&dup_frame, inv, sizeof (InterpFrame));
                                        dup_frame.retval = &retval;
-                                       ves_exec_method_with_context (&dup_frame, context, inv->runtime_method->code + clause->data.filter_offset, frame->ex, -1);
+                                       ves_exec_method_with_context (&dup_frame, context, inv->imethod->code + clause->data.filter_offset, frame->ex, -1);
                                        if (dup_frame.retval->data.i) {
 #if DEBUG_INTERP
                                                if (tracing)
                                                        g_print ("* Matched Filter at '%s'\n", method->name);
 #endif
                                                inv->ex_handler = clause;
-                                               *(MonoException**)(inv->locals + inv->runtime_method->exvar_offsets [i]) = frame->ex;
+                                               *(MonoException**)(inv->locals + inv->imethod->exvar_offsets [i]) = frame->ex;
                                                goto handle_finally;
                                        }
                                } else if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE) {
@@ -4985,7 +5051,7 @@ array_constructed:
                                                        g_print ("* Found handler at '%s'\n", method->name);
 #endif
                                                inv->ex_handler = clause;
-                                               *(MonoException**)(inv->locals + inv->runtime_method->exvar_offsets [i]) = frame->ex;
+                                               *(MonoException**)(inv->locals + inv->imethod->exvar_offsets [i]) = frame->ex;
                                                goto handle_finally;
                                        }
                                }
@@ -5011,7 +5077,7 @@ die_on_ex:
                guint32 ip_offset;
                MonoExceptionClause *clause;
                GSList *old_list = finally_ips;
-               MonoMethod *method = frame->runtime_method->method;
+               MonoMethod *method = frame->imethod->method;
                MonoMethodHeader *header = mono_method_get_header_checked (method, &error);
                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                
@@ -5067,7 +5133,8 @@ die_on_ex:
                int i;
                guint32 ip_offset;
                MonoExceptionClause *clause;
-               MonoMethod *method = frame->runtime_method->method;
+               GSList *old_list = finally_ips;
+               MonoMethod *method = frame->imethod->method;
                MonoMethodHeader *header = mono_method_get_header_checked (method, &error);
                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                
@@ -5080,13 +5147,23 @@ die_on_ex:
                        clause = &rtm->clauses [i];
                        if (clause->flags == MONO_EXCEPTION_CLAUSE_FAULT && MONO_OFFSET_IN_CLAUSE (clause, ip_offset)) {
                                ip = rtm->code + clause->handler_offset;
+                               finally_ips = g_slist_prepend (finally_ips, (gpointer) ip);
 #if DEBUG_INTERP
                                if (tracing)
                                        g_print ("* Executing handler at IL_%04x\n", clause->handler_offset);
 #endif
-                               goto main_loop;
                        }
                }
+
+               if (old_list != finally_ips && finally_ips) {
+                       ip = finally_ips->data;
+                       finally_ips = g_slist_remove (finally_ips, ip);
+                       sp = frame->stack; /* spec says stack should be empty at endfinally so it should be at the start too */
+                       goto main_loop;
+               }
+       }
+       handle_catch:
+       {
                /*
                 * If the handler for the exception was found in this method, we jump
                 * to it right away, otherwise we return and let the caller run
@@ -5109,15 +5186,45 @@ die_on_ex:
                goto exit_frame;
        }
 exit_frame:
+
+       if (!frame->ex && MONO_PROFILER_ENABLED (method_leave) &&
+           frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE) {
+               MonoProfilerCallContext *prof_ctx = NULL;
+
+               if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE_CONTEXT) {
+                       prof_ctx = g_new0 (MonoProfilerCallContext, 1);
+                       prof_ctx->interp_frame = frame;
+                       prof_ctx->method = frame->imethod->method;
+
+                       MonoType *rtype = mono_method_signature (frame->imethod->method)->ret;
+
+                       switch (rtype->type) {
+                       case MONO_TYPE_VOID:
+                               break;
+                       case MONO_TYPE_VALUETYPE:
+                               prof_ctx->return_value = frame->retval->data.p;
+                               break;
+                       default:
+                               prof_ctx->return_value = frame->retval;
+                               break;
+                       }
+               }
+
+               MONO_PROFILER_RAISE (method_leave, (frame->imethod->method, prof_ctx));
+
+               g_free (prof_ctx);
+       } else if (frame->ex && frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE)
+               MONO_PROFILER_RAISE (method_exception_leave, (frame->imethod->method, &frame->ex->object));
+
        DEBUG_LEAVE ();
 }
 
 void
-ves_exec_method (MonoInvocation *frame)
+ves_exec_method (InterpFrame *frame)
 {
        ThreadContext *context = mono_native_tls_get_value (thread_context_id);
        ThreadContext context_struct;
-       MonoDomain *domain = frame->runtime_method->domain;
+       MonoDomain *domain = frame->imethod->domain;
        MonoError error;
        jmp_buf env;
 
@@ -5139,7 +5246,7 @@ ves_exec_method (MonoInvocation *frame)
        }
        frame->ip = NULL;
        frame->parent = context->current_frame;
-       frame->runtime_method = mono_interp_get_runtime_method (domain, frame->method, &error);
+       frame->imethod = mono_interp_get_imethod (domain, frame->method, &error);
        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
        context->managed_code = 1;
        ves_exec_method_with_context (frame, context, NULL, NULL, -1);
@@ -5376,14 +5483,14 @@ mono_interp_set_resume_state (MonoJitTlsData *jit_tls, MonoException *ex, MonoIn
 void
 mono_interp_run_finally (StackFrameInfo *frame, int clause_index, gpointer handler_ip)
 {
-       MonoInvocation *iframe = frame->interp_frame;
+       InterpFrame *iframe = frame->interp_frame;
        ThreadContext *context = mono_native_tls_get_value (thread_context_id);
 
        ves_exec_method_with_context (iframe, context, handler_ip, NULL, clause_index);
 }
 
 typedef struct {
-       MonoInvocation *current;
+       InterpFrame *current;
 } StackIter;
 
 /*
@@ -5396,18 +5503,18 @@ mono_interp_frame_iter_init (MonoInterpStackIter *iter, gpointer interp_exit_dat
 {
        StackIter *stack_iter = (StackIter*)iter;
 
-       stack_iter->current = (MonoInvocation*)interp_exit_data;
+       stack_iter->current = (InterpFrame*)interp_exit_data;
 }
 
 gboolean
 mono_interp_frame_iter_next (MonoInterpStackIter *iter, StackFrameInfo *frame)
 {
        StackIter *stack_iter = (StackIter*)iter;
-       MonoInvocation *iframe = stack_iter->current;
+       InterpFrame *iframe = stack_iter->current;
 
        memset (frame, 0, sizeof (StackFrameInfo));
-       /* pinvoke frames doesn't have runtime_method set */
-       while (iframe && !(iframe->runtime_method && iframe->runtime_method->code))
+       /* pinvoke frames doesn't have imethod set */
+       while (iframe && !(iframe->imethod && iframe->imethod->code))
                iframe = iframe->parent;
        if (!iframe)
                return FALSE;
@@ -5416,11 +5523,11 @@ mono_interp_frame_iter_next (MonoInterpStackIter *iter, StackFrameInfo *frame)
        // FIXME:
        frame->domain = mono_domain_get ();
        frame->interp_frame = iframe;
-       frame->method = iframe->runtime_method->method;
+       frame->method = iframe->imethod->method;
        frame->actual_method = frame->method;
        /* This is the offset in the interpreter IR */
-       frame->native_offset = (guint8*)iframe->ip - (guint8*)iframe->runtime_method->code;
-       frame->ji = iframe->runtime_method->jinfo;
+       frame->native_offset = (guint8*)iframe->ip - (guint8*)iframe->imethod->code;
+       frame->ji = iframe->imethod->jinfo;
 
        stack_iter->current = iframe->parent;
 
@@ -5430,9 +5537,9 @@ mono_interp_frame_iter_next (MonoInterpStackIter *iter, StackFrameInfo *frame)
 MonoJitInfo*
 mono_interp_find_jit_info (MonoDomain *domain, MonoMethod *method)
 {
-       RuntimeMethod* rtm;
+       InterpMethod* rtm;
 
-       rtm = lookup_runtime_method (domain, method);
+       rtm = lookup_imethod (domain, method);
        if (rtm)
                return rtm->jinfo;
        else
@@ -5458,29 +5565,29 @@ mono_interp_clear_breakpoint (MonoJitInfo *jinfo, gpointer ip)
 MonoJitInfo*
 mono_interp_frame_get_jit_info (MonoInterpFrameHandle frame)
 {
-       MonoInvocation *iframe = (MonoInvocation*)frame;
+       InterpFrame *iframe = (InterpFrame*)frame;
 
-       g_assert (iframe->runtime_method);
-       return iframe->runtime_method->jinfo;
+       g_assert (iframe->imethod);
+       return iframe->imethod->jinfo;
 }
 
 gpointer
 mono_interp_frame_get_ip (MonoInterpFrameHandle frame)
 {
-       MonoInvocation *iframe = (MonoInvocation*)frame;
+       InterpFrame *iframe = (InterpFrame*)frame;
 
-       g_assert (iframe->runtime_method);
+       g_assert (iframe->imethod);
        return (gpointer)iframe->ip;
 }
 
 gpointer
 mono_interp_frame_get_arg (MonoInterpFrameHandle frame, int pos)
 {
-       MonoInvocation *iframe = (MonoInvocation*)frame;
+       InterpFrame *iframe = (InterpFrame*)frame;
 
-       g_assert (iframe->runtime_method);
+       g_assert (iframe->imethod);
 
-       int arg_offset = iframe->runtime_method->arg_offsets [pos + (iframe->runtime_method->hasthis ? 1 : 0)];
+       int arg_offset = iframe->imethod->arg_offsets [pos + (iframe->imethod->hasthis ? 1 : 0)];
 
        return iframe->args + arg_offset;
 }
@@ -5488,22 +5595,22 @@ mono_interp_frame_get_arg (MonoInterpFrameHandle frame, int pos)
 gpointer
 mono_interp_frame_get_local (MonoInterpFrameHandle frame, int pos)
 {
-       MonoInvocation *iframe = (MonoInvocation*)frame;
+       InterpFrame *iframe = (InterpFrame*)frame;
 
-       g_assert (iframe->runtime_method);
+       g_assert (iframe->imethod);
 
-       return iframe->locals + iframe->runtime_method->local_offsets [pos];
+       return iframe->locals + iframe->imethod->local_offsets [pos];
 }
 
 gpointer
 mono_interp_frame_get_this (MonoInterpFrameHandle frame)
 {
-       MonoInvocation *iframe = (MonoInvocation*)frame;
+       InterpFrame *iframe = (InterpFrame*)frame;
 
-       g_assert (iframe->runtime_method);
-       g_assert (iframe->runtime_method->hasthis);
+       g_assert (iframe->imethod);
+       g_assert (iframe->imethod->hasthis);
 
-       int arg_offset = iframe->runtime_method->arg_offsets [0];
+       int arg_offset = iframe->imethod->arg_offsets [0];
 
        return iframe->args + arg_offset;
 }
index c270a2b18e47796337c5ce59b4807b4de8c31294..c98740a5d25a2577c3729828a74cfb7e83a82b01 100644 (file)
@@ -9,6 +9,7 @@
 /* OPDEF (opsymbol, opstring, oplength (in uint16s), optype) */
 
 OPDEF(MINT_NOP, "nop", 1, MintOpNoArgs)
+OPDEF(MINT_NIY, "niy", 1, MintOpNoArgs)
 OPDEF(MINT_BREAK, "break", 1, MintOpNoArgs)
 OPDEF(MINT_LDNULL, "ldnull", 1, MintOpNoArgs)
 OPDEF(MINT_DUP, "dup", 1, MintOpNoArgs)
@@ -269,6 +270,7 @@ OPDEF(MINT_CALLRUN, "callrun", 1, MintOpNoArgs)
 OPDEF(MINT_ENDFILTER, "endfilter", 1, MintOpNoArgs)
 
 OPDEF(MINT_NEWOBJ, "newobj", 2, MintOpMethodToken) 
+OPDEF(MINT_NEWOBJ_MAGIC, "newobj_magic", 2, MintOpMethodToken)
 OPDEF(MINT_INITOBJ, "initobj", 3, MintOpInt) 
 OPDEF(MINT_CASTCLASS, "castclass", 2, MintOpClassToken) 
 OPDEF(MINT_ISINST, "isinst", 2, MintOpClassToken) 
@@ -471,12 +473,23 @@ OPDEF(MINT_CEQ_I4, "ceq.i4", 1, MintOpNoArgs)
 OPDEF(MINT_CEQ_I8, "ceq.i8", 1, MintOpNoArgs)
 OPDEF(MINT_CEQ_R8, "ceq.r8", 1, MintOpNoArgs)
 
+OPDEF(MINT_CNE_I4, "cne.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CNE_I8, "cne.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CNE_R8, "cne.r8", 1, MintOpNoArgs)
+
 OPDEF(MINT_CEQ0_I4, "ceq0.i4", 1, MintOpNoArgs)
 
 OPDEF(MINT_CGT_I4, "cgt.i4", 1, MintOpNoArgs)
 OPDEF(MINT_CGT_I8, "cgt.i8", 1, MintOpNoArgs)
 OPDEF(MINT_CGT_R8, "cgt.r8", 1, MintOpNoArgs)
 
+OPDEF(MINT_CGE_I4, "cge.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CGE_I8, "cge.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CGE_R8, "cge.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CGE_UN_I4, "cge.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CGE_UN_I8, "cge.un.i8", 1, MintOpNoArgs)
+
 OPDEF(MINT_CGT_UN_I4, "cgt.un.i4", 1, MintOpNoArgs)
 OPDEF(MINT_CGT_UN_I8, "cgt.un.i8", 1, MintOpNoArgs)
 OPDEF(MINT_CGT_UN_R8, "cgt.un.r8", 1, MintOpNoArgs)
@@ -485,6 +498,13 @@ OPDEF(MINT_CLT_I4, "clt.i4", 1, MintOpNoArgs)
 OPDEF(MINT_CLT_I8, "clt.i8", 1, MintOpNoArgs)
 OPDEF(MINT_CLT_R8, "clt.r8", 1, MintOpNoArgs)
 
+OPDEF(MINT_CLE_I4, "cle.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CLE_I8, "cle.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CLE_R8, "cle.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CLE_UN_I4, "cle.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CLE_UN_I8, "cle.un.i8", 1, MintOpNoArgs)
+
 OPDEF(MINT_CLT_UN_I4, "clt.un.i4", 1, MintOpNoArgs)
 OPDEF(MINT_CLT_UN_I8, "clt.un.i8", 1, MintOpNoArgs)
 OPDEF(MINT_CLT_UN_R8, "clt.un.r8", 1, MintOpNoArgs)
@@ -526,3 +546,9 @@ OPDEF(MINT_JIT_CALL, "mono_jit_call", 2, MintOpNoArgs)
 OPDEF(MINT_SDB_INTR_LOC, "sdb_intr_loc", 1, MintOpNoArgs)
 OPDEF(MINT_SDB_SEQ_POINT, "sdb_seq_point", 1, MintOpNoArgs)
 OPDEF(MINT_SDB_BREAKPOINT, "sdb_breakpoint", 1, MintOpNoArgs)
+
+/*
+ * This needs to be an opcode because we need to trigger the enter event after
+ * the STINARG* opcodes have executed.
+ */
+OPDEF(MINT_PROF_ENTER, "prof_enter", 1, MintOpNoArgs)
index 02a92f271c83a99ee29e82aac9cd2be02629a25f..8a072ce3c327bc9f27ca6ae1634ace3781328f21 100644 (file)
@@ -64,7 +64,7 @@ typedef struct
 {
        MonoMethod *method;
        MonoMethodHeader *header;
-       RuntimeMethod *rtm;
+       InterpMethod *rtm;
        const unsigned char *il_code;
        const unsigned char *ip;
        const unsigned char *last_ip;
@@ -142,6 +142,132 @@ static int stack_type [] = {
        STACK_TYPE_VT
 };
 
+#if SIZEOF_VOID_P == 8
+#define MINT_NEG_P MINT_NEG_I8
+#define MINT_NOT_P MINT_NOT_I8
+
+#define MINT_NEG_FP MINT_NEG_R8
+
+#define MINT_ADD_P MINT_ADD_I8
+#define MINT_SUB_P MINT_SUB_I8
+#define MINT_MUL_P MINT_MUL_I8
+#define MINT_DIV_P MINT_DIV_I8
+#define MINT_DIV_UN_P MINT_DIV_UN_I8
+#define MINT_REM_P MINT_REM_I8
+#define MINT_REM_UN_P MINT_REM_UN_I8
+#define MINT_AND_P MINT_AND_I8
+#define MINT_OR_P MINT_OR_I8
+#define MINT_XOR_P MINT_XOR_I8
+#define MINT_SHL_P MINT_SHL_I8
+#define MINT_SHR_P MINT_SHR_I8
+#define MINT_SHR_UN_P MINT_SHR_UN_I8
+
+#define MINT_CEQ_P MINT_CEQ_I8
+#define MINT_CNE_P MINT_CNE_I8
+#define MINT_CLT_P MINT_CLT_I8
+#define MINT_CLT_UN_P MINT_CLT_UN_I8
+#define MINT_CGT_P MINT_CGT_I8
+#define MINT_CGT_UN_P MINT_CGT_UN_I8
+#define MINT_CLE_P MINT_CLE_I8
+#define MINT_CLE_UN_P MINT_CLE_UN_I8
+#define MINT_CGE_P MINT_CGE_I8
+#define MINT_CGE_UN_P MINT_CGE_UN_I8
+
+#define MINT_ADD_FP MINT_ADD_R8
+#define MINT_SUB_FP MINT_SUB_R8
+#define MINT_MUL_FP MINT_MUL_R8
+#define MINT_DIV_FP MINT_DIV_R8
+#define MINT_REM_FP MINT_REM_R8
+
+#define MINT_CNE_FP MINT_CNE_R8
+#define MINT_CEQ_FP MINT_CEQ_R8
+#define MINT_CGT_FP MINT_CGT_R8
+#define MINT_CGE_FP MINT_CGE_R8
+#define MINT_CLT_FP MINT_CLT_R8
+#define MINT_CLE_FP MINT_CLE_R8
+
+#else
+
+#define MINT_NEG_P MINT_NEG_I4
+#define MINT_NOT_P MINT_NOT_I4
+
+#define MINT_NEG_FP MINT_NEG_R8
+
+#define MINT_ADD_P MINT_ADD_I4
+#define MINT_SUB_P MINT_SUB_I4
+#define MINT_MUL_P MINT_MUL_I4
+#define MINT_DIV_P MINT_DIV_I4
+#define MINT_DIV_UN_P MINT_DIV_UN_I4
+#define MINT_REM_P MINT_REM_I4
+#define MINT_REM_UN_P MINT_REM_UN_I4
+#define MINT_AND_P MINT_AND_I4
+#define MINT_OR_P MINT_OR_I4
+#define MINT_XOR_P MINT_XOR_I4
+#define MINT_SHL_P MINT_SHL_I4
+#define MINT_SHR_P MINT_SHR_I4
+#define MINT_SHR_UN_P MINT_SHR_UN_I4
+
+#define MINT_CEQ_P MINT_CEQ_I4
+#define MINT_CNE_P MINT_CNE_I4
+#define MINT_CLT_P MINT_CLT_I4
+#define MINT_CLT_UN_P MINT_CLT_UN_I4
+#define MINT_CGT_P MINT_CGT_I4
+#define MINT_CGT_UN_P MINT_CGT_UN_I4
+#define MINT_CLE_P MINT_CLE_I4
+#define MINT_CLE_UN_P MINT_CLE_UN_I4
+#define MINT_CGE_P MINT_CGE_I4
+#define MINT_CGE_UN_P MINT_CGE_UN_I4
+
+#define MINT_ADD_FP MINT_ADD_R8
+#define MINT_SUB_FP MINT_SUB_R8
+#define MINT_MUL_FP MINT_MUL_R8
+#define MINT_DIV_FP MINT_DIV_R8
+#define MINT_REM_FP MINT_REM_R8
+
+#define MINT_CNE_FP MINT_CNE_R8
+#define MINT_CEQ_FP MINT_CEQ_R8
+#define MINT_CGT_FP MINT_CGT_R8
+#define MINT_CGE_FP MINT_CGE_R8
+#define MINT_CLT_FP MINT_CLT_R8
+#define MINT_CLE_FP MINT_CLE_R8
+
+#endif
+
+typedef struct {
+       const gchar *op_name;
+       guint16 insn [3];
+} MagicIntrinsic;
+
+// static const MagicIntrinsic int_binop[] = {
+
+static const MagicIntrinsic int_unnop[] = {
+       { "op_UnaryPlus", {MINT_NOP, MINT_NOP, MINT_NOP}},
+       { "op_UnaryNegation", {MINT_NEG_P, MINT_NEG_P, MINT_NEG_FP}},
+       { "op_OnesComplement", {MINT_NOT_P, MINT_NOT_P, MINT_NIY}}
+};
+
+static const MagicIntrinsic int_binop[] = {
+       { "op_Addition", {MINT_ADD_P, MINT_ADD_P, MINT_ADD_FP}},
+       { "op_Subtraction", {MINT_SUB_P, MINT_SUB_P, MINT_SUB_FP}},
+       { "op_Multiply", {MINT_MUL_P, MINT_MUL_P, MINT_MUL_FP}},
+       { "op_Division", {MINT_DIV_P, MINT_DIV_UN_P, MINT_DIV_FP}},
+       { "op_Modulus", {MINT_REM_P, MINT_REM_UN_P, MINT_REM_FP}},
+       { "op_BitwiseAnd", {MINT_AND_P, MINT_AND_P, MINT_NIY}},
+       { "op_BitwiseOr", {MINT_OR_P, MINT_OR_P, MINT_NIY}},
+       { "op_ExclusiveOr", {MINT_XOR_P, MINT_XOR_P, MINT_NIY}},
+       { "op_LeftShift", {MINT_SHL_P, MINT_SHL_P, MINT_NIY}},
+       { "op_RightShift", {MINT_SHR_P, MINT_SHR_UN_P, MINT_NIY}},
+};
+
+static const MagicIntrinsic int_cmpop[] = {
+       { "op_Inequality", {MINT_CNE_P, MINT_CNE_P, MINT_CNE_FP}},
+       { "op_Equality", {MINT_CEQ_P, MINT_CEQ_P, MINT_CEQ_FP}},
+       { "op_GreaterThan", {MINT_CGT_P, MINT_CGT_UN_P, MINT_CGT_FP}},
+       { "op_GreaterThanOrEqual", {MINT_CGE_P, MINT_CGE_UN_P, MINT_CGE_FP}},
+       { "op_LessThan", {MINT_CLT_P, MINT_CLT_UN_P, MINT_CLT_FP}},
+       { "op_LessThanOrEqual", {MINT_CLE_P, MINT_CLE_UN_P, MINT_CLE_FP}}
+};
+
 static void
 grow_code (TransformData *td)
 {
@@ -315,8 +441,9 @@ shift_op(TransformData *td, int mint_op)
 }
 
 static int 
-mint_type(MonoType *type)
+mint_type(MonoType *type_)
 {
+       MonoType *type = mini_native_type_replace_type (type_);
        if (type->byref)
                return MINT_TYPE_P;
 enum_type:
@@ -649,8 +776,8 @@ store_local(TransformData *td, int n)
 
 #define SIMPLE_OP(td, op) \
        do { \
-               ADD_CODE(&td, op); \
-               ++td.ip; \
+               ADD_CODE(td, op); \
+               ++td->ip; \
        } while (0)
 
 static guint16
@@ -700,6 +827,32 @@ jit_call_supported (MonoMethod *method, MonoMethodSignature *sig)
        return FALSE;
 }
 
+static inline gboolean
+type_size (MonoType *type)
+{
+       if (type->type == MONO_TYPE_I4 || type->type == MONO_TYPE_U4)
+               return 4;
+       else if (type->type == MONO_TYPE_I8 || type->type == MONO_TYPE_U8)
+               return 8;
+       else if (type->type == MONO_TYPE_R4 && !type->byref)
+               return 4;
+       else if (type->type == MONO_TYPE_R8 && !type->byref)
+               return 8;
+       return SIZEOF_VOID_P;
+}
+
+static int mono_class_get_magic_index (MonoClass *k)
+{
+       if (mono_class_is_magic_int (k))
+               return !strcmp ("nint", k->name) ? 0 : 1;
+
+       if (mono_class_is_magic_float (k))
+               return 2;
+
+       return -1;
+}
+
+
 static void
 interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target_method, MonoDomain *domain, MonoGenericContext *generic_context, unsigned char *is_bb_start, int body_start_offset, MonoClass *constrained_class, gboolean readonly)
 {
@@ -761,30 +914,151 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
 
        /* Intrinsics */
        if (target_method) {
+               const char *tm = target_method->name;
+               int type_index = mono_class_get_magic_index (target_method->klass);
+
                if (target_method->klass == mono_defaults.string_class) {
-                       if (target_method->name [0] == 'g') {
-                               if (strcmp (target_method->name, "get_Chars") == 0)
+                       if (tm [0] == 'g') {
+                               if (strcmp (tm, "get_Chars") == 0)
                                        op = MINT_GETCHR;
-                               else if (strcmp (target_method->name, "get_Length") == 0)
+                               else if (strcmp (tm, "get_Length") == 0)
                                        op = MINT_STRLEN;
                        }
+               } else if (type_index >= 0) {
+                       MonoClass *magic_class = target_method->klass;
+
+                       const int mt = mint_type (&magic_class->byval_arg);
+                       if (!strcmp (".ctor", tm)) {
+                               MonoType *arg = csignature->params [0];
+                               /* depending on SIZEOF_VOID_P and the type of the value passed to the .ctor we either have to CONV it, or do nothing */
+                               int arg_size = type_size (arg);
+
+                               if (arg_size > SIZEOF_VOID_P) { // 8 -> 4
+                                       switch (type_index) {
+                                       case 0: case 1:
+                                               ADD_CODE (td, MINT_CONV_I8_I4);
+                                               break;
+                                       case 2:
+                                               // ADD_CODE (td, MINT_CONV_R8_R4);
+                                               break;
+                                       }
+                               }
+
+                               if (arg_size < SIZEOF_VOID_P) { // 4 -> 8
+                                       switch (type_index) {
+                                       case 0: case 1:
+                                               ADD_CODE (td, MINT_CONV_I4_I8);
+                                               break;
+                                       case 2:
+                                               ADD_CODE (td, MINT_CONV_R4_R8);
+                                               break;
+                                       }
+                               }
+
+                               switch (type_index) {
+                               case 0: case 1:
+#if SIZEOF_VOID_P == 4
+                                       ADD_CODE (td, MINT_STIND_I4);
+#else
+                                       ADD_CODE (td, MINT_STIND_I8);
+#endif
+                                       break;
+                               case 2:
+#if SIZEOF_VOID_P == 4
+                                       ADD_CODE (td, MINT_STIND_R4);
+#else
+                                       ADD_CODE (td, MINT_STIND_R8);
+#endif
+                                       break;
+                               }
+
+                               td->sp -= 2;
+                               td->ip += 5;
+                               return;
+                       } else if (!strcmp ("op_Implicit", tm ) || !strcmp ("op_Explicit", tm)) {
+                               int arg_size = type_size (csignature->params [0]);
+                               if (arg_size > SIZEOF_VOID_P) { // 8 -> 4
+                                       switch (type_index) {
+                                       case 0: case 1:
+                                               ADD_CODE (td, MINT_CONV_I8_I4);
+                                               break;
+                                       case 2:
+                                               // ADD_CODE (td, MINT_CONV_R4_R8);
+                                               break;
+                                       }
+                               }
+
+                               if (arg_size < SIZEOF_VOID_P) { // 4 -> 8
+                                       switch (type_index) {
+                                       case 0: case 1:
+                                               ADD_CODE (td, MINT_CONV_I4_I8);
+                                               break;
+                                       case 2:
+                                               ADD_CODE (td, MINT_CONV_R4_R8);
+                                               break;
+                                       }
+                               }
+
+                               SET_TYPE (td->sp - 1, stack_type [mt], magic_class);
+                               td->ip += 5;
+                               return;
+                       } else if (!strcmp (".cctor", tm)) {
+                               /* white list */
+                               goto no_intrinsic;
+                       } else if (!strcmp ("Parse", tm)) {
+                               /* white list */
+                               goto no_intrinsic;
+                       }
+
+                       for (i = 0; i < sizeof (int_unnop) / sizeof  (MagicIntrinsic); ++i) {
+                               if (!strcmp (int_unnop [i].op_name, tm)) {
+                                       ADD_CODE (td, int_unnop [i].insn [type_index]);
+                                       SET_TYPE (td->sp - 1, stack_type [mt], magic_class);
+                                       td->ip += 5;
+                                       return;
+                               }
+                       }
+
+                       for (i = 0; i < sizeof (int_binop) / sizeof  (MagicIntrinsic); ++i) {
+                               if (!strcmp (int_binop [i].op_name, tm)) {
+                                       ADD_CODE (td, int_binop [i].insn [type_index]);
+                                       td->sp -= 1;
+                                       SET_TYPE (td->sp - 1, stack_type [mt], magic_class);
+                                       td->ip += 5;
+                                       return;
+                               }
+                       }
+
+                       for (i = 0; i < sizeof (int_cmpop) / sizeof  (MagicIntrinsic); ++i) {
+                               if (!strcmp (int_cmpop [i].op_name, tm)) {
+                                       MonoClass *k = mono_defaults.boolean_class;
+                                       ADD_CODE (td, int_cmpop [i].insn [type_index]);
+                                       td->sp -= 1;
+                                       SET_TYPE (td->sp - 1, stack_type [mint_type (&k->byval_arg)], k);
+                                       td->ip += 5;
+                                       return;
+                               }
+                       }
+
+                       g_error ("TODO: %s", tm);
                } else if (mono_class_is_subclass_of (target_method->klass, mono_defaults.array_class, FALSE)) {
-                       if (!strcmp (target_method->name, "get_Rank")) {
+                       if (!strcmp (tm, "get_Rank")) {
                                op = MINT_ARRAY_RANK;
-                       } else if (!strcmp (target_method->name, "get_Length")) {
+                       } else if (!strcmp (tm, "get_Length")) {
                                op = MINT_LDLEN;
-                       } else if (!strcmp (target_method->name, "Address")) {
+                       } else if (!strcmp (tm, "Address")) {
                                op = readonly ? MINT_LDELEMA : MINT_LDELEMA_TC;
                        }
                } else if (target_method->klass->image == mono_defaults.corlib &&
                                   (strcmp (target_method->klass->name_space, "System.Diagnostics") == 0) &&
                                   (strcmp (target_method->klass->name, "Debugger") == 0)) {
-                       if (!strcmp (target_method->name, "Break") && csignature->param_count == 0) {
+                       if (!strcmp (tm, "Break") && csignature->param_count == 0) {
                                if (mini_should_insert_breakpoint (method))
                                        op = MINT_BREAK;
                        }
                }
        }
+no_intrinsic:
 
        if (constrained_class) {
                if (constrained_class->enumtype && !strcmp (target_method->name, "GetHashCode")) {
@@ -948,7 +1222,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
                }
        } else if (!calli && !virtual && jit_call_supported (target_method, csignature)) {
                ADD_CODE(td, MINT_JIT_CALL);
-               ADD_CODE(td, get_data_item_index (td, (void *)mono_interp_get_runtime_method (domain, target_method, &error)));
+               ADD_CODE(td, get_data_item_index (td, (void *)mono_interp_get_imethod (domain, target_method, &error)));
                mono_error_assert_ok (&error);
        } else {
                if (calli)
@@ -961,7 +1235,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
                if (calli) {
                        ADD_CODE(td, get_data_item_index (td, (void *)csignature));
                } else {
-                       ADD_CODE(td, get_data_item_index (td, (void *)mono_interp_get_runtime_method (domain, target_method, &error)));
+                       ADD_CODE(td, get_data_item_index (td, (void *)mono_interp_get_imethod (domain, target_method, &error)));
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                }
        }
@@ -1094,7 +1368,7 @@ get_basic_blocks (TransformData *td)
 }
 
 static void
-interp_save_debug_info (RuntimeMethod *rtm, MonoMethodHeader *header, TransformData *td, GArray *line_numbers)
+interp_save_debug_info (InterpMethod *rtm, MonoMethodHeader *header, TransformData *td, GArray *line_numbers)
 {
        MonoDebugMethodJitInfo *dinfo;
        int i;
@@ -1224,7 +1498,7 @@ collect_pred_seq_points (TransformData *td, InterpBasicBlock *bb, SeqPoint *seqp
 static void
 save_seq_points (TransformData *td)
 {
-       RuntimeMethod *rtm = td->rtm;
+       InterpMethod *rtm = td->rtm;
        GByteArray *array;
        int i, seq_info_size;
        MonoSeqPointInfo *info;
@@ -1332,13 +1606,13 @@ emit_seq_point (TransformData *td, int il_offset, InterpBasicBlock *cbb, gboolea
 #define BARRIER_IF_VOLATILE(td) \
        do { \
                if (volatile_) { \
-                       ADD_CODE (&td, MINT_MONO_MEMORY_BARRIER); \
+                       ADD_CODE (td, MINT_MONO_MEMORY_BARRIER); \
                        volatile_ = FALSE; \
                } \
        } while (0)
 
 static void
-generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, MonoGenericContext *generic_context)
+generate (MonoMethod *method, InterpMethod *rtm, unsigned char *is_bb_start, MonoGenericContext *generic_context)
 {
        MonoMethodHeader *header = mono_method_get_header (method);
        MonoMethodSignature *signature = mono_method_signature (method);
@@ -1356,7 +1630,8 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
        int body_start_offset;
        int target;
        guint32 token;
-       TransformData td;
+       TransformData transform_data;
+       TransformData *td;
        int generating_code = 1;
        GArray *line_numbers;
        MonoDebugMethodInfo *minfo;
@@ -1372,34 +1647,36 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                verbose_method_inited = TRUE;
        }
 
-       memset (&td, 0, sizeof(td));
-       td.method = method;
-       td.rtm = rtm;
-       td.is_bb_start = is_bb_start;
-       td.il_code = header->code;
-       td.code_size = header->code_size;
-       td.header = header;
-       td.max_code_size = td.code_size;
-       td.new_code = (unsigned short *)g_malloc(td.max_code_size * sizeof(gushort));
-       td.new_code_end = td.new_code + td.max_code_size;
-       td.mempool = mono_mempool_new ();
-       td.in_offsets = g_malloc0(header->code_size * sizeof(int));
-       td.stack_state = g_malloc0(header->code_size * sizeof(StackInfo *));
-       td.stack_height = g_malloc(header->code_size * sizeof(int));
-       td.vt_stack_size = g_malloc(header->code_size * sizeof(int));
-       td.n_data_items = 0;
-       td.max_data_items = 0;
-       td.data_items = NULL;
-       td.data_hash = g_hash_table_new (NULL, NULL);
-       td.clause_indexes = g_malloc (header->code_size * sizeof (int));
-       td.gen_sdb_seq_points = debug_options.gen_sdb_seq_points;
-       td.seq_points = g_ptr_array_new ();
-       td.relocs = g_ptr_array_new ();
-       td.verbose_level = mono_interp_traceopt;
-       rtm->data_items = td.data_items;
+       memset (&transform_data, 0, sizeof(transform_data));
+       td = &transform_data;
+
+       td->method = method;
+       td->rtm = rtm;
+       td->is_bb_start = is_bb_start;
+       td->il_code = header->code;
+       td->code_size = header->code_size;
+       td->header = header;
+       td->max_code_size = td->code_size;
+       td->new_code = (unsigned short *)g_malloc(td->max_code_size * sizeof(gushort));
+       td->new_code_end = td->new_code + td->max_code_size;
+       td->mempool = mono_mempool_new ();
+       td->in_offsets = g_malloc0(header->code_size * sizeof(int));
+       td->stack_state = g_malloc0(header->code_size * sizeof(StackInfo *));
+       td->stack_height = g_malloc(header->code_size * sizeof(int));
+       td->vt_stack_size = g_malloc(header->code_size * sizeof(int));
+       td->n_data_items = 0;
+       td->max_data_items = 0;
+       td->data_items = NULL;
+       td->data_hash = g_hash_table_new (NULL, NULL);
+       td->clause_indexes = g_malloc (header->code_size * sizeof (int));
+       td->gen_sdb_seq_points = debug_options.gen_sdb_seq_points;
+       td->seq_points = g_ptr_array_new ();
+       td->relocs = g_ptr_array_new ();
+       td->verbose_level = mono_interp_traceopt;
+       rtm->data_items = td->data_items;
        for (i = 0; i < header->code_size; i++) {
-               td.stack_height [i] = -1;
-               td.clause_indexes [i] = -1;
+               td->stack_height [i] = -1;
+               td->clause_indexes [i] = -1;
        }
 
        if (verbose_method_name) {
@@ -1410,17 +1687,17 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
 
                        desc = mono_method_desc_new (name, TRUE);
                        if (mono_method_desc_full_match (desc, method)) {
-                               td.verbose_level = 4;
+                               td->verbose_level = 4;
                        }
                        mono_method_desc_free (desc);
                } else {
                        if (strcmp (method->name, name) == 0)
-                               td.verbose_level = 4;
+                               td->verbose_level = 4;
                }
        }
 
-       if (td.gen_sdb_seq_points) {
-               get_basic_blocks (&td);
+       if (td->gen_sdb_seq_points) {
+               get_basic_blocks (td);
 
                minfo = mono_debug_lookup_method (method);
 
@@ -1430,8 +1707,8 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
 
                        mono_debug_get_seq_points (minfo, NULL, NULL, NULL, &sps, &n_il_offsets);
                        // FIXME: Free
-                       seq_point_locs = mono_bitset_mem_new (mono_mempool_alloc0 (td.mempool, mono_bitset_alloc_size (header->code_size, 0)), header->code_size, 0);
-                       seq_point_set_locs = mono_bitset_mem_new (mono_mempool_alloc0 (td.mempool, mono_bitset_alloc_size (header->code_size, 0)), header->code_size, 0);
+                       seq_point_locs = mono_bitset_mem_new (mono_mempool_alloc0 (td->mempool, mono_bitset_alloc_size (header->code_size, 0)), header->code_size, 0);
+                       seq_point_set_locs = mono_bitset_mem_new (mono_mempool_alloc0 (td->mempool, mono_bitset_alloc_size (header->code_size, 0)), header->code_size, 0);
                        sym_seq_points = TRUE;
 
                        for (i = 0; i < n_il_offsets; ++i) {
@@ -1447,48 +1724,48 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                }
        }
 
-       td.new_ip = td.new_code;
-       td.last_new_ip = NULL;
+       td->new_ip = td->new_code;
+       td->last_new_ip = NULL;
 
-       td.stack = g_malloc0 ((header->max_stack + 1) * sizeof (td.stack [0]));
-       td.sp = td.stack;
-       td.max_stack_height = 0;
+       td->stack = g_malloc0 ((header->max_stack + 1) * sizeof (td->stack [0]));
+       td->sp = td->stack;
+       td->max_stack_height = 0;
 
        line_numbers = g_array_new (FALSE, TRUE, sizeof (MonoDebugLineNumberEntry));
 
        for (i = 0; i < header->num_clauses; i++) {
                MonoExceptionClause *c = header->clauses + i;
-               td.stack_height [c->handler_offset] = 0;
-               td.vt_stack_size [c->handler_offset] = 0;
-               td.is_bb_start [c->handler_offset] = 1;
+               td->stack_height [c->handler_offset] = 0;
+               td->vt_stack_size [c->handler_offset] = 0;
+               td->is_bb_start [c->handler_offset] = 1;
 
-               td.stack_height [c->handler_offset] = 1;
-               td.stack_state [c->handler_offset] = g_malloc0(sizeof(StackInfo));
-               td.stack_state [c->handler_offset][0].type = STACK_TYPE_O;
-               td.stack_state [c->handler_offset][0].klass = NULL; /*FIX*/
+               td->stack_height [c->handler_offset] = 1;
+               td->stack_state [c->handler_offset] = g_malloc0(sizeof(StackInfo));
+               td->stack_state [c->handler_offset][0].type = STACK_TYPE_O;
+               td->stack_state [c->handler_offset][0].klass = NULL; /*FIX*/
 
                if (c->flags & MONO_EXCEPTION_CLAUSE_FILTER) {
-                       td.stack_height [c->data.filter_offset] = 0;
-                       td.vt_stack_size [c->data.filter_offset] = 0;
-                       td.is_bb_start [c->data.filter_offset] = 1;
-
-                       td.stack_height [c->data.filter_offset] = 1;
-                       td.stack_state [c->data.filter_offset] = g_malloc0(sizeof(StackInfo));
-                       td.stack_state [c->data.filter_offset][0].type = STACK_TYPE_O;
-                       td.stack_state [c->data.filter_offset][0].klass = NULL; /*FIX*/
+                       td->stack_height [c->data.filter_offset] = 0;
+                       td->vt_stack_size [c->data.filter_offset] = 0;
+                       td->is_bb_start [c->data.filter_offset] = 1;
+
+                       td->stack_height [c->data.filter_offset] = 1;
+                       td->stack_state [c->data.filter_offset] = g_malloc0(sizeof(StackInfo));
+                       td->stack_state [c->data.filter_offset][0].type = STACK_TYPE_O;
+                       td->stack_state [c->data.filter_offset][0].klass = NULL; /*FIX*/
                }
 
                for (int j = c->handler_offset; j < c->handler_offset + c->handler_len; ++j) {
-                       if (td.clause_indexes [j] == -1)
-                               td.clause_indexes [j] = i;
+                       if (td->clause_indexes [j] == -1)
+                               td->clause_indexes [j] = i;
                }
        }
 
-       td.ip = header->code;
-       end = td.ip + header->code_size;
+       td->ip = header->code;
+       end = td->ip + header->code_size;
 
-       if (td.verbose_level) {
-               char *tmp = mono_disasm_code (NULL, method, td.ip, end);
+       if (td->verbose_level) {
+               char *tmp = mono_disasm_code (NULL, method, td->ip, end);
                char *name = mono_method_full_name (method, TRUE);
                g_print ("Method %s, original code:\n", name);
                g_print ("%s\n", tmp);
@@ -1497,70 +1774,73 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
        }
 
        if (signature->hasthis)
-               store_inarg (&td, 0);
+               store_inarg (td, 0);
        for (i = 0; i < signature->param_count; i++)
-               store_inarg (&td, i + !!signature->hasthis);
+               store_inarg (td, i + !!signature->hasthis);
 
-       body_start_offset = td.new_ip - td.new_code;
+       body_start_offset = td->new_ip - td->new_code;
 
        for (i = 0; i < header->num_locals; i++) {
                int mt = mint_type(header->locals [i]);
                if (mt == MINT_TYPE_VT || mt == MINT_TYPE_O || mt == MINT_TYPE_P) {
-                       ADD_CODE(&td, MINT_INITLOCALS);
+                       ADD_CODE(td, MINT_INITLOCALS);
                        break;
                }
        }
 
+       if (rtm->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_ENTER)
+               ADD_CODE (td, MINT_PROF_ENTER);
+
        if (sym_seq_points) {
-               InterpBasicBlock *cbb = td.offset_to_bb [0];
+               InterpBasicBlock *cbb = td->offset_to_bb [0];
                g_assert (cbb);
-               emit_seq_point (&td, METHOD_ENTRY_IL_OFFSET, cbb, FALSE);
+               emit_seq_point (td, METHOD_ENTRY_IL_OFFSET, cbb, FALSE);
        }
 
-       while (td.ip < end) {
+       while (td->ip < end) {
                int in_offset;
 
-               g_assert (td.sp >= td.stack);
-               g_assert (td.vt_sp < 0x10000000);
-               in_offset = td.ip - header->code;
-               td.in_offsets [in_offset] = td.new_ip - td.new_code;
-               new_in_start_offset = td.new_ip - td.new_code;
-               td.in_start = td.ip;
+               g_assert (td->sp >= td->stack);
+               g_assert (td->vt_sp < 0x10000000);
+               in_offset = td->ip - header->code;
+               td->in_offsets [in_offset] = td->new_ip - td->new_code;
+               new_in_start_offset = td->new_ip - td->new_code;
+               td->in_start = td->ip;
 
                MonoDebugLineNumberEntry lne;
-               lne.native_offset = (guint8*)td.new_ip - (guint8*)td.new_code;
+               lne.native_offset = (guint8*)td->new_ip - (guint8*)td->new_code;
                lne.il_offset = in_offset;
                g_array_append_val (line_numbers, lne);
 
-               if (td.stack_height [in_offset] >= 0) {
+               if (td->stack_height [in_offset] >= 0) {
                        g_assert (is_bb_start [in_offset]);
-                       if (td.stack_height [in_offset] > 0)
-                               memcpy (td.stack, td.stack_state [in_offset], td.stack_height [in_offset] * sizeof(td.stack [0]));
-                       td.sp = td.stack + td.stack_height [in_offset];
-                       td.vt_sp = td.vt_stack_size [in_offset];
+                       if (td->stack_height [in_offset] > 0)
+                               memcpy (td->stack, td->stack_state [in_offset], td->stack_height [in_offset] * sizeof(td->stack [0]));
+                       td->sp = td->stack + td->stack_height [in_offset];
+                       td->vt_sp = td->vt_stack_size [in_offset];
                }
                if (is_bb_start [in_offset]) {
                        generating_code = 1;
                }
                if (!generating_code) {
-                       while (td.ip < end && !is_bb_start [td.ip - td.il_code])
-                               ++td.ip;
+                       while (td->ip < end && !is_bb_start [td->ip - td->il_code])
+                               ++td->ip;
                        continue;
                }
-               if (td.verbose_level > 1) {
+               if (td->verbose_level > 1) {
                        printf("IL_%04lx %s %-10s -> IL_%04lx, sp %ld, %s %-12s vt_sp %u (max %u)\n", 
-                               td.ip - td.il_code,
-                               td.is_bb_start [td.ip - td.il_code] == 3 ? "<>" :
-                               td.is_bb_start [td.ip - td.il_code] == 2 ? "< " :
-                               td.is_bb_start [td.ip - td.il_code] == 1 ? " >" : "  ",
-                               mono_opcode_name (*td.ip), td.new_ip - td.new_code, td.sp - td.stack, 
-                               td.sp > td.stack ? stack_type_string [td.sp [-1].type] : "  ",
-                               (td.sp > td.stack && (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_VT)) ? (td.sp [-1].klass == NULL ? "?" : td.sp [-1].klass->name) : "",
-                               td.vt_sp, td.max_vt_sp);
+                               td->ip - td->il_code,
+                               td->is_bb_start [td->ip - td->il_code] == 3 ? "<>" :
+                               td->is_bb_start [td->ip - td->il_code] == 2 ? "< " :
+                               td->is_bb_start [td->ip - td->il_code] == 1 ? " >" : "  ",
+                               mono_opcode_name (*td->ip), td->new_ip - td->new_code, td->sp - td->stack, 
+                               td->sp > td->stack ? stack_type_string [td->sp [-1].type] : "  ",
+                               (td->sp > td->stack && (td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_VT)) ? (td->sp [-1].klass == NULL ? "?" : td->sp [-1].klass->name) : "",
+                               td->vt_sp, td->max_vt_sp);
                }
 
-               if (sym_seq_points && mono_bitset_test_fast (seq_point_locs, td.ip - header->code)) {
-                       InterpBasicBlock *cbb = td.offset_to_bb [td.ip - header->code];
+               if (sym_seq_points && mono_bitset_test_fast (seq_point_locs, td->ip - header->code)) {
+                       InterpBasicBlock *cbb = td->offset_to_bb [td->ip - header->code];
                        g_assert (cbb);
 
                        /*
@@ -1568,20 +1848,20 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                         * backward branches.
                         */
                        if (in_offset == 0 || g_slist_length (cbb->preds) > 1)
-                               ADD_CODE (&td, MINT_SDB_INTR_LOC);
+                               ADD_CODE (td, MINT_SDB_INTR_LOC);
 
-                       emit_seq_point (&td, in_offset, cbb, FALSE);
+                       emit_seq_point (td, in_offset, cbb, FALSE);
 
-                       mono_bitset_set_fast (seq_point_set_locs, td.ip - header->code);
+                       mono_bitset_set_fast (seq_point_set_locs, td->ip - header->code);
                }
 
                if (sym_seq_points)
-                       bb_exit = td.offset_to_bb [td.ip - header->code];
+                       bb_exit = td->offset_to_bb [td->ip - header->code];
 
-               switch (*td.ip) {
+               switch (*td->ip) {
                case CEE_NOP: 
                        /* lose it */
-                       ++td.ip;
+                       ++td->ip;
                        break;
                case CEE_BREAK:
                        SIMPLE_OP(td, MINT_BREAK);
@@ -1590,80 +1870,80 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_LDARG_1:
                case CEE_LDARG_2:
                case CEE_LDARG_3:
-                       load_arg (&td, *td.ip - CEE_LDARG_0);
-                       ++td.ip;
+                       load_arg (td, *td->ip - CEE_LDARG_0);
+                       ++td->ip;
                        break;
                case CEE_LDLOC_0:
                case CEE_LDLOC_1:
                case CEE_LDLOC_2:
                case CEE_LDLOC_3:
-                       load_local (&td, *td.ip - CEE_LDLOC_0);
-                       ++td.ip;
+                       load_local (td, *td->ip - CEE_LDLOC_0);
+                       ++td->ip;
                        break;
                case CEE_STLOC_0:
                case CEE_STLOC_1:
                case CEE_STLOC_2:
                case CEE_STLOC_3:
-                       store_local (&td, *td.ip - CEE_STLOC_0);
-                       ++td.ip;
+                       store_local (td, *td->ip - CEE_STLOC_0);
+                       ++td->ip;
                        break;
                case CEE_LDARG_S:
-                       load_arg (&td, ((guint8 *)td.ip)[1]);
-                       td.ip += 2;
+                       load_arg (td, ((guint8 *)td->ip)[1]);
+                       td->ip += 2;
                        break;
                case CEE_LDARGA_S: {
                        /* NOTE: n includes this */
-                       int n = ((guint8 *) td.ip) [1];
-                       ADD_CODE (&td, MINT_LDARGA);
-                       ADD_CODE (&td, td.rtm->arg_offsets [n]);
-                       PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
-                       td.ip += 2;
+                       int n = ((guint8 *) td->ip) [1];
+                       ADD_CODE (td, MINT_LDARGA);
+                       ADD_CODE (td, td->rtm->arg_offsets [n]);
+                       PUSH_SIMPLE_TYPE(td, STACK_TYPE_MP);
+                       td->ip += 2;
                        break;
                }
                case CEE_STARG_S:
-                       store_arg (&td, ((guint8 *)td.ip)[1]);
-                       td.ip += 2;
+                       store_arg (td, ((guint8 *)td->ip)[1]);
+                       td->ip += 2;
                        break;
                case CEE_LDLOC_S:
-                       load_local (&td, ((guint8 *)td.ip)[1]);
-                       td.ip += 2;
+                       load_local (td, ((guint8 *)td->ip)[1]);
+                       td->ip += 2;
                        break;
                case CEE_LDLOCA_S:
-                       ADD_CODE(&td, MINT_LDLOCA_S);
-                       ADD_CODE(&td, td.rtm->local_offsets [((guint8 *)td.ip)[1]]);
-                       PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
-                       td.ip += 2;
+                       ADD_CODE(td, MINT_LDLOCA_S);
+                       ADD_CODE(td, td->rtm->local_offsets [((guint8 *)td->ip)[1]]);
+                       PUSH_SIMPLE_TYPE(td, STACK_TYPE_MP);
+                       td->ip += 2;
                        break;
                case CEE_STLOC_S:
-                       store_local (&td, ((guint8 *)td.ip)[1]);
-                       td.ip += 2;
+                       store_local (td, ((guint8 *)td->ip)[1]);
+                       td->ip += 2;
                        break;
                case CEE_LDNULL: 
                        SIMPLE_OP(td, MINT_LDNULL);
-                       PUSH_TYPE(&td, STACK_TYPE_O, NULL);
+                       PUSH_TYPE(td, STACK_TYPE_O, NULL);
                        break;
                case CEE_LDC_I4_M1:
                        SIMPLE_OP(td, MINT_LDC_I4_M1);
-                       PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+                       PUSH_SIMPLE_TYPE(td, STACK_TYPE_I4);
                        break;
                case CEE_LDC_I4_0:
-                       if (!td.is_bb_start[td.ip + 1 - td.il_code] && td.ip [1] == 0xfe && td.ip [2] == CEE_CEQ && 
-                               td.sp > td.stack && td.sp [-1].type == STACK_TYPE_I4) {
+                       if (!td->is_bb_start[td->ip + 1 - td->il_code] && td->ip [1] == 0xfe && td->ip [2] == CEE_CEQ && 
+                               td->sp > td->stack && td->sp [-1].type == STACK_TYPE_I4) {
                                SIMPLE_OP(td, MINT_CEQ0_I4);
-                               td.ip += 2;
+                               td->ip += 2;
                        } else {
                                SIMPLE_OP(td, MINT_LDC_I4_0);
-                               PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+                               PUSH_SIMPLE_TYPE(td, STACK_TYPE_I4);
                        }
                        break;
                case CEE_LDC_I4_1:
-                       if (!td.is_bb_start[td.ip + 1 - td.il_code] && 
-                               (td.ip [1] == CEE_ADD || td.ip [1] == CEE_SUB) && td.sp [-1].type == STACK_TYPE_I4) {
-                               ADD_CODE(&td, td.ip [1] == CEE_ADD ? MINT_ADD1_I4 : MINT_SUB1_I4);
-                               td.ip += 2;
+                       if (!td->is_bb_start[td->ip + 1 - td->il_code] && 
+                               (td->ip [1] == CEE_ADD || td->ip [1] == CEE_SUB) && td->sp [-1].type == STACK_TYPE_I4) {
+                               ADD_CODE(td, td->ip [1] == CEE_ADD ? MINT_ADD1_I4 : MINT_SUB1_I4);
+                               td->ip += 2;
                        } else {
                                SIMPLE_OP(td, MINT_LDC_I4_1);
-                               PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+                               PUSH_SIMPLE_TYPE(td, STACK_TYPE_I4);
                        }
                        break;
                case CEE_LDC_I4_2:
@@ -1673,86 +1953,86 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_LDC_I4_6:
                case CEE_LDC_I4_7:
                case CEE_LDC_I4_8:
-                       SIMPLE_OP(td, (*td.ip - CEE_LDC_I4_0) + MINT_LDC_I4_0);
-                       PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+                       SIMPLE_OP(td, (*td->ip - CEE_LDC_I4_0) + MINT_LDC_I4_0);
+                       PUSH_SIMPLE_TYPE(td, STACK_TYPE_I4);
                        break;
                case CEE_LDC_I4_S: 
-                       ADD_CODE(&td, MINT_LDC_I4_S);
-                       ADD_CODE(&td, ((gint8 *) td.ip) [1]);
-                       td.ip += 2;
-                       PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+                       ADD_CODE(td, MINT_LDC_I4_S);
+                       ADD_CODE(td, ((gint8 *) td->ip) [1]);
+                       td->ip += 2;
+                       PUSH_SIMPLE_TYPE(td, STACK_TYPE_I4);
                        break;
                case CEE_LDC_I4:
-                       i32 = read32 (td.ip + 1);
-                       ADD_CODE(&td, MINT_LDC_I4);
-                       WRITE32(&td, &i32);
-                       td.ip += 5;
-                       PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+                       i32 = read32 (td->ip + 1);
+                       ADD_CODE(td, MINT_LDC_I4);
+                       WRITE32(td, &i32);
+                       td->ip += 5;
+                       PUSH_SIMPLE_TYPE(td, STACK_TYPE_I4);
                        break;
                case CEE_LDC_I8: {
-                       gint64 val = read64 (td.ip + 1);
-                       ADD_CODE(&td, MINT_LDC_I8);
-                       WRITE64(&td, &val);
-                       td.ip += 9;
-                       PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I8);
+                       gint64 val = read64 (td->ip + 1);
+                       ADD_CODE(td, MINT_LDC_I8);
+                       WRITE64(td, &val);
+                       td->ip += 9;
+                       PUSH_SIMPLE_TYPE(td, STACK_TYPE_I8);
                        break;
                }
                case CEE_LDC_R4: {
                        float val;
-                       readr4 (td.ip + 1, &val);
-                       ADD_CODE(&td, MINT_LDC_R4);
-                       WRITE32(&td, &val);
-                       td.ip += 5;
-                       PUSH_SIMPLE_TYPE(&td, STACK_TYPE_R8);
+                       readr4 (td->ip + 1, &val);
+                       ADD_CODE(td, MINT_LDC_R4);
+                       WRITE32(td, &val);
+                       td->ip += 5;
+                       PUSH_SIMPLE_TYPE(td, STACK_TYPE_R8);
                        break;
                }
                case CEE_LDC_R8: {
                        double val;
-                       readr8 (td.ip + 1, &val);
-                       ADD_CODE(&td, MINT_LDC_R8);
-                       WRITE64(&td, &val);
-                       td.ip += 9;
-                       PUSH_SIMPLE_TYPE(&td, STACK_TYPE_R8);
+                       readr8 (td->ip + 1, &val);
+                       ADD_CODE(td, MINT_LDC_R8);
+                       WRITE64(td, &val);
+                       td->ip += 9;
+                       PUSH_SIMPLE_TYPE(td, STACK_TYPE_R8);
                        break;
                }
                case CEE_DUP: {
-                       int type = td.sp [-1].type;
-                       MonoClass *klass = td.sp [-1].klass;
-                       if (td.sp [-1].type == STACK_TYPE_VT) {
+                       int type = td->sp [-1].type;
+                       MonoClass *klass = td->sp [-1].klass;
+                       if (td->sp [-1].type == STACK_TYPE_VT) {
                                gint32 size = mono_class_value_size (klass, NULL);
-                               PUSH_VT(&td, size);
-                               ADD_CODE(&td, MINT_DUP_VT);
-                               WRITE32(&td, &size);
-                               td.ip ++;
+                               PUSH_VT(td, size);
+                               ADD_CODE(td, MINT_DUP_VT);
+                               WRITE32(td, &size);
+                               td->ip ++;
                        } else 
                                SIMPLE_OP(td, MINT_DUP);
-                       PUSH_TYPE(&td, type, klass);
+                       PUSH_TYPE(td, type, klass);
                        break;
                }
                case CEE_POP:
-                       CHECK_STACK(&td, 1);
+                       CHECK_STACK(td, 1);
                        SIMPLE_OP(td, MINT_POP);
-                       ADD_CODE (&td, 0);
-                       if (td.sp [-1].type == STACK_TYPE_VT) {
-                               int size = mono_class_value_size (td.sp [-1].klass, NULL);
+                       ADD_CODE (td, 0);
+                       if (td->sp [-1].type == STACK_TYPE_VT) {
+                               int size = mono_class_value_size (td->sp [-1].klass, NULL);
                                size = (size + 7) & ~7;
-                               ADD_CODE(&td, MINT_VTRESULT);
-                               ADD_CODE(&td, 0);
-                               WRITE32(&td, &size);
-                               td.vt_sp -= size;
+                               ADD_CODE(td, MINT_VTRESULT);
+                               ADD_CODE(td, 0);
+                               WRITE32(td, &size);
+                               td->vt_sp -= size;
                        }
-                       --td.sp;
+                       --td->sp;
                        break;
                case CEE_JMP: {
                        MonoMethod *m;
-                       if (td.sp > td.stack)
+                       if (td->sp > td->stack)
                                g_warning ("CEE_JMP: stack must be empty");
-                       token = read32 (td.ip + 1);
+                       token = read32 (td->ip + 1);
                        m = mono_get_method_full (image, token, NULL, generic_context);
-                       ADD_CODE (&td, MINT_JMP);
-                       ADD_CODE (&td, get_data_item_index (&td, mono_interp_get_runtime_method (domain, m, &error)));
+                       ADD_CODE (td, MINT_JMP);
+                       ADD_CODE (td, get_data_item_index (td, mono_interp_get_imethod (domain, m, &error)));
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-                       td.ip += 5;
+                       td->ip += 5;
                        break;
                }
                case CEE_CALLVIRT: /* Fall through */
@@ -1760,16 +2040,16 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_CALL: {
                        gboolean need_seq_point = FALSE;
 
-                       if (sym_seq_points && !mono_bitset_test_fast (seq_point_locs, td.ip + 5 - header->code))
+                       if (sym_seq_points && !mono_bitset_test_fast (seq_point_locs, td->ip + 5 - header->code))
                                need_seq_point = TRUE;
 
-                       interp_transform_call (&td, method, NULL, domain, generic_context, is_bb_start, body_start_offset, constrained_class, readonly);
+                       interp_transform_call (td, method, NULL, domain, generic_context, is_bb_start, body_start_offset, constrained_class, readonly);
 
                        if (need_seq_point) {
-                               InterpBasicBlock *cbb = td.offset_to_bb [td.ip - header->code];
+                               InterpBasicBlock *cbb = td->offset_to_bb [td->ip - header->code];
                                g_assert (cbb);
 
-                               emit_seq_point (&td, td.ip - header->code, cbb, TRUE);
+                               emit_seq_point (td, td->ip - header->code, cbb, TRUE);
                        }
 
                        constrained_class = NULL;
@@ -1779,443 +2059,443 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_RET: {
                        int vt_size = 0;
                        if (signature->ret->type != MONO_TYPE_VOID) {
-                               --td.sp;
+                               --td->sp;
                                MonoClass *klass = mono_class_from_mono_type (signature->ret);
                                if (mint_type (&klass->byval_arg) == MINT_TYPE_VT) {
                                        vt_size = mono_class_value_size (klass, NULL);
                                        vt_size = (vt_size + 7) & ~7;
                                }
                        }
-                       if (td.sp > td.stack)
-                               g_warning ("%s.%s: CEE_RET: more values on stack: %d", td.method->klass->name, td.method->name, td.sp - td.stack);
-                       if (td.vt_sp != vt_size)
-                               g_error ("%s.%s: CEE_RET: value type stack: %d vs. %d", td.method->klass->name, td.method->name, td.vt_sp, vt_size);
+                       if (td->sp > td->stack)
+                               g_warning ("%s.%s: CEE_RET: more values on stack: %d", td->method->klass->name, td->method->name, td->sp - td->stack);
+                       if (td->vt_sp != vt_size)
+                               g_error ("%s.%s: CEE_RET: value type stack: %d vs. %d", td->method->klass->name, td->method->name, td->vt_sp, vt_size);
 
                        if (sym_seq_points) {
-                               InterpBasicBlock *cbb = td.offset_to_bb [td.ip - header->code];
+                               InterpBasicBlock *cbb = td->offset_to_bb [td->ip - header->code];
                                g_assert (cbb);
-                               emit_seq_point (&td, METHOD_EXIT_IL_OFFSET, bb_exit, FALSE);
+                               emit_seq_point (td, METHOD_EXIT_IL_OFFSET, bb_exit, FALSE);
                        }
 
                        if (vt_size == 0)
                                SIMPLE_OP(td, signature->ret->type == MONO_TYPE_VOID ? MINT_RET_VOID : MINT_RET);
                        else {
-                               ADD_CODE(&td, MINT_RET_VT);
-                               WRITE32(&td, &vt_size);
-                               ++td.ip;
+                               ADD_CODE(td, MINT_RET_VT);
+                               WRITE32(td, &vt_size);
+                               ++td->ip;
                        }
                        generating_code = 0;
                        break;
                }
                case CEE_BR:
-                       handle_branch (&td, MINT_BR_S, MINT_BR, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       handle_branch (td, MINT_BR_S, MINT_BR, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        generating_code = 0;
                        break;
                case CEE_BR_S:
-                       handle_branch (&td, MINT_BR_S, MINT_BR, 2 + (gint8)td.ip [1]);
-                       td.ip += 2;
+                       handle_branch (td, MINT_BR_S, MINT_BR, 2 + (gint8)td->ip [1]);
+                       td->ip += 2;
                        generating_code = 0;
                        break;
                case CEE_BRFALSE:
-                       one_arg_branch (&td, MINT_BRFALSE_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       one_arg_branch (td, MINT_BRFALSE_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BRFALSE_S:
-                       one_arg_branch (&td, MINT_BRFALSE_I4, 2 + (gint8)td.ip [1]);
-                       td.ip += 2;
+                       one_arg_branch (td, MINT_BRFALSE_I4, 2 + (gint8)td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BRTRUE:
-                       one_arg_branch (&td, MINT_BRTRUE_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       one_arg_branch (td, MINT_BRTRUE_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BRTRUE_S:
-                       one_arg_branch (&td, MINT_BRTRUE_I4, 2 + (gint8)td.ip [1]);
-                       td.ip += 2;
+                       one_arg_branch (td, MINT_BRTRUE_I4, 2 + (gint8)td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BEQ:
-                       two_arg_branch (&td, MINT_BEQ_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       two_arg_branch (td, MINT_BEQ_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BEQ_S:
-                       two_arg_branch (&td, MINT_BEQ_I4, 2 + (gint8) td.ip [1]);
-                       td.ip += 2;
+                       two_arg_branch (td, MINT_BEQ_I4, 2 + (gint8) td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BGE:
-                       two_arg_branch (&td, MINT_BGE_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       two_arg_branch (td, MINT_BGE_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BGE_S:
-                       two_arg_branch (&td, MINT_BGE_I4, 2 + (gint8) td.ip [1]);
-                       td.ip += 2;
+                       two_arg_branch (td, MINT_BGE_I4, 2 + (gint8) td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BGT:
-                       two_arg_branch (&td, MINT_BGT_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       two_arg_branch (td, MINT_BGT_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BGT_S:
-                       two_arg_branch (&td, MINT_BGT_I4, 2 + (gint8) td.ip [1]);
-                       td.ip += 2;
+                       two_arg_branch (td, MINT_BGT_I4, 2 + (gint8) td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BLT:
-                       two_arg_branch (&td, MINT_BLT_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       two_arg_branch (td, MINT_BLT_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BLT_S:
-                       two_arg_branch (&td, MINT_BLT_I4, 2 + (gint8) td.ip [1]);
-                       td.ip += 2;
+                       two_arg_branch (td, MINT_BLT_I4, 2 + (gint8) td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BLE:
-                       two_arg_branch (&td, MINT_BLE_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       two_arg_branch (td, MINT_BLE_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BLE_S:
-                       two_arg_branch (&td, MINT_BLE_I4, 2 + (gint8) td.ip [1]);
-                       td.ip += 2;
+                       two_arg_branch (td, MINT_BLE_I4, 2 + (gint8) td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BNE_UN:
-                       two_arg_branch (&td, MINT_BNE_UN_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       two_arg_branch (td, MINT_BNE_UN_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BNE_UN_S:
-                       two_arg_branch (&td, MINT_BNE_UN_I4, 2 + (gint8) td.ip [1]);
-                       td.ip += 2;
+                       two_arg_branch (td, MINT_BNE_UN_I4, 2 + (gint8) td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BGE_UN:
-                       two_arg_branch (&td, MINT_BGE_UN_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       two_arg_branch (td, MINT_BGE_UN_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BGE_UN_S:
-                       two_arg_branch (&td, MINT_BGE_UN_I4, 2 + (gint8) td.ip [1]);
-                       td.ip += 2;
+                       two_arg_branch (td, MINT_BGE_UN_I4, 2 + (gint8) td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BGT_UN:
-                       two_arg_branch (&td, MINT_BGT_UN_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       two_arg_branch (td, MINT_BGT_UN_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BGT_UN_S:
-                       two_arg_branch (&td, MINT_BGT_UN_I4, 2 + (gint8) td.ip [1]);
-                       td.ip += 2;
+                       two_arg_branch (td, MINT_BGT_UN_I4, 2 + (gint8) td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BLE_UN:
-                       two_arg_branch (&td, MINT_BLE_UN_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       two_arg_branch (td, MINT_BLE_UN_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BLE_UN_S:
-                       two_arg_branch (&td, MINT_BLE_UN_I4, 2 + (gint8) td.ip [1]);
-                       td.ip += 2;
+                       two_arg_branch (td, MINT_BLE_UN_I4, 2 + (gint8) td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_BLT_UN:
-                       two_arg_branch (&td, MINT_BLT_UN_I4, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       two_arg_branch (td, MINT_BLT_UN_I4, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        break;
                case CEE_BLT_UN_S:
-                       two_arg_branch (&td, MINT_BLT_UN_I4, 2 + (gint8) td.ip [1]);
-                       td.ip += 2;
+                       two_arg_branch (td, MINT_BLT_UN_I4, 2 + (gint8) td->ip [1]);
+                       td->ip += 2;
                        break;
                case CEE_SWITCH: {
                        guint32 n;
                        const unsigned char *next_ip;
-                       ++td.ip;
-                       n = read32 (td.ip);
-                       ADD_CODE (&td, MINT_SWITCH);
-                       WRITE32 (&td, &n);
-                       td.ip += 4;
-                       next_ip = td.ip + n * 4;
-                       --td.sp;
-                       int stack_height = td.sp - td.stack;
+                       ++td->ip;
+                       n = read32 (td->ip);
+                       ADD_CODE (td, MINT_SWITCH);
+                       WRITE32 (td, &n);
+                       td->ip += 4;
+                       next_ip = td->ip + n * 4;
+                       --td->sp;
+                       int stack_height = td->sp - td->stack;
                        for (i = 0; i < n; i++) {
-                               offset = read32 (td.ip);
-                               target = next_ip - td.il_code + offset;
+                               offset = read32 (td->ip);
+                               target = next_ip - td->il_code + offset;
                                if (offset < 0) {
 #if DEBUG_INTERP
-                                       if (stack_height > 0 && stack_height != td.stack_height [target])
+                                       if (stack_height > 0 && stack_height != td->stack_height [target])
                                                g_warning ("SWITCH with back branch and non-empty stack");
 #endif
-                                       target = td.in_offsets [target] - (td.new_ip - td.new_code);
+                                       target = td->in_offsets [target] - (td->new_ip - td->new_code);
                                } else {
-                                       td.stack_height [target] = stack_height;
-                                       td.vt_stack_size [target] = td.vt_sp;
+                                       td->stack_height [target] = stack_height;
+                                       td->vt_stack_size [target] = td->vt_sp;
                                        if (stack_height > 0)
-                                               td.stack_state [target] = g_memdup (td.stack, stack_height * sizeof (td.stack [0]));
+                                               td->stack_state [target] = g_memdup (td->stack, stack_height * sizeof (td->stack [0]));
 
-                                       Reloc *reloc = mono_mempool_alloc0 (td.mempool, sizeof (Reloc));
+                                       Reloc *reloc = mono_mempool_alloc0 (td->mempool, sizeof (Reloc));
                                        reloc->type = RELOC_SWITCH;
-                                       reloc->offset = td.new_ip - td.new_code;
+                                       reloc->offset = td->new_ip - td->new_code;
                                        reloc->target = target;
-                                       g_ptr_array_add (td.relocs, reloc);
+                                       g_ptr_array_add (td->relocs, reloc);
                                        target = 0xffff;
                                }
-                               WRITE32 (&td, &target);
-                               td.ip += 4;
+                               WRITE32 (td, &target);
+                               td->ip += 4;
                        }
                        break;
                }
                case CEE_LDIND_I1:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_I1);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        BARRIER_IF_VOLATILE (td);
                        break;
                case CEE_LDIND_U1:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_U1);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        BARRIER_IF_VOLATILE (td);
                        break;
                case CEE_LDIND_I2:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_I2);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        BARRIER_IF_VOLATILE (td);
                        break;
                case CEE_LDIND_U2:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_U2);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        BARRIER_IF_VOLATILE (td);
                        break;
                case CEE_LDIND_I4:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_I4);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        BARRIER_IF_VOLATILE (td);
                        break;
                case CEE_LDIND_U4:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_U4);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        BARRIER_IF_VOLATILE (td);
                        break;
                case CEE_LDIND_I8:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_I8);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I8);
                        BARRIER_IF_VOLATILE (td);
                        break;
                case CEE_LDIND_I:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_I);
-                       ADD_CODE (&td, 0);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+                       ADD_CODE (td, 0);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I);
                        BARRIER_IF_VOLATILE (td);
                        break;
                case CEE_LDIND_R4:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_R4);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_R8);
                        BARRIER_IF_VOLATILE (td);
                        break;
                case CEE_LDIND_R8:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_R8);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_R8);
                        BARRIER_IF_VOLATILE (td);
                        break;
                case CEE_LDIND_REF:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDIND_REF);
                        BARRIER_IF_VOLATILE (td);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_O);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_O);
                        break;
                case CEE_STIND_REF:
-                       CHECK_STACK (&td, 2);
+                       CHECK_STACK (td, 2);
                        BARRIER_IF_VOLATILE (td);
                        SIMPLE_OP (td, MINT_STIND_REF);
-                       td.sp -= 2;
+                       td->sp -= 2;
                        break;
                case CEE_STIND_I1:
-                       CHECK_STACK (&td, 2);
+                       CHECK_STACK (td, 2);
                        BARRIER_IF_VOLATILE (td);
                        SIMPLE_OP (td, MINT_STIND_I1);
-                       td.sp -= 2;
+                       td->sp -= 2;
                        break;
                case CEE_STIND_I2:
-                       CHECK_STACK (&td, 2);
+                       CHECK_STACK (td, 2);
                        BARRIER_IF_VOLATILE (td);
                        SIMPLE_OP (td, MINT_STIND_I2);
-                       td.sp -= 2;
+                       td->sp -= 2;
                        break;
                case CEE_STIND_I4:
-                       CHECK_STACK (&td, 2);
+                       CHECK_STACK (td, 2);
                        BARRIER_IF_VOLATILE (td);
                        SIMPLE_OP (td, MINT_STIND_I4);
-                       td.sp -= 2;
+                       td->sp -= 2;
                        break;
                case CEE_STIND_I:
-                       CHECK_STACK (&td, 2);
+                       CHECK_STACK (td, 2);
                        BARRIER_IF_VOLATILE (td);
                        SIMPLE_OP (td, MINT_STIND_I);
-                       td.sp -= 2;
+                       td->sp -= 2;
                        break;
                case CEE_STIND_I8:
-                       CHECK_STACK (&td, 2);
+                       CHECK_STACK (td, 2);
                        BARRIER_IF_VOLATILE (td);
                        SIMPLE_OP (td, MINT_STIND_I8);
-                       td.sp -= 2;
+                       td->sp -= 2;
                        break;
                case CEE_STIND_R4:
-                       CHECK_STACK (&td, 2);
+                       CHECK_STACK (td, 2);
                        BARRIER_IF_VOLATILE (td);
                        SIMPLE_OP (td, MINT_STIND_R4);
-                       td.sp -= 2;
+                       td->sp -= 2;
                        break;
                case CEE_STIND_R8:
-                       CHECK_STACK (&td, 2);
+                       CHECK_STACK (td, 2);
                        BARRIER_IF_VOLATILE (td);
                        SIMPLE_OP (td, MINT_STIND_R8);
-                       td.sp -= 2;
+                       td->sp -= 2;
                        break;
                case CEE_ADD:
-                       binary_arith_op(&td, MINT_ADD_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_ADD_I4);
+                       ++td->ip;
                        break;
                case CEE_SUB:
-                       binary_arith_op(&td, MINT_SUB_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_SUB_I4);
+                       ++td->ip;
                        break;
                case CEE_MUL:
-                       binary_arith_op(&td, MINT_MUL_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_MUL_I4);
+                       ++td->ip;
                        break;
                case CEE_DIV:
-                       binary_arith_op(&td, MINT_DIV_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_DIV_I4);
+                       ++td->ip;
                        break;
                case CEE_DIV_UN:
-                       binary_arith_op(&td, MINT_DIV_UN_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_DIV_UN_I4);
+                       ++td->ip;
                        break;
                case CEE_REM:
-                       binary_arith_op (&td, MINT_REM_I4);
-                       ++td.ip;
+                       binary_arith_op (td, MINT_REM_I4);
+                       ++td->ip;
                        break;
                case CEE_REM_UN:
-                       binary_arith_op (&td, MINT_REM_UN_I4);
-                       ++td.ip;
+                       binary_arith_op (td, MINT_REM_UN_I4);
+                       ++td->ip;
                        break;
                case CEE_AND:
-                       binary_arith_op (&td, MINT_AND_I4);
-                       ++td.ip;
+                       binary_arith_op (td, MINT_AND_I4);
+                       ++td->ip;
                        break;
                case CEE_OR:
-                       binary_arith_op (&td, MINT_OR_I4);
-                       ++td.ip;
+                       binary_arith_op (td, MINT_OR_I4);
+                       ++td->ip;
                        break;
                case CEE_XOR:
-                       binary_arith_op (&td, MINT_XOR_I4);
-                       ++td.ip;
+                       binary_arith_op (td, MINT_XOR_I4);
+                       ++td->ip;
                        break;
                case CEE_SHL:
-                       shift_op (&td, MINT_SHL_I4);
-                       ++td.ip;
+                       shift_op (td, MINT_SHL_I4);
+                       ++td->ip;
                        break;
                case CEE_SHR:
-                       shift_op (&td, MINT_SHR_I4);
-                       ++td.ip;
+                       shift_op (td, MINT_SHR_I4);
+                       ++td->ip;
                        break;
                case CEE_SHR_UN:
-                       shift_op (&td, MINT_SHR_UN_I4);
-                       ++td.ip;
+                       shift_op (td, MINT_SHR_UN_I4);
+                       ++td->ip;
                        break;
                case CEE_NEG:
-                       unary_arith_op (&td, MINT_NEG_I4);
-                       ++td.ip;
+                       unary_arith_op (td, MINT_NEG_I4);
+                       ++td->ip;
                        break;
                case CEE_NOT:
-                       unary_arith_op (&td, MINT_NOT_I4);
-                       ++td.ip;
+                       unary_arith_op (td, MINT_NOT_I4);
+                       ++td->ip;
                        break;
                case CEE_CONV_U1:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_U1_R8);
+                               ADD_CODE(td, MINT_CONV_U1_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_U1_I4);
+                               ADD_CODE(td, MINT_CONV_U1_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_U1_I8);
+                               ADD_CODE(td, MINT_CONV_U1_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_CONV_I1:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_I1_R8);
+                               ADD_CODE(td, MINT_CONV_I1_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_I1_I4);
+                               ADD_CODE(td, MINT_CONV_I1_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_I1_I8);
+                               ADD_CODE(td, MINT_CONV_I1_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_CONV_U2:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_U2_R8);
+                               ADD_CODE(td, MINT_CONV_U2_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_U2_I4);
+                               ADD_CODE(td, MINT_CONV_U2_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_U2_I8);
+                               ADD_CODE(td, MINT_CONV_U2_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_CONV_I2:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_I2_R8);
+                               ADD_CODE(td, MINT_CONV_I2_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_I2_I4);
+                               ADD_CODE(td, MINT_CONV_I2_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_I2_I8);
+                               ADD_CODE(td, MINT_CONV_I2_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_CONV_U:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
 #if SIZEOF_VOID_P == 4
-                               ADD_CODE(&td, MINT_CONV_U4_R8);
+                               ADD_CODE(td, MINT_CONV_U4_R8);
 #else
-                               ADD_CODE(&td, MINT_CONV_U8_R8);
+                               ADD_CODE(td, MINT_CONV_U8_R8);
 #endif
                                break;
                        case STACK_TYPE_I4:
 #if SIZEOF_VOID_P == 8
-                               ADD_CODE(&td, MINT_CONV_U8_I4);
+                               ADD_CODE(td, MINT_CONV_U8_I4);
 #endif
                                break;
                        case STACK_TYPE_I8:
 #if SIZEOF_VOID_P == 4
-                               ADD_CODE(&td, MINT_CONV_U4_I8);
+                               ADD_CODE(td, MINT_CONV_U4_I8);
 #endif
                                break;
                        case STACK_TYPE_MP:
@@ -2223,22 +2503,22 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I);
                        break;
                case CEE_CONV_I: 
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
 #if SIZEOF_VOID_P == 8
-                               ADD_CODE(&td, MINT_CONV_I8_R8);
+                               ADD_CODE(td, MINT_CONV_I8_R8);
 #else
-                               ADD_CODE(&td, MINT_CONV_I4_R8);
+                               ADD_CODE(td, MINT_CONV_I4_R8);
 #endif
                                break;
                        case STACK_TYPE_I4:
 #if SIZEOF_VOID_P == 8
-                               ADD_CODE(&td, MINT_CONV_I8_I4);
+                               ADD_CODE(td, MINT_CONV_I8_I4);
 #endif
                                break;
                        case STACK_TYPE_O:
@@ -2247,181 +2527,181 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                break;
                        case STACK_TYPE_I8:
 #if SIZEOF_VOID_P == 4
-                               ADD_CODE(&td, MINT_CONV_I4_I8);
+                               ADD_CODE(td, MINT_CONV_I4_I8);
 #endif
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I);
                        break;
                case CEE_CONV_U4:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_U4_R8);
+                               ADD_CODE(td, MINT_CONV_U4_R8);
                                break;
                        case STACK_TYPE_I4:
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_U4_I8);
+                               ADD_CODE(td, MINT_CONV_U4_I8);
                                break;
                        case STACK_TYPE_MP:
 #if SIZEOF_VOID_P == 8
-                               ADD_CODE(&td, MINT_CONV_U4_I8);
+                               ADD_CODE(td, MINT_CONV_U4_I8);
 #endif
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_CONV_I4:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_I4_R8);
+                               ADD_CODE(td, MINT_CONV_I4_R8);
                                break;
                        case STACK_TYPE_I4:
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_I4_I8);
+                               ADD_CODE(td, MINT_CONV_I4_I8);
                                break;
                        case STACK_TYPE_MP:
 #if SIZEOF_VOID_P == 8
-                               ADD_CODE(&td, MINT_CONV_I4_I8);
+                               ADD_CODE(td, MINT_CONV_I4_I8);
 #endif
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_CONV_I8:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_I8_R8);
+                               ADD_CODE(td, MINT_CONV_I8_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_I8_I4);
+                               ADD_CODE(td, MINT_CONV_I8_I4);
                                break;
                        case STACK_TYPE_I8:
                                break;
                        case STACK_TYPE_MP:
 #if SIZEOF_VOID_P == 4
-                               ADD_CODE(&td, MINT_CONV_I8_I4);
+                               ADD_CODE(td, MINT_CONV_I8_I4);
 #endif
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I8);
                        break;
                case CEE_CONV_R4:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_R4_R8);
+                               ADD_CODE(td, MINT_CONV_R4_R8);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_R4_I8);
+                               ADD_CODE(td, MINT_CONV_R4_I8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_R4_I4);
+                               ADD_CODE(td, MINT_CONV_R4_I4);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_R8);
                        break;
                case CEE_CONV_R8:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_R8_I4);
+                               ADD_CODE(td, MINT_CONV_R8_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_R8_I8);
+                               ADD_CODE(td, MINT_CONV_R8_I8);
                                break;
                        case STACK_TYPE_R8:
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_R8);
                        break;
                case CEE_CONV_U8:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_U8_I4);
+                               ADD_CODE(td, MINT_CONV_U8_I4);
                                break;
                        case STACK_TYPE_I8:
                                break;
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_U8_R8);
+                               ADD_CODE(td, MINT_CONV_U8_R8);
                                break;
                        case STACK_TYPE_MP:
 #if SIZEOF_VOID_P == 4
-                               ADD_CODE(&td, MINT_CONV_U8_I4);
+                               ADD_CODE(td, MINT_CONV_U8_I4);
 #endif
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I8);
                        break;
                case CEE_CPOBJ: {
-                       CHECK_STACK (&td, 2);
+                       CHECK_STACK (td, 2);
 
-                       token = read32 (td.ip + 1);
+                       token = read32 (td->ip + 1);
                        klass = mono_class_get_full (image, token, generic_context);
 
                        if (klass->valuetype) {
-                               ADD_CODE (&td, MINT_CPOBJ);
-                               ADD_CODE (&td, get_data_item_index(&td, klass));
+                               ADD_CODE (td, MINT_CPOBJ);
+                               ADD_CODE (td, get_data_item_index(td, klass));
                        } else {
-                               ADD_CODE (&td, MINT_LDIND_REF);
-                               ADD_CODE (&td, MINT_STIND_REF);
+                               ADD_CODE (td, MINT_LDIND_REF);
+                               ADD_CODE (td, MINT_STIND_REF);
                        }
-                       td.ip += 5;
-                       td.sp -= 2;
+                       td->ip += 5;
+                       td->sp -= 2;
                        break;
                }
                case CEE_LDOBJ: {
                        int size;
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
 
-                       token = read32 (td.ip + 1);
+                       token = read32 (td->ip + 1);
 
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
                        else
                                klass = mono_class_get_full (image, token, generic_context);
 
-                       ADD_CODE(&td, MINT_LDOBJ);
-                       ADD_CODE(&td, get_data_item_index(&td, klass));
+                       ADD_CODE(td, MINT_LDOBJ);
+                       ADD_CODE(td, get_data_item_index(td, klass));
                        if (mint_type (&klass->byval_arg) == MINT_TYPE_VT) {
                                size = mono_class_value_size (klass, NULL);
-                               PUSH_VT(&td, size);
+                               PUSH_VT(td, size);
                        }
-                       td.ip += 5;
-                       SET_TYPE(td.sp - 1, stack_type[mint_type(&klass->byval_arg)], klass);
+                       td->ip += 5;
+                       SET_TYPE(td->sp - 1, stack_type[mint_type(&klass->byval_arg)], klass);
                        BARRIER_IF_VOLATILE (td);
                        break;
                }
                case CEE_LDSTR: {
                        MonoString *s;
-                       token = mono_metadata_token_index (read32 (td.ip + 1));
-                       td.ip += 5;
+                       token = mono_metadata_token_index (read32 (td->ip + 1));
+                       td->ip += 5;
                        if (method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD) {
                                s = mono_method_get_wrapper_data (method, token);
                        } else if (method->wrapper_type != MONO_WRAPPER_NONE) {
@@ -2429,9 +2709,9 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        } else {
                                s = mono_ldstr (domain, image, token);
                        }
-                       ADD_CODE(&td, MINT_LDSTR);
-                       ADD_CODE(&td, get_data_item_index (&td, s));
-                       PUSH_TYPE(&td, STACK_TYPE_O, mono_defaults.string_class);
+                       ADD_CODE(td, MINT_LDSTR);
+                       ADD_CODE(td, get_data_item_index (td, s));
+                       PUSH_TYPE(td, STACK_TYPE_O, mono_defaults.string_class);
                        break;
                }
                case CEE_NEWOBJ: {
@@ -2440,9 +2720,9 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        guint32 vt_stack_used = 0;
                        guint32 vt_res_size = 0;
 
-                       td.ip++;
-                       token = read32 (td.ip);
-                       td.ip += 4;
+                       td->ip++;
+                       token = read32 (td->ip);
+                       td->ip += 4;
 
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                m = (MonoMethod *)mono_method_get_wrapper_data (method, token);
@@ -2451,69 +2731,76 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
 
                        csignature = mono_method_signature (m);
                        klass = m->klass;
-                       td.sp -= csignature->param_count;
-                       ADD_CODE(&td, MINT_NEWOBJ);
-                       ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_runtime_method (domain, m, &error)));
-                       mono_error_cleanup (&error); /* FIXME: don't swallow the error */
 
-                       if (mint_type (&klass->byval_arg) == MINT_TYPE_VT) {
-                               vt_res_size = mono_class_value_size (klass, NULL);
-                               PUSH_VT (&td, vt_res_size);
-                       }
-                       for (i = 0; i < csignature->param_count; ++i) {
-                               int mt = mint_type(csignature->params [i]);
-                               if (mt == MINT_TYPE_VT) {
-                                       MonoClass *k = mono_class_from_mono_type (csignature->params [i]);
-                                       gint32 size = mono_class_value_size (k, NULL);
-                                       size = (size + 7) & ~7;
-                                       vt_stack_used += size;
+                       td->sp -= csignature->param_count;
+                       if (mono_class_is_magic_int (klass) || mono_class_is_magic_float (klass)) {
+                               ADD_CODE (td, MINT_NEWOBJ_MAGIC);
+                               ADD_CODE (td, get_data_item_index (td, mono_interp_get_imethod (domain, m, &error)));
+                               PUSH_TYPE (td, stack_type [mint_type (&klass->byval_arg)], klass);
+                       } else {
+                               ADD_CODE(td, MINT_NEWOBJ);
+                               ADD_CODE(td, get_data_item_index (td, mono_interp_get_imethod (domain, m, &error)));
+                               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
+
+                               if (mint_type (&klass->byval_arg) == MINT_TYPE_VT) {
+                                       vt_res_size = mono_class_value_size (klass, NULL);
+                                       PUSH_VT (td, vt_res_size);
                                }
+                               for (i = 0; i < csignature->param_count; ++i) {
+                                       int mt = mint_type(csignature->params [i]);
+                                       if (mt == MINT_TYPE_VT) {
+                                               MonoClass *k = mono_class_from_mono_type (csignature->params [i]);
+                                               gint32 size = mono_class_value_size (k, NULL);
+                                               size = (size + 7) & ~7;
+                                               vt_stack_used += size;
+                                       }
+                               }
+                               if (vt_stack_used != 0 || vt_res_size != 0) {
+                                       ADD_CODE(td, MINT_VTRESULT);
+                                       ADD_CODE(td, vt_res_size);
+                                       WRITE32(td, &vt_stack_used);
+                                       td->vt_sp -= vt_stack_used;
+                               }
+                               PUSH_TYPE (td, stack_type [mint_type (&klass->byval_arg)], klass);
                        }
-                       if (vt_stack_used != 0 || vt_res_size != 0) {
-                               ADD_CODE(&td, MINT_VTRESULT);
-                               ADD_CODE(&td, vt_res_size);
-                               WRITE32(&td, &vt_stack_used);
-                               td.vt_sp -= vt_stack_used;
-                       }
-                       PUSH_TYPE (&td, stack_type [mint_type (&klass->byval_arg)], klass);
                        break;
                }
                case CEE_CASTCLASS:
-                       CHECK_STACK (&td, 1);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       token = read32 (td->ip + 1);
                        klass = mini_get_class (method, token, generic_context);
-                       ADD_CODE(&td, MINT_CASTCLASS);
-                       ADD_CODE(&td, get_data_item_index (&td, klass));
-                       td.sp [-1].klass = klass;
-                       td.ip += 5;
+                       ADD_CODE(td, MINT_CASTCLASS);
+                       ADD_CODE(td, get_data_item_index (td, klass));
+                       td->sp [-1].klass = klass;
+                       td->ip += 5;
                        break;
                case CEE_ISINST:
-                       CHECK_STACK (&td, 1);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       token = read32 (td->ip + 1);
                        klass = mini_get_class (method, token, generic_context);
-                       ADD_CODE(&td, MINT_ISINST);
-                       ADD_CODE(&td, get_data_item_index (&td, klass));
-                       td.ip += 5;
+                       ADD_CODE(td, MINT_ISINST);
+                       ADD_CODE(td, get_data_item_index (td, klass));
+                       td->ip += 5;
                        break;
                case CEE_CONV_R_UN:
-                       switch (td.sp [-1].type) {
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_R_UN_I8);
+                               ADD_CODE(td, MINT_CONV_R_UN_I8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_R_UN_I4);
+                               ADD_CODE(td, MINT_CONV_R_UN_I4);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
-                       ++td.ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_R8);
+                       ++td->ip;
                        break;
                case CEE_UNBOX:
-                       CHECK_STACK (&td, 1);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       token = read32 (td->ip + 1);
                        
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
@@ -2524,76 +2811,76 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                g_error ("cee_unbox: implement Nullable");
                        }
                        
-                       ADD_CODE(&td, MINT_UNBOX);
-                       ADD_CODE(&td, get_data_item_index (&td, klass));
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
-                       td.ip += 5;
+                       ADD_CODE(td, MINT_UNBOX);
+                       ADD_CODE(td, get_data_item_index (td, klass));
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_MP);
+                       td->ip += 5;
                        break;
                case CEE_UNBOX_ANY:
-                       CHECK_STACK (&td, 1);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       token = read32 (td->ip + 1);
 
                        klass = mini_get_class (method, token, generic_context);
 
                        if (mini_type_is_reference (&klass->byval_arg)) {
                                int mt = mint_type (&klass->byval_arg);
-                               ADD_CODE (&td, MINT_CASTCLASS);
-                               ADD_CODE (&td, get_data_item_index (&td, klass));
-                               SET_TYPE (td.sp - 1, stack_type [mt], klass);
-                               td.ip += 5;
+                               ADD_CODE (td, MINT_CASTCLASS);
+                               ADD_CODE (td, get_data_item_index (td, klass));
+                               SET_TYPE (td->sp - 1, stack_type [mt], klass);
+                               td->ip += 5;
                        } else if (mono_class_is_nullable (klass)) {
                                MonoMethod *target_method = mono_class_get_method_from_name (klass, "Unbox", 1);
-                               /* td.ip is incremented by interp_transform_call */
-                               interp_transform_call (&td, method, target_method, domain, generic_context, is_bb_start, body_start_offset, NULL, FALSE);
+                               /* td->ip is incremented by interp_transform_call */
+                               interp_transform_call (td, method, target_method, domain, generic_context, is_bb_start, body_start_offset, NULL, FALSE);
                        } else {
                                int mt = mint_type (&klass->byval_arg);
-                               ADD_CODE (&td, MINT_UNBOX);
-                               ADD_CODE (&td, get_data_item_index (&td, klass));
+                               ADD_CODE (td, MINT_UNBOX);
+                               ADD_CODE (td, get_data_item_index (td, klass));
 
-                               ADD_CODE (&td, MINT_LDOBJ);
-                               ADD_CODE (&td, get_data_item_index(&td, klass));
-                               SET_TYPE (td.sp - 1, stack_type [mt], klass);
+                               ADD_CODE (td, MINT_LDOBJ);
+                               ADD_CODE (td, get_data_item_index(td, klass));
+                               SET_TYPE (td->sp - 1, stack_type [mt], klass);
 
                                if (mt == MINT_TYPE_VT) {
                                        int size = mono_class_value_size (klass, NULL);
-                                       PUSH_VT (&td, size);
+                                       PUSH_VT (td, size);
                                }
-                               td.ip += 5;
+                               td->ip += 5;
                        }
 
                        break;
                case CEE_THROW:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_THROW);
-                       --td.sp;
+                       --td->sp;
                        generating_code = 0;
                        break;
                case CEE_LDFLDA:
-                       CHECK_STACK (&td, 1);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       token = read32 (td->ip + 1);
                        field = interp_field_from_token (method, token, &klass, generic_context);
                        gboolean is_static = !!(field->type->attrs & FIELD_ATTRIBUTE_STATIC);
                        mono_class_init (klass);
                        if (is_static) {
-                               ADD_CODE (&td, MINT_POP);
-                               ADD_CODE (&td, 0);
-                               ADD_CODE (&td, MINT_LDSFLDA);
-                               ADD_CODE (&td, get_data_item_index (&td, field));
+                               ADD_CODE (td, MINT_POP);
+                               ADD_CODE (td, 0);
+                               ADD_CODE (td, MINT_LDSFLDA);
+                               ADD_CODE (td, get_data_item_index (td, field));
                        } else {
-                               if ((td.sp - 1)->type == STACK_TYPE_O) {
-                                       ADD_CODE (&td, MINT_LDFLDA);
+                               if ((td->sp - 1)->type == STACK_TYPE_O) {
+                                       ADD_CODE (td, MINT_LDFLDA);
                                } else {
-                                       g_assert ((td.sp -1)->type == STACK_TYPE_MP);
-                                       ADD_CODE (&td, MINT_LDFLDA_UNSAFE);
+                                       g_assert ((td->sp -1)->type == STACK_TYPE_MP);
+                                       ADD_CODE (td, MINT_LDFLDA_UNSAFE);
                                }
-                               ADD_CODE (&td, klass->valuetype ? field->offset - sizeof (MonoObject) : field->offset);
+                               ADD_CODE (td, klass->valuetype ? field->offset - sizeof (MonoObject) : field->offset);
                        }
-                       td.ip += 5;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+                       td->ip += 5;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_MP);
                        break;
                case CEE_LDFLD: {
-                       CHECK_STACK (&td, 1);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       token = read32 (td->ip + 1);
                        field = interp_field_from_token (method, token, &klass, generic_context);
                        gboolean is_static = !!(field->type->attrs & FIELD_ATTRIBUTE_STATIC);
                        mono_class_init (klass);
@@ -2603,42 +2890,42 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
 #ifndef DISABLE_REMOTING
                        if (klass->marshalbyref) {
                                g_assert (!is_static);
-                               ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_LDRMFLD_VT :  MINT_LDRMFLD);
-                               ADD_CODE(&td, get_data_item_index (&td, field));
+                               ADD_CODE(td, mt == MINT_TYPE_VT ? MINT_LDRMFLD_VT :  MINT_LDRMFLD);
+                               ADD_CODE(td, get_data_item_index (td, field));
                        } else
 #endif
                        {
                                if (is_static) {
-                                       ADD_CODE (&td, MINT_POP);
-                                       ADD_CODE (&td, 0);
-                                       ADD_CODE (&td, mt == MINT_TYPE_VT ? MINT_LDSFLD_VT : MINT_LDSFLD);
-                                       ADD_CODE (&td, get_data_item_index (&td, field));
+                                       ADD_CODE (td, MINT_POP);
+                                       ADD_CODE (td, 0);
+                                       ADD_CODE (td, mt == MINT_TYPE_VT ? MINT_LDSFLD_VT : MINT_LDSFLD);
+                                       ADD_CODE (td, get_data_item_index (td, field));
                                } else {
-                                       ADD_CODE (&td, MINT_LDFLD_I1 + mt - MINT_TYPE_I1);
-                                       ADD_CODE (&td, klass->valuetype ? field->offset - sizeof(MonoObject) : field->offset);
+                                       ADD_CODE (td, MINT_LDFLD_I1 + mt - MINT_TYPE_I1);
+                                       ADD_CODE (td, klass->valuetype ? field->offset - sizeof(MonoObject) : field->offset);
                                }
                        }
                        if (mt == MINT_TYPE_VT) {
                                int size = mono_class_value_size (field_klass, NULL);
-                               PUSH_VT(&td, size);
-                               WRITE32(&td, &size);
+                               PUSH_VT(td, size);
+                               WRITE32(td, &size);
                        }
-                       if (td.sp [-1].type == STACK_TYPE_VT) {
+                       if (td->sp [-1].type == STACK_TYPE_VT) {
                                int size = mono_class_value_size (klass, NULL);
                                size = (size + 7) & ~7;
-                               td.vt_sp -= size;
-                               ADD_CODE (&td, MINT_VTRESULT);
-                               ADD_CODE (&td, 0);
-                               WRITE32 (&td, &size);
+                               td->vt_sp -= size;
+                               ADD_CODE (td, MINT_VTRESULT);
+                               ADD_CODE (td, 0);
+                               WRITE32 (td, &size);
                        }
-                       td.ip += 5;
-                       SET_TYPE(td.sp - 1, stack_type [mt], field_klass);
+                       td->ip += 5;
+                       SET_TYPE(td->sp - 1, stack_type [mt], field_klass);
                        BARRIER_IF_VOLATILE (td);
                        break;
                }
                case CEE_STFLD: {
-                       CHECK_STACK (&td, 2);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 2);
+                       token = read32 (td->ip + 1);
                        field = interp_field_from_token (method, token, &klass, generic_context);
                        gboolean is_static = !!(field->type->attrs & FIELD_ATTRIBUTE_STATIC);
                        mono_class_init (klass);
@@ -2649,78 +2936,78 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
 #ifndef DISABLE_REMOTING
                        if (klass->marshalbyref) {
                                g_assert (!is_static);
-                               ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_STRMFLD_VT : MINT_STRMFLD);
-                               ADD_CODE(&td, get_data_item_index (&td, field));
+                               ADD_CODE(td, mt == MINT_TYPE_VT ? MINT_STRMFLD_VT : MINT_STRMFLD);
+                               ADD_CODE(td, get_data_item_index (td, field));
                        } else
 #endif
                        {
                                if (is_static) {
-                                       ADD_CODE (&td, MINT_POP);
-                                       ADD_CODE (&td, 1);
-                                       ADD_CODE (&td, mt == MINT_TYPE_VT ? MINT_STSFLD_VT : MINT_STSFLD);
-                                       ADD_CODE (&td, get_data_item_index (&td, field));
+                                       ADD_CODE (td, MINT_POP);
+                                       ADD_CODE (td, 1);
+                                       ADD_CODE (td, mt == MINT_TYPE_VT ? MINT_STSFLD_VT : MINT_STSFLD);
+                                       ADD_CODE (td, get_data_item_index (td, field));
                                } else {
-                                       ADD_CODE (&td, MINT_STFLD_I1 + mt - MINT_TYPE_I1);
-                                       ADD_CODE (&td, klass->valuetype ? field->offset - sizeof(MonoObject) : field->offset);
+                                       ADD_CODE (td, MINT_STFLD_I1 + mt - MINT_TYPE_I1);
+                                       ADD_CODE (td, klass->valuetype ? field->offset - sizeof(MonoObject) : field->offset);
                                }
                        }
                        if (mt == MINT_TYPE_VT) {
                                MonoClass *klass = mono_class_from_mono_type (field->type);
                                int size = mono_class_value_size (klass, NULL);
-                               POP_VT(&td, size);
-                               WRITE32(&td, &size);
+                               POP_VT(td, size);
+                               WRITE32(td, &size);
                        }
-                       td.ip += 5;
-                       td.sp -= 2;
+                       td->ip += 5;
+                       td->sp -= 2;
                        break;
                }
                case CEE_LDSFLDA:
-                       token = read32 (td.ip + 1);
+                       token = read32 (td->ip + 1);
                        field = interp_field_from_token (method, token, &klass, generic_context);
-                       ADD_CODE(&td, MINT_LDSFLDA);
-                       ADD_CODE(&td, get_data_item_index (&td, field));
-                       td.ip += 5;
-                       PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
+                       ADD_CODE(td, MINT_LDSFLDA);
+                       ADD_CODE(td, get_data_item_index (td, field));
+                       td->ip += 5;
+                       PUSH_SIMPLE_TYPE(td, STACK_TYPE_MP);
                        break;
                case CEE_LDSFLD:
-                       token = read32 (td.ip + 1);
+                       token = read32 (td->ip + 1);
                        field = interp_field_from_token (method, token, &klass, generic_context);
                        mt = mint_type(field->type);
-                       ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_LDSFLD_VT : MINT_LDSFLD);
-                       ADD_CODE(&td, get_data_item_index (&td, field));
+                       ADD_CODE(td, mt == MINT_TYPE_VT ? MINT_LDSFLD_VT : MINT_LDSFLD);
+                       ADD_CODE(td, get_data_item_index (td, field));
                        klass = NULL;
                        if (mt == MINT_TYPE_VT) {
                                MonoClass *klass = mono_class_from_mono_type (field->type);
                                int size = mono_class_value_size (klass, NULL);
-                               PUSH_VT(&td, size);
-                               WRITE32(&td, &size);
+                               PUSH_VT(td, size);
+                               WRITE32(td, &size);
                                klass = field->type->data.klass;
                        } else {
                                if (mt == MINT_TYPE_O) 
                                        klass = mono_class_from_mono_type (field->type);
                        }
-                       td.ip += 5;
-                       PUSH_TYPE(&td, stack_type [mt], klass);
+                       td->ip += 5;
+                       PUSH_TYPE(td, stack_type [mt], klass);
                        break;
                case CEE_STSFLD:
-                       CHECK_STACK (&td, 1);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       token = read32 (td->ip + 1);
                        field = interp_field_from_token (method, token, &klass, generic_context);
                        mt = mint_type(field->type);
-                       ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_STSFLD_VT : MINT_STSFLD);
-                       ADD_CODE(&td, get_data_item_index (&td, field));
+                       ADD_CODE(td, mt == MINT_TYPE_VT ? MINT_STSFLD_VT : MINT_STSFLD);
+                       ADD_CODE(td, get_data_item_index (td, field));
                        if (mt == MINT_TYPE_VT) {
                                MonoClass *klass = mono_class_from_mono_type (field->type);
                                int size = mono_class_value_size (klass, NULL);
-                               POP_VT (&td, size);
-                               WRITE32 (&td, &size);
+                               POP_VT (td, size);
+                               WRITE32 (td, &size);
                        }
-                       td.ip += 5;
-                       --td.sp;
+                       td->ip += 5;
+                       --td->sp;
                        break;
                case CEE_STOBJ: {
                        int size;
-                       token = read32 (td.ip + 1);
+                       token = read32 (td->ip + 1);
 
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
@@ -2728,73 +3015,73 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                klass = mini_get_class (method, token, generic_context);
 
                        BARRIER_IF_VOLATILE (td);
-                       ADD_CODE(&td, td.sp [-1].type == STACK_TYPE_VT ? MINT_STOBJ_VT : MINT_STOBJ);
-                       ADD_CODE(&td, get_data_item_index (&td, klass));
-                       if (td.sp [-1].type == STACK_TYPE_VT) {
+                       ADD_CODE(td, td->sp [-1].type == STACK_TYPE_VT ? MINT_STOBJ_VT : MINT_STOBJ);
+                       ADD_CODE(td, get_data_item_index (td, klass));
+                       if (td->sp [-1].type == STACK_TYPE_VT) {
                                size = mono_class_value_size (klass, NULL);
                                size = (size + 7) & ~7;
-                               td.vt_sp -= size;
+                               td->vt_sp -= size;
                        }
-                       td.ip += 5;
-                       td.sp -= 2;
+                       td->ip += 5;
+                       td->sp -= 2;
                        break;
                }
                case CEE_CONV_OVF_I_UN:
                case CEE_CONV_OVF_U_UN:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
 #if SIZEOF_VOID_P == 8
-                               ADD_CODE(&td, MINT_CONV_OVF_I8_UN_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_I8_UN_R8);
 #else
-                               ADD_CODE(&td, MINT_CONV_OVF_I4_UN_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_I4_UN_R8);
 #endif
                                break;
                        case STACK_TYPE_I8:
 #if SIZEOF_VOID_P == 4
-                               ADD_CODE (&td, MINT_CONV_OVF_I4_UN_I8);
+                               ADD_CODE (td, MINT_CONV_OVF_I4_UN_I8);
 #endif
                                break;
                        case STACK_TYPE_I4:
 #if SIZEOF_VOID_P == 8
-                               ADD_CODE(&td, MINT_CONV_I8_U4);
+                               ADD_CODE(td, MINT_CONV_I8_U4);
 #elif SIZEOF_VOID_P == 4
-                               if (*td.ip == CEE_CONV_OVF_I_UN)
-                                       ADD_CODE(&td, MINT_CONV_OVF_I4_U4);
+                               if (*td->ip == CEE_CONV_OVF_I_UN)
+                                       ADD_CODE(td, MINT_CONV_OVF_I4_U4);
 #endif
                                break;
                        default:
                                g_assert_not_reached ();
                                break;
                        }
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
-                       ++td.ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I8);
+                       ++td->ip;
                        break;
                case CEE_CONV_OVF_I8_UN:
                case CEE_CONV_OVF_U8_UN:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_OVF_I8_UN_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_I8_UN_R8);
                                break;
                        case STACK_TYPE_I8:
-                               if (*td.ip == CEE_CONV_OVF_I8_UN)
-                                       ADD_CODE (&td, MINT_CONV_OVF_I8_U8);
+                               if (*td->ip == CEE_CONV_OVF_I8_UN)
+                                       ADD_CODE (td, MINT_CONV_OVF_I8_U8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_I8_U4);
+                               ADD_CODE(td, MINT_CONV_I8_U4);
                                break;
                        default:
                                g_assert_not_reached ();
                                break;
                        }
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
-                       ++td.ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I8);
+                       ++td->ip;
                        break;
                case CEE_BOX: {
                        int size;
-                       CHECK_STACK (&td, 1);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       token = read32 (td->ip + 1);
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
                        else
@@ -2802,59 +3089,59 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
 
                        if (mono_class_is_nullable (klass)) {
                                MonoMethod *target_method = mono_class_get_method_from_name (klass, "Box", 1);
-                               /* td.ip is incremented by interp_transform_call */
-                               interp_transform_call (&td, method, target_method, domain, generic_context, is_bb_start, body_start_offset, NULL, FALSE);
+                               /* td->ip is incremented by interp_transform_call */
+                               interp_transform_call (td, method, target_method, domain, generic_context, is_bb_start, body_start_offset, NULL, FALSE);
                        } else if (!klass->valuetype) {
                                /* already boxed, do nothing. */
-                               td.ip += 5;
+                               td->ip += 5;
                        } else {
                                if (mint_type (&klass->byval_arg) == MINT_TYPE_VT && !klass->enumtype) {
                                        size = mono_class_value_size (klass, NULL);
                                        size = (size + 7) & ~7;
-                                       td.vt_sp -= size;
+                                       td->vt_sp -= size;
                                }
-                               ADD_CODE(&td, MINT_BOX);
-                               ADD_CODE(&td, get_data_item_index (&td, klass));
-                               ADD_CODE (&td, 0);
-                               SET_TYPE(td.sp - 1, STACK_TYPE_O, klass);
-                               td.ip += 5;
+                               ADD_CODE(td, MINT_BOX);
+                               ADD_CODE(td, get_data_item_index (td, klass));
+                               ADD_CODE (td, 0);
+                               SET_TYPE(td->sp - 1, STACK_TYPE_O, klass);
+                               td->ip += 5;
                        }
 
                        break;
                }
                case CEE_NEWARR: {
-                       CHECK_STACK (&td, 1);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       token = read32 (td->ip + 1);
 
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
                        else
                                klass = mini_get_class (method, token, generic_context);
 
-                       unsigned char lentype = (td.sp - 1)->type;
+                       unsigned char lentype = (td->sp - 1)->type;
                        if (lentype == STACK_TYPE_I8) {
                                /* mimic mini behaviour */
-                               ADD_CODE (&td, MINT_CONV_OVF_U4_I8);
+                               ADD_CODE (td, MINT_CONV_OVF_U4_I8);
                        } else {
                                g_assert (lentype == STACK_TYPE_I4);
-                               ADD_CODE (&td, MINT_CONV_OVF_U4_I4);
+                               ADD_CODE (td, MINT_CONV_OVF_U4_I4);
                        }
-                       SET_SIMPLE_TYPE (td.sp - 1, STACK_TYPE_I4);
-                       ADD_CODE (&td, MINT_NEWARR);
-                       ADD_CODE (&td, get_data_item_index (&td, klass));
-                       SET_TYPE (td.sp - 1, STACK_TYPE_O, klass);
-                       td.ip += 5;
+                       SET_SIMPLE_TYPE (td->sp - 1, STACK_TYPE_I4);
+                       ADD_CODE (td, MINT_NEWARR);
+                       ADD_CODE (td, get_data_item_index (td, klass));
+                       SET_TYPE (td->sp - 1, STACK_TYPE_O, klass);
+                       td->ip += 5;
                        break;
                }
                case CEE_LDLEN:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_LDLEN);
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I);
                        break;
                case CEE_LDELEMA:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
+                       token = read32 (td->ip + 1);
 
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                klass = (MonoClass *) mono_method_get_wrapper_data (method, token);
@@ -2862,164 +3149,164 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                klass = mini_get_class (method, token, generic_context);
 
                        if (!klass->valuetype && method->wrapper_type == MONO_WRAPPER_NONE && !readonly) {
-                               ADD_CODE (&td, MINT_LDELEMA_TC);
+                               ADD_CODE (td, MINT_LDELEMA_TC);
                        } else {
-                               ADD_CODE (&td, MINT_LDELEMA);
+                               ADD_CODE (td, MINT_LDELEMA);
                        }
-                       ADD_CODE (&td, get_data_item_index (&td, klass));
+                       ADD_CODE (td, get_data_item_index (td, klass));
                        /* according to spec, ldelema bytecode is only used for 1-dim arrays */
-                       ADD_CODE (&td, 2);
+                       ADD_CODE (td, 2);
                        readonly = FALSE;
 
-                       td.ip += 5;
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+                       td->ip += 5;
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_MP);
                        break;
                case CEE_LDELEM_I1:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_I1);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_LDELEM_U1:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_U1);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_LDELEM_I2:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_I2);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_LDELEM_U2:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_U2);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_LDELEM_I4:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_I4);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_LDELEM_U4:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_U4);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_LDELEM_I8:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_I8);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I8);
                        break;
                case CEE_LDELEM_I:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_I);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I);
                        break;
                case CEE_LDELEM_R4:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_R4);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_R8);
                        break;
                case CEE_LDELEM_R8:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_R8);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_R8);
                        break;
                case CEE_LDELEM_REF:
-                       CHECK_STACK (&td, 2);
-                       ENSURE_I4 (&td, 1);
+                       CHECK_STACK (td, 2);
+                       ENSURE_I4 (td, 1);
                        SIMPLE_OP (td, MINT_LDELEM_REF);
-                       --td.sp;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_O);
+                       --td->sp;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_O);
                        break;
                case CEE_LDELEM:
-                       CHECK_STACK (&td, 2);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 2);
+                       token = read32 (td->ip + 1);
                        klass = mini_get_class (method, token, generic_context);
                        switch (mint_type (&klass->byval_arg)) {
                                case MINT_TYPE_I1:
-                                       ENSURE_I4 (&td, 1);
+                                       ENSURE_I4 (td, 1);
                                        SIMPLE_OP (td, MINT_LDELEM_I1);
-                                       --td.sp;
-                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                                       --td->sp;
+                                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                                        break;
                                case MINT_TYPE_U1:
-                                       ENSURE_I4 (&td, 1);
+                                       ENSURE_I4 (td, 1);
                                        SIMPLE_OP (td, MINT_LDELEM_U1);
-                                       --td.sp;
-                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                                       --td->sp;
+                                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                                        break;
                                case MINT_TYPE_U2:
-                                       ENSURE_I4 (&td, 1);
+                                       ENSURE_I4 (td, 1);
                                        SIMPLE_OP (td, MINT_LDELEM_U2);
-                                       --td.sp;
-                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                                       --td->sp;
+                                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                                        break;
                                case MINT_TYPE_I2:
-                                       ENSURE_I4 (&td, 1);
+                                       ENSURE_I4 (td, 1);
                                        SIMPLE_OP (td, MINT_LDELEM_I2);
-                                       --td.sp;
-                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                                       --td->sp;
+                                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                                        break;
                                case MINT_TYPE_I4:
-                                       ENSURE_I4 (&td, 1);
+                                       ENSURE_I4 (td, 1);
                                        SIMPLE_OP (td, MINT_LDELEM_I4);
-                                       --td.sp;
-                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                                       --td->sp;
+                                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                                        break;
                                case MINT_TYPE_I8:
-                                       ENSURE_I4 (&td, 1);
+                                       ENSURE_I4 (td, 1);
                                        SIMPLE_OP (td, MINT_LDELEM_I8);
-                                       --td.sp;
-                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+                                       --td->sp;
+                                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I8);
                                        break;
                                case MINT_TYPE_R4:
-                                       ENSURE_I4 (&td, 1);
+                                       ENSURE_I4 (td, 1);
                                        SIMPLE_OP (td, MINT_LDELEM_R4);
-                                       --td.sp;
-                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+                                       --td->sp;
+                                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_R8);
                                        break;
                                case MINT_TYPE_R8:
-                                       ENSURE_I4 (&td, 1);
+                                       ENSURE_I4 (td, 1);
                                        SIMPLE_OP (td, MINT_LDELEM_R8);
-                                       --td.sp;
-                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+                                       --td->sp;
+                                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_R8);
                                        break;
                                case MINT_TYPE_O:
-                                       ENSURE_I4 (&td, 1);
+                                       ENSURE_I4 (td, 1);
                                        SIMPLE_OP (td, MINT_LDELEM_REF);
-                                       --td.sp;
-                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_O);
+                                       --td->sp;
+                                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_O);
                                        break;
                                case MINT_TYPE_VT: {
                                        int size = mono_class_value_size (klass, NULL);
-                                       ENSURE_I4 (&td, 1);
+                                       ENSURE_I4 (td, 1);
                                        SIMPLE_OP (td, MINT_LDELEM_VT);
-                                       ADD_CODE (&td, get_data_item_index (&td, klass));
-                                       WRITE32 (&td, &size);
-                                       --td.sp;
-                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_VT);
-                                       PUSH_VT (&td, size);
+                                       ADD_CODE (td, get_data_item_index (td, klass));
+                                       WRITE32 (td, &size);
+                                       --td->sp;
+                                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_VT);
+                                       PUSH_VT (td, size);
                                        break;
                                }
                                default: {
@@ -3031,60 +3318,60 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                        break;
                                }
                        }
-                       td.ip += 4;
+                       td->ip += 4;
                        break;
                case CEE_STELEM_I:
-                       CHECK_STACK (&td, 3);
-                       ENSURE_I4 (&td, 2);
+                       CHECK_STACK (td, 3);
+                       ENSURE_I4 (td, 2);
                        SIMPLE_OP (td, MINT_STELEM_I);
-                       td.sp -= 3;
+                       td->sp -= 3;
                        break;
                case CEE_STELEM_I1:
-                       CHECK_STACK (&td, 3);
-                       ENSURE_I4 (&td, 2);
+                       CHECK_STACK (td, 3);
+                       ENSURE_I4 (td, 2);
                        SIMPLE_OP (td, MINT_STELEM_I1);
-                       td.sp -= 3;
+                       td->sp -= 3;
                        break;
                case CEE_STELEM_I2:
-                       CHECK_STACK (&td, 3);
-                       ENSURE_I4 (&td, 2);
+                       CHECK_STACK (td, 3);
+                       ENSURE_I4 (td, 2);
                        SIMPLE_OP (td, MINT_STELEM_I2);
-                       td.sp -= 3;
+                       td->sp -= 3;
                        break;
                case CEE_STELEM_I4:
-                       CHECK_STACK (&td, 3);
-                       ENSURE_I4 (&td, 2);
+                       CHECK_STACK (td, 3);
+                       ENSURE_I4 (td, 2);
                        SIMPLE_OP (td, MINT_STELEM_I4);
-                       td.sp -= 3;
+                       td->sp -= 3;
                        break;
                case CEE_STELEM_I8:
-                       CHECK_STACK (&td, 3);
-                       ENSURE_I4 (&td, 2);
+                       CHECK_STACK (td, 3);
+                       ENSURE_I4 (td, 2);
                        SIMPLE_OP (td, MINT_STELEM_I8);
-                       td.sp -= 3;
+                       td->sp -= 3;
                        break;
                case CEE_STELEM_R4:
-                       CHECK_STACK (&td, 3);
-                       ENSURE_I4 (&td, 2);
+                       CHECK_STACK (td, 3);
+                       ENSURE_I4 (td, 2);
                        SIMPLE_OP (td, MINT_STELEM_R4);
-                       td.sp -= 3;
+                       td->sp -= 3;
                        break;
                case CEE_STELEM_R8:
-                       CHECK_STACK (&td, 3);
-                       ENSURE_I4 (&td, 2);
+                       CHECK_STACK (td, 3);
+                       ENSURE_I4 (td, 2);
                        SIMPLE_OP (td, MINT_STELEM_R8);
-                       td.sp -= 3;
+                       td->sp -= 3;
                        break;
                case CEE_STELEM_REF:
-                       CHECK_STACK (&td, 3);
-                       ENSURE_I4 (&td, 2);
+                       CHECK_STACK (td, 3);
+                       ENSURE_I4 (td, 2);
                        SIMPLE_OP (td, MINT_STELEM_REF);
-                       td.sp -= 3;
+                       td->sp -= 3;
                        break;
                case CEE_STELEM:
-                       CHECK_STACK (&td, 3);
-                       ENSURE_I4 (&td, 2);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 3);
+                       ENSURE_I4 (td, 2);
+                       token = read32 (td->ip + 1);
                        klass = mini_get_class (method, token, generic_context);
                        switch (mint_type (&klass->byval_arg)) {
                                case MINT_TYPE_U1:
@@ -3105,9 +3392,9 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                case MINT_TYPE_VT: {
                                        int size = mono_class_value_size (klass, NULL);
                                        SIMPLE_OP (td, MINT_STELEM_VT);
-                                       ADD_CODE (&td, get_data_item_index (&td, klass));
-                                       WRITE32 (&td, &size);
-                                       POP_VT (&td, size);
+                                       ADD_CODE (td, get_data_item_index (td, klass));
+                                       WRITE32 (td, &size);
+                                       POP_VT (td, size);
                                        break;
                                }
                                default: {
@@ -3119,8 +3406,8 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                        break;
                                }
                        }
-                       td.ip += 4;
-                       td.sp -= 3;
+                       td->ip += 4;
+                       td->sp -= 3;
                        break;
 #if 0
                case CEE_CONV_OVF_U1:
@@ -3132,205 +3419,205 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
 #endif
 #endif
                case CEE_CKFINITE:
-                       CHECK_STACK (&td, 1);
+                       CHECK_STACK (td, 1);
                        SIMPLE_OP (td, MINT_CKFINITE);
                        break;
                case CEE_MKREFANY:
-                       CHECK_STACK (&td, 1);
-                       ENSURE_I4 (&td, 2);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       ENSURE_I4 (td, 2);
+                       token = read32 (td->ip + 1);
                        klass = mini_get_class (method, token, generic_context);
 
-                       ADD_CODE (&td, MINT_MKREFANY);
-                       ADD_CODE (&td, get_data_item_index (&td, klass));
+                       ADD_CODE (td, MINT_MKREFANY);
+                       ADD_CODE (td, get_data_item_index (td, klass));
 
-                       td.ip += 5;
-                       PUSH_VT (&td, sizeof (MonoTypedRef));
-                       SET_TYPE(td.sp - 1, STACK_TYPE_VT, mono_defaults.typed_reference_class);
+                       td->ip += 5;
+                       PUSH_VT (td, sizeof (MonoTypedRef));
+                       SET_TYPE(td->sp - 1, STACK_TYPE_VT, mono_defaults.typed_reference_class);
                        break;
                case CEE_REFANYVAL: {
-                       CHECK_STACK (&td, 1);
-                       ENSURE_I4 (&td, 2);
-                       token = read32 (td.ip + 1);
+                       CHECK_STACK (td, 1);
+                       ENSURE_I4 (td, 2);
+                       token = read32 (td->ip + 1);
 
-                       ADD_CODE (&td, MINT_REFANYVAL);
+                       ADD_CODE (td, MINT_REFANYVAL);
 
-                       POP_VT (&td, sizeof (MonoTypedRef));
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+                       POP_VT (td, sizeof (MonoTypedRef));
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_MP);
 
-                       td.ip += 5;
+                       td->ip += 5;
                        break;
                }
                case CEE_CONV_OVF_I1:
                case CEE_CONV_OVF_I1_UN:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_OVF_I1_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_I1_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_OVF_I1_I4);
+                               ADD_CODE(td, MINT_CONV_OVF_I1_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_OVF_I1_I8);
+                               ADD_CODE(td, MINT_CONV_OVF_I1_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_CONV_OVF_U1:
                case CEE_CONV_OVF_U1_UN:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_OVF_U1_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_U1_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_OVF_U1_I4);
+                               ADD_CODE(td, MINT_CONV_OVF_U1_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_OVF_U1_I8);
+                               ADD_CODE(td, MINT_CONV_OVF_U1_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_CONV_OVF_I2:
                case CEE_CONV_OVF_I2_UN:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_OVF_I2_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_I2_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_OVF_I2_I4);
+                               ADD_CODE(td, MINT_CONV_OVF_I2_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_OVF_I2_I8);
+                               ADD_CODE(td, MINT_CONV_OVF_I2_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
                case CEE_CONV_OVF_U2_UN:
                case CEE_CONV_OVF_U2:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_OVF_U2_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_U2_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_OVF_U2_I4);
+                               ADD_CODE(td, MINT_CONV_OVF_U2_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_OVF_U2_I8);
+                               ADD_CODE(td, MINT_CONV_OVF_U2_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
 #if SIZEOF_VOID_P == 4
                case CEE_CONV_OVF_I:
 #endif
                case CEE_CONV_OVF_I4:
                case CEE_CONV_OVF_I4_UN:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_OVF_I4_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_I4_R8);
                                break;
                        case STACK_TYPE_I4:
-                               if (*td.ip == CEE_CONV_OVF_I4_UN)
-                                       ADD_CODE(&td, MINT_CONV_OVF_I4_U4);
+                               if (*td->ip == CEE_CONV_OVF_I4_UN)
+                                       ADD_CODE(td, MINT_CONV_OVF_I4_U4);
                                break;
                        case STACK_TYPE_I8:
-                               if (*td.ip == CEE_CONV_OVF_I4_UN)
-                                       ADD_CODE (&td, MINT_CONV_OVF_I4_U8);
+                               if (*td->ip == CEE_CONV_OVF_I4_UN)
+                                       ADD_CODE (td, MINT_CONV_OVF_I4_U8);
                                else
-                                       ADD_CODE (&td, MINT_CONV_OVF_I4_I8);
+                                       ADD_CODE (td, MINT_CONV_OVF_I4_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
 #if SIZEOF_VOID_P == 4
                case CEE_CONV_OVF_U:
 #endif
                case CEE_CONV_OVF_U4:
                case CEE_CONV_OVF_U4_UN:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_OVF_U4_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_U4_R8);
                                break;
                        case STACK_TYPE_I4:
-                               if (*td.ip != CEE_CONV_OVF_U4_UN)
-                                       ADD_CODE(&td, MINT_CONV_OVF_U4_I4);
+                               if (*td->ip != CEE_CONV_OVF_U4_UN)
+                                       ADD_CODE(td, MINT_CONV_OVF_U4_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE(&td, MINT_CONV_OVF_U4_I8);
+                               ADD_CODE(td, MINT_CONV_OVF_U4_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
                        break;
 #if SIZEOF_VOID_P == 8
                case CEE_CONV_OVF_I:
 #endif
                case CEE_CONV_OVF_I8:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_OVF_I8_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_I8_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_I8_I4);
+                               ADD_CODE(td, MINT_CONV_I8_I4);
                                break;
                        case STACK_TYPE_I8:
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I8);
                        break;
 #if SIZEOF_VOID_P == 8
                case CEE_CONV_OVF_U:
 #endif
                case CEE_CONV_OVF_U8:
-                       CHECK_STACK (&td, 1);
-                       switch (td.sp [-1].type) {
+                       CHECK_STACK (td, 1);
+                       switch (td->sp [-1].type) {
                        case STACK_TYPE_R8:
-                               ADD_CODE(&td, MINT_CONV_OVF_U8_R8);
+                               ADD_CODE(td, MINT_CONV_OVF_U8_R8);
                                break;
                        case STACK_TYPE_I4:
-                               ADD_CODE(&td, MINT_CONV_OVF_U8_I4);
+                               ADD_CODE(td, MINT_CONV_OVF_U8_I4);
                                break;
                        case STACK_TYPE_I8:
-                               ADD_CODE (&td, MINT_CONV_OVF_U8_I8);
+                               ADD_CODE (td, MINT_CONV_OVF_U8_I8);
                                break;
                        default:
                                g_assert_not_reached ();
                        }
-                       ++td.ip;
-                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+                       ++td->ip;
+                       SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I8);
                        break;
                case CEE_LDTOKEN: {
                        int size;
                        gpointer handle;
-                       token = read32 (td.ip + 1);
+                       token = read32 (td->ip + 1);
                        if (method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD || method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED) {
                                handle = mono_method_get_wrapper_data (method, token);
                                klass = (MonoClass *) mono_method_get_wrapper_data (method, token + 1);
@@ -3349,81 +3636,81 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        g_assert (mt == MINT_TYPE_VT);
                        size = mono_class_value_size (klass, NULL);
                        g_assert (size == sizeof(gpointer));
-                       PUSH_VT (&td, sizeof(gpointer));
-                       ADD_CODE (&td, MINT_LDTOKEN);
-                       ADD_CODE (&td, get_data_item_index (&td, handle));
+                       PUSH_VT (td, sizeof(gpointer));
+                       ADD_CODE (td, MINT_LDTOKEN);
+                       ADD_CODE (td, get_data_item_index (td, handle));
 
-                       SET_TYPE (td.sp, stack_type [mt], klass);
-                       td.sp++;
-                       td.ip += 5;
+                       SET_TYPE (td->sp, stack_type [mt], klass);
+                       td->sp++;
+                       td->ip += 5;
                        break;
                }
                case CEE_ADD_OVF:
-                       binary_arith_op(&td, MINT_ADD_OVF_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_ADD_OVF_I4);
+                       ++td->ip;
                        break;
                case CEE_ADD_OVF_UN:
-                       binary_arith_op(&td, MINT_ADD_OVF_UN_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_ADD_OVF_UN_I4);
+                       ++td->ip;
                        break;
                case CEE_MUL_OVF:
-                       binary_arith_op(&td, MINT_MUL_OVF_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_MUL_OVF_I4);
+                       ++td->ip;
                        break;
                case CEE_MUL_OVF_UN:
-                       binary_arith_op(&td, MINT_MUL_OVF_UN_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_MUL_OVF_UN_I4);
+                       ++td->ip;
                        break;
                case CEE_SUB_OVF:
-                       binary_arith_op(&td, MINT_SUB_OVF_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_SUB_OVF_I4);
+                       ++td->ip;
                        break;
                case CEE_SUB_OVF_UN:
-                       binary_arith_op(&td, MINT_SUB_OVF_UN_I4);
-                       ++td.ip;
+                       binary_arith_op(td, MINT_SUB_OVF_UN_I4);
+                       ++td->ip;
                        break;
                case CEE_ENDFINALLY:
-                       g_assert (td.clause_indexes [in_offset] != -1);
-                       td.sp = td.stack;
+                       g_assert (td->clause_indexes [in_offset] != -1);
+                       td->sp = td->stack;
                        SIMPLE_OP (td, MINT_ENDFINALLY);
-                       ADD_CODE (&td, td.clause_indexes [in_offset]);
+                       ADD_CODE (td, td->clause_indexes [in_offset]);
                        generating_code = 0;
                        break;
                case CEE_LEAVE:
-                       td.sp = td.stack;
-                       handle_branch (&td, MINT_LEAVE_S, MINT_LEAVE, 5 + read32 (td.ip + 1));
-                       td.ip += 5;
+                       td->sp = td->stack;
+                       handle_branch (td, MINT_LEAVE_S, MINT_LEAVE, 5 + read32 (td->ip + 1));
+                       td->ip += 5;
                        generating_code = 0;
                        break;
                case CEE_LEAVE_S:
-                       td.sp = td.stack;
-                       handle_branch (&td, MINT_LEAVE_S, MINT_LEAVE, 2 + (gint8)td.ip [1]);
-                       td.ip += 2;
+                       td->sp = td->stack;
+                       handle_branch (td, MINT_LEAVE_S, MINT_LEAVE, 2 + (gint8)td->ip [1]);
+                       td->ip += 2;
                        generating_code = 0;
                        break;
                case CEE_UNUSED41:
-                       ++td.ip;
-                       switch (*td.ip) {
+                       ++td->ip;
+                       switch (*td->ip) {
                                case CEE_MONO_CALLI_EXTRA_ARG:
                                        /* Same as CEE_CALLI, except that we drop the extra arg required for llvm specific behaviour */
-                                       ADD_CODE (&td, MINT_POP);
-                                       ADD_CODE (&td, 1);
-                                       --td.sp;
-                                       interp_transform_call (&td, method, NULL, domain, generic_context, is_bb_start, body_start_offset, NULL, FALSE);
+                                       ADD_CODE (td, MINT_POP);
+                                       ADD_CODE (td, 1);
+                                       --td->sp;
+                                       interp_transform_call (td, method, NULL, domain, generic_context, is_bb_start, body_start_offset, NULL, FALSE);
                                        break;
                                case CEE_MONO_JIT_ICALL_ADDR: {
                                        guint32 token;
                                        gpointer func;
                                        MonoJitICallInfo *info;
 
-                                       token = read32 (td.ip + 1);
-                                       td.ip += 5;
+                                       token = read32 (td->ip + 1);
+                                       td->ip += 5;
                                        func = mono_method_get_wrapper_data (method, token);
                                        info = mono_find_jit_icall_by_addr (func);
 
-                                       ADD_CODE (&td, MINT_LDFTN);
-                                       ADD_CODE (&td, get_data_item_index (&td, func));
-                                       PUSH_SIMPLE_TYPE (&td, STACK_TYPE_I);
+                                       ADD_CODE (td, MINT_LDFTN);
+                                       ADD_CODE (td, get_data_item_index (td, func));
+                                       PUSH_SIMPLE_TYPE (td, STACK_TYPE_I);
                                        break;
                                }
                                case CEE_MONO_ICALL: {
@@ -3431,45 +3718,45 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                        gpointer func;
                                        MonoJitICallInfo *info;
 
-                                       token = read32 (td.ip + 1);
-                                       td.ip += 5;
+                                       token = read32 (td->ip + 1);
+                                       td->ip += 5;
                                        func = mono_method_get_wrapper_data (method, token);
                                        info = mono_find_jit_icall_by_addr (func);
                                        g_assert (info);
 
-                                       CHECK_STACK (&td, info->sig->param_count);
+                                       CHECK_STACK (td, info->sig->param_count);
                                        switch (info->sig->param_count) {
                                        case 0:
                                                if (MONO_TYPE_IS_VOID (info->sig->ret))
-                                                       ADD_CODE (&td,MINT_ICALL_V_V);
+                                                       ADD_CODE (td,MINT_ICALL_V_V);
                                                else
-                                                       ADD_CODE (&td, MINT_ICALL_V_P);
+                                                       ADD_CODE (td, MINT_ICALL_V_P);
                                                break;
                                        case 1:
                                                if (MONO_TYPE_IS_VOID (info->sig->ret))
-                                                       ADD_CODE (&td,MINT_ICALL_P_V);
+                                                       ADD_CODE (td,MINT_ICALL_P_V);
                                                else
-                                                       ADD_CODE (&td,MINT_ICALL_P_P);
+                                                       ADD_CODE (td,MINT_ICALL_P_P);
                                                break;
                                        case 2:
                                                if (MONO_TYPE_IS_VOID (info->sig->ret)) {
                                                        if (info->sig->params [1]->type == MONO_TYPE_I4)
-                                                               ADD_CODE (&td,MINT_ICALL_PI_V);
+                                                               ADD_CODE (td,MINT_ICALL_PI_V);
                                                        else
-                                                               ADD_CODE (&td,MINT_ICALL_PP_V);
+                                                               ADD_CODE (td,MINT_ICALL_PP_V);
                                                } else {
                                                        if (info->sig->params [1]->type == MONO_TYPE_I4)
-                                                               ADD_CODE (&td,MINT_ICALL_PI_P);
+                                                               ADD_CODE (td,MINT_ICALL_PI_P);
                                                        else
-                                                               ADD_CODE (&td,MINT_ICALL_PP_P);
+                                                               ADD_CODE (td,MINT_ICALL_PP_P);
                                                }
                                                break;
                                        case 3:
                                                g_assert (MONO_TYPE_IS_VOID (info->sig->ret));
                                                if (info->sig->params [2]->type == MONO_TYPE_I4)
-                                                       ADD_CODE (&td,MINT_ICALL_PPI_V);
+                                                       ADD_CODE (td,MINT_ICALL_PPI_V);
                                                else
-                                                       ADD_CODE (&td,MINT_ICALL_PPP_V);
+                                                       ADD_CODE (td,MINT_ICALL_PPP_V);
                                                break;
                                        default:
                                                g_assert_not_reached ();
@@ -3478,121 +3765,121 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                        if (func == mono_ftnptr_to_delegate) {
                                                g_error ("TODO: ?");
                                        }
-                                       ADD_CODE(&td, get_data_item_index (&td, func));
-                                       td.sp -= info->sig->param_count;
+                                       ADD_CODE(td, get_data_item_index (td, func));
+                                       td->sp -= info->sig->param_count;
 
                                        if (!MONO_TYPE_IS_VOID (info->sig->ret)) {
-                                               td.sp ++;
-                                               SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+                                               td->sp ++;
+                                               SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I);
                                        }
                                        break;
                                }
                        case CEE_MONO_VTADDR: {
                                int size;
-                               CHECK_STACK (&td, 1);
+                               CHECK_STACK (td, 1);
                                if (method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE)
-                                       size = mono_class_native_size(td.sp [-1].klass, NULL);
+                                       size = mono_class_native_size(td->sp [-1].klass, NULL);
                                else
-                                       size = mono_class_value_size(td.sp [-1].klass, NULL);
+                                       size = mono_class_value_size(td->sp [-1].klass, NULL);
                                size = (size + 7) & ~7;
-                               ADD_CODE(&td, MINT_VTRESULT);
-                               ADD_CODE(&td, 0);
-                               WRITE32(&td, &size);
-                               td.vt_sp -= size;
-                               ++td.ip;
-                               SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+                               ADD_CODE(td, MINT_VTRESULT);
+                               ADD_CODE(td, 0);
+                               WRITE32(td, &size);
+                               td->vt_sp -= size;
+                               ++td->ip;
+                               SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_MP);
                                break;
                        }
                        case CEE_MONO_LDPTR:
                        case CEE_MONO_CLASSCONST:
-                               token = read32 (td.ip + 1);
-                               td.ip += 5;
-                               ADD_CODE(&td, MINT_MONO_LDPTR);
-                               ADD_CODE(&td, get_data_item_index (&td, mono_method_get_wrapper_data (method, token)));
-                               td.sp [0].type = STACK_TYPE_I;
-                               ++td.sp;
+                               token = read32 (td->ip + 1);
+                               td->ip += 5;
+                               ADD_CODE(td, MINT_MONO_LDPTR);
+                               ADD_CODE(td, get_data_item_index (td, mono_method_get_wrapper_data (method, token)));
+                               td->sp [0].type = STACK_TYPE_I;
+                               ++td->sp;
                                break;
                        case CEE_MONO_OBJADDR:
-                               CHECK_STACK (&td, 1);
-                               ++td.ip;
-                               td.sp[-1].type = STACK_TYPE_MP;
+                               CHECK_STACK (td, 1);
+                               ++td->ip;
+                               td->sp[-1].type = STACK_TYPE_MP;
                                /* do nothing? */
                                break;
                        case CEE_MONO_NEWOBJ:
-                               token = read32 (td.ip + 1);
-                               td.ip += 5;
-                               ADD_CODE(&td, MINT_MONO_NEWOBJ);
-                               ADD_CODE(&td, get_data_item_index (&td, mono_method_get_wrapper_data (method, token)));
-                               td.sp [0].type = STACK_TYPE_O;
-                               ++td.sp;
+                               token = read32 (td->ip + 1);
+                               td->ip += 5;
+                               ADD_CODE(td, MINT_MONO_NEWOBJ);
+                               ADD_CODE(td, get_data_item_index (td, mono_method_get_wrapper_data (method, token)));
+                               td->sp [0].type = STACK_TYPE_O;
+                               ++td->sp;
                                break;
                        case CEE_MONO_RETOBJ:
-                               CHECK_STACK (&td, 1);
-                               token = read32 (td.ip + 1);
-                               td.ip += 5;
-                               ADD_CODE(&td, MINT_MONO_RETOBJ);
-                               td.sp--;
+                               CHECK_STACK (td, 1);
+                               token = read32 (td->ip + 1);
+                               td->ip += 5;
+                               ADD_CODE(td, MINT_MONO_RETOBJ);
+                               td->sp--;
 
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
                                
                                /*stackval_from_data (signature->ret, frame->retval, sp->data.vt, signature->pinvoke);*/
 
-                               if (td.sp > td.stack)
-                                       g_warning ("CEE_MONO_RETOBJ: more values on stack: %d", td.sp-td.stack);
+                               if (td->sp > td->stack)
+                                       g_warning ("CEE_MONO_RETOBJ: more values on stack: %d", td->sp-td->stack);
                                break;
                        case CEE_MONO_LDNATIVEOBJ:
-                               token = read32 (td.ip + 1);
-                               td.ip += 5;
+                               token = read32 (td->ip + 1);
+                               td->ip += 5;
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
                                g_assert(klass->valuetype);
-                               SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+                               SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_MP);
                                break;
                        case CEE_MONO_TLS: {
-                               gint32 key = read32 (td.ip + 1);
-                               td.ip += 5;
+                               gint32 key = read32 (td->ip + 1);
+                               td->ip += 5;
                                g_assert (key < TLS_KEY_NUM);
-                               ADD_CODE (&td, MINT_MONO_TLS);
-                               WRITE32 (&td, &key);
-                               PUSH_SIMPLE_TYPE (&td, STACK_TYPE_MP);
+                               ADD_CODE (td, MINT_MONO_TLS);
+                               WRITE32 (td, &key);
+                               PUSH_SIMPLE_TYPE (td, STACK_TYPE_MP);
                                break;
                        }
                        case CEE_MONO_ATOMIC_STORE_I4:
-                               CHECK_STACK (&td, 2);
+                               CHECK_STACK (td, 2);
                                SIMPLE_OP (td, MINT_MONO_ATOMIC_STORE_I4);
-                               td.sp -= 2;
-                               td.ip++;
+                               td->sp -= 2;
+                               td->ip++;
                                break;
                        case CEE_MONO_SAVE_LMF:
                        case CEE_MONO_RESTORE_LMF:
                        case CEE_MONO_NOT_TAKEN:
-                               ++td.ip;
+                               ++td->ip;
                                break;
                        case CEE_MONO_LDPTR_INT_REQ_FLAG:
-                               ADD_CODE (&td, MINT_MONO_LDPTR);
-                               ADD_CODE (&td, get_data_item_index (&td, mono_thread_interruption_request_flag ()));
-                               PUSH_TYPE (&td, STACK_TYPE_MP, NULL);
-                               ++td.ip;
+                               ADD_CODE (td, MINT_MONO_LDPTR);
+                               ADD_CODE (td, get_data_item_index (td, mono_thread_interruption_request_flag ()));
+                               PUSH_TYPE (td, STACK_TYPE_MP, NULL);
+                               ++td->ip;
                                break;
                        case CEE_MONO_MEMORY_BARRIER:
-                               ADD_CODE (&td, MINT_MONO_MEMORY_BARRIER);
-                               ++td.ip;
+                               ADD_CODE (td, MINT_MONO_MEMORY_BARRIER);
+                               ++td->ip;
                                break;
                        case CEE_MONO_JIT_ATTACH:
-                               ADD_CODE (&td, MINT_MONO_JIT_ATTACH);
-                               ++td.ip;
+                               ADD_CODE (td, MINT_MONO_JIT_ATTACH);
+                               ++td->ip;
                                break;
                        case CEE_MONO_JIT_DETACH:
-                               ADD_CODE (&td, MINT_MONO_JIT_DETACH);
-                               ++td.ip;
+                               ADD_CODE (td, MINT_MONO_JIT_DETACH);
+                               ++td->ip;
                                break;
                        case CEE_MONO_LDDOMAIN:
-                               ADD_CODE (&td, MINT_MONO_LDDOMAIN);
-                               td.sp [0].type = STACK_TYPE_I;
-                               ++td.sp;
-                               ++td.ip;
+                               ADD_CODE (td, MINT_MONO_LDDOMAIN);
+                               td->sp [0].type = STACK_TYPE_I;
+                               ++td->sp;
+                               ++td->ip;
                                break;
                        default:
-                               g_error ("transform.c: Unimplemented opcode: 0xF0 %02x at 0x%x\n", *td.ip, td.ip-header->code);
+                               g_error ("transform.c: Unimplemented opcode: 0xF0 %02x at 0x%x\n", *td->ip, td->ip-header->code);
                        }
                        break;
 #if 0
@@ -3610,69 +3897,69 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                 * throw point is just (ip - n_prefix_bytes).
                 */
                case CEE_PREFIX1: 
-                       ++td.ip;
-                       switch (*td.ip) {
+                       ++td->ip;
+                       switch (*td->ip) {
 #if 0
                        case CEE_ARGLIST: ves_abort(); break;
 #endif
                        case CEE_CEQ:
-                               CHECK_STACK(&td, 2);
-                               if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
-                                       ADD_CODE(&td, MINT_CEQ_I4 + STACK_TYPE_I - STACK_TYPE_I4);
+                               CHECK_STACK(td, 2);
+                               if (td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP)
+                                       ADD_CODE(td, MINT_CEQ_I4 + STACK_TYPE_I - STACK_TYPE_I4);
                                else
-                                       ADD_CODE(&td, MINT_CEQ_I4 + td.sp [-1].type - STACK_TYPE_I4);
-                               --td.sp;
-                               SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
-                               ++td.ip;
+                                       ADD_CODE(td, MINT_CEQ_I4 + td->sp [-1].type - STACK_TYPE_I4);
+                               --td->sp;
+                               SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
+                               ++td->ip;
                                break;
                        case CEE_CGT:
-                               CHECK_STACK(&td, 2);
-                               if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
-                                       ADD_CODE(&td, MINT_CGT_I4 + STACK_TYPE_I - STACK_TYPE_I4);
+                               CHECK_STACK(td, 2);
+                               if (td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP)
+                                       ADD_CODE(td, MINT_CGT_I4 + STACK_TYPE_I - STACK_TYPE_I4);
                                else
-                                       ADD_CODE(&td, MINT_CGT_I4 + td.sp [-1].type - STACK_TYPE_I4);
-                               --td.sp;
-                               SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
-                               ++td.ip;
+                                       ADD_CODE(td, MINT_CGT_I4 + td->sp [-1].type - STACK_TYPE_I4);
+                               --td->sp;
+                               SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
+                               ++td->ip;
                                break;
                        case CEE_CGT_UN:
-                               CHECK_STACK(&td, 2);
-                               if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
-                                       ADD_CODE(&td, MINT_CGT_UN_I4 + STACK_TYPE_I - STACK_TYPE_I4);
+                               CHECK_STACK(td, 2);
+                               if (td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP)
+                                       ADD_CODE(td, MINT_CGT_UN_I4 + STACK_TYPE_I - STACK_TYPE_I4);
                                else
-                                       ADD_CODE(&td, MINT_CGT_UN_I4 + td.sp [-1].type - STACK_TYPE_I4);
-                               --td.sp;
-                               SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
-                               ++td.ip;
+                                       ADD_CODE(td, MINT_CGT_UN_I4 + td->sp [-1].type - STACK_TYPE_I4);
+                               --td->sp;
+                               SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
+                               ++td->ip;
                                break;
                        case CEE_CLT:
-                               CHECK_STACK(&td, 2);
-                               if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
-                                       ADD_CODE(&td, MINT_CLT_I4 + STACK_TYPE_I - STACK_TYPE_I4);
+                               CHECK_STACK(td, 2);
+                               if (td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP)
+                                       ADD_CODE(td, MINT_CLT_I4 + STACK_TYPE_I - STACK_TYPE_I4);
                                else
-                                       ADD_CODE(&td, MINT_CLT_I4 + td.sp [-1].type - STACK_TYPE_I4);
-                               --td.sp;
-                               SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
-                               ++td.ip;
+                                       ADD_CODE(td, MINT_CLT_I4 + td->sp [-1].type - STACK_TYPE_I4);
+                               --td->sp;
+                               SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
+                               ++td->ip;
                                break;
                        case CEE_CLT_UN:
-                               CHECK_STACK(&td, 2);
-                               if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
-                                       ADD_CODE(&td, MINT_CLT_UN_I4 + STACK_TYPE_I - STACK_TYPE_I4);
+                               CHECK_STACK(td, 2);
+                               if (td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP)
+                                       ADD_CODE(td, MINT_CLT_UN_I4 + STACK_TYPE_I - STACK_TYPE_I4);
                                else
-                                       ADD_CODE(&td, MINT_CLT_UN_I4 + td.sp [-1].type - STACK_TYPE_I4);
-                               --td.sp;
-                               SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
-                               ++td.ip;
+                                       ADD_CODE(td, MINT_CLT_UN_I4 + td->sp [-1].type - STACK_TYPE_I4);
+                               --td->sp;
+                               SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_I4);
+                               ++td->ip;
                                break;
                        case CEE_LDVIRTFTN: /* fallthrough */
                        case CEE_LDFTN: {
                                MonoMethod *m;
-                               if (*td.ip == CEE_LDVIRTFTN) {
-                                       CHECK_STACK (&td, 1);
-                                       --td.sp;
+                               if (*td->ip == CEE_LDVIRTFTN) {
+                                       CHECK_STACK (td, 1);
+                                       --td->sp;
                                }
-                               token = read32 (td.ip + 1);
+                               token = read32 (td->ip + 1);
                                if (method->wrapper_type != MONO_WRAPPER_NONE)
                                        m = (MonoMethod *)mono_method_get_wrapper_data (method, token);
                                else 
@@ -3681,131 +3968,132 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                if (method->wrapper_type == MONO_WRAPPER_NONE && m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
                                        m = mono_marshal_get_synchronized_wrapper (m);
 
-                               ADD_CODE(&td, *td.ip == CEE_LDFTN ? MINT_LDFTN : MINT_LDVIRTFTN);
-                               ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_runtime_method (domain, m, &error)));
+                               ADD_CODE(td, *td->ip == CEE_LDFTN ? MINT_LDFTN : MINT_LDVIRTFTN);
+                               ADD_CODE(td, get_data_item_index (td, mono_interp_get_imethod (domain, m, &error)));
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-                               td.ip += 5;
-                               PUSH_SIMPLE_TYPE (&td, STACK_TYPE_F);
+                               td->ip += 5;
+                               PUSH_SIMPLE_TYPE (td, STACK_TYPE_F);
                                break;
                        }
                        case CEE_LDARG:
-                               load_arg (&td, read16 (td.ip + 1));
-                               td.ip += 3;
+                               load_arg (td, read16 (td->ip + 1));
+                               td->ip += 3;
                                break;
                        case CEE_LDARGA: {
-                               int n = read16 (td.ip + 1);
-                               ADD_CODE (&td, MINT_LDARGA);
-                               ADD_CODE (&td, td.rtm->arg_offsets [n]); /* FIX for large offsets */
-                               PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
-                               td.ip += 3;
+                               int n = read16 (td->ip + 1);
+                               ADD_CODE (td, MINT_LDARGA);
+                               ADD_CODE (td, td->rtm->arg_offsets [n]); /* FIX for large offsets */
+                               PUSH_SIMPLE_TYPE(td, STACK_TYPE_MP);
+                               td->ip += 3;
                                break;
                        }
                        case CEE_STARG:
-                               store_arg (&td, read16 (td.ip + 1));
-                               td.ip += 3;
+                               store_arg (td, read16 (td->ip + 1));
+                               td->ip += 3;
                                break;
                        case CEE_LDLOC:
-                               load_local (&td, read16 (td.ip + 1));
-                               td.ip += 3;
+                               load_local (td, read16 (td->ip + 1));
+                               td->ip += 3;
                                break;
                        case CEE_LDLOCA:
-                               ADD_CODE(&td, MINT_LDLOCA_S);
-                               ADD_CODE(&td, td.rtm->local_offsets [read16 (td.ip + 1)]);
-                               PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
-                               td.ip += 3;
+                               ADD_CODE(td, MINT_LDLOCA_S);
+                               ADD_CODE(td, td->rtm->local_offsets [read16 (td->ip + 1)]);
+                               PUSH_SIMPLE_TYPE(td, STACK_TYPE_MP);
+                               td->ip += 3;
                                break;
                        case CEE_STLOC:
-                               store_local (&td, read16 (td.ip + 1));
-                               td.ip += 3;
+                               store_local (td, read16 (td->ip + 1));
+                               td->ip += 3;
                                break;
                        case CEE_LOCALLOC:
-                               CHECK_STACK (&td, 1);
+                               CHECK_STACK (td, 1);
 #if SIZEOF_VOID_P == 8
-                               if (td.sp [-1].type == STACK_TYPE_I8)
-                                       ADD_CODE(&td, MINT_CONV_I4_I8);
+                               if (td->sp [-1].type == STACK_TYPE_I8)
+                                       ADD_CODE(td, MINT_CONV_I4_I8);
 #endif                         
-                               ADD_CODE(&td, MINT_LOCALLOC);
-                               if (td.sp != td.stack + 1)
+                               ADD_CODE(td, MINT_LOCALLOC);
+                               if (td->sp != td->stack + 1)
                                        g_warning("CEE_LOCALLOC: stack not empty");
-                               ++td.ip;
-                               SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+                               ++td->ip;
+                               SET_SIMPLE_TYPE(td->sp - 1, STACK_TYPE_MP);
                                break;
 #if 0
                        case CEE_UNUSED57: ves_abort(); break;
 #endif
                        case CEE_ENDFILTER:
-                               ADD_CODE (&td, MINT_ENDFILTER);
-                               ++td.ip;
+                               ADD_CODE (td, MINT_ENDFILTER);
+                               ++td->ip;
                                break;
                        case CEE_UNALIGNED_:
-                               td.ip += 2;
+                               td->ip += 2;
                                break;
                        case CEE_VOLATILE_:
-                               ++td.ip;
+                               ++td->ip;
                                volatile_ = TRUE;
                                break;
                        case CEE_TAIL_:
-                               ++td.ip;
+                               ++td->ip;
                                /* FIX: should do something? */;
+                               // TODO: This should raise a method_tail_call profiler event.
                                break;
                        case CEE_INITOBJ:
-                               CHECK_STACK(&td, 1);
-                               token = read32 (td.ip + 1);
+                               CHECK_STACK(td, 1);
+                               token = read32 (td->ip + 1);
                                klass = mini_get_class (method, token, generic_context);
                                if (klass->valuetype) {
-                                       ADD_CODE (&td, MINT_INITOBJ);
+                                       ADD_CODE (td, MINT_INITOBJ);
                                        i32 = mono_class_value_size (klass, NULL);
-                                       WRITE32 (&td, &i32);
+                                       WRITE32 (td, &i32);
                                } else {
-                                       ADD_CODE (&td, MINT_LDNULL);
-                                       ADD_CODE (&td, MINT_STIND_REF);
+                                       ADD_CODE (td, MINT_LDNULL);
+                                       ADD_CODE (td, MINT_STIND_REF);
                                }
-                               td.ip += 5;
-                               --td.sp;
+                               td->ip += 5;
+                               --td->sp;
                                break;
                        case CEE_CPBLK:
-                               CHECK_STACK(&td, 3);
+                               CHECK_STACK(td, 3);
                                /* FIX? convert length to I8? */
                                if (volatile_)
-                                       ADD_CODE (&td, MINT_MONO_MEMORY_BARRIER);
-                               ADD_CODE(&td, MINT_CPBLK);
+                                       ADD_CODE (td, MINT_MONO_MEMORY_BARRIER);
+                               ADD_CODE(td, MINT_CPBLK);
                                BARRIER_IF_VOLATILE (td);
-                               td.sp -= 3;
-                               ++td.ip;
+                               td->sp -= 3;
+                               ++td->ip;
                                break;
                        case CEE_READONLY_:
                                readonly = TRUE;
-                               td.ip += 1;
+                               td->ip += 1;
                                break;
                        case CEE_CONSTRAINED_:
-                               token = read32 (td.ip + 1);
+                               token = read32 (td->ip + 1);
                                constrained_class = mini_get_class (method, token, generic_context);
                                mono_class_init (constrained_class);
-                               td.ip += 5;
+                               td->ip += 5;
                                break;
                        case CEE_INITBLK:
-                               CHECK_STACK(&td, 3);
+                               CHECK_STACK(td, 3);
                                BARRIER_IF_VOLATILE (td);
-                               ADD_CODE(&td, MINT_INITBLK);
-                               td.sp -= 3;
-                               td.ip += 1;
+                               ADD_CODE(td, MINT_INITBLK);
+                               td->sp -= 3;
+                               td->ip += 1;
                                break;
                        case CEE_NO_:
                                /* FIXME: implement */
-                               td.ip += 2;
+                               td->ip += 2;
                                break;
                        case CEE_RETHROW: {
-                               int clause_index = td.clause_indexes [in_offset];
+                               int clause_index = td->clause_indexes [in_offset];
                                g_assert (clause_index != -1);
                                SIMPLE_OP (td, MINT_RETHROW);
-                               ADD_CODE (&td, rtm->exvar_offsets [clause_index]);
+                               ADD_CODE (td, rtm->exvar_offsets [clause_index]);
                                generating_code = 0;
                                break;
                        }
                        case CEE_SIZEOF: {
                                gint32 size;
-                               token = read32 (td.ip + 1);
-                               td.ip += 5;
+                               token = read32 (td->ip + 1);
+                               td->ip += 5;
                                if (mono_metadata_token_table (token) == MONO_TABLE_TYPESPEC && !image_is_dynamic (method->klass->image) && !generic_context) {
                                        int align;
                                        MonoType *type = mono_type_create_from_typespec (image, token);
@@ -3820,57 +4108,57 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
 #endif
                                        size = mono_type_size (&szclass->byval_arg, &align);
                                } 
-                               ADD_CODE(&td, MINT_LDC_I4);
-                               WRITE32(&td, &size);
-                               PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+                               ADD_CODE(td, MINT_LDC_I4);
+                               WRITE32(td, &size);
+                               PUSH_SIMPLE_TYPE(td, STACK_TYPE_I4);
                                break;
                        }
                        case CEE_REFANYTYPE:
-                               ADD_CODE (&td, MINT_REFANYTYPE);
-                               td.ip += 1;
-                               POP_VT (&td, sizeof (MonoTypedRef));
-                               PUSH_VT (&td, sizeof (gpointer));
-                               SET_TYPE(td.sp - 1, STACK_TYPE_VT, NULL);
+                               ADD_CODE (td, MINT_REFANYTYPE);
+                               td->ip += 1;
+                               POP_VT (td, sizeof (MonoTypedRef));
+                               PUSH_VT (td, sizeof (gpointer));
+                               SET_TYPE(td->sp - 1, STACK_TYPE_VT, NULL);
                                break;
                        default:
-                               g_error ("transform.c: Unimplemented opcode: 0xFE %02x (%s) at 0x%x\n", *td.ip, mono_opcode_name (256 + *td.ip), td.ip-header->code);
+                               g_error ("transform.c: Unimplemented opcode: 0xFE %02x (%s) at 0x%x\n", *td->ip, mono_opcode_name (256 + *td->ip), td->ip-header->code);
                        }
                        break;
                default:
-                       g_error ("transform.c: Unimplemented opcode: %02x at 0x%x\n", *td.ip, td.ip-header->code);
+                       g_error ("transform.c: Unimplemented opcode: %02x at 0x%x\n", *td->ip, td->ip-header->code);
                }
 
-               if (td.new_ip - td.new_code != new_in_start_offset) 
-                       td.last_new_ip = td.new_code + new_in_start_offset;
-               else if (td.is_bb_start [td.in_start - td.il_code])
-                       td.is_bb_start [td.ip - td.il_code] = 1;
+               if (td->new_ip - td->new_code != new_in_start_offset) 
+                       td->last_new_ip = td->new_code + new_in_start_offset;
+               else if (td->is_bb_start [td->in_start - td->il_code])
+                       td->is_bb_start [td->ip - td->il_code] = 1;
                        
-               td.last_ip = td.in_start;
+               td->last_ip = td->in_start;
        }
 
        /* Handle relocations */
-       for (int i = 0; i < td.relocs->len; ++i) {
-               Reloc *reloc = g_ptr_array_index (td.relocs, i);
+       for (int i = 0; i < td->relocs->len; ++i) {
+               Reloc *reloc = g_ptr_array_index (td->relocs, i);
 
-               int offset = td.in_offsets [reloc->target] - reloc->offset;
+               int offset = td->in_offsets [reloc->target] - reloc->offset;
 
                switch (reloc->type) {
                case RELOC_SHORT_BRANCH:
-                       g_assert (td.new_code [reloc->offset + 1] == 0xffff);
-                       td.new_code [reloc->offset + 1] = offset;
+                       g_assert (td->new_code [reloc->offset + 1] == 0xffff);
+                       td->new_code [reloc->offset + 1] = offset;
                        break;
                case RELOC_LONG_BRANCH: {
                        guint16 *v = (guint16 *) &offset;
-                       g_assert (td.new_code [reloc->offset + 1] == 0xbeef);
-                       g_assert (td.new_code [reloc->offset + 2] == 0xdead);
-                       td.new_code [reloc->offset + 1] = *(guint16 *) v;
-                       td.new_code [reloc->offset + 2] = *(guint16 *) (v + 1);
+                       g_assert (td->new_code [reloc->offset + 1] == 0xbeef);
+                       g_assert (td->new_code [reloc->offset + 2] == 0xdead);
+                       td->new_code [reloc->offset + 1] = *(guint16 *) v;
+                       td->new_code [reloc->offset + 2] = *(guint16 *) (v + 1);
                        break;
                }
                case RELOC_SWITCH: {
                        guint16 *v = (guint16*)&offset;
-                       td.new_code [reloc->offset] = *(guint16*)v;
-                       td.new_code [reloc->offset + 1] = *(guint16*)(v + 1);
+                       td->new_code [reloc->offset] = *(guint16*)v;
+                       td->new_code [reloc->offset + 1] = *(guint16*)(v + 1);
                        break;
                }
                default:
@@ -3879,44 +4167,44 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                }
        }
 
-       if (td.verbose_level) {
-               const guint16 *p = td.new_code;
-               printf("Runtime method: %s %p, VT stack size: %d\n", mono_method_full_name (method, TRUE), rtm, td.max_vt_sp);
-               printf("Calculated stack size: %d, stated size: %d\n", td.max_stack_height, header->max_stack);
-               while (p < td.new_ip) {
-                       p = mono_interp_dis_mintop(td.new_code, p);
+       if (td->verbose_level) {
+               const guint16 *p = td->new_code;
+               printf("Runtime method: %s %p, VT stack size: %d\n", mono_method_full_name (method, TRUE), rtm, td->max_vt_sp);
+               printf("Calculated stack size: %d, stated size: %d\n", td->max_stack_height, header->max_stack);
+               while (p < td->new_ip) {
+                       p = mono_interp_dis_mintop(td->new_code, p);
                        printf("\n");
                }
        }
-       g_assert (td.max_stack_height <= (header->max_stack + 1));
+       g_assert (td->max_stack_height <= (header->max_stack + 1));
 
-       int code_len = td.new_ip - td.new_code;
+       int code_len = td->new_ip - td->new_code;
 
        rtm->clauses = mono_domain_alloc0 (domain, header->num_clauses * sizeof (MonoExceptionClause));
        memcpy (rtm->clauses, header->clauses, header->num_clauses * sizeof(MonoExceptionClause));
-       rtm->code = mono_domain_alloc0 (domain, (td.new_ip - td.new_code) * sizeof (gushort));
-       memcpy (rtm->code, td.new_code, (td.new_ip - td.new_code) * sizeof(gushort));
-       g_free (td.new_code);
+       rtm->code = mono_domain_alloc0 (domain, (td->new_ip - td->new_code) * sizeof (gushort));
+       memcpy (rtm->code, td->new_code, (td->new_ip - td->new_code) * sizeof(gushort));
+       g_free (td->new_code);
        rtm->new_body_start = rtm->code + body_start_offset;
        rtm->num_clauses = header->num_clauses;
        for (i = 0; i < header->num_clauses; i++) {
                MonoExceptionClause *c = rtm->clauses + i;
                int end_off = c->try_offset + c->try_len;
-               c->try_offset = td.in_offsets [c->try_offset];
-               c->try_len = td.in_offsets [end_off] - c->try_offset;
+               c->try_offset = td->in_offsets [c->try_offset];
+               c->try_len = td->in_offsets [end_off] - c->try_offset;
                end_off = c->handler_offset + c->handler_len;
-               c->handler_offset = td.in_offsets [c->handler_offset];
-               c->handler_len = td.in_offsets [end_off] - c->handler_offset;
+               c->handler_offset = td->in_offsets [c->handler_offset];
+               c->handler_len = td->in_offsets [end_off] - c->handler_offset;
                if (c->flags & MONO_EXCEPTION_CLAUSE_FILTER)
-                       c->data.filter_offset = td.in_offsets [c->data.filter_offset];
+                       c->data.filter_offset = td->in_offsets [c->data.filter_offset];
        }
-       rtm->vt_stack_size = td.max_vt_sp;
+       rtm->vt_stack_size = td->max_vt_sp;
        rtm->alloca_size = rtm->locals_size + rtm->args_size + rtm->vt_stack_size + rtm->stack_size;
-       rtm->data_items = mono_domain_alloc0 (domain, td.n_data_items * sizeof (td.data_items [0]));
-       memcpy (rtm->data_items, td.data_items, td.n_data_items * sizeof (td.data_items [0]));
+       rtm->data_items = mono_domain_alloc0 (domain, td->n_data_items * sizeof (td->data_items [0]));
+       memcpy (rtm->data_items, td->data_items, td->n_data_items * sizeof (td->data_items [0]));
 
        /* Save debug info */
-       interp_save_debug_info (rtm, header, &td, line_numbers);
+       interp_save_debug_info (rtm, header, td, line_numbers);
 
        /* Create a MonoJitInfo for the interpreted method by creating the interpreter IR as the native code. */
        int jinfo_len = mono_jit_info_size (0, header->num_clauses, 0);
@@ -3941,22 +4229,22 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                }
        }
 
-       save_seq_points (&td);
+       save_seq_points (td);
 
-       g_free (td.in_offsets);
+       g_free (td->in_offsets);
        for (i = 0; i < header->code_size; ++i)
-               g_free (td.stack_state [i]);
-       g_free (td.stack_state);
-       g_free (td.stack_height);
-       g_free (td.vt_stack_size);
-       g_free (td.data_items);
-       g_free (td.stack);
-       g_hash_table_destroy (td.data_hash);
-       g_free (td.clause_indexes);
-       g_ptr_array_free (td.seq_points, TRUE);
+               g_free (td->stack_state [i]);
+       g_free (td->stack_state);
+       g_free (td->stack_height);
+       g_free (td->vt_stack_size);
+       g_free (td->data_items);
+       g_free (td->stack);
+       g_hash_table_destroy (td->data_hash);
+       g_free (td->clause_indexes);
+       g_ptr_array_free (td->seq_points, TRUE);
        g_array_free (line_numbers, TRUE);
-       g_ptr_array_free (td.relocs, TRUE);
-       mono_mempool_destroy (td.mempool);
+       g_ptr_array_free (td->relocs, TRUE);
+       mono_mempool_destroy (td->mempool);
 }
 
 static mono_mutex_t calc_section;
@@ -3968,10 +4256,10 @@ mono_interp_transform_init (void)
 }
 
 MonoException *
-mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context)
+mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context)
 {
        int i, align, size, offset;
-       MonoMethod *method = runtime_method->method;
+       MonoMethod *method = imethod->method;
        MonoImage *image = method->klass->image;
        MonoMethodHeader *header = mono_method_get_header (method);
        MonoMethodSignature *signature = mono_method_signature (method);
@@ -3984,14 +4272,14 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
        MonoVTable *method_class_vt;
        int backwards;
        MonoGenericContext *generic_context = NULL;
-       MonoDomain *domain = runtime_method->domain;
+       MonoDomain *domain = imethod->domain;
 
        // g_printerr ("TRANSFORM(0x%016lx): begin %s::%s\n", mono_thread_current (), method->klass->name, method->name);
-       method_class_vt = mono_class_vtable (domain, runtime_method->method->klass);
+       method_class_vt = mono_class_vtable (domain, imethod->method->klass);
        if (!method_class_vt->initialized) {
                MonoError error;
                jmp_buf env;
-               MonoInvocation *last_env_frame = context->env_frame;
+               InterpFrame *last_env_frame = context->env_frame;
                jmp_buf *old_env = context->current_env;
                error_init (&error);
 
@@ -4025,9 +4313,9 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
        if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
                MonoMethod *nm = NULL;
                mono_os_mutex_lock(&calc_section);
-               if (runtime_method->transformed) {
+               if (imethod->transformed) {
                        mono_os_mutex_unlock(&calc_section);
-                       MONO_PROFILER_RAISE (jit_done, (method, runtime_method->jinfo));
+                       MONO_PROFILER_RAISE (jit_done, (method, imethod->jinfo));
                        return NULL;
                }
 
@@ -4052,14 +4340,14 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
                                }
                        }
                        if (nm == NULL) {
-                               runtime_method->code = g_malloc(sizeof(short));
-                               runtime_method->code[0] = MINT_CALLRUN;
+                               imethod->code = g_malloc(sizeof(short));
+                               imethod->code[0] = MINT_CALLRUN;
                        }
                }
                if (nm == NULL) {
-                       runtime_method->stack_size = sizeof (stackval); /* for tracing */
-                       runtime_method->alloca_size = runtime_method->stack_size;
-                       runtime_method->transformed = TRUE;
+                       imethod->stack_size = sizeof (stackval); /* for tracing */
+                       imethod->alloca_size = imethod->stack_size;
+                       imethod->transformed = TRUE;
                        mono_os_mutex_unlock(&calc_section);
                        MONO_PROFILER_RAISE (jit_done, (method, NULL));
                        return NULL;
@@ -4070,12 +4358,12 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
        } else if (method->klass == mono_defaults.array_class) {
                if (!strcmp (method->name, "UnsafeMov") || !strcmp (method->name, "UnsafeLoad")) {
                        mono_os_mutex_lock (&calc_section);
-                       if (!runtime_method->transformed) {
-                               runtime_method->code = g_malloc (sizeof (short));
-                               runtime_method->code[0] = MINT_CALLRUN;
-                               runtime_method->stack_size = sizeof (stackval); /* for tracing */
-                               runtime_method->alloca_size = runtime_method->stack_size;
-                               runtime_method->transformed = TRUE;
+                       if (!imethod->transformed) {
+                               imethod->code = g_malloc (sizeof (short));
+                               imethod->code[0] = MINT_CALLRUN;
+                               imethod->stack_size = sizeof (stackval); /* for tracing */
+                               imethod->alloca_size = imethod->stack_size;
+                               imethod->transformed = TRUE;
                        }
                        mono_os_mutex_unlock(&calc_section);
                        MONO_PROFILER_RAISE (jit_done, (method, NULL));
@@ -4199,44 +4487,44 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
 
        /* the rest needs to be locked so it is only done once */
        mono_os_mutex_lock(&calc_section);
-       if (runtime_method->transformed) {
+       if (imethod->transformed) {
                mono_os_mutex_unlock(&calc_section);
                g_free (is_bb_start);
-               MONO_PROFILER_RAISE (jit_done, (method, runtime_method->jinfo));
+               MONO_PROFILER_RAISE (jit_done, (method, imethod->jinfo));
                return NULL;
        }
 
-       runtime_method->local_offsets = g_malloc (header->num_locals * sizeof(guint32));
-       runtime_method->stack_size = (sizeof (stackval)) * (header->max_stack + 2); /* + 1 for returns of called functions  + 1 for 0-ing in trace*/
-       runtime_method->stack_size = (runtime_method->stack_size + 7) & ~7;
+       imethod->local_offsets = g_malloc (header->num_locals * sizeof(guint32));
+       imethod->stack_size = (sizeof (stackval)) * (header->max_stack + 2); /* + 1 for returns of called functions  + 1 for 0-ing in trace*/
+       imethod->stack_size = (imethod->stack_size + 7) & ~7;
        offset = 0;
        for (i = 0; i < header->num_locals; ++i) {
                size = mono_type_size (header->locals [i], &align);
                offset += align - 1;
                offset &= ~(align - 1);
-               runtime_method->local_offsets [i] = offset;
+               imethod->local_offsets [i] = offset;
                offset += size;
        }
        offset = (offset + 7) & ~7;
 
-       runtime_method->exvar_offsets = g_malloc (header->num_clauses * sizeof (guint32));
+       imethod->exvar_offsets = g_malloc (header->num_clauses * sizeof (guint32));
        for (i = 0; i < header->num_clauses; i++) {
                offset += sizeof (MonoObject*);
-               runtime_method->exvar_offsets [i] = offset;
+               imethod->exvar_offsets [i] = offset;
        }
        offset = (offset + 7) & ~7;
 
-       runtime_method->locals_size = offset;
-       g_assert (runtime_method->locals_size < 65536);
+       imethod->locals_size = offset;
+       g_assert (imethod->locals_size < 65536);
        offset = 0;
-       runtime_method->arg_offsets = g_malloc ((!!signature->hasthis + signature->param_count) * sizeof(guint32));
+       imethod->arg_offsets = g_malloc ((!!signature->hasthis + signature->param_count) * sizeof(guint32));
 
        if (signature->hasthis) {
                g_assert (!signature->pinvoke);
                size = mono_type_stack_size (&method->klass->byval_arg, &align);
                offset += align - 1;
                offset &= ~(align - 1);
-               runtime_method->arg_offsets [0] = offset;
+               imethod->arg_offsets [0] = offset;
                offset += size;
        }
 
@@ -4250,20 +4538,20 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
                        size = mono_type_stack_size (signature->params [i], &align);
                offset += align - 1;
                offset &= ~(align - 1);
-               runtime_method->arg_offsets [i + !!signature->hasthis] = offset;
+               imethod->arg_offsets [i + !!signature->hasthis] = offset;
                offset += size;
        }
        offset = (offset + 7) & ~7;
-       runtime_method->args_size = offset;
-       g_assert (runtime_method->args_size < 10000);
+       imethod->args_size = offset;
+       g_assert (imethod->args_size < 10000);
 
-       generate (method, runtime_method, is_bb_start, generic_context);
+       generate (method, imethod, is_bb_start, generic_context);
 
        g_free (is_bb_start);
 
        // FIXME: Add a different callback ?
-       MONO_PROFILER_RAISE (jit_done, (method, runtime_method->jinfo));
-       runtime_method->transformed = TRUE;
+       MONO_PROFILER_RAISE (jit_done, (method, imethod->jinfo));
+       imethod->transformed = TRUE;
        mono_os_mutex_unlock(&calc_section);
 
        return NULL;
index 302b28b69e2d7393f036a55141ac6de893df55dc..408fead304ef2f95073bbe518c329125f519ea24 100644 (file)
@@ -63,6 +63,13 @@ typedef enum {
 MONO_API void
 mono_jit_set_aot_mode      (MonoAotMode mode);
 
+/*
+ * Returns whether the runtime was invoked for the purpose of AOT-compiling an
+ * assembly, i.e. no managed code will run.
+ */
+MONO_API mono_bool
+mono_jit_aot_compiling (void);
+
 /* Allow embedders to decide wherther to actually obey breakpoint instructions
  * in specific methods (works for both break IL instructions and Debugger.Break ()
  * method calls).
@@ -87,14 +94,6 @@ mono_jit_parse_options     (int argc, char * argv[]);
 
 MONO_API char*       mono_get_runtime_build_info    (void);
 
-/* The following APIs are not stable. Avoid if possible. */
-
-MONO_API MonoJitInfo *
-mono_get_jit_info_from_method (MonoDomain *domain, MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void *
-mono_aot_get_method (MonoDomain *domain, MonoMethod *method);
-
 MONO_END_DECLS
 
 #endif
index c20c6b2bbbf6102bd76c963a00cba4af9ba82c56..07585ad2f82dcdddc969c2cd41242f620400b387 100644 (file)
@@ -1764,24 +1764,6 @@ emit_pop_lmf (MonoCompile *cfg)
        EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_addr_reg, 0, prev_lmf_reg);
 }
 
-static void
-emit_instrumentation_call (MonoCompile *cfg, void *func, gboolean entry)
-{
-       MonoInst *iargs [1];
-
-       /*
-        * Avoid instrumenting inlined methods since it can
-        * distort profiling results.
-        */
-       if (cfg->method != cfg->current_method)
-               return;
-
-       if (mono_profiler_should_instrument_method (cfg->method, entry)) {
-               EMIT_NEW_METHODCONST (cfg, iargs [0], cfg->method);
-               mono_emit_jit_icall (cfg, func, iargs);
-       }
-}
-
 static int
 ret_type_to_call_opcode (MonoCompile *cfg, MonoType *type, int calli, int virt)
 {
@@ -2235,7 +2217,7 @@ check_method_sharing (MonoCompile *cfg, MonoMethod *cmethod, gboolean *out_pass_
 
 inline static MonoCallInst *
 mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig, 
-                                        MonoInst **args, int calli, int virtual_, int tail, int rgctx, int unbox_trampoline)
+                                        MonoInst **args, int calli, int virtual_, int tail, int rgctx, int unbox_trampoline, MonoMethod *target)
 {
        MonoType *sig_ret;
        MonoCallInst *call;
@@ -2247,7 +2229,7 @@ mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig,
                tail = FALSE;
 
        if (tail) {
-               emit_instrumentation_call (cfg, mono_profiler_raise_method_leave, FALSE);
+               mini_profiler_emit_tail_call (cfg, target);
 
                MONO_INST_NEW_CALL (cfg, call, OP_TAILCALL);
        } else
@@ -2380,7 +2362,7 @@ mini_emit_calli (MonoCompile *cfg, MonoMethodSignature *sig, MonoInst **args, Mo
                MONO_ADD_INS (cfg->cbb, ins);
        }
 
-       call = mono_emit_call_args (cfg, sig, args, TRUE, FALSE, FALSE, rgctx_arg ? TRUE : FALSE, FALSE);
+       call = mono_emit_call_args (cfg, sig, args, TRUE, FALSE, FALSE, rgctx_arg ? TRUE : FALSE, FALSE, NULL);
 
        call->inst.sreg1 = addr->dreg;
 
@@ -2474,7 +2456,7 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign
 
        need_unbox_trampoline = method->klass == mono_defaults.object_class || mono_class_is_interface (method->klass);
 
-       call = mono_emit_call_args (cfg, sig, args, FALSE, virtual_, tail, rgctx_arg ? TRUE : FALSE, need_unbox_trampoline);
+       call = mono_emit_call_args (cfg, sig, args, FALSE, virtual_, tail, rgctx_arg ? TRUE : FALSE, need_unbox_trampoline, method);
 
 #ifndef DISABLE_REMOTING
        if (might_be_remote)
@@ -2604,7 +2586,7 @@ mono_emit_native_call (MonoCompile *cfg, gconstpointer func, MonoMethodSignature
 
        g_assert (sig);
 
-       call = mono_emit_call_args (cfg, sig, args, FALSE, FALSE, FALSE, FALSE, FALSE);
+       call = mono_emit_call_args (cfg, sig, args, FALSE, FALSE, FALSE, FALSE, FALSE, NULL);
        call->fptr = func;
 
        MONO_ADD_INS (cfg->cbb, (MonoInst*)call);
@@ -3719,11 +3701,10 @@ handle_alloc (MonoCompile *cfg, MonoClass *klass, gboolean for_box, int context_
                /* This happens often in argument checking code, eg. throw new FooException... */
                /* Avoid relocations and save some space by calling a helper function specialized to mscorlib */
                EMIT_NEW_ICONST (cfg, iargs [0], mono_metadata_token_index (klass->type_token));
-               return mono_emit_jit_icall (cfg, mono_helper_newobj_mscorlib, iargs);
+               alloc_ftn = mono_helper_newobj_mscorlib;
        } else {
                MonoVTable *vtable = mono_class_vtable (cfg->domain, klass);
                MonoMethod *managed_alloc = NULL;
-               gboolean pass_lw;
 
                if (!vtable) {
                        mono_cfg_set_exception (cfg, MONO_EXCEPTION_TYPE_LOAD);
@@ -3742,16 +3723,8 @@ handle_alloc (MonoCompile *cfg, MonoClass *klass, gboolean for_box, int context_
                        EMIT_NEW_ICONST (cfg, iargs [1], size);
                        return mono_emit_method_call (cfg, managed_alloc, iargs, NULL);
                }
-               alloc_ftn = mono_class_get_allocation_ftn (vtable, for_box, &pass_lw);
-               if (pass_lw) {
-                       guint32 lw = vtable->klass->instance_size;
-                       lw = ((lw + (sizeof (gpointer) - 1)) & ~(sizeof (gpointer) - 1)) / sizeof (gpointer);
-                       EMIT_NEW_ICONST (cfg, iargs [0], lw);
-                       EMIT_NEW_VTABLECONST (cfg, iargs [1], vtable);
-               }
-               else {
-                       EMIT_NEW_VTABLECONST (cfg, iargs [0], vtable);
-               }
+               alloc_ftn = ves_icall_object_new_specific;
+               EMIT_NEW_VTABLECONST (cfg, iargs [0], vtable);
        }
 
        return mono_emit_jit_icall (cfg, alloc_ftn, iargs);
@@ -4362,6 +4335,9 @@ mono_method_check_inlining (MonoCompile *cfg, MonoMethod *method)
        if (g_list_find (cfg->dont_inline, method))
                return FALSE;
 
+       if (mono_profiler_get_call_instrumentation_flags (method))
+               return FALSE;
+
        return TRUE;
 }
 
@@ -7345,6 +7321,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        tblock->real_offset = clause->handler_offset;
                        tblock->flags |= BB_EXCEPTION_HANDLER;
 
+                       if (clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY)
+                               mono_create_exvar_for_offset (cfg, clause->handler_offset);
                        /*
                         * Linking the try block with the EH block hinders inlining as we won't be able to 
                         * merge the bblocks from inlining and produce an artificial hole for no good reason.
@@ -8043,7 +8021,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        if (cfg->gshared && mono_method_check_context_used (cmethod))
                                GENERIC_SHARING_FAILURE (CEE_JMP);
 
-                       emit_instrumentation_call (cfg, mono_profiler_raise_method_leave, FALSE);
+                       mini_profiler_emit_tail_call (cfg, cmethod);
 
                        fsig = mono_method_signature (cmethod);
                        n = fsig->param_count + fsig->hasthis;
@@ -8985,7 +8963,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        /* Handle tail calls similarly to normal calls */
                                        tail_call = TRUE;
                                } else {
-                                       emit_instrumentation_call (cfg, mono_profiler_raise_method_leave, FALSE);
+                                       mini_profiler_emit_tail_call (cfg, cmethod);
 
                                        MONO_INST_NEW_CALL (cfg, call, OP_JMP);
                                        call->tail_call = TRUE;
@@ -9096,6 +9074,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        break;
                }
                case CEE_RET:
+                       mini_profiler_emit_leave (cfg, sig->ret->type != MONO_TYPE_VOID ? sp [-1] : NULL);
+
                        if (cfg->method != method) {
                                /* return from inlined method */
                                /* 
@@ -9119,8 +9099,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        cfg->ret_var_set = TRUE;
                                } 
                        } else {
-                               emit_instrumentation_call (cfg, mono_profiler_raise_method_leave, FALSE);
-
                                if (cfg->lmf_var && cfg->cbb->in_count && !cfg->llvm_only)
                                        emit_pop_lmf (cfg);
 
@@ -11408,18 +11386,35 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
                        if ((handlers = mono_find_final_block (cfg, ip, target, MONO_EXCEPTION_CLAUSE_FINALLY))) {
                                GList *tmp;
-                               MonoExceptionClause *clause;
 
                                for (tmp = handlers; tmp; tmp = tmp->next) {
-                                       clause = (MonoExceptionClause *)tmp->data;
+                                       MonoExceptionClause *clause = (MonoExceptionClause *)tmp->data;
+                                       MonoInst *abort_exc = (MonoInst *)mono_find_exvar_for_offset (cfg, clause->handler_offset);
+                                       MonoBasicBlock *dont_throw;
+
                                        tblock = cfg->cil_offset_to_bb [clause->handler_offset];
                                        g_assert (tblock);
                                        link_bblock (cfg, cfg->cbb, tblock);
+
+                                       MONO_EMIT_NEW_PCONST (cfg, abort_exc->dreg, 0);
+
                                        MONO_INST_NEW (cfg, ins, OP_CALL_HANDLER);
                                        ins->inst_target_bb = tblock;
                                        ins->inst_eh_block = clause;
                                        MONO_ADD_INS (cfg->cbb, ins);
                                        cfg->cbb->has_call_handler = 1;
+
+                                       /* Throw exception if exvar is set */
+                                       /* FIXME Do we need this for calls from catch/filter ? */
+                                       NEW_BBLOCK (cfg, dont_throw);
+                                       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, abort_exc->dreg, 0);
+                                       MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBEQ, dont_throw);
+                                       mono_emit_jit_icall (cfg, mono_thread_self_abort, NULL);
+                                       cfg->cbb->clause_hole = clause;
+
+                                       MONO_START_BB (cfg, dont_throw);
+                                       cfg->cbb->clause_hole = clause;
+
                                        if (COMPILE_LLVM (cfg)) {
                                                MonoBasicBlock *target_bb;
 
@@ -12631,7 +12626,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
        }
 
        cfg->cbb = init_localsbb;
-       emit_instrumentation_call (cfg, mono_profiler_raise_method_enter, TRUE);
+       mini_profiler_emit_enter (cfg);
 
        if (seq_points) {
                MonoBasicBlock *bb;
index bab77635fde6c1a54313b1dc4faef6f4f018563f..9653be3ff367be99133adc474923eadbd2392eb1 100644 (file)
@@ -1168,7 +1168,6 @@ mono_arch_init (void)
        mono_aot_register_jit_icall ("mono_amd64_throw_corlib_exception", mono_amd64_throw_corlib_exception);
        mono_aot_register_jit_icall ("mono_amd64_resume_unwind", mono_amd64_resume_unwind);
        mono_aot_register_jit_icall ("mono_amd64_get_original_ip", mono_amd64_get_original_ip);
-       mono_aot_register_jit_icall ("mono_amd64_handler_block_trampoline_helper", mono_amd64_handler_block_trampoline_helper);
 
 #if defined(MONO_ARCH_GSHAREDVT_SUPPORTED)
        mono_aot_register_jit_icall ("mono_amd64_start_gsharedvt_call", mono_amd64_start_gsharedvt_call);
@@ -6420,6 +6419,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                case OP_GET_LAST_ERROR:
                        emit_get_last_error(code, ins->dreg);
                        break;
+               case OP_FILL_PROF_CALL_CTX:
+                       for (int i = 0; i < AMD64_NREG; i++)
+                               if (AMD64_IS_CALLEE_SAVED_REG (i) || i == AMD64_RSP)
+                                       amd64_mov_membase_reg (code, ins->sreg1, MONO_STRUCT_OFFSET (MonoContext, gregs) + i * sizeof (mgreg_t), i, sizeof (mgreg_t));
+                       break;
                default:
                        g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
                        g_assert_not_reached ();
@@ -8114,12 +8118,6 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho
 }
 #endif
 
-gboolean
-mono_arch_print_tree (MonoInst *tree, int arity)
-{
-       return 0;
-}
-
 mgreg_t
 mono_arch_context_get_int_reg (MonoContext *ctx, int reg)
 {
@@ -8132,25 +8130,6 @@ mono_arch_context_set_int_reg (MonoContext *ctx, int reg, mgreg_t val)
        ctx->gregs [reg] = val;
 }
 
-gpointer
-mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, MonoContext *ctx, gpointer new_value)
-{
-       gpointer *sp, old_value;
-       char *bp;
-
-       /*Load the spvar*/
-       bp = (char *)MONO_CONTEXT_GET_BP (ctx);
-       sp = (gpointer *)*(gpointer*)(bp + clause->exvar_offset);
-
-       old_value = *sp;
-       if (old_value < ji->code_start || (char*)old_value > ((char*)ji->code_start + ji->code_size))
-               return old_value;
-
-       *sp = new_value;
-
-       return old_value;
-}
-
 /*
  * mono_arch_emit_load_aotconst:
  *
index d568af78db8b190b775e019051bde842b4404605..b688502060669d8f06f5cec7f668d70fd6b3284f 100644 (file)
@@ -431,8 +431,6 @@ typedef struct {
 #define MONO_ARCH_DYN_CALL_PARAM_AREA (DYN_CALL_STACK_ARGS * 8)
 
 #define MONO_ARCH_LLVM_SUPPORTED 1
-#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
-#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD_AOT 1
 #define MONO_ARCH_HAVE_CARD_TABLE_WBARRIER 1
 #define MONO_ARCH_HAVE_SETUP_RESUME_FROM_SIGNAL_HANDLER_CTX 1
 #define MONO_ARCH_GC_MAPS_SUPPORTED 1
@@ -503,9 +501,6 @@ mono_amd64_get_exception_trampolines (gboolean aot);
 int
 mono_amd64_get_tls_gs_offset (void) MONO_LLVM_INTERNAL;
 
-gpointer
-mono_amd64_handler_block_trampoline_helper (void);
-
 #if defined(TARGET_WIN32) && !defined(DISABLE_JIT)
 
 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
index 9703c1e09de12282e8cef5f83cb8d4a0a6fa78bf..98bc4bf7ee5483d0c8cb6b25075ec150b3031e92 100644 (file)
@@ -799,7 +799,6 @@ mono_arch_init (void)
        mono_aot_register_jit_icall ("mono_arm_start_gsharedvt_call", mono_arm_start_gsharedvt_call);
 #endif
        mono_aot_register_jit_icall ("mono_arm_unaligned_stack", mono_arm_unaligned_stack);
-       mono_aot_register_jit_icall ("mono_arm_handler_block_trampoline_helper", mono_arm_handler_block_trampoline_helper);
 #if defined(__ARM_EABI__)
        eabi_supported = TRUE;
 #endif
@@ -5891,7 +5890,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        arm_patch (buf [0], code);
                        break;
                }
-
+               case OP_FILL_PROF_CALL_CTX:
+                       for (int i = 0; i < ARMREG_MAX; i++)
+                               if ((MONO_ARCH_CALLEE_SAVED_REGS & (1 << i)) || i == ARMREG_SP || i == ARMREG_FP)
+                                       ARM_STR_IMM (code, i, ins->sreg1, MONO_STRUCT_OFFSET (MonoContext, regs) + i * sizeof (mgreg_t));
+                       break;
                default:
                        g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
                        g_assert_not_reached ();
@@ -6749,12 +6752,6 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho
        return NULL;
 }
 
-gboolean
-mono_arch_print_tree (MonoInst *tree, int arity)
-{
-       return 0;
-}
-
 #ifndef DISABLE_JIT
 
 #endif
@@ -7082,26 +7079,6 @@ mono_arch_get_trampolines (gboolean aot)
        return mono_arm_get_exception_trampolines (aot);
 }
 
-gpointer
-mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, MonoContext *ctx, gpointer new_value)
-{
-       gpointer *lr_loc;
-       char *old_value;
-       char *bp;
-
-       /*Load the spvar*/
-       bp = MONO_CONTEXT_GET_BP (ctx);
-       lr_loc = (gpointer*)(bp + clause->exvar_offset);
-
-       old_value = *lr_loc;
-       if ((char*)old_value < (char*)ji->code_start || (char*)old_value > ((char*)ji->code_start + ji->code_size))
-               return old_value;
-
-       *lr_loc = new_value;
-
-       return old_value;
-}
-
 #if defined(MONO_ARCH_SOFT_DEBUG_SUPPORTED)
 /*
  * mono_arch_set_breakpoint:
index 2e8914c395c6160462754e6c8c34155e31eb9079..633c16f306b6a26a21702258d8a8733c9ac4bbd6 100644 (file)
@@ -340,10 +340,6 @@ typedef struct MonoCompileArch {
 #define MONO_ARCH_GC_MAPS_SUPPORTED 1
 #define MONO_ARCH_HAVE_SETUP_ASYNC_CALLBACK 1
 #define MONO_ARCH_HAVE_CONTEXT_SET_INT_REG 1
-#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
-#ifndef TARGET_IOS
-#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD_AOT 1
-#endif
 #define MONO_ARCH_HAVE_SETUP_RESUME_FROM_SIGNAL_HANDLER_CTX 1
 #define MONO_ARCH_GSHAREDVT_SUPPORTED 1
 #define MONO_ARCH_HAVE_GENERAL_RGCTX_LAZY_FETCH_TRAMPOLINE 1
@@ -414,9 +410,6 @@ mono_arm_is_hard_float (void);
 void
 mono_arm_unaligned_stack (MonoMethod *method);
 
-gpointer
-mono_arm_handler_block_trampoline_helper (gpointer *ptr);
-
 /* MonoJumpInfo **ji */
 guint8*
 mono_arm_emit_aotconst (gpointer ji, guint8 *code, guint8 *buf, int dreg, int patch_type, gconstpointer data);
index 7a189792a2c5d0e6a2f08655e1df538723950856..9edb57aa9ef87da6594dea1b82e87867f7ee5dfe 100644 (file)
@@ -234,7 +234,6 @@ mono_arch_init (void)
 {
        mono_aot_register_jit_icall ("mono_arm_throw_exception", mono_arm_throw_exception);
        mono_aot_register_jit_icall ("mono_arm_resume_unwind", mono_arm_resume_unwind);
-       mono_aot_register_jit_icall ("mono_arm_handler_block_trampoline_helper", mono_arm_handler_block_trampoline_helper);
 
        if (!mono_aot_only)
                bp_trampoline = mini_get_breakpoint_trampoline ();
@@ -4330,7 +4329,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 #endif
                        break;
                }
-
+               case OP_FILL_PROF_CALL_CTX:
+                       for (int i = 0; i < MONO_MAX_IREGS; i++)
+                               if ((MONO_ARCH_CALLEE_SAVED_REGS & (1 << i)) || i == ARMREG_SP || i == ARMREG_FP)
+                                       arm_strx (code, i, ins->sreg1, MONO_STRUCT_OFFSET (MonoContext, regs) + i * sizeof (mgreg_t));
+                       break;
                default:
                        g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
                        g_assert_not_reached ();
@@ -4927,12 +4930,6 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho
        return NULL;
 }
 
-gboolean
-mono_arch_print_tree (MonoInst *tree, int arity)
-{
-       return FALSE;
-}
-
 guint32
 mono_arch_get_patch_offset (guint8 *code)
 {
@@ -5241,22 +5238,3 @@ mono_arch_get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
        return get_call_info (mp, sig);
 }
 
-gpointer
-mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, MonoContext *ctx, gpointer new_value)
-{
-       gpointer *lr_loc;
-       char *old_value;
-       char *bp;
-
-       /*Load the spvar*/
-       bp = MONO_CONTEXT_GET_BP (ctx);
-       lr_loc = (gpointer*)(bp + clause->exvar_offset);
-
-       old_value = *lr_loc;
-       if ((char*)old_value < (char*)ji->code_start || (char*)old_value > ((char*)ji->code_start + ji->code_size))
-               return old_value;
-
-       *lr_loc = new_value;
-
-       return old_value;
-}
index c7cd1fb1262f4f40dc91cf98e148f5f1f61fd03c..6268a1064de9266f034eaa7b72f1a3b34a722560 100644 (file)
@@ -154,11 +154,7 @@ typedef struct {
 #define MONO_ARCH_HAVE_OP_GENERIC_CLASS_INIT 1
 #define MONO_ARCH_HAVE_OPCODE_NEEDS_EMULATION 1
 #define MONO_ARCH_HAVE_DECOMPOSE_LONG_OPTS 1
-#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
 #define MONO_ARCH_HAVE_INIT_LMF_EXT 1
-#ifndef TARGET_IOS
-#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD_AOT 1
-#endif
 
 #ifdef TARGET_IOS
 
@@ -260,8 +256,6 @@ GSList* mono_arm_get_exception_trampolines (gboolean aot);
 
 void mono_arm_resume_unwind (gpointer arg, mgreg_t pc, mgreg_t *int_regs, gdouble *fp_regs, gboolean corlib, gboolean rethrow);
 
-gpointer mono_arm_handler_block_trampoline_helper (gpointer *ptr);
-
 CallInfo* mono_arch_get_call_info (MonoMemPool *mp, MonoMethodSignature *sig);
 
 #endif /* __MONO_MINI_ARM64_H__ */
index c8e6b75b496511ff87027095278dea133ac0e0ad..4f81d7c4c37c42793c25b489ae438325e5c68dd7 100644 (file)
@@ -120,6 +120,7 @@ static void mono_walk_stack_full (MonoJitStackWalk func, MonoContext *start_ctx,
 static void mono_raise_exception_with_ctx (MonoException *exc, MonoContext *ctx);
 static void mono_runtime_walk_stack_with_ctx (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnwindOptions unwind_options, void *user_data);
 static gboolean mono_current_thread_has_handle_block_guard (void);
+static gboolean mono_install_handler_block_guard (MonoThreadUnwindState *ctx);
 
 static gboolean
 first_managed (MonoStackFrameInfo *frame, MonoContext *ctx, gpointer addr)
@@ -349,7 +350,7 @@ is_address_protected (MonoJitInfo *ji, MonoJitExceptionInfo *ei, gpointer ip)
 
        for (i = 0; i < table->num_holes; ++i) {
                MonoTryBlockHoleJitInfo *hole = &table->holes [i];
-               if (hole->clause == clause && hole->offset <= offset && hole->offset + hole->length > offset)
+               if (ji->clauses [hole->clause].try_offset == ji->clauses [clause].try_offset && hole->offset <= offset && hole->offset + hole->length > offset)
                        return FALSE;
        }
        return TRUE;
@@ -2106,11 +2107,12 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu
                                         * that was called by the EH machinery. It won't have a guard trampoline installed, so we must
                                         * check for this situation here and resume interruption if we are below the guarded block.
                                         */
-                                       if (G_UNLIKELY (jit_tls->handler_block_return_address)) {
+                                       if (G_UNLIKELY (jit_tls->handler_block)) {
                                                gboolean is_outside = FALSE;
                                                gpointer prot_bp = MONO_CONTEXT_GET_BP (&jit_tls->handler_block_context);
                                                gpointer catch_bp = MONO_CONTEXT_GET_BP (ctx);
                                                //FIXME make this stack direction aware
+
                                                if (catch_bp > prot_bp) {
                                                        is_outside = TRUE;
                                                } else if (catch_bp == prot_bp) {
@@ -2130,7 +2132,6 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu
                                                        }
                                                }
                                                if (is_outside) {
-                                                       jit_tls->handler_block_return_address = NULL;
                                                        jit_tls->handler_block = NULL;
                                                        mono_thread_resume_interruption (TRUE); /*We ignore the exception here, it will be raised later*/
                                                }
@@ -2185,8 +2186,6 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu
                                        jit_tls->orig_ex_ctx_set = TRUE;
                                        MONO_PROFILER_RAISE (exception_clause, (method, i, ei->flags, ex_obj));
                                        jit_tls->orig_ex_ctx_set = FALSE;
-                                       mini_set_abort_threshold (ctx);
-                                       call_filter (ctx, ei->handler_start);
                                }
                                if (ei->flags == MONO_EXCEPTION_CLAUSE_FINALLY) {
                                        if (mono_trace_is_enabled () && mono_trace_eval (method))
@@ -2197,6 +2196,8 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu
 #ifndef DISABLE_PERFCOUNTERS
                                        mono_perfcounters->exceptions_finallys++;
 #endif
+                               }
+                               if (ei->flags == MONO_EXCEPTION_CLAUSE_FAULT || ei->flags == MONO_EXCEPTION_CLAUSE_FINALLY) {
                                        mono_set_lmf (lmf);
                                        if (ji->from_llvm) {
                                                /* 
@@ -2229,9 +2230,12 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu
                        }
                }
 
-               jit_tls->orig_ex_ctx_set = TRUE;
-               MONO_PROFILER_RAISE (method_exception_leave, (method, ex_obj));
-               jit_tls->orig_ex_ctx_set = FALSE;
+               if (MONO_PROFILER_ENABLED (method_exception_leave) &&
+                   mono_profiler_get_call_instrumentation_flags (method) & MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE) {
+                       jit_tls->orig_ex_ctx_set = TRUE;
+                       MONO_PROFILER_RAISE (method_exception_leave, (method, ex_obj));
+                       jit_tls->orig_ex_ctx_set = FALSE;
+               }
 
                *ctx = new_ctx;
        }
@@ -2890,8 +2894,6 @@ mono_resume_unwind (MonoContext *ctx)
        mono_restore_context (&new_ctx);
 }
 
-#ifdef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
-
 typedef struct {
        MonoJitInfo *ji;
        MonoContext ctx;
@@ -2917,7 +2919,7 @@ find_last_handler_block (StackFrameInfo *frame, MonoContext *ctx, gpointer data)
                        continue;
                /*If ip points to the first instruction it means the handler block didn't start
                 so we can leave its execution to the EH machinery*/
-               if (ei->handler_start < ip && ip < ei->data.handler_end) {
+               if (ei->handler_start <= ip && ip < ei->data.handler_end) {
                        pdata->ji = ji;
                        pdata->ei = ei;
                        pdata->ctx = *ctx;
@@ -2928,12 +2930,13 @@ find_last_handler_block (StackFrameInfo *frame, MonoContext *ctx, gpointer data)
 }
 
 
-static gpointer
+static void
 install_handler_block_guard (MonoJitInfo *ji, MonoContext *ctx)
 {
        int i;
        MonoJitExceptionInfo *clause = NULL;
        gpointer ip;
+       guint8 *bp;
 
        ip = MONO_CONTEXT_GET_IP (ctx);
 
@@ -2941,40 +2944,32 @@ install_handler_block_guard (MonoJitInfo *ji, MonoContext *ctx)
                clause = &ji->clauses [i];
                if (clause->flags != MONO_EXCEPTION_CLAUSE_FINALLY)
                        continue;
-               if (clause->handler_start < ip && clause->data.handler_end > ip)
+               if (clause->handler_start <= ip && clause->data.handler_end > ip)
                        break;
        }
 
        /*no matching finally */
        if (i == ji->num_clauses)
-               return NULL;
-
-       /*If we stopped on the instruction right before the try, we haven't actually started executing it*/
-       if (ip == clause->handler_start)
-               return NULL;
+               return;
 
-       return mono_arch_install_handler_block_guard (ji, clause, ctx, mono_create_handler_block_trampoline ());
+        /*Load the spvar*/
+        bp = (guint8*)MONO_CONTEXT_GET_BP (ctx);
+        *(bp + clause->exvar_offset) = 1;
 }
 
 /*
  * Finds the bottom handler block running and install a block guard if needed.
  */
-gboolean
+static gboolean
 mono_install_handler_block_guard (MonoThreadUnwindState *ctx)
 {
        FindHandlerBlockData data = { 0 };
        MonoJitTlsData *jit_tls = (MonoJitTlsData *)ctx->unwind_data [MONO_UNWIND_DATA_JIT_TLS];
-       gpointer resume_ip;
-
-#ifndef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD_AOT
-       if (mono_aot_only)
-               return FALSE;
-#endif
 
        /* Guard against a null MonoJitTlsData. This can happens if the thread receives the
          * interrupt signal before the JIT has time to initialize its TLS data for the given thread.
         */
-       if (!jit_tls || jit_tls->handler_block_return_address)
+       if (!jit_tls || jit_tls->handler_block)
                return FALSE;
 
        /* Do an async safe stack walk */
@@ -2987,11 +2982,8 @@ mono_install_handler_block_guard (MonoThreadUnwindState *ctx)
 
        memcpy (&jit_tls->handler_block_context, &data.ctx, sizeof (MonoContext));
 
-       resume_ip = install_handler_block_guard (data.ji, &data.ctx);
-       if (resume_ip == NULL)
-               return FALSE;
+       install_handler_block_guard (data.ji, &data.ctx);
 
-       jit_tls->handler_block_return_address = resume_ip;
        jit_tls->handler_block = data.ei;
 
        return TRUE;
@@ -3001,24 +2993,9 @@ static gboolean
 mono_current_thread_has_handle_block_guard (void)
 {
        MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_tls_get_jit_tls ();
-       return jit_tls && jit_tls->handler_block_return_address != NULL;
-}
-
-#else
-gboolean
-mono_install_handler_block_guard (MonoThreadUnwindState *ctx)
-{
-       return FALSE;
+       return jit_tls && jit_tls->handler_block != NULL;
 }
 
-static gboolean
-mono_current_thread_has_handle_block_guard (void)
-{
-       return FALSE;
-}
-
-#endif
-
 void
 mono_set_cast_details (MonoClass *from, MonoClass *to)
 {
index a5c0397221b6f5e8889f9447d7d98605c58c0740..fb1dcac98133843d52cc48ed74aef539240d4340 100644 (file)
@@ -14,7 +14,7 @@ typedef struct {
        void (*cleanup)(void);
        void (*emit_method)(MonoCompile *cfg);
        void (*emit_call)(MonoCompile *cfg, MonoCallInst *call);
-       void (*create_aot_module)(MonoAssembly *assembly, const char *global_prefix, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only);
+       void (*create_aot_module)(MonoAssembly *assembly, const char *global_prefix, int initial_got_size, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only);
        void (*emit_aot_module)(const char *filename, const char *cu_name);
        void (*check_method_supported)(MonoCompile *cfg);
        void (*emit_aot_file_info)(MonoAotFileInfo *info, gboolean has_jitted_code);
@@ -50,9 +50,9 @@ mono_llvm_emit_call (MonoCompile *cfg, MonoCallInst *call)
 }
 
 void
-mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only)
+mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix, int initial_got_size, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only)
 {
-       backend.create_aot_module (assembly, global_prefix, emit_dwarf, static_link, llvm_only);
+       backend.create_aot_module (assembly, global_prefix, initial_got_size, emit_dwarf, static_link, llvm_only);
 }
 
 void
index f1bec8a2a156f545fceb3457821e42de8aab5310..f072ac56c1eb5f3561fbd7802ffbf85b31643771 100644 (file)
@@ -1832,7 +1832,7 @@ emit_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, LL
                clause = get_most_deep_clause (cfg, ctx, bb);
 
                if (clause) {
-                       g_assert (clause->flags == MONO_EXCEPTION_CLAUSE_NONE || clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY);
+                       g_assert (clause->flags == MONO_EXCEPTION_CLAUSE_NONE || clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY || clause->flags == MONO_EXCEPTION_CLAUSE_FAULT);
 
                        /*
                         * Have to use an invoke instead of a call, branching to the
@@ -1871,7 +1871,7 @@ emit_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, LL
                         * handler bblock of the clause containing this bblock.
                         */
 
-                       g_assert (ec->flags == MONO_EXCEPTION_CLAUSE_NONE || ec->flags == MONO_EXCEPTION_CLAUSE_FINALLY);
+                       g_assert (ec->flags == MONO_EXCEPTION_CLAUSE_NONE || ec->flags == MONO_EXCEPTION_CLAUSE_FINALLY || ec->flags == MONO_EXCEPTION_CLAUSE_FAULT);
 
                        tblock = cfg->cil_offset_to_bb [ec->handler_offset];
                        g_assert (tblock);
@@ -3911,7 +3911,7 @@ emit_landing_pad (EmitContext *ctx, int group_index, int group_size)
        MonoExceptionClause *group_cursor = group_start;
 
        for (int i = 0; i < group_size; i ++) {
-               if (!(group_cursor->flags & MONO_EXCEPTION_CLAUSE_FINALLY))
+               if (!(group_cursor->flags & MONO_EXCEPTION_CLAUSE_FINALLY || group_cursor->flags & MONO_EXCEPTION_CLAUSE_FAULT))
                        finally_only = FALSE;
 
                group_cursor++;
@@ -3960,7 +3960,7 @@ emit_llvmonly_handler_start (EmitContext *ctx, MonoBasicBlock *bb, LLVMBasicBloc
        MonoExceptionClause *clause = &ctx->cfg->header->clauses [clause_index];
 
        // Make exception available to catch blocks
-       if (!(clause->flags & MONO_EXCEPTION_CLAUSE_FINALLY)) {
+       if (!(clause->flags & MONO_EXCEPTION_CLAUSE_FINALLY || clause->flags & MONO_EXCEPTION_CLAUSE_FAULT)) {
                LLVMValueRef mono_exc = mono_llvm_emit_load_exception_call (ctx, ctx->builder);
 
                g_assert (ctx->ex_var);
@@ -4117,26 +4117,26 @@ emit_handler_start (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef builder
        }
 
        /* Start a new bblock which CALL_HANDLER can branch to */
-       target_bb = bblocks [bb->block_num].call_handler_target_bb;
-       if (target_bb) {
-               ctx->builder = builder = create_builder (ctx);
-               LLVMPositionBuilderAtEnd (ctx->builder, target_bb);
+       ctx->builder = builder = create_builder (ctx);
+       LLVMPositionBuilderAtEnd (ctx->builder, target_bb);
 
-               ctx->bblocks [bb->block_num].end_bblock = target_bb;
+       ctx->bblocks [bb->block_num].end_bblock = target_bb;
 
-               /* Store the exception into the IL level exvar */
-               if (bb->in_scount == 1) {
-                       g_assert (bb->in_scount == 1);
-                       exvar = bb->in_stack [0];
+       /* Store the exception into the IL level exvar */
+       if (bb->in_scount == 1) {
+               g_assert (bb->in_scount == 1);
+               exvar = bb->in_stack [0];
 
-                       // FIXME: This is shared with filter clauses ?
-                       g_assert (!values [exvar->dreg]);
+               // FIXME: This is shared with filter clauses ?
+               g_assert (!values [exvar->dreg]);
 
-                       g_assert (ctx->ex_var);
-                       values [exvar->dreg] = LLVMBuildLoad (builder, ctx->ex_var, "");
-                       emit_volatile_store (ctx, exvar->dreg);
-               }
+               g_assert (ctx->ex_var);
+               values [exvar->dreg] = LLVMBuildLoad (builder, ctx->ex_var, "");
+               emit_volatile_store (ctx, exvar->dreg);
        }
+
+       /* Make normal branches to the start of the clause branch to the new bblock */
+       bblocks [bb->block_num].bblock = target_bb;
 }
 
 static void
@@ -6537,33 +6537,39 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        LLVMValueRef val, switch_ins, callee;
                        GSList *bb_list;
                        BBInfo *info;
+                       gboolean is_fault = MONO_REGION_FLAGS (bb->region) == MONO_EXCEPTION_CLAUSE_FAULT;
 
-                       handler_bb = (MonoBasicBlock*)g_hash_table_lookup (ctx->region_to_handler, GUINT_TO_POINTER (mono_get_block_region_notry (cfg, bb->region)));
-                       g_assert (handler_bb);
-                       info = &bblocks [handler_bb->block_num];
-                       lhs = info->finally_ind;
-                       g_assert (lhs);
+                       /*
+                        * Fault clauses are like finally clauses, but they are only called if an exception is thrown.
+                        */
+                       if (!is_fault) {
+                               handler_bb = (MonoBasicBlock*)g_hash_table_lookup (ctx->region_to_handler, GUINT_TO_POINTER (mono_get_block_region_notry (cfg, bb->region)));
+                               g_assert (handler_bb);
+                               info = &bblocks [handler_bb->block_num];
+                               lhs = info->finally_ind;
+                               g_assert (lhs);
 
-                       bb_list = info->call_handler_return_bbs;
+                               bb_list = info->call_handler_return_bbs;
 
-                       resume_bb = gen_bb (ctx, "ENDFINALLY_RESUME_BB");
+                               resume_bb = gen_bb (ctx, "ENDFINALLY_RESUME_BB");
 
-                       /* Load the finally variable */
-                       val = LLVMBuildLoad (builder, lhs, "");
+                               /* Load the finally variable */
+                               val = LLVMBuildLoad (builder, lhs, "");
 
-                       /* Reset the variable */
-                       LLVMBuildStore (builder, LLVMConstInt (LLVMInt32Type (), 0, FALSE), lhs);
+                               /* Reset the variable */
+                               LLVMBuildStore (builder, LLVMConstInt (LLVMInt32Type (), 0, FALSE), lhs);
 
-                       /* Branch to either resume_bb, or to the bblocks in bb_list */
-                       switch_ins = LLVMBuildSwitch (builder, val, resume_bb, g_slist_length (bb_list));
-                       /* 
-                        * The other targets are added at the end to handle OP_CALL_HANDLER
-                        * opcodes processed later.
-                        */
-                       info->endfinally_switch_ins_list = g_slist_append_mempool (cfg->mempool, info->endfinally_switch_ins_list, switch_ins);
+                               /* Branch to either resume_bb, or to the bblocks in bb_list */
+                               switch_ins = LLVMBuildSwitch (builder, val, resume_bb, g_slist_length (bb_list));
+                               /*
+                                * The other targets are added at the end to handle OP_CALL_HANDLER
+                                * opcodes processed later.
+                                */
+                               info->endfinally_switch_ins_list = g_slist_append_mempool (cfg->mempool, info->endfinally_switch_ins_list, switch_ins);
 
-                       builder = ctx->builder = create_builder (ctx);
-                       LLVMPositionBuilderAtEnd (ctx->builder, resume_bb);
+                               builder = ctx->builder = create_builder (ctx);
+                               LLVMPositionBuilderAtEnd (ctx->builder, resume_bb);
+                       }
 
                        if (ctx->llvm_only) {
                                emit_resume_eh (ctx, bb);
@@ -7003,8 +7009,8 @@ emit_method_inner (EmitContext *ctx)
        header = cfg->header;
        for (i = 0; i < header->num_clauses; ++i) {
                clause = &header->clauses [i];
-               if (clause->flags != MONO_EXCEPTION_CLAUSE_FINALLY && clause->flags != MONO_EXCEPTION_CLAUSE_NONE) {
-                   set_failure (ctx, "non-finally/catch clause.");
+               if (clause->flags != MONO_EXCEPTION_CLAUSE_FINALLY && clause->flags != MONO_EXCEPTION_CLAUSE_FAULT && clause->flags != MONO_EXCEPTION_CLAUSE_NONE) {
+                   set_failure (ctx, "non-finally/catch/fault clause.");
                        return;
                }
        }
@@ -7107,19 +7113,6 @@ emit_method_inner (EmitContext *ctx)
                }
        }
 
-       /*
-        * The INDIRECT flag added by OP_LDADDR inhibits optimizations, even if the LDADDR
-        * was later optimized away, so clear these flags, and add them back for the still
-        * present OP_LDADDR instructions.
-        */
-       for (i = 0; i < cfg->next_vreg; ++i) {
-               MonoInst *ins;
-
-               ins = get_vreg_to_inst (cfg, i);
-               if (ins && ins != cfg->rgctx_var)
-                       ins->flags &= ~MONO_INST_INDIRECT;
-       }
-
        /*
         * Make a first pass over the code to precreate PHI nodes/set INDIRECT flags.
         */
@@ -8423,7 +8416,7 @@ mono_llvm_free_domain_info (MonoDomain *domain)
 }
 
 void
-mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only)
+mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix, int initial_got_size, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only)
 {
        MonoLLVMModule *module = &aot_module;
 
@@ -8447,7 +8440,7 @@ mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix,
        module->static_link = static_link;
        module->llvm_only = llvm_only;
        /* The first few entries are reserved */
-       module->max_got_offset = 16;
+       module->max_got_offset = initial_got_size;
        module->context = LLVMGetGlobalContext ();
 
        if (llvm_only)
index 483729d1c3bbc03b3a2ee5dfb392b183c0470b72..0942c9a7d42370d478d2ef1e3a1fd1fceaf1b3c6 100644 (file)
@@ -13,7 +13,7 @@ void     mono_llvm_init                     (void) MONO_LLVM_INTERNAL;
 void     mono_llvm_cleanup                  (void) MONO_LLVM_INTERNAL;
 void     mono_llvm_emit_method              (MonoCompile *cfg) MONO_LLVM_INTERNAL;
 void     mono_llvm_emit_call                (MonoCompile *cfg, MonoCallInst *call) MONO_LLVM_INTERNAL;
-void     mono_llvm_create_aot_module        (MonoAssembly *assembly, const char *global_prefix, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only) MONO_LLVM_INTERNAL;
+void     mono_llvm_create_aot_module        (MonoAssembly *assembly, const char *global_prefix, int initial_got_size, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only) MONO_LLVM_INTERNAL;
 void     mono_llvm_emit_aot_module          (const char *filename, const char *cu_name) MONO_LLVM_INTERNAL;
 void     mono_llvm_emit_aot_file_info       (MonoAotFileInfo *info, gboolean has_jitted_code) MONO_LLVM_INTERNAL;
 void     mono_llvm_emit_aot_data            (const char *symbol, guint8 *data, int data_len) MONO_LLVM_INTERNAL;
index bf06aee47bb5523f8c68a8d4a8139d73e65292ff..3bf1147f7613a070502021971194fbec39227fea 100644 (file)
@@ -5561,12 +5561,6 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho
        return NULL;
 }
 
-gboolean
-mono_arch_print_tree (MonoInst *tree, int arity)
-{
-       return 0;
-}
-
 mgreg_t
 mono_arch_context_get_int_reg (MonoContext *ctx, int reg)
 {
index 9732a3f94fc5e29b76c8651bb17710ccfe0e18a7..88efb61d67b9a587edd702b6c4f0741a10bc048c 100644 (file)
@@ -126,9 +126,6 @@ static const MagicTypeInfo type_info[] = {
        { 2, STACK_R8, STACK_R8, STACK_R8, OP_FCONV_TO_R8, OP_FCONV_TO_R4, OP_FMOVE, 0, 0, OP_PT_STORE_FP_MEMBASE_REG, 0 },
 };
 
-static inline gboolean mono_class_is_magic_int (MonoClass *klass);
-static inline gboolean mono_class_is_magic_float (MonoClass *klass);
-
 
 static inline gboolean
 type_size (MonoCompile *cfg, MonoType *type)
@@ -352,10 +349,13 @@ mono_class_is_magic_assembly (MonoClass *klass)
                return TRUE;
        if (!strcmp ("Xamarin.WatchOS", klass->image->assembly_name))
                return TRUE;
+       /* regression test suite */
+       if (!strcmp ("builtin-types", klass->image->assembly_name))
+               return TRUE;
        return FALSE;
 }
 
-static inline gboolean
+gboolean
 mono_class_is_magic_int (MonoClass *klass)
 {
        static MonoClass *magic_nint_class;
@@ -388,7 +388,7 @@ mono_class_is_magic_int (MonoClass *klass)
        return FALSE;
 }
 
-static inline gboolean
+gboolean
 mono_class_is_magic_float (MonoClass *klass)
 {
        static MonoClass *magic_nfloat_class;
index ae9165e1174792376a3a602cdc75ba758692f012..29d8cb09fb77e0b2d84586309f48dc85243afc26 100644 (file)
@@ -1305,3 +1305,10 @@ MINI_OP(OP_GET_SP, "get_sp", IREG, NONE, NONE)
 MINI_OP(OP_SET_SP, "set_sp", NONE, IREG, NONE)
 
 MINI_OP(OP_GET_LAST_ERROR, "get_last_error", IREG, NONE, NONE)
+
+/*
+ * Fill out a MonoContext contained in a MonoProfilerCallContext. This only
+ * stores the stack pointer, frame pointer, and callee-saved registers. This
+ * should be enough to locate arguments and variables.
+ */
+MINI_OP(OP_FILL_PROF_CALL_CTX, "fill_prof_call_ctx", NONE, IREG, NONE)
index 40a841b729f4fdfdd7ca9a5ae07bfe4ca57b36b0..8b17287a21a5aa0bd48fc9828176dda9ec1b255b 100644 (file)
@@ -640,14 +640,18 @@ init:
        mono_profiler_get_sample_mode (NULL, &mode, NULL);
 
        if (mode == MONO_PROFILER_SAMPLE_MODE_NONE) {
-               mono_profiler_sampling_thread_sleep ();
+               mono_profiler_sampling_thread_wait ();
+
+               if (!InterlockedRead (&sampling_thread_running))
+                       goto done;
+
                goto init;
        }
 
        clock_init (mode);
 
        for (guint64 sleep = clock_get_time_ns (); InterlockedRead (&sampling_thread_running); clock_sleep_ns_abs (sleep)) {
-               uint64_t freq;
+               uint32_t freq;
                MonoProfilerSampleMode new_mode;
 
                mono_profiler_get_sample_mode (NULL, &new_mode, &freq);
@@ -676,10 +680,11 @@ init:
                } FOREACH_THREAD_SAFE_END
        }
 
-       InterlockedWrite (&sampling_thread_exiting, 1);
-
        clock_cleanup ();
 
+done:
+       InterlockedWrite (&sampling_thread_exiting, 1);
+
        pthread_setschedparam (pthread_self (), old_policy, &old_sched);
 
        mono_thread_info_detach ();
@@ -692,6 +697,8 @@ mono_runtime_shutdown_stat_profiler (void)
 {
        InterlockedWrite (&sampling_thread_running, 0);
 
+       mono_profiler_sampling_thread_post ();
+
 #ifndef PLATFORM_MACOSX
        /*
         * There is a slight problem when we're using CLOCK_PROCESS_CPUTIME_ID: If
index f36a3fd528ae4e964fdac0435b760bc47c9c3d8d..97ded1bee40b4ebd96e792f9635e724d02a991cb 100644 (file)
@@ -5782,12 +5782,6 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho
        return NULL;
 }
 
-gboolean
-mono_arch_print_tree (MonoInst *tree, int arity)
-{
-       return 0;
-}
-
 mgreg_t
 mono_arch_context_get_int_reg (MonoContext *ctx, int reg)
 {
@@ -6017,15 +6011,3 @@ mono_arch_opcode_supported (int opcode)
        }
 }
 
-
-#if 0
-// FIXME: To get the test case  finally_block_ending_in_dead_bb  to work properly we need to define the following
-// (in mini-ppc.h) and then implement the fuction mono_arch_create_handler_block_trampoline.
-//  #define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
-
-gpointer
-mono_arch_create_handler_block_trampoline (void)
-{
-       . . .
-}
-#endif
index 718bb98d6fa4077ed1e8179f5c3bbb419ca3c21e..3f241f6db3178ee9f456421b06748c2cefb70a65 100644 (file)
@@ -160,10 +160,6 @@ typedef struct MonoCompileArch {
   #define MONO_ARCH_HAVE_DECOMPOSE_VTYPE_OPTS 1
   #define MONO_ARCH_RETURN_CAN_USE_MULTIPLE_REGISTERS 1
 
-// FIXME: To get the test case  finally_block_ending_in_dead_bb  to work properly define the following
-// and then implement the fuction mono_arch_create_handler_block_trampoline.
-//  #define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
-
 // Define "DEBUG_ELFABIV2" to allow for debugging output for ELF ABI v2 function call and return codegen
 //  #define DEBUG_ELFABIV2
 
diff --git a/mono/mini/mini-profiler.c b/mono/mini/mini-profiler.c
new file mode 100644 (file)
index 0000000..c6c6158
--- /dev/null
@@ -0,0 +1,276 @@
+/*
+ * Licensed to the .NET Foundation under one or more agreements.
+ * The .NET Foundation licenses this file to you under the MIT license.
+ * See the LICENSE file in the project root for more information.
+ */
+
+#include <config.h>
+
+#include <mono/metadata/abi-details.h>
+#include <mono/metadata/mono-debug.h>
+
+#include "interp/interp.h"
+#include "ir-emit.h"
+#include "mini.h"
+
+#ifndef DISABLE_JIT
+
+static MonoInst *
+emit_fill_call_ctx (MonoCompile *cfg, MonoInst *method, MonoInst *ret)
+{
+       cfg->flags |= MONO_CFG_HAS_ALLOCA;
+
+       MonoInst *alloc, *size, *fill_ctx;
+
+       EMIT_NEW_ICONST (cfg, size, sizeof (MonoProfilerCallContext));
+       MONO_INST_NEW (cfg, alloc, OP_LOCALLOC);
+       alloc->dreg = alloc_preg (cfg);
+       alloc->sreg1 = size->dreg;
+       alloc->flags |= MONO_INST_INIT;
+       MONO_ADD_INS (cfg->cbb, alloc);
+       MONO_INST_NEW (cfg, fill_ctx, OP_FILL_PROF_CALL_CTX);
+       fill_ctx->sreg1 = alloc->dreg;
+       MONO_ADD_INS (cfg->cbb, fill_ctx);
+       MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, alloc->dreg, MONO_STRUCT_OFFSET (MonoProfilerCallContext, method), method->dreg);
+
+       if (ret) {
+               MonoInst *var = mono_compile_create_var (cfg, mono_method_signature (cfg->method)->ret, OP_LOCAL);
+
+               MonoInst *store, *addr;
+
+               EMIT_NEW_TEMPSTORE (cfg, store, var->inst_c0, ret);
+               EMIT_NEW_VARLOADA (cfg, addr, var, NULL);
+               MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, alloc->dreg, MONO_STRUCT_OFFSET (MonoProfilerCallContext, return_value), addr->dreg);
+       }
+
+       return alloc;
+}
+
+void
+mini_profiler_emit_enter (MonoCompile *cfg)
+{
+       if (!MONO_CFG_PROFILE (cfg, ENTER) || cfg->current_method != cfg->method)
+               return;
+
+       MonoInst *iargs [2];
+
+       EMIT_NEW_METHODCONST (cfg, iargs [0], cfg->method);
+
+       if (MONO_CFG_PROFILE (cfg, ENTER_CONTEXT) && !cfg->llvm_only)
+               iargs [1] = emit_fill_call_ctx (cfg, iargs [0], NULL);
+       else
+               EMIT_NEW_PCONST (cfg, iargs [1], NULL);
+
+       /* void mono_profiler_raise_method_enter (MonoMethod *method, MonoProfilerCallContext *ctx) */
+       mono_emit_jit_icall (cfg, mono_profiler_raise_method_enter, iargs);
+}
+
+void
+mini_profiler_emit_leave (MonoCompile *cfg, MonoInst *ret)
+{
+       if (!MONO_CFG_PROFILE (cfg, LEAVE) || cfg->current_method != cfg->method)
+               return;
+
+       MonoInst *iargs [2];
+
+       EMIT_NEW_METHODCONST (cfg, iargs [0], cfg->method);
+
+       if (MONO_CFG_PROFILE (cfg, LEAVE_CONTEXT) && !cfg->llvm_only)
+               iargs [1] = emit_fill_call_ctx (cfg, iargs [0], ret);
+       else
+               EMIT_NEW_PCONST (cfg, iargs [1], NULL);
+
+       /* void mono_profiler_raise_method_leave (MonoMethod *method, MonoProfilerCallContext *ctx) */
+       mono_emit_jit_icall (cfg, mono_profiler_raise_method_leave, iargs);
+}
+
+void
+mini_profiler_emit_tail_call (MonoCompile *cfg, MonoMethod *target)
+{
+       if (!MONO_CFG_PROFILE (cfg, TAIL_CALL) || cfg->current_method != cfg->method)
+               return;
+
+       g_assert (cfg->current_method == cfg->method);
+
+       MonoInst *iargs [2];
+
+       EMIT_NEW_METHODCONST (cfg, iargs [0], cfg->method);
+
+       if (target)
+               EMIT_NEW_METHODCONST (cfg, iargs [1], target);
+       else
+               EMIT_NEW_PCONST (cfg, iargs [1], NULL);
+
+       /* void mono_profiler_raise_method_tail_call (MonoMethod *method, MonoMethod *target) */
+       mono_emit_jit_icall (cfg, mono_profiler_raise_method_tail_call, iargs);
+}
+
+#endif
+
+void
+mini_profiler_context_enable (void)
+{
+       if (!mono_debug_enabled ())
+               mono_debug_init (MONO_DEBUG_FORMAT_MONO);
+}
+
+static gpointer
+memdup_with_type (gpointer data, MonoType *t)
+{
+       int dummy;
+
+       return g_memdup (data, mono_type_size (t, &dummy));
+}
+
+static guint8 *
+get_int_reg (MonoContext *ctx, guint32 reg)
+{
+       return (guint8 *) mono_arch_context_get_int_reg (ctx, reg);
+}
+
+static gpointer
+get_variable_buffer (MonoDebugMethodJitInfo *jit, MonoDebugVarInfo *var, MonoContext *ctx)
+{
+       guint32 flags = var->index & MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS;
+       guint32 reg = var->index & ~MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS;
+
+       switch (flags) {
+       case MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER: {
+               /*
+                * This is kind of a special case: All other address modes ultimately
+                * produce an address to where the actual value is located, but this
+                * address mode gets us the value itself as an mgreg_t value.
+                */
+               mgreg_t value = (mgreg_t) get_int_reg (ctx, reg);
+
+               return memdup_with_type (&value, var->type);
+       }
+       case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET:
+               return memdup_with_type (get_int_reg (ctx, reg) + (gint32) var->offset, var->type);
+       case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR:
+       case MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR:
+               return memdup_with_type (*(guint8 **) (get_int_reg (ctx, reg) + (gint32) var->offset), var->type);
+       case MONO_DEBUG_VAR_ADDRESS_MODE_GSHAREDVT_LOCAL: {
+               guint32 idx = reg;
+
+               MonoDebugVarInfo *info_var = jit->gsharedvt_info_var;
+
+               flags = info_var->index & MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS;
+               reg = info_var->index & ~MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS;
+
+               MonoGSharedVtMethodRuntimeInfo *info;
+
+               switch (flags) {
+               case MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER:
+                       info = (MonoGSharedVtMethodRuntimeInfo *) get_int_reg (ctx, reg);
+                       break;
+               case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET:
+                       info = *(MonoGSharedVtMethodRuntimeInfo **) (get_int_reg (ctx, reg) + (gint32) info_var->offset);
+                       break;
+               default:
+                       g_assert_not_reached ();
+               }
+
+               MonoDebugVarInfo *locals_var = jit->gsharedvt_locals_var;
+
+               flags = locals_var->index & MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS;
+               reg = locals_var->index & ~MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS;
+
+               guint8 *locals;
+
+               switch (flags) {
+               case MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER:
+                       locals = get_int_reg (ctx, reg);
+                       break;
+               case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET:
+                       locals = *(guint8 **) (get_int_reg (ctx, reg) + (gint32) info_var->offset);
+                       break;
+               default:
+                       g_assert_not_reached ();
+               }
+
+               return memdup_with_type (locals + (gsize) info->entries [idx], var->type);
+       }
+       default:
+               g_assert_not_reached ();
+               return NULL;
+       }
+}
+
+gpointer
+mini_profiler_context_get_this (MonoProfilerCallContext *ctx)
+{
+       if (!mono_method_signature (ctx->method)->hasthis)
+               return NULL;
+
+       if (ctx->interp_frame)
+               return memdup_with_type (mono_interp_frame_get_this (ctx->interp_frame), &ctx->method->klass->this_arg);
+
+       MonoDebugMethodJitInfo *info = mono_debug_find_method (ctx->method, mono_domain_get ());
+
+       if (!info)
+               return NULL;
+
+       return get_variable_buffer (info, info->this_var, &ctx->context);
+}
+
+gpointer
+mini_profiler_context_get_argument (MonoProfilerCallContext *ctx, guint32 pos)
+{
+       MonoMethodSignature *sig = mono_method_signature (ctx->method);
+
+       if (pos >= sig->param_count)
+               return NULL;
+
+       if (ctx->interp_frame)
+               return memdup_with_type (mono_interp_frame_get_arg (ctx->interp_frame, pos), sig->params [pos]);
+
+       MonoDebugMethodJitInfo *info = mono_debug_find_method (ctx->method, mono_domain_get ());
+
+       if (!info)
+               return NULL;
+
+       return get_variable_buffer (info, &info->params [pos], &ctx->context);
+}
+
+gpointer
+mini_profiler_context_get_local (MonoProfilerCallContext *ctx, guint32 pos)
+{
+       MonoError error;
+       MonoMethodHeader *header = mono_method_get_header_checked (ctx->method, &error);
+       mono_error_assert_ok (&error); // Must be a valid method at this point.
+
+       if (pos >= header->num_locals) {
+               mono_metadata_free_mh (header);
+               return NULL;
+       }
+
+       MonoType *t = header->locals [pos];
+
+       mono_metadata_free_mh (header);
+
+       if (ctx->interp_frame)
+               return memdup_with_type (mono_interp_frame_get_local (ctx->interp_frame, pos), t);
+
+       MonoDebugMethodJitInfo *info = mono_debug_find_method (ctx->method, mono_domain_get ());
+
+       if (!info)
+               return NULL;
+
+       return get_variable_buffer (info, &info->locals [pos], &ctx->context);
+}
+
+gpointer
+mini_profiler_context_get_result (MonoProfilerCallContext *ctx)
+{
+       if (!ctx->return_value)
+               return NULL;
+
+       return memdup_with_type (ctx->return_value, mono_method_signature (ctx->method)->ret);
+}
+
+void
+mini_profiler_context_free_buffer (void *buffer)
+{
+       g_free (buffer);
+}
index 8e385be0afca28fdce9979df8201258d1ce3051c..b839e49f09637e9d1314e10c13815ced0435d885 100644 (file)
@@ -130,16 +130,12 @@ int valgrind_register;
 #endif
 GList* mono_aot_paths;
 
-static gboolean mini_enable_profiler = FALSE;
-static char* mini_profiler_options = NULL;
+static GPtrArray *profile_options;
 
 static GSList *tramp_infos;
 
 static void register_icalls (void);
 
-static gboolean mini_profiler_enabled (void) { return mini_enable_profiler; }
-static const char* mini_profiler_get_options (void) {  return mini_profiler_options;  }
-
 gboolean
 mono_running_on_valgrind (void)
 {
@@ -1739,12 +1735,6 @@ lookup_method (MonoDomain *domain, MonoMethod *method)
        return ji;
 }
 
-MonoJitInfo *
-mono_get_jit_info_from_method (MonoDomain *domain, MonoMethod *method)
-{
-       return lookup_method (domain, method);
-}
-
 MonoClass*
 mini_get_class (MonoMethod *method, guint32 token, MonoGenericContext *context)
 {
@@ -3764,10 +3754,12 @@ mini_llvm_init (void)
 }
 
 void
-mini_profiler_enable_with_options (const char* profile_options)
+mini_add_profiler_argument (const char *desc)
 {
-       mini_enable_profiler = TRUE;
-       mini_profiler_options = g_strdup (profile_options);
+       if (!profile_options)
+               profile_options = g_ptr_array_new ();
+
+       g_ptr_array_add (profile_options, (gpointer) desc);
 }
 
 MonoDomain *
@@ -3940,8 +3932,16 @@ mini_init (const char *filename, const char *runtime_version)
        mono_install_get_class_from_name (mono_aot_get_class_from_name);
        mono_install_jit_info_find_in_aot (mono_aot_find_jit_info);
 
-       if (mini_profiler_enabled ())
-               mono_profiler_load (mini_profiler_get_options ());
+       mono_profiler_state.context_enable = mini_profiler_context_enable;
+       mono_profiler_state.context_get_this = mini_profiler_context_get_this;
+       mono_profiler_state.context_get_argument = mini_profiler_context_get_argument;
+       mono_profiler_state.context_get_local = mini_profiler_context_get_local;
+       mono_profiler_state.context_get_result = mini_profiler_context_get_result;
+       mono_profiler_state.context_free_buffer = mini_profiler_context_free_buffer;
+
+       if (profile_options)
+               for (guint i = 0; i < profile_options->len; i++)
+                       mono_profiler_load ((const char *) g_ptr_array_index (profile_options, i));
 
        mono_profiler_started ();
 
@@ -4057,8 +4057,9 @@ register_icalls (void)
         * the wrapper would call the icall which would call the wrapper and
         * so on.
         */
-       register_icall (mono_profiler_raise_method_enter, "mono_profiler_raise_method_enter", "void ptr", TRUE);
-       register_icall (mono_profiler_raise_method_leave, "mono_profiler_raise_method_leave", "void ptr", TRUE);
+       register_icall (mono_profiler_raise_method_enter, "mono_profiler_raise_method_enter", "void ptr ptr", TRUE);
+       register_icall (mono_profiler_raise_method_leave, "mono_profiler_raise_method_leave", "void ptr ptr", TRUE);
+       register_icall (mono_profiler_raise_method_tail_call, "mono_profiler_raise_method_tail_call", "void ptr ptr", TRUE);
 
        register_icall (mono_trace_enter_method, "mono_trace_enter_method", NULL, TRUE);
        register_icall (mono_trace_leave_method, "mono_trace_leave_method", NULL, TRUE);
@@ -4085,6 +4086,7 @@ register_icalls (void)
        register_dyn_icall (mono_get_rethrow_exception (), "mono_arch_rethrow_exception", "void object", TRUE);
        register_dyn_icall (mono_get_throw_corlib_exception (), "mono_arch_throw_corlib_exception", "void ptr", TRUE);
        register_icall (mono_thread_get_undeniable_exception, "mono_thread_get_undeniable_exception", "object", FALSE);
+       register_icall (mono_thread_self_abort, "mono_thread_self_abort", "void", FALSE);
        register_icall (mono_thread_interruption_checkpoint, "mono_thread_interruption_checkpoint", "object", FALSE);
        register_icall (mono_thread_force_interruption_checkpoint_noraise, "mono_thread_force_interruption_checkpoint_noraise", "object", FALSE);
 
@@ -4384,6 +4386,9 @@ mini_cleanup (MonoDomain *domain)
 
        mono_profiler_cleanup ();
 
+       if (profile_options)
+               g_ptr_array_free (profile_options, TRUE);
+
        free_jit_tls_data ((MonoJitTlsData *)mono_tls_get_jit_tls ());
 
        mono_icall_cleanup ();
index bab41317cc6012bd583e8b0f9063ed8ad80bbb21..5760bfb8672d8276721c86ee2e4a8928e6a830f4 100644 (file)
@@ -6220,73 +6220,6 @@ mono_arch_decompose_opts (MonoCompile *cfg, MonoInst *ins)
 
 /*========================= End of Function ========================*/
 
-/*------------------------------------------------------------------*/
-/*                                                                  */
-/* Name                - mono_arch_print_tree                              */
-/*                                                                  */
-/* Function    - Print platform-specific opcode details.           */
-/*                                                                 */
-/* Returns     - 1 - opcode details have been printed              */
-/*               0 - opcode details have not been printed          */
-/*                                                                  */
-/*------------------------------------------------------------------*/
-
-gboolean
-mono_arch_print_tree (MonoInst *tree, int arity)
-{
-       gboolean done;
-
-       switch (tree->opcode) {
-               case OP_S390_LOADARG:
-               case OP_S390_ARGREG:
-               case OP_S390_ARGPTR:
-                       printf ("[0x%lx(%s)]", tree->inst_offset, 
-                               mono_arch_regname (tree->inst_basereg));
-                       done = 1;
-                       break;
-               case OP_S390_STKARG:
-                       printf ("[0x%lx(previous_frame)]", 
-                               tree->inst_offset); 
-                       done = 1;
-                       break;
-               case OP_S390_MOVE:
-                       printf ("[0x%lx(%d,%s),0x%lx(%s)]",
-                               tree->inst_offset, tree->backend.size,
-                               mono_arch_regname(tree->dreg), 
-                               tree->inst_imm, 
-                               mono_arch_regname(tree->sreg1));
-                       done = 1;
-                       break;
-               case OP_S390_SETF4RET:
-                       printf ("[f%s,f%s]", 
-                               mono_arch_regname (tree->dreg),
-                               mono_arch_regname (tree->sreg1));
-                       done = 1;
-                       break;
-               case OP_TLS_GET:
-                       printf ("[0x%lx(0x%lx,%s)]", tree->inst_offset,
-                       tree->inst_imm,
-                       mono_arch_regname (tree->sreg1));
-                       done = 1;
-                       break;
-               case OP_TLS_SET:
-                       printf ("[0x%lx(0x%lx,%s)]", tree->inst_offset,
-                       tree->inst_imm,
-                       mono_arch_regname (tree->sreg1));
-                       done = 1;
-                       break;
-               case OP_S390_BKCHAIN:
-                       printf ("[previous_frame(%s)]", 
-                               mono_arch_regname (tree->sreg1));
-                       done = 1;
-               default:
-                       done = 0;
-       }
-       return (done);
-}
-
-/*========================= End of Function ========================*/
-
 /*------------------------------------------------------------------*/
 /*                                                                  */
 /* Name                - mono_arch_regalloc_cost                           */
@@ -6413,39 +6346,6 @@ mono_arch_get_this_arg_from_call (mgreg_t *regs, guint8 *code)
 
 /*========================= End of Function ========================*/
  
-/*------------------------------------------------------------------*/
-/*                                                                  */
-/* Name                - mono_arch_install_handler_block_guard             */
-/*                                                                  */
-/* Function    -                                                   */
-/*                                                                 */
-/*------------------------------------------------------------------*/
-
-gpointer
-mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, 
-                                      MonoContext *ctx, gpointer new_value)
-{
-       int offset;
-       gpointer *sp, old_value;
-       char *bp;
-
-       offset = clause->exvar_offset;
-
-       /*Load the spvar*/
-       bp = MONO_CONTEXT_GET_BP (ctx);
-       sp = *(gpointer*)(bp + offset);
-
-       old_value = *sp;
-       if (old_value < ji->code_start || (char*)old_value > ((char*)ji->code_start + ji->code_size))
-               return old_value;
-
-       *sp = new_value;
-
-       return old_value;
-}
-
-/*========================= End of Function ========================*/
 /*------------------------------------------------------------------*/
 /*                                                                  */
 /* Name                - get_delegate_invoke_impl.                         */
index 9747be08ce7f9b504e35437cda29af54bfdaf83d..01dcfd997a9bf6a9822f412625f7b16b3989aaf0 100644 (file)
@@ -61,7 +61,6 @@ typedef struct
 #define MONO_ARCH_GC_MAPS_SUPPORTED                    1
 #define MONO_ARCH_GSHARED_SUPPORTED                    1
 #define MONO_ARCH_MONITOR_ENTER_ADJUSTMENT             1
-#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD             1
 #define MONO_ARCH_HAVE_INVALIDATE_METHOD               1
 #define MONO_ARCH_HAVE_OP_GENERIC_CLASS_INIT           1
 #define MONO_ARCH_HAVE_SETUP_ASYNC_CALLBACK            1
index 1edddbd139c18646423c10962784bb75d46732c2..7f5f68091e4a813dbfc9aceeac829c52743dbf1e 100644 (file)
@@ -4413,12 +4413,6 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit
        return 0;
 }
 
-gboolean
-mono_arch_print_tree (MonoInst *tree, int arity)
-{
-       return 0;
-}
-
 mgreg_t
 mono_arch_context_get_int_reg (MonoContext *ctx, int reg)
 {
index 3ef30208cf7b65a0e8a1d5dfdf5c8ce400380f7e..c78abccad633d929d1dcef391ef5ba360dd0ee16 100644 (file)
@@ -1273,68 +1273,6 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr
        return code;
 }
 
-#ifdef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
-static gpointer
-mono_handler_block_guard_trampoline (mgreg_t *regs, guint8 *code, gpointer *tramp_info, guint8* tramp)
-{
-       MONO_REQ_GC_UNSAFE_MODE;
-
-       MonoContext ctx;
-       MonoException *exc;
-       MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_tls_get_jit_tls ();
-       gpointer resume_ip = jit_tls->handler_block_return_address;
-
-       memcpy (&ctx, &jit_tls->handler_block_context, sizeof (MonoContext));
-       MONO_CONTEXT_SET_IP (&ctx, jit_tls->handler_block_return_address);
-
-       jit_tls->handler_block_return_address = NULL;
-       jit_tls->handler_block = NULL;
-
-       if (!resume_ip) /*this should not happen, but we should avoid crashing */
-               exc = mono_get_exception_execution_engine ("Invalid internal state, resuming abort after handler block but no resume ip found");
-       else
-               exc = mono_thread_resume_interruption (TRUE);
-
-       if (exc) {
-               mono_handle_exception (&ctx, (MonoObject *)exc);
-               mono_restore_context (&ctx);
-       }
-
-       return resume_ip;
-}
-
-gpointer
-mono_create_handler_block_trampoline (void)
-{
-       static gpointer code;
-
-       if (code)
-               return code;
-
-       if (mono_aot_only) {
-               gpointer tmp = mono_aot_get_trampoline ("handler_block_trampoline");
-               g_assert (tmp);
-               mono_memory_barrier ();
-               code = tmp;
-               return code;
-       }
-
-       mono_trampolines_lock ();
-       if (!code) {
-               MonoTrampInfo *info;
-               gpointer tmp;
-
-               tmp = mono_arch_create_handler_block_trampoline (&info, FALSE);
-               mono_tramp_info_register (info, NULL);
-               mono_memory_barrier ();
-               code = tmp;
-       }
-       mono_trampolines_unlock ();
-
-       return code;
-}
-#endif
-
 /*
  * mono_get_trampoline_func:
  *
@@ -1366,10 +1304,6 @@ mono_get_trampoline_func (MonoTrampolineType tramp_type)
 #endif
        case MONO_TRAMPOLINE_VCALL:
                return mono_vcall_trampoline;
-#ifdef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
-       case MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD:
-               return mono_handler_block_guard_trampoline;
-#endif
        default:
                g_assert_not_reached ();
                return NULL;
@@ -1409,10 +1343,6 @@ mono_trampolines_init (void)
        mono_trampoline_code [MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING] = create_trampoline_code (MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING);
 #endif
        mono_trampoline_code [MONO_TRAMPOLINE_VCALL] = create_trampoline_code (MONO_TRAMPOLINE_VCALL);
-#ifdef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
-       mono_trampoline_code [MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD] = create_trampoline_code (MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD);
-       mono_create_handler_block_trampoline ();
-#endif
 
        mono_counters_register ("Calls to trampolines", MONO_COUNTER_JIT | MONO_COUNTER_INT, &trampoline_calls);
        mono_counters_register ("JIT trampolines", MONO_COUNTER_JIT | MONO_COUNTER_INT, &jit_trampolines);
@@ -1740,8 +1670,7 @@ static const char*tramp_names [MONO_TRAMPOLINE_NUM] = {
        "delegate",
        "restore_stack_prot",
        "generic_virtual_remoting",
-       "vcall",
-       "handler_block_guard"
+       "vcall"
 };
 
 /*
index ad1637319c864f3875104b3fc4f05c364319f8af..86ddb41427893ec9429ea134d6dcbf0b75ad8a7f 100644 (file)
@@ -4927,6 +4927,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                case OP_SET_SP:
                        x86_mov_reg_reg (code, X86_ESP, ins->sreg1, sizeof (mgreg_t));
                        break;
+               case OP_FILL_PROF_CALL_CTX:
+                       x86_mov_membase_reg (code, ins->sreg1, MONO_STRUCT_OFFSET (MonoContext, esp), X86_ESP, sizeof (mgreg_t));
+                       x86_mov_membase_reg (code, ins->sreg1, MONO_STRUCT_OFFSET (MonoContext, ebp), X86_EBP, sizeof (mgreg_t));
+                       x86_mov_membase_reg (code, ins->sreg1, MONO_STRUCT_OFFSET (MonoContext, ebx), X86_EBX, sizeof (mgreg_t));
+                       x86_mov_membase_reg (code, ins->sreg1, MONO_STRUCT_OFFSET (MonoContext, esi), X86_ESI, sizeof (mgreg_t));
+                       x86_mov_membase_reg (code, ins->sreg1, MONO_STRUCT_OFFSET (MonoContext, edi), X86_EDI, sizeof (mgreg_t));
+                       break;
                default:
                        g_warning ("unknown opcode %s\n", mono_inst_name (ins->opcode));
                        g_assert_not_reached ();
@@ -5749,12 +5756,6 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho
        return ins;
 }
 
-gboolean
-mono_arch_print_tree (MonoInst *tree, int arity)
-{
-       return 0;
-}
-
 guint32
 mono_arch_get_patch_offset (guint8 *code)
 {
@@ -6294,29 +6295,6 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *long_ins)
 #endif /* MONO_ARCH_SIMD_INTRINSICS */
 }
 
-/*MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD*/
-gpointer
-mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, MonoContext *ctx, gpointer new_value)
-{
-       int offset;
-       gpointer *sp, old_value;
-       char *bp;
-
-       offset = clause->exvar_offset;
-
-       /*Load the spvar*/
-       bp = MONO_CONTEXT_GET_BP (ctx);
-       sp = *(gpointer*)(bp + offset);
-
-       old_value = *sp;
-       if (old_value < ji->code_start || (char*)old_value > ((char*)ji->code_start + ji->code_size))
-               return old_value;
-
-       *sp = new_value;
-
-       return old_value;
-}
-
 /*
  * mono_aot_emit_load_got_addr:
  *
index a3d0a60000383c2ad3c790fdadd618b6ed149220..180e6cc967cab907b5ae8a86cfd070c5b18a7dbd 100644 (file)
@@ -224,7 +224,6 @@ typedef struct {
 #define MONO_ARCH_SOFT_DEBUG_SUPPORTED 1
 
 #define MONO_ARCH_HAVE_EXCEPTIONS_INIT 1
-#define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1
 
 #define MONO_ARCH_HAVE_CARD_TABLE_WBARRIER 1
 #define MONO_ARCH_HAVE_SETUP_RESUME_FROM_SIGNAL_HANDLER_CTX 1
index 9948d16c14554277b1c313c217a664b2676a4ca5..5e6e718486f8b7c29b519017b2acf237b41b8e58 100644 (file)
@@ -2077,8 +2077,11 @@ mono_compile_create_vars (MonoCompile *cfg)
        if (cfg->verbose_level > 2)
                g_print ("creating locals\n");
 
-       for (i = 0; i < header->num_locals; ++i)
+       for (i = 0; i < header->num_locals; ++i) {
+               if (cfg->verbose_level > 2)
+                       g_print ("\tlocal [%d]: ", i);
                cfg->locals [i] = mono_compile_create_var (cfg, header->locals [i], OP_LOCAL);
+       }
 
        if (cfg->verbose_level > 2)
                g_print ("locals done\n");
@@ -2251,6 +2254,9 @@ mono_codegen (MonoCompile *cfg)
                        mono_arch_emit_epilog (cfg);
                        cfg->epilog_end = cfg->code_len;
                }
+
+               if (bb->clause_hole)
+                       mono_cfg_add_try_hole (cfg, bb->clause_hole, cfg->native_code + bb->native_offset, bb);
        }
 
        mono_arch_emit_exceptions (cfg);
@@ -2649,27 +2655,15 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile)
                        MonoExceptionClause *ec = &header->clauses [i];
                        MonoJitExceptionInfo *ei = &jinfo->clauses [i];
                        MonoBasicBlock *tblock;
-                       MonoInst *exvar, *spvar;
+                       MonoInst *exvar;
 
                        ei->flags = ec->flags;
 
                        if (G_UNLIKELY (cfg->verbose_level >= 4))
                                printf ("IL clause: try 0x%x-0x%x handler 0x%x-0x%x filter 0x%x\n", ec->try_offset, ec->try_offset + ec->try_len, ec->handler_offset, ec->handler_offset + ec->handler_len, ec->flags == MONO_EXCEPTION_CLAUSE_FILTER ? ec->data.filter_offset : 0);
 
-                       /*
-                        * The spvars are needed by mono_arch_install_handler_block_guard ().
-                        */
-                       if (ei->flags == MONO_EXCEPTION_CLAUSE_FINALLY) {
-                               int region;
-
-                               region = ((i + 1) << 8) | MONO_REGION_FINALLY | ec->flags;
-                               spvar = mono_find_spvar_for_region (cfg, region);
-                               g_assert (spvar);
-                               ei->exvar_offset = spvar->inst_offset;
-                       } else {
-                               exvar = mono_find_exvar_for_offset (cfg, ec->handler_offset);
-                               ei->exvar_offset = exvar ? exvar->inst_offset : 0;
-                       }
+                       exvar = mono_find_exvar_for_offset (cfg, ec->handler_offset);
+                       ei->exvar_offset = exvar ? exvar->inst_offset : 0;
 
                        if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
                                tblock = cfg->cil_offset_to_bb [ec->data.filter_offset];
@@ -3300,8 +3294,10 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        }
 #endif
 
+       cfg->prof_flags = mono_profiler_get_call_instrumentation_flags (cfg->method);
+
        /* The debugger has no liveness information, so avoid sharing registers/stack slots */
-       if (debug_options.mdb_optimizations) {
+       if (debug_options.mdb_optimizations || MONO_CFG_PROFILE_CALL_CONTEXT (cfg)) {
                cfg->disable_reuse_registers = TRUE;
                cfg->disable_reuse_stack_slots = TRUE;
                /* 
index fea3746e5dac50a59ba8071bdec9f635a84f2dd5..7ce873a38ce7b6bdb0f42d9830c4329fa4d4f844 100644 (file)
 #endif
 
 /* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 140
+#define MONO_AOT_FILE_VERSION 141
 
 //TODO: This is x86/amd64 specific.
 #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
@@ -755,6 +755,9 @@ struct MonoBasicBlock {
        /* List of call sites in this bblock sorted by pc_offset */
        GSList *gc_callsites;
 
+       /* If this is not null, the basic block is a try hole for this clause */
+       MonoExceptionClause *clause_hole;
+
        /*
         * The region encodes whether the basic block is inside
         * a finally, catch, filter or none of these.
@@ -1167,10 +1170,6 @@ typedef struct {
        MonoContext     ex_ctx;
        ResumeState resume_state;
 
-       /*Variabled use to implement handler blocks (finally/catch/etc) guards during interruption*/
-       /* handler block return address */
-       gpointer handler_block_return_address;
-
        /* handler block been guarded. It's safe to store this even for dynamic methods since there
        is an activation on stack making sure it will remain alive.*/
        MonoJitExceptionInfo *handler_block;
@@ -1486,7 +1485,6 @@ typedef enum {
        MONO_TRAMPOLINE_RESTORE_STACK_PROT,
        MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING,
        MONO_TRAMPOLINE_VCALL,
-       MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD,
        MONO_TRAMPOLINE_NUM
 } MonoTrampolineType;
 
@@ -1497,7 +1495,7 @@ typedef enum {
 
 /* These trampolines receive an argument directly in a register */
 #define MONO_TRAMPOLINE_TYPE_HAS_ARG(t)                \
-       ((t) == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD)
+       (FALSE)
 
 /* optimization flags */
 #define OPTFLAG(id,shift,name,descr) MONO_OPT_ ## id = 1 << shift,
@@ -1635,10 +1633,18 @@ typedef struct {
 
        /* A hashtable of region ID-> SP var mappings */
        /* An SP var is a place to store the stack pointer (used by handlers)*/
+       /*
+        * FIXME We can potentially get rid of this, since it was mainly used
+        * for hijacking return address for handler.
+        */
        GHashTable      *spvars;
 
-       /* A hashtable of region ID -> EX var mappings */
-       /* An EX var stores the exception object passed to catch/filter blocks */
+       /*
+        * A hashtable of region ID -> EX var mappings
+        * An EX var stores the exception object passed to catch/filter blocks
+        * For finally blocks, it is set to TRUE if we should throw an abort
+        * once the execution of the finally block is over.
+        */
        GHashTable      *exvars;
 
        GList           *ldstr_list; /* used by AOT */
@@ -1910,8 +1916,16 @@ typedef struct {
        int stat_inlineable_methods;
        int stat_inlined_methods;
        int stat_code_reallocs;
+
+       MonoProfilerCallInstrumentationFlags prof_flags;
 } MonoCompile;
 
+#define MONO_CFG_PROFILE(cfg, flag) \
+       G_UNLIKELY ((cfg)->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_ ## flag)
+
+#define MONO_CFG_PROFILE_CALL_CONTEXT(cfg) \
+       (MONO_CFG_PROFILE (cfg, ENTER_CONTEXT) || MONO_CFG_PROFILE (cfg, LEAVE_CONTEXT))
+
 typedef enum {
        MONO_CFG_HAS_ALLOCA = 1 << 0,
        MONO_CFG_HAS_CALLS  = 1 << 1,
@@ -2346,7 +2360,18 @@ MonoDomain* mini_init                      (const char *filename, const char *ru
 void        mini_cleanup                   (MonoDomain *domain);
 MONO_API MonoDebugOptions *mini_get_debug_options   (void);
 MONO_API gboolean    mini_parse_debug_option (const char *option);
-void        mini_profiler_enable_with_options (const char *profile_options);
+
+/* profiler support */
+void        mini_add_profiler_argument (const char *desc);
+void        mini_profiler_emit_enter (MonoCompile *cfg);
+void        mini_profiler_emit_leave (MonoCompile *cfg, MonoInst *ret);
+void        mini_profiler_emit_tail_call (MonoCompile *cfg, MonoMethod *target);
+void        mini_profiler_context_enable (void);
+gpointer    mini_profiler_context_get_this (MonoProfilerCallContext *ctx);
+gpointer    mini_profiler_context_get_argument (MonoProfilerCallContext *ctx, guint32 pos);
+gpointer    mini_profiler_context_get_local (MonoProfilerCallContext *ctx, guint32 pos);
+gpointer    mini_profiler_context_get_result (MonoProfilerCallContext *ctx);
+void        mini_profiler_context_free_buffer (gpointer buffer);
 
 /* graph dumping */
 void mono_cfg_dump_create_context (MonoCompile *cfg);
@@ -2749,7 +2774,6 @@ void      mono_arch_free_jit_tls_data           (MonoJitTlsData *tls);
 void      mono_arch_fill_argument_info          (MonoCompile *cfg);
 void      mono_arch_allocate_vars               (MonoCompile *m);
 int       mono_arch_get_argument_info           (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info);
-gboolean  mono_arch_print_tree                         (MonoInst *tree, int arity);
 void      mono_arch_emit_call                   (MonoCompile *cfg, MonoCallInst *call);
 void      mono_arch_emit_outarg_vt              (MonoCompile *cfg, MonoInst *ins, MonoInst *src);
 void      mono_arch_emit_setret                 (MonoCompile *cfg, MonoMethod *method, MonoInst *val);
@@ -2853,12 +2877,6 @@ guint32 mono_arch_get_plt_info_offset           (guint8 *plt_entry, mgreg_t *reg
 GSList *mono_arch_get_trampolines               (gboolean aot);
 gpointer mono_arch_get_enter_icall_trampoline   (MonoTrampInfo **info);
 
-/* Handle block guard */
-gpointer mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, MonoContext *ctx, gpointer new_value);
-gpointer mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot);
-gpointer mono_create_handler_block_trampoline (void);
-gboolean mono_install_handler_block_guard (MonoThreadUnwindState *ctx);
-
 /*New interruption machinery */
 void
 mono_setup_async_callback (MonoContext *ctx, void (*async_cb)(void *fun), gpointer user_data);
@@ -3184,6 +3202,8 @@ MonoInst*   mono_emit_simd_field_load (MonoCompile *cfg, MonoClassField *field,
 guint32     mono_arch_cpu_enumerate_simd_versions (void);
 void        mono_simd_intrinsics_init (void);
 
+gboolean    mono_class_is_magic_int (MonoClass *klass);
+gboolean    mono_class_is_magic_float (MonoClass *klass);
 MonoInst*   mono_emit_native_types_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args);
 MonoType*   mini_native_type_replace_type (MonoType *type) MONO_LLVM_INTERNAL;
 
index 846c04c550f7571bc537367fd0908c6a0c2231d8..d55055f9f4763bf2833553eb5d40c3aceb338cce 100644 (file)
@@ -829,7 +829,7 @@ get_simd_vreg (MonoCompile *cfg, MonoMethod *cmethod, MonoInst *src)
                return src->sreg1;
        } else if (spec [MONO_INST_DEST] == 'x') {
                return src->dreg;
-       } else if (src->opcode == OP_VCALL) {
+       } else if (src->opcode == OP_VCALL || src->opcode == OP_VCALL_MEMBASE) {
                return src->dreg;
        }
 
index cf519e1c9298d378f62a1209838e4452966aef96..53e3bc2e834c53dd39f310e66e6f4da222d49f72 100644 (file)
@@ -239,7 +239,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        MonoJumpInfo *ji = NULL;
        const guint kMaxCodeSize = 630;
 
-       if (tramp_type == MONO_TRAMPOLINE_JUMP || tramp_type == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD)
+       if (tramp_type == MONO_TRAMPOLINE_JUMP)
                has_caller = FALSE;
        else
                has_caller = TRUE;
@@ -379,43 +379,38 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        mono_amd64_patch (br [0], code);
        //amd64_breakpoint (code);
 
-       if (tramp_type != MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD) {
-               /* Obtain the trampoline argument which is encoded in the instruction stream */
-               if (aot) {
-                       /* Load the GOT offset */
-                       amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, tramp_offset, sizeof(gpointer));
-                       /*
-                        * r11 points to a call *<offset>(%rip) instruction, load the
-                        * pc-relative offset from the instruction itself.
-                        */
-                       amd64_mov_reg_membase (code, AMD64_RAX, AMD64_R11, 3, 4);
-                       /* 7 is the length of the call, 8 is the offset to the next got slot */
-                       amd64_alu_reg_imm_size (code, X86_ADD, AMD64_RAX, 7 + sizeof (gpointer), sizeof(gpointer));
-                       /* Compute the address of the GOT slot */
-                       amd64_alu_reg_reg_size (code, X86_ADD, AMD64_R11, AMD64_RAX, sizeof(gpointer));
-                       /* Load the value */
-                       amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 0, sizeof(gpointer));
-               } else {                        
-                       amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, tramp_offset, sizeof(gpointer));
-                       amd64_mov_reg_membase (code, AMD64_RAX, AMD64_R11, 5, 1);
-                       amd64_widen_reg (code, AMD64_RAX, AMD64_RAX, TRUE, FALSE);
-                       amd64_alu_reg_imm_size (code, X86_CMP, AMD64_RAX, 4, 1);
-                       br [0] = code;
-                       x86_branch8 (code, X86_CC_NE, 6, FALSE);
-                       /* 32 bit immediate */
-                       amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 6, 4);
-                       br [1] = code;
-                       x86_jump8 (code, 10);
-                       /* 64 bit immediate */
-                       mono_amd64_patch (br [0], code);
-                       amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 6, 8);
-                       mono_amd64_patch (br [1], code);
-               }
-               amd64_mov_membase_reg (code, AMD64_RBP, arg_offset, AMD64_R11, sizeof(gpointer));
+       /* Obtain the trampoline argument which is encoded in the instruction stream */
+       if (aot) {
+               /* Load the GOT offset */
+               amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, tramp_offset, sizeof(gpointer));
+               /*
+                * r11 points to a call *<offset>(%rip) instruction, load the
+                * pc-relative offset from the instruction itself.
+                */
+               amd64_mov_reg_membase (code, AMD64_RAX, AMD64_R11, 3, 4);
+               /* 7 is the length of the call, 8 is the offset to the next got slot */
+               amd64_alu_reg_imm_size (code, X86_ADD, AMD64_RAX, 7 + sizeof (gpointer), sizeof(gpointer));
+               /* Compute the address of the GOT slot */
+               amd64_alu_reg_reg_size (code, X86_ADD, AMD64_R11, AMD64_RAX, sizeof(gpointer));
+               /* Load the value */
+               amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 0, sizeof(gpointer));
        } else {
-               amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, saved_regs_offset + (MONO_AMD64_ARG_REG1 * sizeof(mgreg_t)), sizeof(mgreg_t));
-               amd64_mov_membase_reg (code, AMD64_RBP, arg_offset, AMD64_R11, sizeof(gpointer));
+               amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, tramp_offset, sizeof(gpointer));
+               amd64_mov_reg_membase (code, AMD64_RAX, AMD64_R11, 5, 1);
+               amd64_widen_reg (code, AMD64_RAX, AMD64_RAX, TRUE, FALSE);
+               amd64_alu_reg_imm_size (code, X86_CMP, AMD64_RAX, 4, 1);
+               br [0] = code;
+               x86_branch8 (code, X86_CC_NE, 6, FALSE);
+               /* 32 bit immediate */
+               amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 6, 4);
+               br [1] = code;
+               x86_jump8 (code, 10);
+               /* 64 bit immediate */
+               mono_amd64_patch (br [0], code);
+               amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 6, 8);
+               mono_amd64_patch (br [1], code);
        }
+       amd64_mov_membase_reg (code, AMD64_RBP, arg_offset, AMD64_R11, sizeof(gpointer));
 
        /* Save LMF begin */
 
@@ -786,85 +781,6 @@ mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg)
 }
 #endif /* !DISABLE_JIT */
 
-gpointer
-mono_amd64_handler_block_trampoline_helper (void)
-{
-       MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_tls_get_jit_tls ();
-       return jit_tls->handler_block_return_address;
-}
-
-#ifndef DISABLE_JIT
-gpointer
-mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       guint8 *code, *buf;
-       int tramp_size = 64;
-       MonoJumpInfo *ji = NULL;
-       GSList *unwind_ops;
-
-       code = buf = (guint8 *)mono_global_codeman_reserve (tramp_size + MONO_TRAMPOLINE_UNWINDINFO_SIZE(0));
-
-       unwind_ops = mono_arch_get_cie_program ();
-
-       /*
-        * This trampoline restore the call chain of the handler block then jumps into the code that deals with it.
-        * We get here from the ret emitted by CEE_ENDFINALLY.
-        * The stack is misaligned.
-        */
-       /* Align the stack before the call to mono_amd64_handler_block_trampoline_helper() */
-#ifdef TARGET_WIN32
-       /* Also make room for the "register parameter stack area" as specified by the Windows x64 ABI (4 64-bit registers) */
-       amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8 + 4 * 8);
-#else
-       amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8);
-#endif
-       if (aot) {
-               code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_amd64_handler_block_trampoline_helper");
-               amd64_call_reg (code, AMD64_R11);
-       } else {
-               amd64_mov_reg_imm (code, AMD64_RAX, mono_amd64_handler_block_trampoline_helper);
-               amd64_call_reg (code, AMD64_RAX);
-       }
-       /* Undo stack alignment */
-#ifdef TARGET_WIN32
-       amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8 + 4 * 8);
-#else
-       amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
-#endif
-       /* Save the result to the stack */
-       amd64_push_reg (code, AMD64_RAX);
-#ifdef TARGET_WIN32
-       /* Make room for the "register parameter stack area" as specified by the Windows x64 ABI (4 64-bit registers) */
-       amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 4 * 8);
-#endif
-       if (aot) {
-               char *name = g_strdup_printf ("trampoline_func_%d", MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD);
-               code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, name);
-               amd64_mov_reg_reg (code, AMD64_RAX, AMD64_R11, 8);
-       } else {
-               amd64_mov_reg_imm (code, AMD64_RAX, mono_get_trampoline_func (MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD));
-       }
-       /* The stack is aligned */
-       amd64_call_reg (code, AMD64_RAX);
-#ifdef TARGET_WIN32
-       amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 4 * 8);
-#endif
-       /* Load return address */
-       amd64_pop_reg (code, AMD64_RAX);
-       /* The stack is misaligned, thats what the code we branch to expects */
-       amd64_jump_reg (code, AMD64_RAX);
-
-       mono_arch_flush_icache (buf, code - buf);
-       MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL));
-       g_assert (code - buf <= tramp_size);
-       g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_TRAMPOLINE_UNWINDINFO_SIZE(0)));
-
-       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
-
-       return buf;
-}
-#endif /* !DISABLE_JIT */
-
 /*
  * mono_arch_get_call_target:
  *
@@ -1207,13 +1123,6 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo
        return NULL;
 }
 
-gpointer
-mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-        g_assert_not_reached ();
-        return NULL;
-}
-
 void
 mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg)
 {
index 935a2ee6882c14839f1b5bd6e6c3721c826990a7..bf2c9c91447c7b97dc15a180698becb1a13410fc 100644 (file)
@@ -89,13 +89,6 @@ mono_arch_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint8 *a
        *(guint8**)jump_entry = addr;
 }
 
-gpointer
-mono_arm_handler_block_trampoline_helper (gpointer *ptr)
-{
-       MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
-       return jit_tls->handler_block_return_address;
-}
-
 #ifndef DISABLE_JIT
 
 #define arm_is_imm12(v) ((int)(v) > -4096 && (int)(v) < 4096)
@@ -692,62 +685,6 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo
        return buf;
 }
 
-gpointer
-mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       guint8 *tramp;
-       guint8 *code, *buf;
-       int tramp_size = 64;
-       MonoJumpInfo *ji = NULL;
-       GSList *unwind_ops = NULL;
-
-       code = buf = mono_global_codeman_reserve (tramp_size);
-
-       unwind_ops = mono_arch_get_cie_program ();
-
-       tramp = mono_arch_create_specific_trampoline (NULL, MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD, NULL, NULL);
-
-       /*
-       This trampoline restore the call chain of the handler block then jumps into the code that deals with it.
-       */
-
-       /*
-        * We are in a method frame after the call emitted by OP_CALL_HANDLER.
-        */
-       /* Obtain jit_tls->handler_block_return_address */
-       if (aot) {
-               code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_R0, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_arm_handler_block_trampoline_helper");
-       } else {
-               ARM_LDR_IMM (code, ARMREG_R0, ARMREG_PC, 0);
-               ARM_B (code, 0);
-               *(gpointer*)code = mono_arm_handler_block_trampoline_helper;
-               code += 4;
-       }
-       ARM_BLX_REG (code, ARMREG_R0);
-       /* Set it as the return address so the trampoline will return to it */
-       ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_R0);
-
-       /* Call the trampoline */
-       if (aot) {
-               char *name = g_strdup_printf ("trampoline_func_%d", MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD);
-               code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_R0, MONO_PATCH_INFO_JIT_ICALL_ADDR, name);
-               code = emit_bx (code, ARMREG_R0);
-       } else {
-               ARM_LDR_IMM (code, ARMREG_R0, ARMREG_PC, 0);
-               code = emit_bx (code, ARMREG_R0);
-               *(gpointer*)code = tramp;
-               code += 4;
-       }
-
-       mono_arch_flush_icache (buf, code - buf);
-       MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL));
-       g_assert (code - buf <= tramp_size);
-
-       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
-
-       return buf;
-}
-
 guint8*
 mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gboolean aot)
 {
@@ -1028,13 +965,6 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info
        return NULL;
 }
 
-gpointer
-mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       g_assert_not_reached ();
-       return NULL;
-}
-
 guint8*
 mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gboolean aot)
 {
index be10117bbe7a049007042c451f2b6359f26f62f3..a09fed858fe73688f99cc3924a6c11637d7a10fd 100644 (file)
@@ -97,13 +97,6 @@ mono_arch_get_plt_info_offset (guint8 *plt_entry, mgreg_t *regs, guint8 *code)
        return ((guint32*)plt_entry) [4];
 }
 
-gpointer
-mono_arm_handler_block_trampoline_helper (gpointer *ptr)
-{
-       MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
-       return jit_tls->handler_block_return_address;
-}
-
 #ifndef DISABLE_JIT
 
 guchar*
@@ -519,54 +512,6 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo
        return buf;
 }
 
-gpointer
-mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       guint8 *tramp;
-       guint8 *code, *buf;
-       int tramp_size = 64;
-       MonoJumpInfo *ji = NULL;
-       GSList *unwind_ops = NULL;
-
-       code = buf = mono_global_codeman_reserve (tramp_size);
-
-       unwind_ops = NULL;
-
-       /*
-       This trampoline restore the call chain of the handler block then jumps into the code that deals with it.
-       */
-
-       /*
-        * We are in a method frame after the call emitted by OP_CALL_HANDLER.
-        */
-       /* Call a helper to obtain jit_tls->handler_block_return_address */
-       if (aot)
-               code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_IP0, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_arm_handler_block_trampoline_helper");
-       else
-               code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)mono_arm_handler_block_trampoline_helper);
-       arm_blrx (code, ARMREG_IP0);
-       /* Set it as the return address so the trampoline will return to it */
-       arm_movx (code, ARMREG_LR, ARMREG_R0);
-
-       /* Call the C trampoline function */
-       if (aot) {
-               char *name = g_strdup_printf ("trampoline_func_%d", MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD);
-               code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_IP0, MONO_PATCH_INFO_JIT_ICALL_ADDR, name);
-       } else {
-               tramp = mono_arch_create_specific_trampoline (NULL, MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD, NULL, NULL);
-               code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)tramp);
-       }
-       arm_brx (code, ARMREG_IP0);
-
-       mono_arch_flush_icache (buf, code - buf);
-       MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL));
-       g_assert (code - buf <= tramp_size);
-
-       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
-
-       return buf;
-}
-
 /*
  * mono_arch_create_sdb_trampoline:
  *
@@ -836,13 +781,6 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty
        return NULL;
 }
 
-gpointer
-mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-        g_assert_not_reached ();
-        return NULL;
-}
-
 gpointer
 mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr)
 {
index b0333d3cf18a92c3cfbca8fdec243131d1216168..91aed0b96e22801406dbc4482762d9e10cc4d63b 100644 (file)
@@ -190,8 +190,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
                
        code = buf = mono_global_codeman_reserve(512);
                
-       if ((tramp_type == MONO_TRAMPOLINE_JUMP) ||
-           (tramp_type == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD)) 
+       if (tramp_type == MONO_TRAMPOLINE_JUMP) 
                has_caller = 0;
        else
                has_caller = 1;
@@ -587,64 +586,3 @@ mono_arch_get_static_rgctx_trampoline (gpointer arg,
 }      
 
 /*========================= End of Function ========================*/
-
-/*------------------------------------------------------------------*/
-/*                                                                  */
-/* Name                - handler_block_trampoline_helper                   */
-/*                                                                  */
-/* Function    -                                                   */
-/*                                                                  */
-/*------------------------------------------------------------------*/
-
-static void
-handler_block_trampoline_helper (gpointer *ptr)
-{
-       MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
-       *ptr = jit_tls->handler_block_return_address;
-}
-
-/*========================= End of Function ========================*/
-
-/*------------------------------------------------------------------*/
-/*                                                                  */
-/* Name                - mono_arch_create_handler_block_trampoline         */
-/*                                                                  */
-/* Function    -                                                   */
-/*                                                                  */
-/*------------------------------------------------------------------*/
-
-gpointer
-mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       guint8 *tramp = mono_get_trampoline_code (MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD);
-       guint8 *code, *buf;
-       int tramp_size = 64;
-       MonoJumpInfo *ji = NULL;
-       GSList *unwind_ops = NULL;
-
-       g_assert (!aot);
-
-       code = buf = mono_global_codeman_reserve (tramp_size);
-
-       /*
-        * This trampoline restore the call chain of the handler block 
-        * then jumps into the code that deals with it.
-        */
-
-       /*
-        * Slow path uses a C helper
-        */
-       S390_SET  (code, s390_r2, tramp);
-       S390_SET  (code, s390_r1, handler_block_trampoline_helper);
-       s390_br   (code, s390_r1);
-
-       mono_arch_flush_icache (buf, code - buf);
-       MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL));
-       g_assert (code - buf <= tramp_size);
-
-       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
-
-       return buf;
-}
-
-/*========================= End of Function ========================*/
index 6d2ba621ea9af056ea479fa475b5ca87ebb805e3..bced9017f43deb62af57f101446bf70456ae6005 100644 (file)
@@ -414,16 +414,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
                mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, cfa_offset);
                x86_ret (code);
        } else {
-               /* The trampoline argument is at the top of the stack, and it contains the address we need to branch to */
-               if (tramp_type == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD) {
-                       x86_pop_reg (code, X86_EAX);
-                       cfa_offset -= sizeof (mgreg_t);
-                       mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, cfa_offset);
-                       x86_alu_reg_imm (code, X86_ADD, X86_ESP, 0x8);
-                       x86_jump_reg (code, X86_EAX);
-               } else {
-                       x86_ret (code);
-               }
+               x86_ret (code);
        }
 
        g_assert ((code - buf) <= 256);
@@ -608,65 +599,6 @@ mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg)
        x86_call_code (code, (guint8*)func);
 }
 
-static gpointer
-handler_block_trampoline_helper (void)
-{
-       MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
-       return jit_tls->handler_block_return_address;
-}
-
-gpointer
-mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       guint8 *tramp = mono_get_trampoline_code (MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD);
-       guint8 *code, *buf;
-       int tramp_size = 64;
-       MonoJumpInfo *ji = NULL;
-       int cfa_offset;
-       GSList *unwind_ops = NULL;
-
-       g_assert (!aot);
-
-       code = buf = mono_global_codeman_reserve (tramp_size);
-
-       unwind_ops = mono_arch_get_cie_program ();
-       cfa_offset = sizeof (mgreg_t);
-       /*
-       This trampoline restore the call chain of the handler block then jumps into the code that deals with it.
-       */
-
-       /*
-        * We are in a method frame after the call emitted by OP_CALL_HANDLER.
-        */
-
-       /*Slow path uses a c helper*/
-       x86_call_code (code, handler_block_trampoline_helper);
-       /* Simulate a call */
-       /*Fix stack alignment*/
-       x86_alu_reg_imm (code, X86_SUB, X86_ESP, 0x4);
-       cfa_offset += sizeof (mgreg_t);
-       mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, cfa_offset);
-
-       /* This is the address the trampoline will return to */
-       x86_push_reg (code, X86_EAX);
-       cfa_offset += sizeof (mgreg_t);
-       mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, cfa_offset);
-
-       /* Dummy trampoline argument, since we call the generic trampoline directly */
-       x86_push_imm (code, 0);
-       cfa_offset += sizeof (mgreg_t);
-       mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, cfa_offset);
-       x86_jump_code (code, tramp);
-
-       mono_arch_flush_icache (buf, code - buf);
-       MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL));
-       g_assert (code - buf <= tramp_size);
-
-       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
-
-       return buf;
-}
-
 guint8*
 mono_arch_get_call_target (guint8 *code)
 {
index ee8f4f79061c26081ef606cd010e4afd5d79bc0e..7d88f7da640f9ed10b62d915ac05ed5a81b6a4f2 100644 (file)
@@ -28,7 +28,6 @@
 #include <glib.h>
 #include "mini.h"
 
-#if !defined(DISABLE_AOT) && !defined(DISABLE_JIT) && USE_BIN_WRITER
 #include <sys/types.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -50,6 +49,9 @@
 #include <sys/stat.h>
 
 #include "image-writer.h"
+
+#if !defined(DISABLE_AOT) && !defined(DISABLE_JIT) && USE_BIN_WRITER
+
 #include "dwarfwriter.h"
 
 #include "mono/utils/mono-compiler.h"
@@ -339,6 +341,10 @@ mono_save_xdebug_info (MonoCompile *cfg)
 void
 mono_save_trampoline_xdebug_info (MonoTrampInfo *info)
 {
+       const char *info_name = info->name;
+       if (info_name == NULL)
+               info_name = "";
+
        if (use_gdb_interface) {
                MonoImageWriter *w;
                MonoDwarfWriter *dw;
@@ -348,7 +354,7 @@ mono_save_trampoline_xdebug_info (MonoTrampInfo *info)
 
                xdebug_begin_emit (&w, &dw);
 
-               mono_dwarf_writer_emit_trampoline (dw, info->name, NULL, NULL, info->code, info->code_size, info->unwind_ops);
+               mono_dwarf_writer_emit_trampoline (dw, info_name, NULL, NULL, info->code, info->code_size, info->unwind_ops);
 
                xdebug_end_emit (w, dw, NULL);
                
@@ -358,7 +364,7 @@ mono_save_trampoline_xdebug_info (MonoTrampInfo *info)
                        return;
 
                mono_loader_lock_if_inited ();
-               mono_dwarf_writer_emit_trampoline (xdebug_writer, info->name, NULL, NULL, info->code, info->code_size, info->unwind_ops);
+               mono_dwarf_writer_emit_trampoline (xdebug_writer, info_name, NULL, NULL, info->code, info->code_size, info->unwind_ops);
                fflush (xdebug_fp);
                mono_loader_unlock_if_inited ();
        }
index d2b227d826c6263ba8eecf84487fb1087a18bce0..ea2dc1b23fa174995584fc949a38644c5f626e94 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * mono-profiler-aot.c: Ahead of Time Compiler Profiler for Mono.
+ * aot.c: Ahead of Time Compiler Profiler for Mono.
  *
  *
  * Copyright 2008-2009 Novell, Inc (http://www.novell.com)
@@ -112,19 +112,19 @@ match_option (const char* p, const char *opt, char **rval)
 }
 
 void
-mono_profiler_init (const char *desc);
+mono_profiler_init_aot (const char *desc);
 
 /**
- * mono_profiler_init:
+ * mono_profiler_init_aot:
  * the entry point
  */
 void
-mono_profiler_init (const char *desc)
+mono_profiler_init_aot (const char *desc)
 {
        MonoProfiler *prof;
        const char *p;
        const char *opt;
-       char *outfile_name;
+       char *outfile_name = NULL;
 
        p = desc;
        if (strncmp (p, "aot", 3))
@@ -167,7 +167,7 @@ mono_profiler_init (const char *desc)
 
        mono_os_mutex_init (&mutex);
 
-       MonoProfilerHandle handle = mono_profiler_install (prof);
+       MonoProfilerHandle handle = mono_profiler_create (prof);
        mono_profiler_set_runtime_shutdown_end_callback (handle, prof_shutdown);
        mono_profiler_set_jit_done_callback (handle, prof_jit_leave);
 }
index 89a30193179607755687a9ec8d57a672f061e855..b2ce8871001a0490c090aeea306aa3f09646a80d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * mono-profiler-iomap.c: IOMAP string profiler for Mono.
+ * iomap.c: IOMAP string profiler for Mono.
  *
  * Authors:
  *   Marek Habersack <mhabersack@novell.com>
@@ -92,7 +92,7 @@ static inline gchar *build_hint (SavedString *head);
 static inline gchar *build_hint_from_stack (MonoDomain *domain, void **stack, gint stack_entries);
 static inline void store_string_location (MonoProfiler *prof, const gchar *string, guint32 hash, size_t len);
 static void mono_portability_remember_string (MonoProfiler *prof, MonoDomain *domain, MonoString *str);
-void mono_profiler_init (const char *desc);
+void mono_profiler_init_iomap (const char *desc);
 
 static void mismatched_stats_foreach_func (gpointer key, gpointer value, gpointer user_data)
 {
@@ -531,7 +531,7 @@ static void profiler_shutdown (MonoProfiler *prof)
        mono_os_mutex_destroy (&mismatched_files_section);
 }
 
-void mono_profiler_init (const char *desc)
+void mono_profiler_init_iomap (const char *desc)
 {
        MonoProfiler *prof = g_new0 (MonoProfiler, 1);
 
@@ -540,7 +540,7 @@ void mono_profiler_init (const char *desc)
        prof->saved_strings_hash = g_hash_table_new (NULL, NULL);
        prof->string_locations_hash = g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal);
 
-       MonoProfilerHandle handle = mono_profiler_install (prof);
+       MonoProfilerHandle handle = mono_profiler_create (prof);
        mono_profiler_set_runtime_shutdown_end_callback (handle, profiler_shutdown);
        mono_profiler_set_runtime_initialized_callback (handle, runtime_initialized_cb);
        mono_profiler_set_iomap_report_callback (handle, mono_portability_iomap_event);
index a7d71f3202b726ae8448692c8716578a1dfd5ca2..8f56a644ac7bb9678f3405b6ebd154fea8f85ed3 100644 (file)
@@ -1,67 +1,36 @@
 #include <config.h>
-
+#include <mono/utils/mono-logger-internals.h>
+#include <mono/utils/mono-proclib.h>
 #include "log.h"
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
-#ifdef HAVE_SCHED_GETAFFINITY
-#include <sched.h>
-
-#  ifndef GLIBC_HAS_CPU_COUNT
-static int
-CPU_COUNT(cpu_set_t *set)
-{
-       int i, count = 0;
-
-       for (int i = 0; i < CPU_SETSIZE; i++)
-               if (CPU_ISSET(i, set))
-                       count++;
-       return count;
-}
-#  endif
-#endif
-
 typedef struct {
        const char *event_name;
        const int mask;
 } NameAndMask;
 
 static NameAndMask event_list[] = {
-       { "domain", PROFLOG_DOMAIN_EVENTS },
-       { "assembly", PROFLOG_ASSEMBLY_EVENTS },
-       { "module", PROFLOG_MODULE_EVENTS },
-       { "class", PROFLOG_CLASS_EVENTS },
-       { "jit", PROFLOG_JIT_COMPILATION_EVENTS },
        { "exception", PROFLOG_EXCEPTION_EVENTS },
-       { "gcalloc", PROFLOG_ALLOCATION_EVENTS },
-       { "gc", PROFLOG_GC_EVENTS },
-       { "thread", PROFLOG_THREAD_EVENTS },
-       { "calls", PROFLOG_CALL_EVENTS },
-       //{ "inscov", PROFLOG_INS_COVERAGE_EVENTS }, //this is a profiler API event, but there's no actual event for us to emit here
-       //{ "sampling", PROFLOG_SAMPLING_EVENTS }, //it makes no sense to enable/disable this event by itself
        { "monitor", PROFLOG_MONITOR_EVENTS },
-       { "gcmove", PROFLOG_GC_MOVES_EVENTS },
+       { "gc", PROFLOG_GC_EVENTS },
+       { "gcalloc", PROFLOG_GC_ALLOCATION_EVENTS },
+       { "gcmove", PROFLOG_GC_MOVE_EVENTS },
        { "gcroot", PROFLOG_GC_ROOT_EVENTS },
-       { "context", PROFLOG_CONTEXT_EVENTS },
-       { "finalization", PROFLOG_FINALIZATION_EVENTS },
-       { "counter", PROFLOG_COUNTER_EVENTS },
        { "gchandle", PROFLOG_GC_HANDLE_EVENTS },
+       { "finalization", PROFLOG_GC_FINALIZATION_EVENTS },
+       { "counter", PROFLOG_COUNTER_EVENTS },
+       { "jit", PROFLOG_JIT_EVENTS },
 
-       { "typesystem", PROFLOG_TYPELOADING_ALIAS },
-       { "coverage", PROFLOG_CODECOV_ALIAS },
-       //{ "sample", PROFLOG_PERF_SAMPLING_ALIAS }, //takes args, explicitly handles
-       { "alloc", PROFLOG_GC_ALLOC_ALIAS },
-       //{ "heapshot", PROFLOG_HEAPSHOT_ALIAS }, //takes args, explicitly handled
+       { "alloc", PROFLOG_ALLOC_ALIAS },
        { "legacy", PROFLOG_LEGACY_ALIAS },
 };
 
 static void usage (void);
 static void set_hsmode (ProfilerConfig *config, const char* val);
 static void set_sample_freq (ProfilerConfig *config, const char *val);
-static int mono_cpu_count (void);
-
 
 static gboolean
 match_option (const char *arg, const char *opt_name, const char **rval)
@@ -94,19 +63,25 @@ parse_arg (const char *arg, ProfilerConfig *config)
                config->do_report = TRUE;
        } else if (match_option (arg, "debug", NULL)) {
                config->do_debug = TRUE;
-       } else if (match_option (arg, "debug-coverage", NULL)) {
-               config->debug_coverage = TRUE;
-       } else if (match_option (arg, "sampling-real", NULL)) {
-               config->sampling_mode = MONO_PROFILER_SAMPLE_MODE_REAL;
-       } else if (match_option (arg, "sampling-process", NULL)) {
-               config->sampling_mode = MONO_PROFILER_SAMPLE_MODE_PROCESS;
        } else if (match_option (arg, "heapshot", &val)) {
-               config->enable_mask |= PROFLOG_HEAPSHOT_ALIAS;
                set_hsmode (config, val);
+               if (config->hs_mode != MONO_PROFILER_HEAPSHOT_NONE)
+                       config->enable_mask |= PROFLOG_HEAPSHOT_ALIAS;
+       } else if (match_option (arg, "heapshot-on-shutdown", NULL)) {
+               config->hs_on_shutdown = TRUE;
+               config->enable_mask |= PROFLOG_HEAPSHOT_ALIAS;
        } else if (match_option (arg, "sample", &val)) {
                set_sample_freq (config, val);
-               if (config->sample_freq)
-                       config->enable_mask |= PROFLOG_PERF_SAMPLING_ALIAS;
+               config->sampling_mode = MONO_PROFILER_SAMPLE_MODE_PROCESS;
+               config->enable_mask |= PROFLOG_SAMPLE_EVENTS;
+       } else if (match_option (arg, "sample-real", &val)) {
+               set_sample_freq (config, val);
+               config->sampling_mode = MONO_PROFILER_SAMPLE_MODE_REAL;
+               config->enable_mask |= PROFLOG_SAMPLE_EVENTS;
+       } else if (match_option (arg, "calls", NULL)) {
+               config->enter_leave = TRUE;
+       } else if (match_option (arg, "coverage", NULL)) {
+               config->collect_coverage = TRUE;
        } else if (match_option (arg, "zip", NULL)) {
                config->use_zip = TRUE;
        } else if (match_option (arg, "output", &val)) {
@@ -119,7 +94,6 @@ parse_arg (const char *arg, ProfilerConfig *config)
                int num_frames = strtoul (val, &end, 10);
                if (num_frames > MAX_FRAMES)
                        num_frames = MAX_FRAMES;
-               config->notraces = num_frames == 0;
                config->num_frames = num_frames;
        } else if (match_option (arg, "maxsamples", &val)) {
                char *end;
@@ -145,9 +119,9 @@ parse_arg (const char *arg, ProfilerConfig *config)
                                break;
                        }
                }
-               if (i == G_N_ELEMENTS (event_list)) {
-                       printf ("Could not parse argument %s\n", arg);
-               }
+
+               if (i == G_N_ELEMENTS (event_list))
+                       mono_profiler_printf_err ("Could not parse argument: %s", arg);
        }
 }
 
@@ -157,7 +131,7 @@ load_args_from_env_or_default (ProfilerConfig *config)
        //XXX change this to header constants
 
        config->max_allocated_sample_hits = mono_cpu_count () * 1000;
-       config->sampling_mode = MONO_PROFILER_SAMPLE_MODE_PROCESS;
+       config->sampling_mode = MONO_PROFILER_SAMPLE_MODE_NONE;
        config->sample_freq = 100;
        config->max_call_depth = 100;
        config->num_frames = MAX_FRAMES;
@@ -227,183 +201,88 @@ proflog_parse_args (ProfilerConfig *config, const char *desc)
 static void
 set_hsmode (ProfilerConfig *config, const char* val)
 {
-       char *end;
-       unsigned int count;
-       if (!val)
+       if (!val) {
+               config->hs_mode = MONO_PROFILER_HEAPSHOT_MAJOR;
                return;
+       }
+
        if (strcmp (val, "ondemand") == 0) {
-               config->hs_mode_ondemand = TRUE;
+               config->hs_mode = MONO_PROFILER_HEAPSHOT_ON_DEMAND;
                return;
        }
 
-       count = strtoul (val, &end, 10);
+       char *end;
+
+       unsigned int count = strtoul (val, &end, 10);
+
        if (val == end) {
                usage ();
                return;
        }
 
-       if (strcmp (end, "ms") == 0)
-               config->hs_mode_ms = count;
-       else if (strcmp (end, "gc") == 0)
-               config->hs_mode_gc = count;
-       else
+       if (strcmp (end, "ms") == 0) {
+               config->hs_mode = MONO_PROFILER_HEAPSHOT_X_MS;
+               config->hs_freq_ms = count;
+       } else if (strcmp (end, "gc") == 0) {
+               config->hs_mode = MONO_PROFILER_HEAPSHOT_X_GC;
+               config->hs_freq_gc = count;
+       } else
                usage ();
 }
 
-/*
-Sampling frequency allows for one undocumented, hidden and ignored argument. The sampling kind.
-Back in the day when this was done using perf, we could specify one of: cycles,instr,cacherefs,cachemiss,branches,branchmiss
-With us moving ot userland sampling, those options are now meaningless.
-*/
 static void
 set_sample_freq (ProfilerConfig *config, const char *val)
 {
        if (!val)
                return;
 
-       const char *p = val;
-
-       // Is it only the frequency (new option style)?
-       if (isdigit (*p))
-               goto parse;
-
-       // Skip the sample type for backwards compatibility.
-       while (isalpha (*p))
-               p++;
-
-       // Skip the forward slash only if we got a sample type.
-       if (p != val && *p == '/') {
-               p++;
-
-               char *end;
-
-       parse:
-               config->sample_freq = strtoul (p, &end, 10);
+       char *end;
 
-               if (p == end) {
-                       usage ();
-                       return; 
-               }
+       int freq = strtoul (val, &end, 10);
 
-               p = end;
+       if (val == end) {
+               usage ();
+               return;
        }
 
-       if (*p)
-               usage ();
+       config->sample_freq = freq;
 }
 
 static void
 usage (void)
 {
-       printf ("Log profiler version %d.%d (format: %d)\n", LOG_VERSION_MAJOR, LOG_VERSION_MINOR, LOG_DATA_VERSION);
-       printf ("Usage: mono --profile=log[:OPTION1[,OPTION2...]] program.exe\n");
-       printf ("Options:\n");
-       printf ("\thelp                 show this usage info\n");
-       printf ("\t[no]'event'          enable/disable a profiling event. Valid values: domain, assembly, module, class, jit, exception, gcalloc, gc, thread, monitor, gcmove, gcroot, context, finalization, counter, gchandle\n");
-       printf ("\t[no]typesystem       enable/disable typesystem related events such as class and assembly loading\n");
-       printf ("\t[no]alloc            enable/disable recording allocation info\n");
-       printf ("\t[no]calls            enable/disable recording enter/leave method events\n");
-       printf ("\t[no]legacy           enable/disable pre mono 5.4 default profiler events\n");
-       printf ("\tsample[=frequency]   enable/disable statistical sampling of threads (frequency in Hz, 100 by default)\n");
-       printf ("\theapshot[=MODE]      record heap shot info (by default at each major collection)\n");
-       printf ("\t                     MODE: every XXms milliseconds, every YYgc collections, ondemand\n");
-       printf ("\t[no]coverage         enable collection of code coverage data\n");
-       printf ("\tcovfilter=ASSEMBLY   add an assembly to the code coverage filters\n");
-       printf ("\t                     add a + to include the assembly or a - to exclude it\n");
-       printf ("\t                     covfilter=-mscorlib\n");
-       printf ("\tcovfilter-file=FILE  use FILE to generate the list of assemblies to be filtered\n");
-       printf ("\tmaxframes=NUM        collect up to NUM stack frames\n");
-       printf ("\tcalldepth=NUM        ignore method events for call chain depth bigger than NUM\n");
-       printf ("\toutput=FILENAME      write the data to file FILENAME (The file is always overwriten)\n");
-       printf ("\toutput=+FILENAME     write the data to file FILENAME.pid (The file is always overwriten)\n");
-       printf ("\toutput=|PROGRAM      write the data to the stdin of PROGRAM\n");
-       printf ("\t                     %%t is subtituted with date and time, %%p with the pid\n");
-       printf ("\treport               create a report instead of writing the raw data to a file\n");
-       printf ("\tzip                  compress the output data\n");
-       printf ("\tport=PORTNUM         use PORTNUM for the listening command server\n");
-}
-
-static int
-mono_cpu_count (void)
-{
-#ifdef PLATFORM_ANDROID
-       /* Android tries really hard to save power by powering off CPUs on SMP phones which
-        * means the normal way to query cpu count returns a wrong value with userspace API.
-        * Instead we use /sys entries to query the actual hardware CPU count.
-        */
-       int count = 0;
-       char buffer[8] = {'\0'};
-       int present = open ("/sys/devices/system/cpu/present", O_RDONLY);
-       /* Format of the /sys entry is a cpulist of indexes which in the case
-        * of present is always of the form "0-(n-1)" when there is more than
-        * 1 core, n being the number of CPU cores in the system. Otherwise
-        * the value is simply 0
-        */
-       if (present != -1 && read (present, (char*)buffer, sizeof (buffer)) > 3)
-               count = strtol (((char*)buffer) + 2, NULL, 10);
-       if (present != -1)
-               close (present);
-       if (count > 0)
-               return count + 1;
-#endif
-
-#if defined(HOST_ARM) || defined (HOST_ARM64)
-
-       /* ARM platforms tries really hard to save power by powering off CPUs on SMP phones which
-        * means the normal way to query cpu count returns a wrong value with userspace API. */
-
-#ifdef _SC_NPROCESSORS_CONF
-       {
-               int count = sysconf (_SC_NPROCESSORS_CONF);
-               if (count > 0)
-                       return count;
-       }
-#endif
-
-#else
-
-#ifdef HAVE_SCHED_GETAFFINITY
-       {
-               cpu_set_t set;
-               if (sched_getaffinity (getpid (), sizeof (set), &set) == 0)
-                       return CPU_COUNT (&set);
-       }
-#endif
-#ifdef _SC_NPROCESSORS_ONLN
-       {
-               int count = sysconf (_SC_NPROCESSORS_ONLN);
-               if (count > 0)
-                       return count;
-       }
-#endif
-
-#endif /* defined(HOST_ARM) || defined (HOST_ARM64) */
-
-#ifdef USE_SYSCTL
-       {
-               int count;
-               int mib [2];
-               size_t len = sizeof (int);
-               mib [0] = CTL_HW;
-               mib [1] = HW_NCPU;
-               if (sysctl (mib, 2, &count, &len, NULL, 0) == 0)
-                       return count;
-       }
-#endif
-#ifdef HOST_WIN32
-       {
-               SYSTEM_INFO info;
-               GetSystemInfo (&info);
-               return info.dwNumberOfProcessors;
-       }
-#endif
-
-       static gboolean warned;
-
-       if (!warned) {
-               g_warning ("Don't know how to determine CPU count on this platform; assuming 1");
-               warned = TRUE;
-       }
-
-       return 1;
+       mono_profiler_printf ("Mono log profiler version %d.%d (format: %d)", LOG_VERSION_MAJOR, LOG_VERSION_MINOR, LOG_DATA_VERSION);
+       mono_profiler_printf ("Usage: mono --profile=log[:OPTION1[,OPTION2...]] program.exe\n");
+       mono_profiler_printf ("Options:");
+       mono_profiler_printf ("\thelp                 show this usage info");
+       mono_profiler_printf ("\t[no]'EVENT'          enable/disable an individual profiling event");
+       mono_profiler_printf ("\t                     valid EVENT values:");
+
+       for (int i = 0; i < G_N_ELEMENTS (event_list); i++)
+               mono_profiler_printf ("\t                         %s", event_list [i].event_name);
+
+       mono_profiler_printf ("\t[no]alloc            enable/disable recording allocation info");
+       mono_profiler_printf ("\t[no]legacy           enable/disable pre mono 5.4 default profiler events");
+       mono_profiler_printf ("\tsample[-real][=FREQ] enable/disable statistical sampling of threads");
+       mono_profiler_printf ("\t                     FREQ in Hz, 100 by default");
+       mono_profiler_printf ("\t                     the -real variant uses wall clock time instead of process time");
+       mono_profiler_printf ("\theapshot[=MODE]      record heapshot info (by default at each major collection)");
+       mono_profiler_printf ("\t                     MODE: every XXms milliseconds, every YYgc collections, ondemand");
+       mono_profiler_printf ("\theapshot-on-shutdown do a heapshot on runtime shutdown");
+       mono_profiler_printf ("\t                     this option is independent of the above option");
+       mono_profiler_printf ("\tcalls                enable recording enter/leave method events (very heavy)");
+       mono_profiler_printf ("\tcoverage             enable collection of code coverage data");
+       mono_profiler_printf ("\tcovfilter=ASSEMBLY   add ASSEMBLY to the code coverage filters");
+       mono_profiler_printf ("\t                     prefix a + to include the assembly or a - to exclude it");
+       mono_profiler_printf ("\t                     e.g. covfilter=-mscorlib");
+       mono_profiler_printf ("\tcovfilter-file=FILE  use FILE to generate the list of assemblies to be filtered");
+       mono_profiler_printf ("\tmaxframes=NUM        collect up to NUM stack frames");
+       mono_profiler_printf ("\tcalldepth=NUM        ignore method events for call chain depth bigger than NUM");
+       mono_profiler_printf ("\toutput=FILENAME      write the data to file FILENAME (the file is always overwritten)");
+       mono_profiler_printf ("\toutput=+FILENAME     write the data to file FILENAME.pid (the file is always overwritten)");
+       mono_profiler_printf ("\toutput=|PROGRAM      write the data to the stdin of PROGRAM");
+       mono_profiler_printf ("\t                     %%t is substituted with date and time, %%p with the pid");
+       mono_profiler_printf ("\treport               create a report instead of writing the raw data to a file");
+       mono_profiler_printf ("\tzip                  compress the output data");
+       mono_profiler_printf ("\tport=PORTNUM         use PORTNUM for the listening command server");
 }
index 9793f8392d851cfa69a0e0048ae5f0605919855a..8a3790aac248ed44baa2d156137da838cfb65e42 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * mono-profiler-log.c: mono log profiler
+ * log.c: mono log profiler
  *
  * Authors:
  *   Paolo Molaro (lupus@ximian.com)
 
 #include <config.h>
 #include <mono/metadata/assembly.h>
+#include <mono/metadata/class-internals.h>
 #include <mono/metadata/debug-helpers.h>
-#include "../metadata/metadata-internals.h"
+#include <mono/metadata/loader.h>
+#include <mono/metadata/metadata-internals.h>
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/mono-gc.h>
 #include <mono/metadata/mono-perfcounters.h>
+#include <mono/metadata/tabledefs.h>
 #include <mono/utils/atomic.h>
 #include <mono/utils/hazard-pointer.h>
 #include <mono/utils/lock-free-alloc.h>
 #include <mono/utils/lock-free-queue.h>
 #include <mono/utils/mono-conc-hashtable.h>
+#include <mono/utils/mono-coop-mutex.h>
 #include <mono/utils/mono-counters.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-linked-list-set.h>
 #include <mono/utils/mono-membar.h>
 #include <mono/utils/mono-mmap.h>
 #include <zlib.h>
 #endif
 
-#define BUFFER_SIZE (4096 * 16)
-
-/* Worst-case size in bytes of a 64-bit value encoded with LEB128. */
-#define LEB128_SIZE 10
-
-/* Size of a value encoded as a single byte. */
-#undef BYTE_SIZE // mach/i386/vm_param.h on OS X defines this to 8, but it isn't used for anything.
-#define BYTE_SIZE 1
-
-/* Size in bytes of the event prefix (ID + time). */
-#define EVENT_SIZE (BYTE_SIZE + LEB128_SIZE)
-
-static volatile gint32 runtime_inited;
-static volatile gint32 in_shutdown;
-
-static ProfilerConfig config;
-static int nocalls = 0;
-static int notraces = 0;
-static int use_zip = 0;
-static int do_report = 0;
-static int do_heap_shot = 0;
-static int max_call_depth = 0;
-static int command_port = 0;
-static int heapshot_requested = 0;
-static int do_mono_sample = 0;
-static int do_debug = 0;
-static int do_coverage = 0;
-static gboolean no_counters = FALSE;
-static gboolean debug_coverage = FALSE;
-static int max_allocated_sample_hits;
-
-#define ENABLED(EVT) (config.effective_mask & (EVT))
-
 // Statistics for internal profiler data structures.
 static gint32 sample_allocations_ctr,
               buffer_allocations_ctr;
@@ -141,293 +113,6 @@ static gint32 sync_points_ctr,
               coverage_classes_ctr,
               coverage_assemblies_ctr;
 
-static MonoLinkedListSet profiler_thread_list;
-
-/*
- * file format:
- * [header] [buffer]*
- *
- * The file is composed by a header followed by 0 or more buffers.
- * Each buffer contains events that happened on a thread: for a given thread
- * buffers that appear later in the file are guaranteed to contain events
- * that happened later in time. Buffers from separate threads could be interleaved,
- * though.
- * Buffers are not required to be aligned.
- *
- * header format:
- * [id: 4 bytes] constant value: LOG_HEADER_ID
- * [major: 1 byte] [minor: 1 byte] major and minor version of the log profiler
- * [format: 1 byte] version of the data format for the rest of the file
- * [ptrsize: 1 byte] size in bytes of a pointer in the profiled program
- * [startup time: 8 bytes] time in milliseconds since the unix epoch when the program started
- * [timer overhead: 4 bytes] approximate overhead in nanoseconds of the timer
- * [flags: 4 bytes] file format flags, should be 0 for now
- * [pid: 4 bytes] pid of the profiled process
- * [port: 2 bytes] tcp port for server if != 0
- * [args size: 4 bytes] size of args
- * [args: string] arguments passed to the profiler
- * [arch size: 4 bytes] size of arch
- * [arch: string] architecture the profiler is running on
- * [os size: 4 bytes] size of os
- * [os: string] operating system the profiler is running on
- *
- * The multiple byte integers are in little-endian format.
- *
- * buffer format:
- * [buffer header] [event]*
- * Buffers have a fixed-size header followed by 0 or more bytes of event data.
- * Timing information and other values in the event data are usually stored
- * as uleb128 or sleb128 integers. To save space, as noted for each item below,
- * some data is represented as a difference between the actual value and
- * either the last value of the same type (like for timing information) or
- * as the difference from a value stored in a buffer header.
- *
- * For timing information the data is stored as uleb128, since timing
- * increases in a monotonic way in each thread: the value is the number of
- * nanoseconds to add to the last seen timing data in a buffer. The first value
- * in a buffer will be calculated from the time_base field in the buffer head.
- *
- * Object or heap sizes are stored as uleb128.
- * Pointer differences are stored as sleb128, instead.
- *
- * If an unexpected value is found, the rest of the buffer should be ignored,
- * as generally the later values need the former to be interpreted correctly.
- *
- * buffer header format:
- * [bufid: 4 bytes] constant value: BUF_ID
- * [len: 4 bytes] size of the data following the buffer header
- * [time_base: 8 bytes] time base in nanoseconds since an unspecified epoch
- * [ptr_base: 8 bytes] base value for pointers
- * [obj_base: 8 bytes] base value for object addresses
- * [thread id: 8 bytes] system-specific thread ID (pthread_t for example)
- * [method_base: 8 bytes] base value for MonoMethod pointers
- *
- * event format:
- * [extended info: upper 4 bits] [type: lower 4 bits]
- * [time diff: uleb128] nanoseconds since last timing
- * [data]*
- * The data that follows depends on type and the extended info.
- * Type is one of the enum values in mono-profiler-log.h: TYPE_ALLOC, TYPE_GC,
- * TYPE_METADATA, TYPE_METHOD, TYPE_EXCEPTION, TYPE_MONITOR, TYPE_HEAP.
- * The extended info bits are interpreted based on type, see
- * each individual event description below.
- * strings are represented as a 0-terminated utf8 sequence.
- *
- * backtrace format:
- * [num: uleb128] number of frames following
- * [frame: sleb128]* mum MonoMethod* as a pointer difference from the last such
- * pointer or the buffer method_base
- *
- * type alloc format:
- * type: TYPE_ALLOC
- * exinfo: zero or TYPE_ALLOC_BT
- * [ptr: sleb128] class as a byte difference from ptr_base
- * [obj: sleb128] object address as a byte difference from obj_base
- * [size: uleb128] size of the object in the heap
- * If exinfo == TYPE_ALLOC_BT, a backtrace follows.
- *
- * type GC format:
- * type: TYPE_GC
- * exinfo: one of TYPE_GC_EVENT, TYPE_GC_RESIZE, TYPE_GC_MOVE, TYPE_GC_HANDLE_CREATED[_BT],
- * TYPE_GC_HANDLE_DESTROYED[_BT], TYPE_GC_FINALIZE_START, TYPE_GC_FINALIZE_END,
- * TYPE_GC_FINALIZE_OBJECT_START, TYPE_GC_FINALIZE_OBJECT_END
- * if exinfo == TYPE_GC_RESIZE
- *     [heap_size: uleb128] new heap size
- * if exinfo == TYPE_GC_EVENT
- *     [event type: byte] GC event (MONO_GC_EVENT_* from profiler.h)
- *     [generation: byte] GC generation event refers to
- * if exinfo == TYPE_GC_MOVE
- *     [num_objects: uleb128] number of object moves that follow
- *     [objaddr: sleb128]+ num_objects object pointer differences from obj_base
- *     num is always an even number: the even items are the old
- *     addresses, the odd numbers are the respective new object addresses
- * if exinfo == TYPE_GC_HANDLE_CREATED[_BT]
- *     [handle_type: uleb128] MonoGCHandleType enum value
- *     upper bits reserved as flags
- *     [handle: uleb128] GC handle value
- *     [objaddr: sleb128] object pointer differences from obj_base
- *     If exinfo == TYPE_GC_HANDLE_CREATED_BT, a backtrace follows.
- * if exinfo == TYPE_GC_HANDLE_DESTROYED[_BT]
- *     [handle_type: uleb128] MonoGCHandleType enum value
- *     upper bits reserved as flags
- *     [handle: uleb128] GC handle value
- *     If exinfo == TYPE_GC_HANDLE_DESTROYED_BT, a backtrace follows.
- * if exinfo == TYPE_GC_FINALIZE_OBJECT_{START,END}
- *     [object: sleb128] the object as a difference from obj_base
- *
- * type metadata format:
- * type: TYPE_METADATA
- * exinfo: one of: TYPE_END_LOAD, TYPE_END_UNLOAD (optional for TYPE_THREAD and TYPE_DOMAIN,
- * doesn't occur for TYPE_CLASS)
- * [mtype: byte] metadata type, one of: TYPE_CLASS, TYPE_IMAGE, TYPE_ASSEMBLY, TYPE_DOMAIN,
- * TYPE_THREAD, TYPE_CONTEXT
- * [pointer: sleb128] pointer of the metadata type depending on mtype
- * if mtype == TYPE_CLASS
- *     [image: sleb128] MonoImage* as a pointer difference from ptr_base
- *     [name: string] full class name
- * if mtype == TYPE_IMAGE
- *     [name: string] image file name
- * if mtype == TYPE_ASSEMBLY
- *     [image: sleb128] MonoImage* as a pointer difference from ptr_base
- *     [name: string] assembly name
- * if mtype == TYPE_DOMAIN && exinfo == 0
- *     [name: string] domain friendly name
- * if mtype == TYPE_CONTEXT
- *     [domain: sleb128] domain id as pointer
- * if mtype == TYPE_THREAD && exinfo == 0
- *     [name: string] thread name
- *
- * type method format:
- * type: TYPE_METHOD
- * exinfo: one of: TYPE_LEAVE, TYPE_ENTER, TYPE_EXC_LEAVE, TYPE_JIT
- * [method: sleb128] MonoMethod* as a pointer difference from the last such
- * pointer or the buffer method_base
- * if exinfo == TYPE_JIT
- *     [code address: sleb128] pointer to the native code as a diff from ptr_base
- *     [code size: uleb128] size of the generated code
- *     [name: string] full method name
- *
- * type exception format:
- * type: TYPE_EXCEPTION
- * exinfo: zero, TYPE_CLAUSE, or TYPE_THROW_BT
- * if exinfo == TYPE_CLAUSE
- *     [clause type: byte] MonoExceptionEnum enum value
- *     [clause index: uleb128] index of the current clause
- *     [method: sleb128] MonoMethod* as a pointer difference from the last such
- *     pointer or the buffer method_base
- *     [object: sleb128] the exception object as a difference from obj_base
- * else
- *     [object: sleb128] the exception object as a difference from obj_base
- *     If exinfo == TYPE_THROW_BT, a backtrace follows.
- *
- * type runtime format:
- * type: TYPE_RUNTIME
- * exinfo: one of: TYPE_JITHELPER
- * if exinfo == TYPE_JITHELPER
- *     [type: byte] MonoProfilerCodeBufferType enum value
- *     [buffer address: sleb128] pointer to the native code as a diff from ptr_base
- *     [buffer size: uleb128] size of the generated code
- *     if type == MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE
- *             [name: string] buffer description name
- *
- * type monitor format:
- * type: TYPE_MONITOR
- * exinfo: zero or TYPE_MONITOR_BT
- * [type: byte] MonoProfilerMonitorEvent enum value
- * [object: sleb128] the lock object as a difference from obj_base
- * If exinfo == TYPE_MONITOR_BT, a backtrace follows.
- *
- * type heap format
- * type: TYPE_HEAP
- * exinfo: one of TYPE_HEAP_START, TYPE_HEAP_END, TYPE_HEAP_OBJECT, TYPE_HEAP_ROOT
- * if exinfo == TYPE_HEAP_OBJECT
- *     [object: sleb128] the object as a difference from obj_base
- *     [class: sleb128] the object MonoClass* as a difference from ptr_base
- *     [size: uleb128] size of the object on the heap
- *     [num_refs: uleb128] number of object references
- *     each referenced objref is preceded by a uleb128 encoded offset: the
- *     first offset is from the object address and each next offset is relative
- *     to the previous one
- *     [objrefs: sleb128]+ object referenced as a difference from obj_base
- *     The same object can appear multiple times, but only the first time
- *     with size != 0: in the other cases this data will only be used to
- *     provide additional referenced objects.
- * if exinfo == TYPE_HEAP_ROOT
- *     [num_roots: uleb128] number of root references
- *     [num_gc: uleb128] number of major gcs
- *     [object: sleb128] the object as a difference from obj_base
- *     [root_type: byte] the root_type: MonoProfileGCRootType (profiler.h)
- *     [extra_info: uleb128] the extra_info value
- *     object, root_type and extra_info are repeated num_roots times
- *
- * type sample format
- * type: TYPE_SAMPLE
- * exinfo: one of TYPE_SAMPLE_HIT, TYPE_SAMPLE_USYM, TYPE_SAMPLE_UBIN, TYPE_SAMPLE_COUNTERS_DESC, TYPE_SAMPLE_COUNTERS
- * if exinfo == TYPE_SAMPLE_HIT
- *     [thread: sleb128] thread id as difference from ptr_base
- *     [count: uleb128] number of following instruction addresses
- *     [ip: sleb128]* instruction pointer as difference from ptr_base
- *     [mbt_count: uleb128] number of managed backtrace frames
- *     [method: sleb128]* MonoMethod* as a pointer difference from the last such
- *     pointer or the buffer method_base (the first such method can be also indentified by ip, but this is not neccessarily true)
- * if exinfo == TYPE_SAMPLE_USYM
- *     [address: sleb128] symbol address as a difference from ptr_base
- *     [size: uleb128] symbol size (may be 0 if unknown)
- *     [name: string] symbol name
- * if exinfo == TYPE_SAMPLE_UBIN
- *     [address: sleb128] address where binary has been loaded as a difference from ptr_base
- *     [offset: uleb128] file offset of mapping (the same file can be mapped multiple times)
- *     [size: uleb128] memory size
- *     [name: string] binary name
- * if exinfo == TYPE_SAMPLE_COUNTERS_DESC
- *     [len: uleb128] number of counters
- *     for i = 0 to len
- *             [section: uleb128] section of counter
- *             if section == MONO_COUNTER_PERFCOUNTERS:
- *                     [section_name: string] section name of counter
- *             [name: string] name of counter
- *             [type: byte] type of counter
- *             [unit: byte] unit of counter
- *             [variance: byte] variance of counter
- *             [index: uleb128] unique index of counter
- * if exinfo == TYPE_SAMPLE_COUNTERS
- *     while true:
- *             [index: uleb128] unique index of counter
- *             if index == 0:
- *                     break
- *             [type: byte] type of counter value
- *             if type == string:
- *                     if value == null:
- *                             [0: byte] 0 -> value is null
- *                     else:
- *                             [1: byte] 1 -> value is not null
- *                             [value: string] counter value
- *             else:
- *                     [value: uleb128/sleb128/double] counter value, can be sleb128, uleb128 or double (determined by using type)
- *
- * type coverage format
- * type: TYPE_COVERAGE
- * exinfo: one of TYPE_COVERAGE_METHOD, TYPE_COVERAGE_STATEMENT, TYPE_COVERAGE_ASSEMBLY, TYPE_COVERAGE_CLASS
- * if exinfo == TYPE_COVERAGE_METHOD
- *  [assembly: string] name of assembly
- *  [class: string] name of the class
- *  [name: string] name of the method
- *  [signature: string] the signature of the method
- *  [filename: string] the file path of the file that contains this method
- *  [token: uleb128] the method token
- *  [method_id: uleb128] an ID for this data to associate with the buffers of TYPE_COVERAGE_STATEMENTS
- *  [len: uleb128] the number of TYPE_COVERAGE_BUFFERS associated with this method
- * if exinfo == TYPE_COVERAGE_STATEMENTS
- *  [method_id: uleb128] an the TYPE_COVERAGE_METHOD buffer to associate this with
- *  [offset: uleb128] the il offset relative to the previous offset
- *  [counter: uleb128] the counter for this instruction
- *  [line: uleb128] the line of filename containing this instruction
- *  [column: uleb128] the column containing this instruction
- * if exinfo == TYPE_COVERAGE_ASSEMBLY
- *  [name: string] assembly name
- *  [guid: string] assembly GUID
- *  [filename: string] assembly filename
- *  [number_of_methods: uleb128] the number of methods in this assembly
- *  [fully_covered: uleb128] the number of fully covered methods
- *  [partially_covered: uleb128] the number of partially covered methods
- *    currently partially_covered will always be 0, and fully_covered is the
- *    number of methods that are fully and partially covered.
- * if exinfo == TYPE_COVERAGE_CLASS
- *  [name: string] assembly name
- *  [class: string] class name
- *  [number_of_methods: uleb128] the number of methods in this class
- *  [fully_covered: uleb128] the number of fully covered methods
- *  [partially_covered: uleb128] the number of partially covered methods
- *    currently partially_covered will always be 0, and fully_covered is the
- *    number of methods that are fully and partially covered.
- *
- * type meta format:
- * type: TYPE_META
- * exinfo: one of: TYPE_SYNC_POINT
- * if exinfo == TYPE_SYNC_POINT
- *     [type: byte] MonoProfilerSyncPointType enum value
- */
-
 // Pending data to be written to the log, for a single thread.
 // Threads periodically flush their own LogBuffers by calling safe_send
 typedef struct _LogBuffer LogBuffer;
@@ -459,9 +144,6 @@ struct _LogBuffer {
 typedef struct {
        MonoLinkedListSetNode node;
 
-       // Convenience pointer to the profiler structure.
-       MonoProfiler *profiler;
-
        // Was this thread added to the LLS?
        gboolean attached;
 
@@ -531,65 +213,9 @@ process_id (void)
 #endif
 }
 
-#ifdef __APPLE__
-static mach_timebase_info_data_t timebase_info;
-#elif defined (HOST_WIN32)
-static LARGE_INTEGER pcounter_freq;
-#endif
-
-#define TICKS_PER_SEC 1000000000LL
-
-static uint64_t
-current_time (void)
-{
-#ifdef __APPLE__
-       uint64_t time = mach_absolute_time ();
-
-       time *= timebase_info.numer;
-       time /= timebase_info.denom;
-
-       return time;
-#elif defined (HOST_WIN32)
-       LARGE_INTEGER value;
-
-       QueryPerformanceCounter (&value);
-
-       return value.QuadPart * TICKS_PER_SEC / pcounter_freq.QuadPart;
-#elif defined (CLOCK_MONOTONIC)
-       struct timespec tspec;
-
-       clock_gettime (CLOCK_MONOTONIC, &tspec);
-
-       return ((uint64_t) tspec.tv_sec * TICKS_PER_SEC + tspec.tv_nsec);
-#else
-       struct timeval tv;
-
-       gettimeofday (&tv, NULL);
-
-       return ((uint64_t) tv.tv_sec * TICKS_PER_SEC + tv.tv_usec * 1000);
-#endif
-}
-
-static int timer_overhead;
-
-static void
-init_time (void)
-{
-#ifdef __APPLE__
-       mach_timebase_info (&timebase_info);
-#elif defined (HOST_WIN32)
-       QueryPerformanceFrequency (&pcounter_freq);
-#endif
-
-       uint64_t time_start = current_time ();
-
-       for (int i = 0; i < 256; ++i)
-               current_time ();
-
-       uint64_t time_end = current_time ();
-
-       timer_overhead = (time_end - time_start) / 256;
-}
+#define ENABLED(EVT) (!!(log_config.effective_mask & (EVT)))
+#define ENABLE(EVT) do { log_config.effective_mask |= (EVT); } while (0)
+#define DISABLE(EVT) do { log_config.effective_mask &= ~(EVT); } while (0)
 
 /*
  * These macros should be used when writing an event to a log buffer. They
@@ -636,40 +262,114 @@ struct _BinaryObject {
        char *name;
 };
 
-static MonoProfiler *log_profiler;
+typedef struct MonoCounterAgent {
+       MonoCounter *counter;
+       // MonoCounterAgent specific data :
+       void *value;
+       size_t value_size;
+       guint32 index;
+       gboolean emitted;
+       struct MonoCounterAgent *next;
+} MonoCounterAgent;
+
+typedef struct _PerfCounterAgent PerfCounterAgent;
+struct _PerfCounterAgent {
+       PerfCounterAgent *next;
+       guint32 index;
+       char *category_name;
+       char *name;
+       gint64 value;
+       gboolean emitted;
+       gboolean updated;
+       gboolean deleted;
+};
 
 struct _MonoProfiler {
        MonoProfilerHandle handle;
+
        FILE* file;
 #if defined (HAVE_SYS_ZLIB)
        gzFile gzfile;
 #endif
+
        char *args;
        uint64_t startup_time;
+       int timer_overhead;
+
+#ifdef __APPLE__
+       mach_timebase_info_data_t timebase_info;
+#elif defined (HOST_WIN32)
+       LARGE_INTEGER pcounter_freq;
+#endif
+
        int pipe_output;
        int command_port;
        int server_socket;
        int pipes [2];
+
+       MonoLinkedListSet profiler_thread_list;
+       volatile gint32 buffer_lock_state;
+       volatile gint32 buffer_lock_exclusive_intent;
+
+       volatile gint32 runtime_inited;
+       volatile gint32 in_shutdown;
+
        MonoNativeThreadId helper_thread;
+
        MonoNativeThreadId writer_thread;
-       MonoNativeThreadId dumper_thread;
        volatile gint32 run_writer_thread;
-       MonoLockFreeAllocSizeClass writer_entry_size_class;
-       MonoLockFreeAllocator writer_entry_allocator;
        MonoLockFreeQueue writer_queue;
        MonoSemType writer_queue_sem;
+
+       MonoLockFreeAllocSizeClass writer_entry_size_class;
+       MonoLockFreeAllocator writer_entry_allocator;
+
        MonoConcurrentHashTable *method_table;
        mono_mutex_t method_table_mutex;
+
+       MonoNativeThreadId dumper_thread;
        volatile gint32 run_dumper_thread;
        MonoLockFreeQueue dumper_queue;
        MonoSemType dumper_queue_sem;
+
        MonoLockFreeAllocSizeClass sample_size_class;
        MonoLockFreeAllocator sample_allocator;
        MonoLockFreeQueue sample_reuse_queue;
+
        BinaryObject *binary_objects;
+
+       volatile gint32 heapshot_requested;
+       guint64 gc_count;
+       guint64 last_hs_time;
+       gboolean do_heap_walk;
+
+       mono_mutex_t counters_mutex;
+       MonoCounterAgent *counters;
+       PerfCounterAgent *perfcounters;
+       guint32 counters_index;
+
+       mono_mutex_t coverage_mutex;
+       GPtrArray *coverage_data;
+
        GPtrArray *coverage_filters;
+       MonoConcurrentHashTable *coverage_filtered_classes;
+       MonoConcurrentHashTable *coverage_suppressed_assemblies;
+
+       MonoConcurrentHashTable *coverage_methods;
+       MonoConcurrentHashTable *coverage_assemblies;
+       MonoConcurrentHashTable *coverage_classes;
+
+       MonoConcurrentHashTable *coverage_image_to_methods;
+
+       guint32 coverage_previous_offset;
+       guint32 coverage_method_id;
+
+       MonoCoopMutex api_mutex;
 };
 
+static ProfilerConfig log_config;
+static struct _MonoProfiler log_profiler;
+
 typedef struct {
        MonoLockFreeQueueNode node;
        GPtrArray *methods;
@@ -684,6 +384,58 @@ typedef struct {
        uint64_t time;
 } MethodInfo;
 
+#define TICKS_PER_SEC 1000000000LL
+
+static uint64_t
+current_time (void)
+{
+#ifdef __APPLE__
+       uint64_t time = mach_absolute_time ();
+
+       time *= log_profiler.timebase_info.numer;
+       time /= log_profiler.timebase_info.denom;
+
+       return time;
+#elif defined (HOST_WIN32)
+       LARGE_INTEGER value;
+
+       QueryPerformanceCounter (&value);
+
+       return value.QuadPart * TICKS_PER_SEC / log_profiler.pcounter_freq.QuadPart;
+#elif defined (CLOCK_MONOTONIC)
+       struct timespec tspec;
+
+       clock_gettime (CLOCK_MONOTONIC, &tspec);
+
+       return ((uint64_t) tspec.tv_sec * TICKS_PER_SEC + tspec.tv_nsec);
+#else
+       struct timeval tv;
+
+       gettimeofday (&tv, NULL);
+
+       return ((uint64_t) tv.tv_sec * TICKS_PER_SEC + tv.tv_usec * 1000);
+#endif
+}
+
+static void
+init_time (void)
+{
+#ifdef __APPLE__
+       mach_timebase_info (&log_profiler.timebase_info);
+#elif defined (HOST_WIN32)
+       QueryPerformanceFrequency (&log_profiler.pcounter_freq);
+#endif
+
+       uint64_t time_start = current_time ();
+
+       for (int i = 0; i < 256; ++i)
+               current_time ();
+
+       uint64_t time_end = current_time ();
+
+       log_profiler.timer_overhead = (time_end - time_start) / 256;
+}
+
 static char*
 pstrdup (const char *s)
 {
@@ -693,6 +445,18 @@ pstrdup (const char *s)
        return p;
 }
 
+#define BUFFER_SIZE (4096 * 16)
+
+/* Worst-case size in bytes of a 64-bit value encoded with LEB128. */
+#define LEB128_SIZE 10
+
+/* Size of a value encoded as a single byte. */
+#undef BYTE_SIZE // mach/i386/vm_param.h on OS X defines this to 8, but it isn't used for anything.
+#define BYTE_SIZE 1
+
+/* Size in bytes of the event prefix (ID + time). */
+#define EVENT_SIZE (BYTE_SIZE + LEB128_SIZE)
+
 static void *
 alloc_buffer (int size)
 {
@@ -744,7 +508,7 @@ clear_hazard_pointers (MonoThreadHazardPointers *hp)
 }
 
 static MonoProfilerThread *
-init_thread (MonoProfiler *prof, gboolean add_to_lls)
+init_thread (gboolean add_to_lls)
 {
        MonoProfilerThread *thread = PROF_TLS_GET ();
 
@@ -764,7 +528,6 @@ init_thread (MonoProfiler *prof, gboolean add_to_lls)
 
        thread = g_malloc (sizeof (MonoProfilerThread));
        thread->node.key = thread_id ();
-       thread->profiler = prof;
        thread->attached = add_to_lls;
        thread->call_depth = 0;
        thread->busy = 0;
@@ -780,7 +543,7 @@ init_thread (MonoProfiler *prof, gboolean add_to_lls)
         */
        if (add_to_lls) {
                MonoThreadHazardPointers *hp = mono_hazard_pointer_get ();
-               g_assert (mono_lls_insert (&profiler_thread_list, hp, &thread->node) && "Why can't we insert the thread in the LLS?");
+               g_assert (mono_lls_insert (&log_profiler.profiler_thread_list, hp, &thread->node) && "Why can't we insert the thread in the LLS?");
                clear_hazard_pointers (hp);
        }
 
@@ -802,7 +565,7 @@ deinit_thread (MonoProfilerThread *thread)
 static MonoProfilerThread *
 get_thread (void)
 {
-       return init_thread (log_profiler, TRUE);
+       return init_thread (TRUE);
 }
 
 // Only valid if init_thread () was called with add_to_lls = FALSE.
@@ -852,8 +615,6 @@ ensure_logbuf_unsafe (MonoProfilerThread *thread, int bytes)
  *
  * The lock does not support recursion.
  */
-static volatile gint32 buffer_lock_state;
-static volatile gint32 buffer_lock_exclusive_intent;
 
 static void
 buffer_lock (void)
@@ -868,7 +629,7 @@ buffer_lock (void)
         * the exclusive lock in the gc_event () callback when the world
         * is about to stop.
         */
-       if (InterlockedRead (&buffer_lock_state) != get_thread ()->small_id << 16) {
+       if (InterlockedRead (&log_profiler.buffer_lock_state) != get_thread ()->small_id << 16) {
                MONO_ENTER_GC_SAFE;
 
                gint32 old, new_;
@@ -876,10 +637,10 @@ buffer_lock (void)
                do {
                restart:
                        // Hold off if a thread wants to take the exclusive lock.
-                       while (InterlockedRead (&buffer_lock_exclusive_intent))
+                       while (InterlockedRead (&log_profiler.buffer_lock_exclusive_intent))
                                mono_thread_info_yield ();
 
-                       old = InterlockedRead (&buffer_lock_state);
+                       old = InterlockedRead (&log_profiler.buffer_lock_state);
 
                        // Is a thread holding the exclusive lock?
                        if (old >> 16) {
@@ -888,7 +649,7 @@ buffer_lock (void)
                        }
 
                        new_ = old + 1;
-               } while (InterlockedCompareExchange (&buffer_lock_state, new_, old) != old);
+               } while (InterlockedCompareExchange (&log_profiler.buffer_lock_state, new_, old) != old);
 
                MONO_EXIT_GC_SAFE;
        }
@@ -901,7 +662,7 @@ buffer_unlock (void)
 {
        mono_memory_barrier ();
 
-       gint32 state = InterlockedRead (&buffer_lock_state);
+       gint32 state = InterlockedRead (&log_profiler.buffer_lock_state);
 
        // See the comment in buffer_lock ().
        if (state == PROF_TLS_GET ()->small_id << 16)
@@ -910,7 +671,7 @@ buffer_unlock (void)
        g_assert (state && "Why are we decrementing a zero reader count?");
        g_assert (!(state >> 16) && "Why is the exclusive lock held?");
 
-       InterlockedDecrement (&buffer_lock_state);
+       InterlockedDecrement (&log_profiler.buffer_lock_state);
 }
 
 static void
@@ -918,13 +679,13 @@ buffer_lock_excl (void)
 {
        gint32 new_ = get_thread ()->small_id << 16;
 
-       g_assert (InterlockedRead (&buffer_lock_state) != new_ && "Why are we taking the exclusive lock twice?");
+       g_assert (InterlockedRead (&log_profiler.buffer_lock_state) != new_ && "Why are we taking the exclusive lock twice?");
 
-       InterlockedIncrement (&buffer_lock_exclusive_intent);
+       InterlockedIncrement (&log_profiler.buffer_lock_exclusive_intent);
 
        MONO_ENTER_GC_SAFE;
 
-       while (InterlockedCompareExchange (&buffer_lock_state, new_, 0))
+       while (InterlockedCompareExchange (&log_profiler.buffer_lock_state, new_, 0))
                mono_thread_info_yield ();
 
        MONO_EXIT_GC_SAFE;
@@ -937,15 +698,15 @@ buffer_unlock_excl (void)
 {
        mono_memory_barrier ();
 
-       gint32 state = InterlockedRead (&buffer_lock_state);
+       gint32 state = InterlockedRead (&log_profiler.buffer_lock_state);
        gint32 excl = state >> 16;
 
        g_assert (excl && "Why is the exclusive lock not held?");
        g_assert (excl == PROF_TLS_GET ()->small_id && "Why does another thread hold the exclusive lock?");
        g_assert (!(state & 0xFFFF) && "Why are there readers when the exclusive lock is held?");
 
-       InterlockedWrite (&buffer_lock_state, 0);
-       InterlockedDecrement (&buffer_lock_exclusive_intent);
+       InterlockedWrite (&log_profiler.buffer_lock_state, 0);
+       InterlockedDecrement (&log_profiler.buffer_lock_exclusive_intent);
 }
 
 static void
@@ -1087,7 +848,7 @@ register_method_local (MonoMethod *method, MonoJitInfo *ji)
 {
        MonoProfilerThread *thread = get_thread ();
 
-       if (!mono_conc_hashtable_lookup (thread->profiler->method_table, method)) {
+       if (!mono_conc_hashtable_lookup (log_profiler.method_table, method)) {
                MethodInfo *info = (MethodInfo *) g_malloc (sizeof (MethodInfo));
 
                info->method = method;
@@ -1190,9 +951,9 @@ write_header_string (char *p, const char *str)
 }
 
 static void
-dump_header (MonoProfiler *profiler)
+dump_header (void)
 {
-       const char *args = profiler->args;
+       const char *args = log_profiler.args;
        const char *arch = mono_config_get_cpu ();
        const char *os = mono_config_get_os ();
 
@@ -1219,22 +980,22 @@ dump_header (MonoProfiler *profiler)
        *p++ = LOG_DATA_VERSION;
        *p++ = sizeof (void *);
        p = write_int64 (p, ((uint64_t) time (NULL)) * 1000);
-       p = write_int32 (p, timer_overhead);
+       p = write_int32 (p, log_profiler.timer_overhead);
        p = write_int32 (p, 0); /* flags */
        p = write_int32 (p, process_id ());
-       p = write_int16 (p, profiler->command_port);
+       p = write_int16 (p, log_profiler.command_port);
        p = write_header_string (p, args);
        p = write_header_string (p, arch);
        p = write_header_string (p, os);
 
 #if defined (HAVE_SYS_ZLIB)
-       if (profiler->gzfile) {
-               gzwrite (profiler->gzfile, hbuf, p - hbuf);
+       if (log_profiler.gzfile) {
+               gzwrite (log_profiler.gzfile, hbuf, p - hbuf);
        } else
 #endif
        {
-               fwrite (hbuf, p - hbuf, 1, profiler->file);
-               fflush (profiler->file);
+               fwrite (hbuf, p - hbuf, 1, log_profiler.file);
+               fflush (log_profiler.file);
        }
 
        g_free (hbuf);
@@ -1249,14 +1010,14 @@ dump_header (MonoProfiler *profiler)
 static void
 send_buffer (MonoProfilerThread *thread)
 {
-       WriterQueueEntry *entry = mono_lock_free_alloc (&thread->profiler->writer_entry_allocator);
+       WriterQueueEntry *entry = mono_lock_free_alloc (&log_profiler.writer_entry_allocator);
        entry->methods = thread->methods;
        entry->buffer = thread->buffer;
 
        mono_lock_free_queue_node_init (&entry->node, FALSE);
 
-       mono_lock_free_queue_enqueue (&thread->profiler->writer_queue, &entry->node);
-       mono_os_sem_post (&thread->profiler->writer_queue_sem);
+       mono_lock_free_queue_enqueue (&log_profiler.writer_queue, &entry->node);
+       mono_os_sem_post (&log_profiler.writer_queue_sem);
 }
 
 static void
@@ -1273,17 +1034,15 @@ free_thread (gpointer p)
 
                InterlockedIncrement (&thread_ends_ctr);
 
-               if (ENABLED (PROFLOG_THREAD_EVENTS)) {
-                       LogBuffer *buf = ensure_logbuf_unsafe (thread,
-                               EVENT_SIZE /* event */ +
-                               BYTE_SIZE /* type */ +
-                               LEB128_SIZE /* tid */
-                       );
+               LogBuffer *buf = ensure_logbuf_unsafe (thread,
+                       EVENT_SIZE /* event */ +
+                       BYTE_SIZE /* type */ +
+                       LEB128_SIZE /* tid */
+               );
 
-                       emit_event (buf, TYPE_END_UNLOAD | TYPE_METADATA);
-                       emit_byte (buf, TYPE_THREAD);
-                       emit_ptr (buf, (void *) thread->node.key);
-               }
+               emit_event (buf, TYPE_END_UNLOAD | TYPE_METADATA);
+               emit_byte (buf, TYPE_THREAD);
+               emit_ptr (buf, (void *) thread->node.key);
        }
 
        send_buffer (thread);
@@ -1296,20 +1055,20 @@ remove_thread (MonoProfilerThread *thread)
 {
        MonoThreadHazardPointers *hp = mono_hazard_pointer_get ();
 
-       if (mono_lls_remove (&profiler_thread_list, hp, &thread->node))
+       if (mono_lls_remove (&log_profiler.profiler_thread_list, hp, &thread->node))
                mono_thread_hazardous_try_free (thread, free_thread);
 
        clear_hazard_pointers (hp);
 }
 
 static void
-dump_buffer (MonoProfiler *profiler, LogBuffer *buf)
+dump_buffer (LogBuffer *buf)
 {
        char hbuf [128];
        char *p = hbuf;
 
        if (buf->next)
-               dump_buffer (profiler, buf->next);
+               dump_buffer (buf->next);
 
        if (buf->cursor - buf->buf) {
                p = write_int32 (p, BUF_ID);
@@ -1321,15 +1080,15 @@ dump_buffer (MonoProfiler *profiler, LogBuffer *buf)
                p = write_int64 (p, buf->method_base);
 
 #if defined (HAVE_SYS_ZLIB)
-               if (profiler->gzfile) {
-                       gzwrite (profiler->gzfile, hbuf, p - hbuf);
-                       gzwrite (profiler->gzfile, buf->buf, buf->cursor - buf->buf);
+               if (log_profiler.gzfile) {
+                       gzwrite (log_profiler.gzfile, hbuf, p - hbuf);
+                       gzwrite (log_profiler.gzfile, buf->buf, buf->cursor - buf->buf);
                } else
 #endif
                {
-                       fwrite (hbuf, p - hbuf, 1, profiler->file);
-                       fwrite (buf->buf, buf->cursor - buf->buf, 1, profiler->file);
-                       fflush (profiler->file);
+                       fwrite (hbuf, p - hbuf, 1, log_profiler.file);
+                       fwrite (buf->buf, buf->cursor - buf->buf, 1, log_profiler.file);
+                       fflush (log_profiler.file);
                }
        }
 
@@ -1337,12 +1096,12 @@ dump_buffer (MonoProfiler *profiler, LogBuffer *buf)
 }
 
 static void
-dump_buffer_threadless (MonoProfiler *profiler, LogBuffer *buf)
+dump_buffer_threadless (LogBuffer *buf)
 {
        for (LogBuffer *iter = buf; iter; iter = iter->next)
                iter->thread_id = 0;
 
-       dump_buffer (profiler, buf);
+       dump_buffer (buf);
 }
 
 // Only valid if init_thread () was called with add_to_lls = FALSE.
@@ -1365,9 +1124,9 @@ send_log_unsafe (gboolean if_needed)
 static void
 sync_point_flush (void)
 {
-       g_assert (InterlockedRead (&buffer_lock_state) == PROF_TLS_GET ()->small_id << 16 && "Why don't we hold the exclusive lock?");
+       g_assert (InterlockedRead (&log_profiler.buffer_lock_state) == PROF_TLS_GET ()->small_id << 16 && "Why don't we hold the exclusive lock?");
 
-       MONO_LLS_FOREACH_SAFE (&profiler_thread_list, MonoProfilerThread, thread) {
+       MONO_LLS_FOREACH_SAFE (&log_profiler.profiler_thread_list, MonoProfilerThread, thread) {
                g_assert (thread->attached && "Why is a thread in the LLS not attached?");
 
                send_buffer (thread);
@@ -1379,7 +1138,7 @@ sync_point_flush (void)
 static void
 sync_point_mark (MonoProfilerSyncPointType type)
 {
-       g_assert (InterlockedRead (&buffer_lock_state) == PROF_TLS_GET ()->small_id << 16 && "Why don't we hold the exclusive lock?");
+       g_assert (InterlockedRead (&log_profiler.buffer_lock_state) == PROF_TLS_GET ()->small_id << 16 && "Why don't we hold the exclusive lock?");
 
        ENTER_LOG (&sync_points_ctr, logbuffer,
                EVENT_SIZE /* event */ +
@@ -1435,25 +1194,14 @@ gc_reference (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num,
                emit_obj (logbuffer, refs [i]);
        }
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 
        return 0;
 }
 
-static unsigned int hs_mode_ms = 0;
-static unsigned int hs_mode_gc = 0;
-static unsigned int hs_mode_ondemand = 0;
-static unsigned int gc_count = 0;
-static uint64_t last_hs_time = 0;
-static gboolean do_heap_walk = FALSE;
-static gboolean ignore_heap_events;
-
 static void
 gc_roots (MonoProfiler *prof, MonoObject *const *objects, const MonoProfilerGCRootType *root_types, const uintptr_t *extra_info, uint64_t num)
 {
-       if (ignore_heap_events)
-               return;
-
        ENTER_LOG (&heap_roots_ctr, logbuffer,
                EVENT_SIZE /* event */ +
                LEB128_SIZE /* num */ +
@@ -1475,42 +1223,22 @@ gc_roots (MonoProfiler *prof, MonoObject *const *objects, const MonoProfilerGCRo
                emit_value (logbuffer, extra_info [i]);
        }
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 }
 
 
 static void
 trigger_on_demand_heapshot (void)
 {
-       if (heapshot_requested)
+       if (InterlockedRead (&log_profiler.heapshot_requested))
                mono_gc_collect (mono_gc_max_generation ());
 }
 
-#define ALL_GC_EVENTS_MASK (PROFLOG_GC_MOVES_EVENTS | PROFLOG_GC_ROOT_EVENTS | PROFLOG_GC_EVENTS | PROFLOG_HEAPSHOT_FEATURE)
+#define ALL_GC_EVENTS_MASK (PROFLOG_GC_EVENTS | PROFLOG_GC_MOVE_EVENTS | PROFLOG_GC_ROOT_EVENTS)
 
 static void
 gc_event (MonoProfiler *profiler, MonoProfilerGCEvent ev, uint32_t generation)
 {
-       if (ev == MONO_GC_EVENT_START) {
-               uint64_t now = current_time ();
-
-               if (hs_mode_ms && (now - last_hs_time) / 1000 * 1000 >= hs_mode_ms)
-                       do_heap_walk = TRUE;
-               else if (hs_mode_gc && !(gc_count % hs_mode_gc))
-                       do_heap_walk = TRUE;
-               else if (hs_mode_ondemand)
-                       do_heap_walk = heapshot_requested;
-               else if (!hs_mode_ms && !hs_mode_gc && generation == mono_gc_max_generation ())
-                       do_heap_walk = TRUE;
-
-               //If using heapshot, ignore events for collections we don't care
-               if (ENABLED (PROFLOG_HEAPSHOT_FEATURE)) {
-                       // Ignore events generated during the collection itself (IE GC ROOTS)
-                       ignore_heap_events = !do_heap_walk;
-               }
-       }
-
-
        if (ENABLED (PROFLOG_GC_EVENTS)) {
                ENTER_LOG (&gc_events_ctr, logbuffer,
                        EVENT_SIZE /* event */ +
@@ -1522,21 +1250,50 @@ gc_event (MonoProfiler *profiler, MonoProfilerGCEvent ev, uint32_t generation)
                emit_byte (logbuffer, ev);
                emit_byte (logbuffer, generation);
 
-               EXIT_LOG_EXPLICIT (NO_SEND);
+               EXIT_LOG;
        }
 
        switch (ev) {
-       case MONO_GC_EVENT_START:
-               if (generation == mono_gc_max_generation ())
-                       gc_count++;
-
-               break;
        case MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED:
+               switch (log_config.hs_mode) {
+               case MONO_PROFILER_HEAPSHOT_NONE:
+                       log_profiler.do_heap_walk = FALSE;
+                       break;
+               case MONO_PROFILER_HEAPSHOT_MAJOR:
+                       log_profiler.do_heap_walk = generation == mono_gc_max_generation ();
+                       break;
+               case MONO_PROFILER_HEAPSHOT_ON_DEMAND:
+                       log_profiler.do_heap_walk = InterlockedRead (&log_profiler.heapshot_requested);
+                       break;
+               case MONO_PROFILER_HEAPSHOT_X_GC:
+                       log_profiler.do_heap_walk = !(log_profiler.gc_count % log_config.hs_freq_gc);
+                       break;
+               case MONO_PROFILER_HEAPSHOT_X_MS:
+                       log_profiler.do_heap_walk = (current_time () - log_profiler.last_hs_time) / 1000 * 1000 >= log_config.hs_freq_ms;
+                       break;
+               default:
+                       g_assert_not_reached ();
+               }
+
+               /*
+                * heapshot_requested is set either because on-demand heapshot is
+                * enabled and a heapshot was triggered, or because we're doing a
+                * shutdown heapshot. In the latter case, we won't check it in the
+                * switch above, so check it here and override any decision we made
+                * above.
+                */
+               if (InterlockedRead (&log_profiler.heapshot_requested))
+                       log_profiler.do_heap_walk = TRUE;
+
+               if (ENABLED (PROFLOG_GC_ROOT_EVENTS) && log_profiler.do_heap_walk)
+                       mono_profiler_set_gc_roots_callback (log_profiler.handle, gc_roots);
+
                /*
                 * Ensure that no thread can be in the middle of writing to
                 * a buffer when the world stops...
                 */
                buffer_lock_excl ();
+
                break;
        case MONO_GC_EVENT_POST_STOP_WORLD:
                /*
@@ -1549,40 +1306,41 @@ gc_event (MonoProfiler *profiler, MonoProfilerGCEvent ev, uint32_t generation)
                if (ENABLED (ALL_GC_EVENTS_MASK))
                        sync_point (SYNC_POINT_WORLD_STOP);
 
-               /*
-                * All heap events are surrounded by a HEAP_START and a HEAP_ENV event.
-                * Right now, that's the case for GC Moves, GC Roots or heapshots.
-                */
-               if (ENABLED (PROFLOG_GC_MOVES_EVENTS | PROFLOG_GC_ROOT_EVENTS) || do_heap_walk) {
+               // Surround heapshots with HEAP_START/HEAP_END events.
+               if (log_profiler.do_heap_walk) {
                        ENTER_LOG (&heap_starts_ctr, logbuffer,
                                EVENT_SIZE /* event */
                        );
 
                        emit_event (logbuffer, TYPE_HEAP_START | TYPE_HEAP);
 
-                       EXIT_LOG_EXPLICIT (DO_SEND);
+                       EXIT_LOG;
                }
 
+               break;
+       case MONO_GC_EVENT_START:
+               if (generation == mono_gc_max_generation ())
+                       log_profiler.gc_count++;
+
                break;
        case MONO_GC_EVENT_PRE_START_WORLD:
-               if (do_heap_shot && do_heap_walk)
+               mono_profiler_set_gc_roots_callback (log_profiler.handle, NULL);
+
+               if (log_profiler.do_heap_walk) {
                        mono_gc_walk_heap (0, gc_reference, NULL);
 
-               /* Matching HEAP_END to the HEAP_START from above */
-               if (ENABLED (PROFLOG_GC_MOVES_EVENTS | PROFLOG_GC_ROOT_EVENTS) || do_heap_walk) {
                        ENTER_LOG (&heap_ends_ctr, logbuffer,
                                EVENT_SIZE /* event */
                        );
 
                        emit_event (logbuffer, TYPE_HEAP_END | TYPE_HEAP);
 
-                       EXIT_LOG_EXPLICIT (DO_SEND);
-               }
+                       EXIT_LOG;
 
-               if (do_heap_shot && do_heap_walk) {
-                       do_heap_walk = FALSE;
-                       heapshot_requested = 0;
-                       last_hs_time = current_time ();
+                       log_profiler.do_heap_walk = FALSE;
+                       log_profiler.last_hs_time = current_time ();
+
+                       InterlockedWrite (&log_profiler.heapshot_requested, 0);
                }
 
                /*
@@ -1593,6 +1351,7 @@ gc_event (MonoProfiler *profiler, MonoProfilerGCEvent ev, uint32_t generation)
                 */
                if (ENABLED (ALL_GC_EVENTS_MASK))
                        sync_point_mark (SYNC_POINT_WORLD_START);
+
                break;
        case MONO_GC_EVENT_POST_START_WORLD_UNLOCKED:
                /*
@@ -1600,6 +1359,7 @@ gc_event (MonoProfiler *profiler, MonoProfilerGCEvent ev, uint32_t generation)
                 * their buffers again.
                 */
                buffer_unlock_excl ();
+
                break;
        default:
                break;
@@ -1617,7 +1377,7 @@ gc_resize (MonoProfiler *profiler, uintptr_t new_size)
        emit_event (logbuffer, TYPE_GC_RESIZE | TYPE_GC);
        emit_value (logbuffer, new_size);
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 }
 
 typedef struct {
@@ -1627,19 +1387,16 @@ typedef struct {
        int32_t native_offsets [MAX_FRAMES];
 } FrameData;
 
-static int num_frames = MAX_FRAMES;
-
 static mono_bool
 walk_stack (MonoMethod *method, int32_t native_offset, int32_t il_offset, mono_bool managed, void* data)
 {
        FrameData *frame = (FrameData *)data;
-       if (method && frame->count < num_frames) {
+       if (method && frame->count < log_config.num_frames) {
                frame->il_offsets [frame->count] = il_offset;
                frame->native_offsets [frame->count] = native_offset;
                frame->methods [frame->count++] = method;
-               //printf ("In %d %s at %d (native: %d)\n", frame->count, mono_method_get_name (method), il_offset, native_offset);
        }
-       return frame->count == num_frames;
+       return frame->count == log_config.num_frames;
 }
 
 /*
@@ -1655,11 +1412,8 @@ collect_bt (FrameData *data)
 }
 
 static void
-emit_bt (MonoProfiler *prof, LogBuffer *logbuffer, FrameData *data)
+emit_bt (LogBuffer *logbuffer, FrameData *data)
 {
-       if (data->count > num_frames)
-               printf ("bad num frames: %d\n", data->count);
-
        emit_value (logbuffer, data->count);
 
        while (data->count)
@@ -1669,7 +1423,7 @@ emit_bt (MonoProfiler *prof, LogBuffer *logbuffer, FrameData *data)
 static void
 gc_alloc (MonoProfiler *prof, MonoObject *obj)
 {
-       int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces) ? TYPE_ALLOC_BT : 0;
+       int do_bt = (!log_config.enter_leave && InterlockedRead (&log_profiler.runtime_inited) && log_config.num_frames) ? TYPE_ALLOC_BT : 0;
        FrameData data;
        uintptr_t len = mono_object_get_size (obj);
        /* account for object alignment in the heap */
@@ -1698,7 +1452,7 @@ gc_alloc (MonoProfiler *prof, MonoObject *obj)
        emit_value (logbuffer, len);
 
        if (do_bt)
-               emit_bt (prof, logbuffer, &data);
+               emit_bt (logbuffer, &data);
 
        EXIT_LOG;
 }
@@ -1720,13 +1474,13 @@ gc_moves (MonoProfiler *prof, MonoObject *const *objects, uint64_t num)
        for (int i = 0; i < num; ++i)
                emit_obj (logbuffer, objects [i]);
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 }
 
 static void
 gc_handle (MonoProfiler *prof, int op, MonoGCHandleType type, uint32_t handle, MonoObject *obj)
 {
-       int do_bt = nocalls && InterlockedRead (&runtime_inited) && !notraces;
+       int do_bt = !log_config.enter_leave && InterlockedRead (&log_profiler.runtime_inited) && log_config.num_frames;
        FrameData data;
 
        if (do_bt)
@@ -1763,7 +1517,7 @@ gc_handle (MonoProfiler *prof, int op, MonoGCHandleType type, uint32_t handle, M
                emit_obj (logbuffer, obj);
 
        if (do_bt)
-               emit_bt (prof, logbuffer, &data);
+               emit_bt (logbuffer, &data);
 
        EXIT_LOG;
 }
@@ -1796,7 +1550,7 @@ static void
 finalize_end (MonoProfiler *prof)
 {
        trigger_on_demand_heapshot ();
-       if (ENABLED (PROFLOG_FINALIZATION_EVENTS)) {
+       if (ENABLED (PROFLOG_GC_FINALIZATION_EVENTS)) {
                ENTER_LOG (&finalize_ends_ctr, buf,
                        EVENT_SIZE /* event */
                );
@@ -1974,7 +1728,7 @@ class_loaded (MonoProfiler *prof, MonoClass *klass)
 {
        char *name;
 
-       if (InterlockedRead (&runtime_inited))
+       if (InterlockedRead (&log_profiler.runtime_inited))
                name = mono_type_get_name (mono_class_get_type (klass));
        else
                name = type_name (klass);
@@ -1999,16 +1753,16 @@ class_loaded (MonoProfiler *prof, MonoClass *klass)
 
        EXIT_LOG;
 
-       if (runtime_inited)
+       if (InterlockedRead (&log_profiler.runtime_inited))
                mono_free (name);
        else
                g_free (name);
 }
 
 static void
-method_enter (MonoProfiler *prof, MonoMethod *method)
+method_enter (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *ctx)
 {
-       if (get_thread ()->call_depth++ <= max_call_depth) {
+       if (get_thread ()->call_depth++ <= log_config.max_call_depth) {
                ENTER_LOG (&method_entries_ctr, logbuffer,
                        EVENT_SIZE /* event */ +
                        LEB128_SIZE /* method */
@@ -2022,9 +1776,9 @@ method_enter (MonoProfiler *prof, MonoMethod *method)
 }
 
 static void
-method_leave (MonoProfiler *prof, MonoMethod *method)
+method_leave (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *ctx)
 {
-       if (--get_thread ()->call_depth <= max_call_depth) {
+       if (--get_thread ()->call_depth <= log_config.max_call_depth) {
                ENTER_LOG (&method_exits_ctr, logbuffer,
                        EVENT_SIZE /* event */ +
                        LEB128_SIZE /* method */
@@ -2037,10 +1791,16 @@ method_leave (MonoProfiler *prof, MonoMethod *method)
        }
 }
 
+static void
+tail_call (MonoProfiler *prof, MonoMethod *method, MonoMethod *target)
+{
+       method_leave (prof, method, NULL);
+}
+
 static void
 method_exc_leave (MonoProfiler *prof, MonoMethod *method, MonoObject *exc)
 {
-       if (!nocalls && --get_thread ()->call_depth <= max_call_depth) {
+       if (--get_thread ()->call_depth <= log_config.max_call_depth) {
                ENTER_LOG (&method_exception_exits_ctr, logbuffer,
                        EVENT_SIZE /* event */ +
                        LEB128_SIZE /* method */
@@ -2056,7 +1816,10 @@ method_exc_leave (MonoProfiler *prof, MonoMethod *method, MonoObject *exc)
 static MonoProfilerCallInstrumentationFlags
 method_filter (MonoProfiler *prof, MonoMethod *method)
 {
-       return MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE | MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE;
+       return MONO_PROFILER_CALL_INSTRUMENTATION_ENTER |
+              MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE |
+              MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL |
+              MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE;
 }
 
 static void
@@ -2109,7 +1872,7 @@ code_buffer_new (MonoProfiler *prof, const mono_byte *buffer, uint64_t size, Mon
 static void
 throw_exc (MonoProfiler *prof, MonoObject *object)
 {
-       int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces) ? TYPE_THROW_BT : 0;
+       int do_bt = (!log_config.enter_leave && InterlockedRead (&log_profiler.runtime_inited) && log_config.num_frames) ? TYPE_THROW_BT : 0;
        FrameData data;
 
        if (do_bt)
@@ -2130,7 +1893,7 @@ throw_exc (MonoProfiler *prof, MonoObject *object)
        emit_obj (logbuffer, object);
 
        if (do_bt)
-               emit_bt (prof, logbuffer, &data);
+               emit_bt (logbuffer, &data);
 
        EXIT_LOG;
 }
@@ -2157,7 +1920,7 @@ clause_exc (MonoProfiler *prof, MonoMethod *method, uint32_t clause_num, MonoExc
 static void
 monitor_event (MonoProfiler *profiler, MonoObject *object, MonoProfilerMonitorEvent ev)
 {
-       int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces) ? TYPE_MONITOR_BT : 0;
+       int do_bt = (!log_config.enter_leave && InterlockedRead (&log_profiler.runtime_inited) && log_config.num_frames) ? TYPE_MONITOR_BT : 0;
        FrameData data;
 
        if (do_bt)
@@ -2180,7 +1943,7 @@ monitor_event (MonoProfiler *profiler, MonoObject *object, MonoProfilerMonitorEv
        emit_obj (logbuffer, object);
 
        if (do_bt)
-               emit_bt (profiler, logbuffer, &data);
+               emit_bt (logbuffer, &data);
 
        EXIT_LOG;
 }
@@ -2206,37 +1969,33 @@ monitor_failed (MonoProfiler *prof, MonoObject *object)
 static void
 thread_start (MonoProfiler *prof, uintptr_t tid)
 {
-       if (ENABLED (PROFLOG_THREAD_EVENTS)) {
-               ENTER_LOG (&thread_starts_ctr, logbuffer,
-                       EVENT_SIZE /* event */ +
-                       BYTE_SIZE /* type */ +
-                       LEB128_SIZE /* tid */
-               );
+       ENTER_LOG (&thread_starts_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* tid */
+       );
 
-               emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
-               emit_byte (logbuffer, TYPE_THREAD);
-               emit_ptr (logbuffer, (void*) tid);
+       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_THREAD);
+       emit_ptr (logbuffer, (void*) tid);
 
-               EXIT_LOG;
-       }
+       EXIT_LOG;
 }
 
 static void
 thread_end (MonoProfiler *prof, uintptr_t tid)
 {
-       if (ENABLED (PROFLOG_THREAD_EVENTS)) {
-               ENTER_LOG (&thread_ends_ctr, logbuffer,
-                       EVENT_SIZE /* event */ +
-                       BYTE_SIZE /* type */ +
-                       LEB128_SIZE /* tid */
-               );
+       ENTER_LOG (&thread_ends_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* tid */
+       );
 
-               emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
-               emit_byte (logbuffer, TYPE_THREAD);
-               emit_ptr (logbuffer, (void*) tid);
+       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_THREAD);
+       emit_ptr (logbuffer, (void*) tid);
 
-               EXIT_LOG_EXPLICIT (NO_SEND);
-       }
+       EXIT_LOG_EXPLICIT (NO_SEND);
 
        MonoProfilerThread *thread = get_thread ();
 
@@ -2251,22 +2010,20 @@ thread_name (MonoProfiler *prof, uintptr_t tid, const char *name)
 {
        int len = strlen (name) + 1;
 
-       if (ENABLED (PROFLOG_THREAD_EVENTS)) {
-               ENTER_LOG (&thread_names_ctr, logbuffer,
-                       EVENT_SIZE /* event */ +
-                       BYTE_SIZE /* type */ +
-                       LEB128_SIZE /* tid */ +
-                       len /* name */
-               );
+       ENTER_LOG (&thread_names_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* tid */ +
+               len /* name */
+       );
 
-               emit_event (logbuffer, TYPE_METADATA);
-               emit_byte (logbuffer, TYPE_THREAD);
-               emit_ptr (logbuffer, (void*)tid);
-               memcpy (logbuffer->cursor, name, len);
-               logbuffer->cursor += len;
+       emit_event (logbuffer, TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_THREAD);
+       emit_ptr (logbuffer, (void*)tid);
+       memcpy (logbuffer->cursor, name, len);
+       logbuffer->cursor += len;
 
-               EXIT_LOG;
-       }
+       EXIT_LOG;
 }
 
 static void
@@ -2367,7 +2124,6 @@ typedef struct {
 
 typedef struct {
        MonoLockFreeQueueNode node;
-       MonoProfiler *prof;
        uint64_t time;
        uintptr_t tid;
        const void *ip;
@@ -2380,7 +2136,7 @@ async_walk_stack (MonoMethod *method, MonoDomain *domain, void *base_address, in
 {
        SampleHit *sample = (SampleHit *) data;
 
-       if (sample->count < num_frames) {
+       if (sample->count < log_config.num_frames) {
                int i = sample->count;
 
                sample->frames [i].method = method;
@@ -2391,7 +2147,7 @@ async_walk_stack (MonoMethod *method, MonoDomain *domain, void *base_address, in
                sample->count++;
        }
 
-       return sample->count == num_frames;
+       return sample->count == log_config.num_frames;
 }
 
 #define SAMPLE_SLOT_SIZE(FRAMES) (sizeof (SampleHit) + sizeof (AsyncFrameInfo) * (FRAMES - MONO_ZERO_LEN_ARRAY))
@@ -2403,8 +2159,8 @@ enqueue_sample_hit (gpointer p)
        SampleHit *sample = p;
 
        mono_lock_free_queue_node_unpoison (&sample->node);
-       mono_lock_free_queue_enqueue (&sample->prof->dumper_queue, &sample->node);
-       mono_os_sem_post (&sample->prof->dumper_queue_sem);
+       mono_lock_free_queue_enqueue (&log_profiler.dumper_queue, &sample->node);
+       mono_os_sem_post (&log_profiler.dumper_queue_sem);
 }
 
 static void
@@ -2418,7 +2174,7 @@ mono_sample_hit (MonoProfiler *profiler, const mono_byte *ip, const void *contex
         * invoking runtime functions, which is not async-signal-safe.
         */
 
-       if (InterlockedRead (&in_shutdown))
+       if (InterlockedRead (&log_profiler.in_shutdown))
                return;
 
        SampleHit *sample = (SampleHit *) mono_lock_free_queue_dequeue (&profiler->sample_reuse_queue);
@@ -2428,11 +2184,10 @@ mono_sample_hit (MonoProfiler *profiler, const mono_byte *ip, const void *contex
                 * If we're out of reusable sample events and we're not allowed to
                 * allocate more, we have no choice but to drop the event.
                 */
-               if (InterlockedRead (&sample_allocations_ctr) >= max_allocated_sample_hits)
+               if (InterlockedRead (&sample_allocations_ctr) >= log_config.max_allocated_sample_hits)
                        return;
 
                sample = mono_lock_free_alloc (&profiler->sample_allocator);
-               sample->prof = profiler;
                mono_lock_free_queue_node_init (&sample->node, TRUE);
 
                InterlockedIncrement (&sample_allocations_ctr);
@@ -2474,8 +2229,7 @@ add_code_page (uintptr_t *hash, uintptr_t hsize, uintptr_t page)
                if (++i == hsize)
                        i = 0;
        } while (i != start_pos);
-       /* should not happen */
-       printf ("failed code page store\n");
+       g_assert_not_reached ();
        return 0;
 }
 
@@ -2505,7 +2259,7 @@ add_code_pointer (uintptr_t ip)
 //#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
 #if 0
 static void
-dump_ubin (MonoProfiler *prof, const char *filename, uintptr_t load_addr, uint64_t offset, uintptr_t size)
+dump_ubin (const char *filename, uintptr_t load_addr, uint64_t offset, uintptr_t size)
 {
        int len = strlen (filename) + 1;
 
@@ -2524,12 +2278,12 @@ dump_ubin (MonoProfiler *prof, const char *filename, uintptr_t load_addr, uint64
        memcpy (logbuffer->cursor, filename, len);
        logbuffer->cursor += len;
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 }
 #endif
 
 static void
-dump_usym (MonoProfiler *prof, const char *name, uintptr_t value, uintptr_t size)
+dump_usym (const char *name, uintptr_t value, uintptr_t size)
 {
        int len = strlen (name) + 1;
 
@@ -2546,7 +2300,7 @@ dump_usym (MonoProfiler *prof, const char *name, uintptr_t value, uintptr_t size
        memcpy (logbuffer->cursor, name, len);
        logbuffer->cursor += len;
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 }
 
 /* ELF code crashes on some systems. */
@@ -2565,7 +2319,7 @@ dump_usym (MonoProfiler *prof, const char *name, uintptr_t value, uintptr_t size
 #endif
 
 static void
-dump_elf_symbols (MonoProfiler *prof, ElfW(Sym) *symbols, int num_symbols, const char *strtab, void *load_addr)
+dump_elf_symbols (ElfW(Sym) *symbols, int num_symbols, const char *strtab, void *load_addr)
 {
        int i;
        for (i = 0; i < num_symbols; ++i) {
@@ -2573,7 +2327,6 @@ dump_elf_symbols (MonoProfiler *prof, ElfW(Sym) *symbols, int num_symbols, const
                sym =  strtab + symbols [i].st_name;
                if (!symbols [i].st_name || !symbols [i].st_size || (symbols [i].st_info & 0xf) != STT_FUNC)
                        continue;
-               //printf ("symbol %s at %d\n", sym, symbols [i].st_value);
                dump_usym (sym, (uintptr_t)load_addr + symbols [i].st_value, symbols [i].st_size);
        }
 }
@@ -2618,11 +2371,9 @@ read_elf_symbols (MonoProfiler *prof, const char *filename, void *load_addr)
        shstrtabh = (void*)((char*)sheader + (header->e_shentsize * header->e_shstrndx));
        strtab = (const char*)data + shstrtabh->sh_offset;
        for (i = 0; i < header->e_shnum; ++i) {
-               //printf ("section header: %d\n", sheader->sh_type);
                if (sheader->sh_type == SHT_SYMTAB) {
                        symtabh = sheader;
                        strtabh = (void*)((char*)data + header->e_shoff + sheader->sh_link * header->e_shentsize);
-                       /*printf ("symtab section header: %d, .strstr: %d\n", i, sheader->sh_link);*/
                        break;
                }
                sheader = (void*)((char*)sheader + header->e_shentsize);
@@ -2646,7 +2397,6 @@ read_elf_symbols (MonoProfiler *prof, const char *filename, void *load_addr)
 static int
 elf_dl_callback (struct dl_phdr_info *info, size_t size, void *data)
 {
-       MonoProfiler *prof = data;
        char buf [256];
        const char *filename;
        BinaryObject *obj;
@@ -2657,7 +2407,7 @@ elf_dl_callback (struct dl_phdr_info *info, size_t size, void *data)
        ElfW(Word) *hash_table = NULL;
        ElfW(Ehdr) *header = NULL;
        const char* strtab = NULL;
-       for (obj = prof->binary_objects; obj; obj = obj->next) {
+       for (obj = log_profiler.binary_objects; obj; obj = obj->next) {
                if (obj->addr == a)
                        return 0;
        }
@@ -2674,12 +2424,10 @@ elf_dl_callback (struct dl_phdr_info *info, size_t size, void *data)
        obj = g_calloc (sizeof (BinaryObject), 1);
        obj->addr = (void*)info->dlpi_addr;
        obj->name = pstrdup (filename);
-       obj->next = prof->binary_objects;
-       prof->binary_objects = obj;
-       //printf ("loaded file: %s at %p, segments: %d\n", filename, (void*)info->dlpi_addr, info->dlpi_phnum);
+       obj->next = log_profiler.binary_objects;
+       log_profiler.binary_objects = obj;
        a = NULL;
        for (i = 0; i < info->dlpi_phnum; ++i) {
-               //printf ("segment type %d file offset: %d, size: %d\n", info->dlpi_phdr[i].p_type, info->dlpi_phdr[i].p_offset, info->dlpi_phdr[i].p_memsz);
                if (info->dlpi_phdr[i].p_type == PT_LOAD && !header) {
                        header = (ElfW(Ehdr)*)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr);
                        if (header->e_ident [EI_MAG0] != ELFMAG0 ||
@@ -2688,12 +2436,12 @@ elf_dl_callback (struct dl_phdr_info *info, size_t size, void *data)
                                        header->e_ident [EI_MAG3] != ELFMAG3 ) {
                                header = NULL;
                        }
-                       dump_ubin (prof, filename, info->dlpi_addr + info->dlpi_phdr[i].p_vaddr, info->dlpi_phdr[i].p_offset, info->dlpi_phdr[i].p_memsz);
+                       dump_ubin (filename, info->dlpi_addr + info->dlpi_phdr[i].p_vaddr, info->dlpi_phdr[i].p_offset, info->dlpi_phdr[i].p_memsz);
                } else if (info->dlpi_phdr[i].p_type == PT_DYNAMIC) {
                        dyn = (ElfW(Dyn) *)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr);
                }
        }
-       if (read_elf_symbols (prof, filename, (void*)info->dlpi_addr))
+       if (read_elf_symbols (filename, (void*)info->dlpi_addr))
                return 0;
        if (!info->dlpi_name || !info->dlpi_name[0])
                return 0;
@@ -2701,8 +2449,6 @@ elf_dl_callback (struct dl_phdr_info *info, size_t size, void *data)
                return 0;
        for (i = 0; dyn [i].d_tag != DT_NULL; ++i) {
                if (dyn [i].d_tag == DT_SYMTAB) {
-                       if (symtab && do_debug)
-                               printf ("multiple symtabs: %d\n", i);
                        symtab = (ElfW(Sym) *)(a + dyn [i].d_un.d_ptr);
                } else if (dyn [i].d_tag == DT_HASH) {
                        hash_table = (ElfW(Word) *)(a + dyn [i].d_un.d_ptr);
@@ -2713,19 +2459,19 @@ elf_dl_callback (struct dl_phdr_info *info, size_t size, void *data)
        if (!hash_table)
                return 0;
        num_sym = hash_table [1];
-       dump_elf_symbols (prof, symtab, num_sym, strtab, (void*)info->dlpi_addr);
+       dump_elf_symbols (symtab, num_sym, strtab, (void*)info->dlpi_addr);
        return 0;
 }
 
 static int
-load_binaries (MonoProfiler *prof)
+load_binaries (void)
 {
-       dl_iterate_phdr (elf_dl_callback, prof);
+       dl_iterate_phdr (elf_dl_callback, NULL);
        return 1;
 }
 #else
 static int
-load_binaries (MonoProfiler *prof)
+load_binaries (void)
 {
        return 0;
 }
@@ -2755,13 +2501,13 @@ symbol_for (uintptr_t code)
 }
 
 static void
-dump_unmanaged_coderefs (MonoProfiler *prof)
+dump_unmanaged_coderefs (void)
 {
        int i;
        const char* last_symbol;
        uintptr_t addr, page_end;
 
-       if (load_binaries (prof))
+       if (load_binaries ())
                return;
        for (i = 0; i < size_code_pages; ++i) {
                const char* sym;
@@ -2779,37 +2525,22 @@ dump_unmanaged_coderefs (MonoProfiler *prof)
                        last_symbol = sym;
                        if (!sym)
                                continue;
-                       dump_usym (prof, sym, addr, 0); /* let's not guess the size */
-                       //printf ("found symbol at %p: %s\n", (void*)addr, sym);
+                       dump_usym (sym, addr, 0); /* let's not guess the size */
                }
        }
 }
 
-typedef struct MonoCounterAgent {
-       MonoCounter *counter;
-       // MonoCounterAgent specific data :
-       void *value;
-       size_t value_size;
-       short index;
-       short emitted;
-       struct MonoCounterAgent *next;
-} MonoCounterAgent;
-
-static MonoCounterAgent* counters;
-static int counters_index = 1;
-static mono_mutex_t counters_mutex;
-
 static void
 counters_add_agent (MonoCounter *counter)
 {
-       if (InterlockedRead (&in_shutdown))
+       if (InterlockedRead (&log_profiler.in_shutdown))
                return;
 
        MonoCounterAgent *agent, *item;
 
-       mono_os_mutex_lock (&counters_mutex);
+       mono_os_mutex_lock (&log_profiler.counters_mutex);
 
-       for (agent = counters; agent; agent = agent->next) {
+       for (agent = log_profiler.counters; agent; agent = agent->next) {
                if (agent->counter == counter) {
                        agent->value_size = 0;
                        if (agent->value) {
@@ -2824,21 +2555,21 @@ counters_add_agent (MonoCounter *counter)
        agent->counter = counter;
        agent->value = NULL;
        agent->value_size = 0;
-       agent->index = counters_index++;
-       agent->emitted = 0;
+       agent->index = log_profiler.counters_index++;
+       agent->emitted = FALSE;
        agent->next = NULL;
 
-       if (!counters) {
-               counters = agent;
+       if (!log_profiler.counters) {
+               log_profiler.counters = agent;
        } else {
-               item = counters;
+               item = log_profiler.counters;
                while (item->next)
                        item = item->next;
                item->next = agent;
        }
 
 done:
-       mono_os_mutex_unlock (&counters_mutex);
+       mono_os_mutex_unlock (&log_profiler.counters_mutex);
 }
 
 static mono_bool
@@ -2849,16 +2580,18 @@ counters_init_foreach_callback (MonoCounter *counter, gpointer data)
 }
 
 static void
-counters_init (MonoProfiler *profiler)
+counters_init (void)
 {
-       mono_os_mutex_init (&counters_mutex);
+       mono_os_mutex_init (&log_profiler.counters_mutex);
+
+       log_profiler.counters_index = 1;
 
        mono_counters_on_register (&counters_add_agent);
        mono_counters_foreach (counters_init_foreach_callback, NULL);
 }
 
 static void
-counters_emit (MonoProfiler *profiler)
+counters_emit (void)
 {
        MonoCounterAgent *agent;
        int len = 0;
@@ -2867,9 +2600,9 @@ counters_emit (MonoProfiler *profiler)
                LEB128_SIZE /* len */
        ;
 
-       mono_os_mutex_lock (&counters_mutex);
+       mono_os_mutex_lock (&log_profiler.counters_mutex);
 
-       for (agent = counters; agent; agent = agent->next) {
+       for (agent = log_profiler.counters; agent; agent = agent->next) {
                if (agent->emitted)
                        continue;
 
@@ -2893,7 +2626,7 @@ counters_emit (MonoProfiler *profiler)
        emit_event (logbuffer, TYPE_SAMPLE_COUNTERS_DESC | TYPE_SAMPLE);
        emit_value (logbuffer, len);
 
-       for (agent = counters; agent; agent = agent->next) {
+       for (agent = log_profiler.counters; agent; agent = agent->next) {
                const char *name;
 
                if (agent->emitted)
@@ -2907,17 +2640,17 @@ counters_emit (MonoProfiler *profiler)
                emit_byte (logbuffer, mono_counter_get_variance (agent->counter));
                emit_value (logbuffer, agent->index);
 
-               agent->emitted = 1;
+               agent->emitted = TRUE;
        }
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 
 done:
-       mono_os_mutex_unlock (&counters_mutex);
+       mono_os_mutex_unlock (&log_profiler.counters_mutex);
 }
 
 static void
-counters_sample (MonoProfiler *profiler, uint64_t timestamp)
+counters_sample (uint64_t timestamp)
 {
        MonoCounterAgent *agent;
        MonoCounter *counter;
@@ -2926,18 +2659,18 @@ counters_sample (MonoProfiler *profiler, uint64_t timestamp)
        void *buffer;
        int size;
 
-       counters_emit (profiler);
+       counters_emit ();
 
        buffer_size = 8;
        buffer = g_calloc (1, buffer_size);
 
-       mono_os_mutex_lock (&counters_mutex);
+       mono_os_mutex_lock (&log_profiler.counters_mutex);
 
        size =
                EVENT_SIZE /* event */
        ;
 
-       for (agent = counters; agent; agent = agent->next) {
+       for (agent = log_profiler.counters; agent; agent = agent->next) {
                size +=
                        LEB128_SIZE /* index */ +
                        BYTE_SIZE /* type */ +
@@ -2953,7 +2686,7 @@ counters_sample (MonoProfiler *profiler, uint64_t timestamp)
 
        emit_event_time (logbuffer, TYPE_SAMPLE_COUNTERS | TYPE_SAMPLE, timestamp);
 
-       for (agent = counters; agent; agent = agent->next) {
+       for (agent = log_profiler.counters; agent; agent = agent->next) {
                size_t size;
 
                counter = agent->counter;
@@ -3033,28 +2766,13 @@ counters_sample (MonoProfiler *profiler, uint64_t timestamp)
 
        emit_value (logbuffer, 0);
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 
-       mono_os_mutex_unlock (&counters_mutex);
+       mono_os_mutex_unlock (&log_profiler.counters_mutex);
 }
 
-typedef struct _PerfCounterAgent PerfCounterAgent;
-struct _PerfCounterAgent {
-       PerfCounterAgent *next;
-       int index;
-       char *category_name;
-       char *name;
-       int type;
-       gint64 value;
-       guint8 emitted;
-       guint8 updated;
-       guint8 deleted;
-};
-
-static PerfCounterAgent *perfcounters = NULL;
-
 static void
-perfcounters_emit (MonoProfiler *profiler)
+perfcounters_emit (void)
 {
        PerfCounterAgent *pcagent;
        int len = 0;
@@ -3063,7 +2781,7 @@ perfcounters_emit (MonoProfiler *profiler)
                LEB128_SIZE /* len */
        ;
 
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
+       for (pcagent = log_profiler.perfcounters; pcagent; pcagent = pcagent->next) {
                if (pcagent->emitted)
                        continue;
 
@@ -3088,7 +2806,7 @@ perfcounters_emit (MonoProfiler *profiler)
        emit_event (logbuffer, TYPE_SAMPLE_COUNTERS_DESC | TYPE_SAMPLE);
        emit_value (logbuffer, len);
 
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
+       for (pcagent = log_profiler.perfcounters; pcagent; pcagent = pcagent->next) {
                if (pcagent->emitted)
                        continue;
 
@@ -3100,10 +2818,10 @@ perfcounters_emit (MonoProfiler *profiler)
                emit_byte (logbuffer, MONO_COUNTER_VARIABLE);
                emit_value (logbuffer, pcagent->index);
 
-               pcagent->emitted = 1;
+               pcagent->emitted = TRUE;
        }
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 }
 
 static gboolean
@@ -3111,56 +2829,55 @@ perfcounters_foreach (char *category_name, char *name, unsigned char type, gint6
 {
        PerfCounterAgent *pcagent;
 
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
+       for (pcagent = log_profiler.perfcounters; pcagent; pcagent = pcagent->next) {
                if (strcmp (pcagent->category_name, category_name) != 0 || strcmp (pcagent->name, name) != 0)
                        continue;
                if (pcagent->value == value)
                        return TRUE;
 
                pcagent->value = value;
-               pcagent->updated = 1;
-               pcagent->deleted = 0;
+               pcagent->updated = TRUE;
+               pcagent->deleted = FALSE;
                return TRUE;
        }
 
        pcagent = g_new0 (PerfCounterAgent, 1);
-       pcagent->next = perfcounters;
-       pcagent->index = counters_index++;
+       pcagent->next = log_profiler.perfcounters;
+       pcagent->index = log_profiler.counters_index++;
        pcagent->category_name = g_strdup (category_name);
        pcagent->name = g_strdup (name);
-       pcagent->type = (int) type;
        pcagent->value = value;
-       pcagent->emitted = 0;
-       pcagent->updated = 1;
-       pcagent->deleted = 0;
+       pcagent->emitted = FALSE;
+       pcagent->updated = TRUE;
+       pcagent->deleted = FALSE;
 
-       perfcounters = pcagent;
+       log_profiler.perfcounters = pcagent;
 
        return TRUE;
 }
 
 static void
-perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp)
+perfcounters_sample (uint64_t timestamp)
 {
        PerfCounterAgent *pcagent;
        int len = 0;
        int size;
 
-       mono_os_mutex_lock (&counters_mutex);
+       mono_os_mutex_lock (&log_profiler.counters_mutex);
 
        /* mark all perfcounters as deleted, foreach will unmark them as necessary */
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next)
-               pcagent->deleted = 1;
+       for (pcagent = log_profiler.perfcounters; pcagent; pcagent = pcagent->next)
+               pcagent->deleted = TRUE;
 
-       mono_perfcounter_foreach (perfcounters_foreach, perfcounters);
+       mono_perfcounter_foreach (perfcounters_foreach, NULL);
 
-       perfcounters_emit (profiler);
+       perfcounters_emit ();
 
        size =
                EVENT_SIZE /* event */
        ;
 
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
+       for (pcagent = log_profiler.perfcounters; pcagent; pcagent = pcagent->next) {
                if (pcagent->deleted || !pcagent->updated)
                        continue;
 
@@ -3184,47 +2901,33 @@ perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp)
 
        emit_event_time (logbuffer, TYPE_SAMPLE_COUNTERS | TYPE_SAMPLE, timestamp);
 
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
+       for (pcagent = log_profiler.perfcounters; pcagent; pcagent = pcagent->next) {
                if (pcagent->deleted || !pcagent->updated)
                        continue;
                emit_uvalue (logbuffer, pcagent->index);
                emit_byte (logbuffer, MONO_COUNTER_LONG);
                emit_svalue (logbuffer, pcagent->value);
 
-               pcagent->updated = 0;
+               pcagent->updated = FALSE;
        }
 
        emit_value (logbuffer, 0);
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 
 done:
-       mono_os_mutex_unlock (&counters_mutex);
+       mono_os_mutex_unlock (&log_profiler.counters_mutex);
 }
 
 static void
-counters_and_perfcounters_sample (MonoProfiler *prof)
+counters_and_perfcounters_sample (void)
 {
        uint64_t now = current_time ();
 
-       counters_sample (prof, now);
-       perfcounters_sample (prof, now);
+       counters_sample (now);
+       perfcounters_sample (now);
 }
 
-#define COVERAGE_DEBUG(x) if (debug_coverage) {x}
-static mono_mutex_t coverage_mutex;
-static MonoConcurrentHashTable *coverage_methods = NULL;
-static MonoConcurrentHashTable *coverage_assemblies = NULL;
-static MonoConcurrentHashTable *coverage_classes = NULL;
-
-static MonoConcurrentHashTable *filtered_classes = NULL;
-static MonoConcurrentHashTable *image_to_methods = NULL;
-static MonoConcurrentHashTable *suppressed_assemblies = NULL;
-static gboolean coverage_initialized = FALSE;
-
-static GPtrArray *coverage_data = NULL;
-static int previous_offset = 0;
-
 typedef struct {
        MonoLockFreeQueueNode node;
        MonoMethod *method;
@@ -3249,10 +2952,10 @@ free_coverage_entry (gpointer data, gpointer userdata)
 static void
 obtain_coverage_for_method (MonoProfiler *prof, const MonoProfilerCoverageData *entry)
 {
-       int offset = entry->il_offset - previous_offset;
+       int offset = entry->il_offset - log_profiler.coverage_previous_offset;
        CoverageEntry *e = g_new (CoverageEntry, 1);
 
-       previous_offset = entry->il_offset;
+       log_profiler.coverage_previous_offset = entry->il_offset;
 
        e->offset = offset;
        e->counter = entry->counter;
@@ -3260,7 +2963,7 @@ obtain_coverage_for_method (MonoProfiler *prof, const MonoProfilerCoverageData *
        e->line = entry->line;
        e->column = entry->column;
 
-       g_ptr_array_add (coverage_data, e);
+       g_ptr_array_add (log_profiler.coverage_data, e);
 }
 
 static char *
@@ -3310,22 +3013,20 @@ parse_generic_type_names(char *name)
        return ret;
 }
 
-static int method_id;
 static void
 build_method_buffer (gpointer key, gpointer value, gpointer userdata)
 {
        MonoMethod *method = (MonoMethod *)value;
-       MonoProfiler *prof = (MonoProfiler *)userdata;
        MonoClass *klass;
        MonoImage *image;
        char *class_name;
        const char *image_name, *method_name, *sig, *first_filename;
        guint i;
 
-       previous_offset = 0;
-       coverage_data = g_ptr_array_new ();
+       log_profiler.coverage_previous_offset = 0;
+       log_profiler.coverage_data = g_ptr_array_new ();
 
-       mono_profiler_get_coverage_data (prof->handle, method, obtain_coverage_for_method);
+       mono_profiler_get_coverage_data (log_profiler.handle, method, obtain_coverage_for_method);
 
        klass = mono_method_get_class (method);
        image = mono_class_get_image (klass);
@@ -3335,8 +3036,8 @@ build_method_buffer (gpointer key, gpointer value, gpointer userdata)
        class_name = parse_generic_type_names (mono_type_get_name (mono_class_get_type (klass)));
        method_name = mono_method_get_name (method);
 
-       if (coverage_data->len != 0) {
-               CoverageEntry *entry = (CoverageEntry *)coverage_data->pdata[0];
+       if (log_profiler.coverage_data->len != 0) {
+               CoverageEntry *entry = (CoverageEntry *)log_profiler.coverage_data->pdata[0];
                first_filename = entry->filename ? entry->filename : "";
        } else
                first_filename = "";
@@ -3365,13 +3066,13 @@ build_method_buffer (gpointer key, gpointer value, gpointer userdata)
        emit_string (logbuffer, first_filename, strlen (first_filename) + 1);
 
        emit_uvalue (logbuffer, mono_method_get_token (method));
-       emit_uvalue (logbuffer, method_id);
-       emit_value (logbuffer, coverage_data->len);
+       emit_uvalue (logbuffer, log_profiler.coverage_method_id);
+       emit_value (logbuffer, log_profiler.coverage_data->len);
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 
-       for (i = 0; i < coverage_data->len; i++) {
-               CoverageEntry *entry = (CoverageEntry *)coverage_data->pdata[i];
+       for (i = 0; i < log_profiler.coverage_data->len; i++) {
+               CoverageEntry *entry = (CoverageEntry *)log_profiler.coverage_data->pdata[i];
 
                ENTER_LOG (&coverage_statements_ctr, logbuffer,
                        EVENT_SIZE /* event */ +
@@ -3383,22 +3084,21 @@ build_method_buffer (gpointer key, gpointer value, gpointer userdata)
                );
 
                emit_event (logbuffer, TYPE_COVERAGE_STATEMENT | TYPE_COVERAGE);
-               emit_uvalue (logbuffer, method_id);
+               emit_uvalue (logbuffer, log_profiler.coverage_method_id);
                emit_uvalue (logbuffer, entry->offset);
                emit_uvalue (logbuffer, entry->counter);
                emit_uvalue (logbuffer, entry->line);
                emit_uvalue (logbuffer, entry->column);
 
-               EXIT_LOG_EXPLICIT (DO_SEND);
+               EXIT_LOG;
        }
 
-       method_id++;
+       log_profiler.coverage_method_id++;
 
        g_free (class_name);
 
-       g_ptr_array_foreach (coverage_data, free_coverage_entry, NULL);
-       g_ptr_array_free (coverage_data, TRUE);
-       coverage_data = NULL;
+       g_ptr_array_foreach (log_profiler.coverage_data, free_coverage_entry, NULL);
+       g_ptr_array_free (log_profiler.coverage_data, TRUE);
 }
 
 /* This empties the queue */
@@ -3453,7 +3153,7 @@ build_class_buffer (gpointer key, gpointer value, gpointer userdata)
        emit_uvalue (logbuffer, fully_covered);
        emit_uvalue (logbuffer, partially_covered);
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 
        g_free (class_name);
 }
@@ -3461,7 +3161,7 @@ build_class_buffer (gpointer key, gpointer value, gpointer userdata)
 static void
 get_coverage_for_image (MonoImage *image, int *number_of_methods, guint *fully_covered, int *partially_covered)
 {
-       MonoLockFreeQueue *image_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (image_to_methods, image);
+       MonoLockFreeQueue *image_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (log_profiler.coverage_image_to_methods, image);
 
        *number_of_methods = mono_image_get_table_rows (image, MONO_TABLE_METHOD);
        if (image_methods)
@@ -3510,25 +3210,17 @@ build_assembly_buffer (gpointer key, gpointer value, gpointer userdata)
        emit_uvalue (logbuffer, fully_covered);
        emit_uvalue (logbuffer, partially_covered);
 
-       EXIT_LOG_EXPLICIT (DO_SEND);
+       EXIT_LOG;
 }
 
 static void
-dump_coverage (MonoProfiler *prof)
+dump_coverage (void)
 {
-       if (!coverage_initialized)
-               return;
-
-       COVERAGE_DEBUG(fprintf (stderr, "Coverage: Started dump\n");)
-       method_id = 0;
-
-       mono_os_mutex_lock (&coverage_mutex);
-       mono_conc_hashtable_foreach (coverage_assemblies, build_assembly_buffer, NULL);
-       mono_conc_hashtable_foreach (coverage_classes, build_class_buffer, NULL);
-       mono_conc_hashtable_foreach (coverage_methods, build_method_buffer, prof);
-       mono_os_mutex_unlock (&coverage_mutex);
-
-       COVERAGE_DEBUG(fprintf (stderr, "Coverage: Finished dump\n");)
+       mono_os_mutex_lock (&log_profiler.coverage_mutex);
+       mono_conc_hashtable_foreach (log_profiler.coverage_assemblies, build_assembly_buffer, NULL);
+       mono_conc_hashtable_foreach (log_profiler.coverage_classes, build_class_buffer, NULL);
+       mono_conc_hashtable_foreach (log_profiler.coverage_methods, build_method_buffer, NULL);
+       mono_os_mutex_unlock (&log_profiler.coverage_mutex);
 }
 
 static MonoLockFreeQueueNode *
@@ -3555,42 +3247,31 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method)
        MonoLockFreeQueue *image_methods, *class_methods;
        MonoLockFreeQueueNode *node;
 
-       g_assert (coverage_initialized && "Why are we being asked for coverage filter info when we're not doing coverage?");
-
-       COVERAGE_DEBUG(fprintf (stderr, "Coverage filter for %s\n", mono_method_get_name (method));)
-
        flags = mono_method_get_flags (method, &iflags);
-       if ((iflags & 0x1000 /*METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL*/) ||
-           (flags & 0x2000 /*METHOD_ATTRIBUTE_PINVOKE_IMPL*/)) {
-               COVERAGE_DEBUG(fprintf (stderr, "   Internal call or pinvoke - ignoring\n");)
+       if ((iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+           (flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
                return FALSE;
-       }
 
        // Don't need to do anything else if we're already tracking this method
-       if (mono_conc_hashtable_lookup (coverage_methods, method)) {
-               COVERAGE_DEBUG(fprintf (stderr, "   Already tracking\n");)
+       if (mono_conc_hashtable_lookup (log_profiler.coverage_methods, method))
                return TRUE;
-       }
 
        klass = mono_method_get_class (method);
        image = mono_class_get_image (klass);
 
        // Don't handle coverage for the core assemblies
-       if (mono_conc_hashtable_lookup (suppressed_assemblies, (gpointer) mono_image_get_name (image)) != NULL)
+       if (mono_conc_hashtable_lookup (log_profiler.coverage_suppressed_assemblies, (gpointer) mono_image_get_name (image)) != NULL)
                return FALSE;
 
        if (prof->coverage_filters) {
                /* Check already filtered classes first */
-               if (mono_conc_hashtable_lookup (filtered_classes, klass)) {
-                       COVERAGE_DEBUG(fprintf (stderr, "   Already filtered\n");)
+               if (mono_conc_hashtable_lookup (log_profiler.coverage_filtered_classes, klass))
                        return FALSE;
-               }
 
                classname = mono_type_get_name (mono_class_get_type (klass));
 
                fqn = g_strdup_printf ("[%s]%s", mono_image_get_name (image), classname);
 
-               COVERAGE_DEBUG(fprintf (stderr, "   Looking for %s in filter\n", fqn);)
                // Check positive filters first
                has_positive = FALSE;
                found = FALSE;
@@ -3600,24 +3281,17 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method)
                        if (filter [0] == '+') {
                                filter = &filter [1];
 
-                               COVERAGE_DEBUG(fprintf (stderr, "   Checking against +%s ...", filter);)
-
-                               if (strstr (fqn, filter) != NULL) {
-                                       COVERAGE_DEBUG(fprintf (stderr, "matched\n");)
+                               if (strstr (fqn, filter) != NULL)
                                        found = TRUE;
-                               } else
-                                       COVERAGE_DEBUG(fprintf (stderr, "no match\n");)
 
                                has_positive = TRUE;
                        }
                }
 
                if (has_positive && !found) {
-                       COVERAGE_DEBUG(fprintf (stderr, "   Positive match was not found\n");)
-
-                       mono_os_mutex_lock (&coverage_mutex);
-                       mono_conc_hashtable_insert (filtered_classes, klass, klass);
-                       mono_os_mutex_unlock (&coverage_mutex);
+                       mono_os_mutex_lock (&log_profiler.coverage_mutex);
+                       mono_conc_hashtable_insert (log_profiler.coverage_filtered_classes, klass, klass);
+                       mono_os_mutex_unlock (&log_profiler.coverage_mutex);
                        g_free (fqn);
                        g_free (classname);
 
@@ -3632,28 +3306,22 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method)
 
                        // Skip '-'
                        filter = &filter [1];
-                       COVERAGE_DEBUG(fprintf (stderr, "   Checking against -%s ...", filter);)
 
                        if (strstr (fqn, filter) != NULL) {
-                               COVERAGE_DEBUG(fprintf (stderr, "matched\n");)
-
-                               mono_os_mutex_lock (&coverage_mutex);
-                               mono_conc_hashtable_insert (filtered_classes, klass, klass);
-                               mono_os_mutex_unlock (&coverage_mutex);
+                               mono_os_mutex_lock (&log_profiler.coverage_mutex);
+                               mono_conc_hashtable_insert (log_profiler.coverage_filtered_classes, klass, klass);
+                               mono_os_mutex_unlock (&log_profiler.coverage_mutex);
                                g_free (fqn);
                                g_free (classname);
 
                                return FALSE;
-                       } else
-                               COVERAGE_DEBUG(fprintf (stderr, "no match\n");)
-
+                       }
                }
 
                g_free (fqn);
                g_free (classname);
        }
 
-       COVERAGE_DEBUG(fprintf (stderr, "   Handling coverage for %s\n", mono_method_get_name (method));)
        header = mono_method_get_header_checked (method, &error);
        mono_error_cleanup (&error);
 
@@ -3666,32 +3334,32 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method)
        // generated causing a crash. See https://bugzilla.xamarin.com/show_bug.cgi?id=39325
        mono_assembly_addref (assembly);
 
-       mono_os_mutex_lock (&coverage_mutex);
-       mono_conc_hashtable_insert (coverage_methods, method, method);
-       mono_conc_hashtable_insert (coverage_assemblies, assembly, assembly);
-       mono_os_mutex_unlock (&coverage_mutex);
+       mono_os_mutex_lock (&log_profiler.coverage_mutex);
+       mono_conc_hashtable_insert (log_profiler.coverage_methods, method, method);
+       mono_conc_hashtable_insert (log_profiler.coverage_assemblies, assembly, assembly);
+       mono_os_mutex_unlock (&log_profiler.coverage_mutex);
 
-       image_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (image_to_methods, image);
+       image_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (log_profiler.coverage_image_to_methods, image);
 
        if (image_methods == NULL) {
                image_methods = (MonoLockFreeQueue *) g_malloc (sizeof (MonoLockFreeQueue));
                mono_lock_free_queue_init (image_methods);
-               mono_os_mutex_lock (&coverage_mutex);
-               mono_conc_hashtable_insert (image_to_methods, image, image_methods);
-               mono_os_mutex_unlock (&coverage_mutex);
+               mono_os_mutex_lock (&log_profiler.coverage_mutex);
+               mono_conc_hashtable_insert (log_profiler.coverage_image_to_methods, image, image_methods);
+               mono_os_mutex_unlock (&log_profiler.coverage_mutex);
        }
 
        node = create_method_node (method);
        mono_lock_free_queue_enqueue (image_methods, node);
 
-       class_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (coverage_classes, klass);
+       class_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (log_profiler.coverage_classes, klass);
 
        if (class_methods == NULL) {
                class_methods = (MonoLockFreeQueue *) g_malloc (sizeof (MonoLockFreeQueue));
                mono_lock_free_queue_init (class_methods);
-               mono_os_mutex_lock (&coverage_mutex);
-               mono_conc_hashtable_insert (coverage_classes, klass, class_methods);
-               mono_os_mutex_unlock (&coverage_mutex);
+               mono_os_mutex_lock (&log_profiler.coverage_mutex);
+               mono_conc_hashtable_insert (log_profiler.coverage_classes, klass, class_methods);
+               mono_os_mutex_unlock (&log_profiler.coverage_mutex);
        }
 
        node = create_method_node (method);
@@ -3764,21 +3432,20 @@ init_suppressed_assemblies (void)
        char *line;
        FILE *sa_file;
 
-       suppressed_assemblies = mono_conc_hashtable_new (g_str_hash, g_str_equal);
+       log_profiler.coverage_suppressed_assemblies = mono_conc_hashtable_new (g_str_hash, g_str_equal);
        sa_file = fopen (SUPPRESSION_DIR "/mono-profiler-log.suppression", "r");
        if (sa_file == NULL)
                return;
 
        /* Don't need to free @content as it is referred to by the lines stored in @suppressed_assemblies */
        content = get_file_content (sa_file);
-       if (content == NULL) {
-               g_error ("mono-profiler-log.suppression is greater than 128kb - aborting\n");
-       }
+       if (content == NULL)
+               g_error ("mono-profiler-log.suppression is greater than 128kb - aborting.");
 
        while ((line = get_next_line (content, &content))) {
                line = g_strchomp (g_strchug (line));
                /* No locking needed as we're doing initialization */
-               mono_conc_hashtable_insert (suppressed_assemblies, line, line);
+               mono_conc_hashtable_insert (log_profiler.coverage_suppressed_assemblies, line, line);
        }
 
        fclose (sa_file);
@@ -3787,19 +3454,20 @@ init_suppressed_assemblies (void)
 static void
 parse_cov_filter_file (GPtrArray *filters, const char *file)
 {
-       FILE *filter_file;
-       char *line, *content;
+       FILE *filter_file = fopen (file, "r");
 
-       filter_file = fopen (file, "r");
        if (filter_file == NULL) {
-               fprintf (stderr, "Unable to open %s\n", file);
+               mono_profiler_printf_err ("Could not open coverage filter file '%s'.", file);
                return;
        }
 
        /* Don't need to free content as it is referred to by the lines stored in @filters */
-       content = get_file_content (filter_file);
+       char *content = get_file_content (filter_file);
+
        if (content == NULL)
-               fprintf (stderr, "WARNING: %s is greater than 128kb - ignoring\n", file);
+               mono_profiler_printf_err ("Coverage filter file '%s' is larger than 128kb - ignoring.", file);
+
+       char *line;
 
        while ((line = get_next_line (content, &content)))
                g_ptr_array_add (filters, g_strchug (g_strchomp (line)));
@@ -3808,21 +3476,15 @@ parse_cov_filter_file (GPtrArray *filters, const char *file)
 }
 
 static void
-coverage_init (MonoProfiler *prof)
-{
-       g_assert (!coverage_initialized && "Why are we initializing coverage twice?");
-
-       COVERAGE_DEBUG(fprintf (stderr, "Coverage initialized\n");)
-
-       mono_os_mutex_init (&coverage_mutex);
-       coverage_methods = mono_conc_hashtable_new (NULL, NULL);
-       coverage_assemblies = mono_conc_hashtable_new (NULL, NULL);
-       coverage_classes = mono_conc_hashtable_new (NULL, NULL);
-       filtered_classes = mono_conc_hashtable_new (NULL, NULL);
-       image_to_methods = mono_conc_hashtable_new (NULL, NULL);
+coverage_init (void)
+{
+       mono_os_mutex_init (&log_profiler.coverage_mutex);
+       log_profiler.coverage_methods = mono_conc_hashtable_new (NULL, NULL);
+       log_profiler.coverage_assemblies = mono_conc_hashtable_new (NULL, NULL);
+       log_profiler.coverage_classes = mono_conc_hashtable_new (NULL, NULL);
+       log_profiler.coverage_filtered_classes = mono_conc_hashtable_new (NULL, NULL);
+       log_profiler.coverage_image_to_methods = mono_conc_hashtable_new (NULL, NULL);
        init_suppressed_assemblies ();
-
-       coverage_initialized = TRUE;
 }
 
 static void
@@ -3839,45 +3501,55 @@ free_sample_hit (gpointer p)
 }
 
 static void
-cleanup_reusable_samples (MonoProfiler *prof)
+cleanup_reusable_samples (void)
 {
        SampleHit *sample;
 
-       while ((sample = (SampleHit *) mono_lock_free_queue_dequeue (&prof->sample_reuse_queue)))
+       while ((sample = (SampleHit *) mono_lock_free_queue_dequeue (&log_profiler.sample_reuse_queue)))
                mono_thread_hazardous_try_free (sample, free_sample_hit);
 }
 
+static void
+log_early_shutdown (MonoProfiler *prof)
+{
+       if (log_config.hs_on_shutdown) {
+               InterlockedWrite (&log_profiler.heapshot_requested, 1);
+               mono_gc_collect (mono_gc_max_generation ());
+       }
+}
+
 static void
 log_shutdown (MonoProfiler *prof)
 {
-       InterlockedWrite (&in_shutdown, 1);
+       InterlockedWrite (&log_profiler.in_shutdown, 1);
 
-       if (!no_counters)
-               counters_and_perfcounters_sample (prof);
+       if (ENABLED (PROFLOG_COUNTER_EVENTS))
+               counters_and_perfcounters_sample ();
 
-       dump_coverage (prof);
+       if (log_config.collect_coverage)
+               dump_coverage ();
 
        char c = 1;
 
        if (write (prof->pipes [1], &c, 1) != 1) {
-               fprintf (stderr, "Could not write to pipe: %s\n", strerror (errno));
+               mono_profiler_printf_err ("Could not write to log profiler pipe: %s", g_strerror (errno));
                exit (1);
        }
 
        mono_native_thread_join (prof->helper_thread);
 
-       mono_os_mutex_destroy (&counters_mutex);
+       mono_os_mutex_destroy (&log_profiler.counters_mutex);
 
        MonoCounterAgent *mc_next;
 
-       for (MonoCounterAgent *cur = counters; cur; cur = mc_next) {
+       for (MonoCounterAgent *cur = log_profiler.counters; cur; cur = mc_next) {
                mc_next = cur->next;
                g_free (cur);
        }
 
        PerfCounterAgent *pc_next;
 
-       for (PerfCounterAgent *cur = perfcounters; cur; cur = pc_next) {
+       for (PerfCounterAgent *cur = log_profiler.perfcounters; cur; cur = pc_next) {
                pc_next = cur->next;
                g_free (cur);
        }
@@ -3887,8 +3559,8 @@ log_shutdown (MonoProfiler *prof)
         * not immediately removed upon calling mono_lls_remove (), by
         * iterating until the head is NULL.
         */
-       while (profiler_thread_list.head) {
-               MONO_LLS_FOREACH_SAFE (&profiler_thread_list, MonoProfilerThread, thread) {
+       while (log_profiler.profiler_thread_list.head) {
+               MONO_LLS_FOREACH_SAFE (&log_profiler.profiler_thread_list, MonoProfilerThread, thread) {
                        g_assert (thread->attached && "Why is a thread in the LLS not attached?");
 
                        remove_thread (thread);
@@ -3917,7 +3589,7 @@ log_shutdown (MonoProfiler *prof)
         */
        mono_thread_hazardous_try_free_all ();
 
-       cleanup_reusable_samples (prof);
+       cleanup_reusable_samples ();
 
        /*
         * Finally, make sure that all sample hits are freed. This should cover all
@@ -3927,7 +3599,7 @@ log_shutdown (MonoProfiler *prof)
         */
        mono_thread_hazardous_try_free_all ();
 
-       gint32 state = InterlockedRead (&buffer_lock_state);
+       gint32 state = InterlockedRead (&log_profiler.buffer_lock_state);
 
        g_assert (!(state & 0xFFFF) && "Why is the reader count still non-zero?");
        g_assert (!(state >> 16) && "Why is the exclusive lock still held?");
@@ -3944,25 +3616,26 @@ log_shutdown (MonoProfiler *prof)
        mono_conc_hashtable_destroy (prof->method_table);
        mono_os_mutex_destroy (&prof->method_table_mutex);
 
-       if (coverage_initialized) {
-               mono_os_mutex_lock (&coverage_mutex);
-               mono_conc_hashtable_foreach (coverage_assemblies, unref_coverage_assemblies, prof);
-               mono_os_mutex_unlock (&coverage_mutex);
+       if (log_config.collect_coverage) {
+               mono_os_mutex_lock (&log_profiler.coverage_mutex);
+               mono_conc_hashtable_foreach (log_profiler.coverage_assemblies, unref_coverage_assemblies, NULL);
+               mono_os_mutex_unlock (&log_profiler.coverage_mutex);
 
-               mono_conc_hashtable_destroy (coverage_methods);
-               mono_conc_hashtable_destroy (coverage_assemblies);
-               mono_conc_hashtable_destroy (coverage_classes);
-               mono_conc_hashtable_destroy (filtered_classes);
+               mono_conc_hashtable_destroy (log_profiler.coverage_methods);
+               mono_conc_hashtable_destroy (log_profiler.coverage_assemblies);
+               mono_conc_hashtable_destroy (log_profiler.coverage_classes);
+               mono_conc_hashtable_destroy (log_profiler.coverage_filtered_classes);
 
-               mono_conc_hashtable_destroy (image_to_methods);
-               mono_conc_hashtable_destroy (suppressed_assemblies);
-               mono_os_mutex_destroy (&coverage_mutex);
+               mono_conc_hashtable_destroy (log_profiler.coverage_image_to_methods);
+               mono_conc_hashtable_destroy (log_profiler.coverage_suppressed_assemblies);
+               mono_os_mutex_destroy (&log_profiler.coverage_mutex);
        }
 
+       mono_coop_mutex_destroy (&log_profiler.api_mutex);
+
        PROF_TLS_FREE ();
 
        g_free (prof->args);
-       g_free (prof);
 }
 
 static char*
@@ -4034,7 +3707,7 @@ add_to_fd_set (fd_set *set, int fd, int *max_fd)
         * error and exiting.
         */
        if (fd >= FD_SETSIZE) {
-               fprintf (stderr, "File descriptor is out of bounds for fd_set: %d\n", fd);
+               mono_profiler_printf_err ("File descriptor is out of bounds for fd_set: %d", fd);
                exit (1);
        }
 
@@ -4047,12 +3720,10 @@ add_to_fd_set (fd_set *set, int fd, int *max_fd)
 static void *
 helper_thread (void *arg)
 {
-       MonoProfiler *prof = (MonoProfiler *) arg;
-
        mono_threads_attach_tools_thread ();
        mono_native_thread_set_name (mono_native_thread_id_get (), "Profiler helper");
 
-       MonoProfilerThread *thread = init_thread (prof, FALSE);
+       MonoProfilerThread *thread = init_thread (FALSE);
 
        GArray *command_sockets = g_array_new (FALSE, FALSE, sizeof (int));
 
@@ -4062,8 +3733,8 @@ helper_thread (void *arg)
 
                FD_ZERO (&rfds);
 
-               add_to_fd_set (&rfds, prof->server_socket, &max_fd);
-               add_to_fd_set (&rfds, prof->pipes [0], &max_fd);
+               add_to_fd_set (&rfds, log_profiler.server_socket, &max_fd);
+               add_to_fd_set (&rfds, log_profiler.pipes [0], &max_fd);
 
                for (gint i = 0; i < command_sockets->len; i++)
                        add_to_fd_set (&rfds, g_array_index (command_sockets, int, i), &max_fd);
@@ -4075,12 +3746,12 @@ helper_thread (void *arg)
                        if (errno == EINTR)
                                continue;
 
-                       fprintf (stderr, "Error in mono-profiler-log server: %s", strerror (errno));
+                       mono_profiler_printf_err ("Could not poll in log profiler helper thread: %s", g_strerror (errno));
                        exit (1);
                }
 
-               if (!no_counters)
-                       counters_and_perfcounters_sample (prof);
+               if (ENABLED (PROFLOG_COUNTER_EVENTS))
+                       counters_and_perfcounters_sample ();
 
                buffer_lock_excl ();
 
@@ -4089,9 +3760,9 @@ helper_thread (void *arg)
                buffer_unlock_excl ();
 
                // Are we shutting down?
-               if (FD_ISSET (prof->pipes [0], &rfds)) {
+               if (FD_ISSET (log_profiler.pipes [0], &rfds)) {
                        char c;
-                       read (prof->pipes [0], &c, 1);
+                       read (log_profiler.pipes [0], &c, 1);
                        break;
                }
 
@@ -4117,15 +3788,15 @@ helper_thread (void *arg)
 
                        buf [len] = 0;
 
-                       if (!strcmp (buf, "heapshot\n") && hs_mode_ondemand) {
+                       if (log_config.hs_mode == MONO_PROFILER_HEAPSHOT_ON_DEMAND && !strcmp (buf, "heapshot\n")) {
                                // Rely on the finalization callback triggering a GC.
-                               heapshot_requested = 1;
+                               InterlockedWrite (&log_profiler.heapshot_requested, 1);
                                mono_gc_finalize_notify ();
                        }
                }
 
-               if (FD_ISSET (prof->server_socket, &rfds)) {
-                       int fd = accept (prof->server_socket, NULL, NULL);
+               if (FD_ISSET (log_profiler.server_socket, &rfds)) {
+                       int fd = accept (log_profiler.server_socket, NULL, NULL);
 
                        if (fd != -1) {
                                if (fd >= FD_SETSIZE)
@@ -4150,17 +3821,17 @@ helper_thread (void *arg)
 }
 
 static void
-start_helper_thread (MonoProfiler* prof)
+start_helper_thread (void)
 {
-       if (pipe (prof->pipes) == -1) {
-               fprintf (stderr, "Cannot create pipe: %s\n", strerror (errno));
+       if (pipe (log_profiler.pipes) == -1) {
+               mono_profiler_printf_err ("Could not create log profiler pipe: %s", g_strerror (errno));
                exit (1);
        }
 
-       prof->server_socket = socket (PF_INET, SOCK_STREAM, 0);
+       log_profiler.server_socket = socket (PF_INET, SOCK_STREAM, 0);
 
-       if (prof->server_socket == -1) {
-               fprintf (stderr, "Cannot create server socket: %s\n", strerror (errno));
+       if (log_profiler.server_socket == -1) {
+               mono_profiler_printf_err ("Could not create log profiler server socket: %s", g_strerror (errno));
                exit (1);
        }
 
@@ -4169,33 +3840,33 @@ start_helper_thread (MonoProfiler* prof)
        memset (&server_address, 0, sizeof (server_address));
        server_address.sin_family = AF_INET;
        server_address.sin_addr.s_addr = INADDR_ANY;
-       server_address.sin_port = htons (prof->command_port);
+       server_address.sin_port = htons (log_profiler.command_port);
 
-       if (bind (prof->server_socket, (struct sockaddr *) &server_address, sizeof (server_address)) == -1) {
-               fprintf (stderr, "Cannot bind server socket on port %d: %s\n", prof->command_port, strerror (errno));
-               close (prof->server_socket);
+       if (bind (log_profiler.server_socket, (struct sockaddr *) &server_address, sizeof (server_address)) == -1) {
+               mono_profiler_printf_err ("Could not bind log profiler server socket on port %d: %s", log_profiler.command_port, g_strerror (errno));
+               close (log_profiler.server_socket);
                exit (1);
        }
 
-       if (listen (prof->server_socket, 1) == -1) {
-               fprintf (stderr, "Cannot listen on server socket: %s\n", strerror (errno));
-               close (prof->server_socket);
+       if (listen (log_profiler.server_socket, 1) == -1) {
+               mono_profiler_printf_err ("Could not listen on log profiler server socket: %s", g_strerror (errno));
+               close (log_profiler.server_socket);
                exit (1);
        }
 
        socklen_t slen = sizeof (server_address);
 
-       if (getsockname (prof->server_socket, (struct sockaddr *) &server_address, &slen)) {
-               fprintf (stderr, "Could not get assigned port: %s\n", strerror (errno));
-               close (prof->server_socket);
+       if (getsockname (log_profiler.server_socket, (struct sockaddr *) &server_address, &slen)) {
+               mono_profiler_printf_err ("Could not retrieve assigned port for log profiler server socket: %s", g_strerror (errno));
+               close (log_profiler.server_socket);
                exit (1);
        }
 
-       prof->command_port = ntohs (server_address.sin_port);
+       log_profiler.command_port = ntohs (server_address.sin_port);
 
-       if (!mono_native_thread_create (&prof->helper_thread, helper_thread, prof)) {
-               fprintf (stderr, "Could not start helper thread\n");
-               close (prof->server_socket);
+       if (!mono_native_thread_create (&log_profiler.helper_thread, helper_thread, NULL)) {
+               mono_profiler_printf_err ("Could not start log profiler helper thread");
+               close (log_profiler.server_socket);
                exit (1);
        }
 }
@@ -4207,11 +3878,11 @@ free_writer_entry (gpointer p)
 }
 
 static gboolean
-handle_writer_queue_entry (MonoProfiler *prof)
+handle_writer_queue_entry (void)
 {
        WriterQueueEntry *entry;
 
-       if ((entry = (WriterQueueEntry *) mono_lock_free_queue_dequeue (&prof->writer_queue))) {
+       if ((entry = (WriterQueueEntry *) mono_lock_free_queue_dequeue (&log_profiler.writer_queue))) {
                if (!entry->methods)
                        goto no_methods;
 
@@ -4231,7 +3902,7 @@ handle_writer_queue_entry (MonoProfiler *prof)
                for (guint i = 0; i < entry->methods->len; i++) {
                        MethodInfo *info = (MethodInfo *) g_ptr_array_index (entry->methods, i);
 
-                       if (mono_conc_hashtable_lookup (prof->method_table, info->method))
+                       if (mono_conc_hashtable_lookup (log_profiler.method_table, info->method))
                                goto free_info; // This method already has metadata emitted.
 
                        /*
@@ -4244,9 +3915,9 @@ handle_writer_queue_entry (MonoProfiler *prof)
                         * method lists will just be empty for the rest of the
                         * app's lifetime.
                         */
-                       mono_os_mutex_lock (&prof->method_table_mutex);
-                       mono_conc_hashtable_insert (prof->method_table, info->method, info->method);
-                       mono_os_mutex_unlock (&prof->method_table_mutex);
+                       mono_os_mutex_lock (&log_profiler.method_table_mutex);
+                       mono_conc_hashtable_insert (log_profiler.method_table, info->method, info->method);
+                       mono_os_mutex_unlock (&log_profiler.method_table_mutex);
 
                        char *name = mono_method_full_name (info->method, 1);
                        int nlen = strlen (name) + 1;
@@ -4284,12 +3955,12 @@ handle_writer_queue_entry (MonoProfiler *prof)
                if (wrote_methods) {
                        MonoProfilerThread *thread = PROF_TLS_GET ();
 
-                       dump_buffer_threadless (prof, thread->buffer);
+                       dump_buffer_threadless (thread->buffer);
                        init_buffer_state (thread);
                }
 
        no_methods:
-               dump_buffer (prof, entry->buffer);
+               dump_buffer (entry->buffer);
 
                mono_thread_hazardous_try_free (entry, free_writer_entry);
 
@@ -4302,22 +3973,20 @@ handle_writer_queue_entry (MonoProfiler *prof)
 static void *
 writer_thread (void *arg)
 {
-       MonoProfiler *prof = (MonoProfiler *)arg;
-
        mono_threads_attach_tools_thread ();
        mono_native_thread_set_name (mono_native_thread_id_get (), "Profiler writer");
 
-       dump_header (prof);
+       dump_header ();
 
-       MonoProfilerThread *thread = init_thread (prof, FALSE);
+       MonoProfilerThread *thread = init_thread (FALSE);
 
-       while (InterlockedRead (&prof->run_writer_thread)) {
-               mono_os_sem_wait (&prof->writer_queue_sem, MONO_SEM_FLAGS_NONE);
-               handle_writer_queue_entry (prof);
+       while (InterlockedRead (&log_profiler.run_writer_thread)) {
+               mono_os_sem_wait (&log_profiler.writer_queue_sem, MONO_SEM_FLAGS_NONE);
+               handle_writer_queue_entry ();
        }
 
        /* Drain any remaining entries on shutdown. */
-       while (handle_writer_queue_entry (prof));
+       while (handle_writer_queue_entry ());
 
        free_buffer (thread->buffer, thread->buffer->size);
        deinit_thread (thread);
@@ -4328,12 +3997,12 @@ writer_thread (void *arg)
 }
 
 static void
-start_writer_thread (MonoProfiler* prof)
+start_writer_thread (void)
 {
-       InterlockedWrite (&prof->run_writer_thread, 1);
+       InterlockedWrite (&log_profiler.run_writer_thread, 1);
 
-       if (!mono_native_thread_create (&prof->writer_thread, writer_thread, prof)) {
-               fprintf (stderr, "Could not start writer thread\n");
+       if (!mono_native_thread_create (&log_profiler.writer_thread, writer_thread, NULL)) {
+               mono_profiler_printf_err ("Could not start log profiler writer thread");
                exit (1);
        }
 }
@@ -4344,15 +4013,15 @@ reuse_sample_hit (gpointer p)
        SampleHit *sample = p;
 
        mono_lock_free_queue_node_unpoison (&sample->node);
-       mono_lock_free_queue_enqueue (&sample->prof->sample_reuse_queue, &sample->node);
+       mono_lock_free_queue_enqueue (&log_profiler.sample_reuse_queue, &sample->node);
 }
 
 static gboolean
-handle_dumper_queue_entry (MonoProfiler *prof)
+handle_dumper_queue_entry (void)
 {
        SampleHit *sample;
 
-       if ((sample = (SampleHit *) mono_lock_free_queue_dequeue (&prof->dumper_queue))) {
+       if ((sample = (SampleHit *) mono_lock_free_queue_dequeue (&log_profiler.dumper_queue))) {
                for (int i = 0; i < sample->count; ++i) {
                        MonoMethod *method = sample->frames [i].method;
                        MonoDomain *domain = sample->frames [i].domain;
@@ -4371,7 +4040,6 @@ handle_dumper_queue_entry (MonoProfiler *prof)
 
                ENTER_LOG (&sample_hits_ctr, logbuffer,
                        EVENT_SIZE /* event */ +
-                       BYTE_SIZE /* type */ +
                        LEB128_SIZE /* tid */ +
                        LEB128_SIZE /* count */ +
                        1 * (
@@ -4399,11 +4067,11 @@ handle_dumper_queue_entry (MonoProfiler *prof)
                for (int i = 0; i < sample->count; ++i)
                        emit_method (logbuffer, sample->frames [i].method);
 
-               EXIT_LOG_EXPLICIT (DO_SEND);
+               EXIT_LOG;
 
                mono_thread_hazardous_try_free (sample, reuse_sample_hit);
 
-               dump_unmanaged_coderefs (prof);
+               dump_unmanaged_coderefs ();
        }
 
        return FALSE;
@@ -4412,26 +4080,24 @@ handle_dumper_queue_entry (MonoProfiler *prof)
 static void *
 dumper_thread (void *arg)
 {
-       MonoProfiler *prof = (MonoProfiler *)arg;
-
        mono_threads_attach_tools_thread ();
        mono_native_thread_set_name (mono_native_thread_id_get (), "Profiler dumper");
 
-       MonoProfilerThread *thread = init_thread (prof, FALSE);
+       MonoProfilerThread *thread = init_thread (FALSE);
 
-       while (InterlockedRead (&prof->run_dumper_thread)) {
+       while (InterlockedRead (&log_profiler.run_dumper_thread)) {
                /*
                 * Flush samples every second so it doesn't seem like the profiler is
                 * not working if the program is mostly idle.
                 */
-               if (mono_os_sem_timedwait (&prof->dumper_queue_sem, 1000, MONO_SEM_FLAGS_NONE) == MONO_SEM_TIMEDWAIT_RET_TIMEDOUT)
+               if (mono_os_sem_timedwait (&log_profiler.dumper_queue_sem, 1000, MONO_SEM_FLAGS_NONE) == MONO_SEM_TIMEDWAIT_RET_TIMEDOUT)
                        send_log_unsafe (FALSE);
 
-               handle_dumper_queue_entry (prof);
+               handle_dumper_queue_entry ();
        }
 
        /* Drain any remaining entries on shutdown. */
-       while (handle_dumper_queue_entry (prof));
+       while (handle_dumper_queue_entry ());
 
        send_log_unsafe (FALSE);
        deinit_thread (thread);
@@ -4442,12 +4108,12 @@ dumper_thread (void *arg)
 }
 
 static void
-start_dumper_thread (MonoProfiler* prof)
+start_dumper_thread (void)
 {
-       InterlockedWrite (&prof->run_dumper_thread, 1);
+       InterlockedWrite (&log_profiler.run_dumper_thread, 1);
 
-       if (!mono_native_thread_create (&prof->dumper_thread, dumper_thread, prof)) {
-               fprintf (stderr, "Could not start dumper thread\n");
+       if (!mono_native_thread_create (&log_profiler.dumper_thread, dumper_thread, NULL)) {
+               mono_profiler_printf_err ("Could not start log profiler dumper thread");
                exit (1);
        }
 }
@@ -4458,10 +4124,329 @@ register_counter (const char *name, gint32 *counter)
        mono_counters_register (name, MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, counter);
 }
 
+ICALL_EXPORT gint32
+proflog_icall_GetMaxStackTraceFrames (void)
+{
+       return MAX_FRAMES;
+}
+
+ICALL_EXPORT gint32
+proflog_icall_GetStackTraceFrames (void)
+{
+       return log_config.num_frames;
+}
+
+ICALL_EXPORT void
+proflog_icall_SetStackTraceFrames (gint32 value)
+{
+       log_config.num_frames = value;
+}
+
+ICALL_EXPORT MonoProfilerHeapshotMode
+proflog_icall_GetHeapshotMode (void)
+{
+       return log_config.hs_mode;
+}
+
+ICALL_EXPORT void
+proflog_icall_SetHeapshotMode (MonoProfilerHeapshotMode value)
+{
+       log_config.hs_mode = value;
+}
+
+ICALL_EXPORT gint32
+proflog_icall_GetHeapshotMillisecondsFrequency (void)
+{
+       return log_config.hs_freq_ms;
+}
+
+ICALL_EXPORT void
+proflog_icall_SetHeapshotMillisecondsFrequency (gint32 value)
+{
+       log_config.hs_freq_ms = value;
+}
+
+ICALL_EXPORT gint32
+proflog_icall_GetHeapshotCollectionsFrequency (void)
+{
+       return log_config.hs_freq_gc;
+}
+
+ICALL_EXPORT void
+proflog_icall_SetHeapshotCollectionsFrequency (gint32 value)
+{
+       log_config.hs_freq_gc = value;
+}
+
+ICALL_EXPORT gint32
+proflog_icall_GetCallDepth (void)
+{
+       return log_config.max_call_depth;
+}
+
+ICALL_EXPORT void
+proflog_icall_SetCallDepth (gint32 value)
+{
+       log_config.max_call_depth = value;
+}
+
+ICALL_EXPORT void
+proflog_icall_GetSampleMode (MonoProfilerSampleMode *mode, gint32 *frequency)
+{
+       uint32_t freq;
+
+       mono_profiler_get_sample_mode (log_profiler.handle, mode, &freq);
+
+       *frequency = freq;
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_SetSampleMode (MonoProfilerSampleMode mode, gint32 frequency)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       mono_bool result = mono_profiler_set_sample_mode (log_profiler.handle, mode, frequency);
+
+       if (mode != MONO_PROFILER_SAMPLE_MODE_NONE) {
+               ENABLE (PROFLOG_SAMPLE_EVENTS);
+               mono_profiler_set_sample_hit_callback (log_profiler.handle, mono_sample_hit);
+       } else {
+               DISABLE (PROFLOG_SAMPLE_EVENTS);
+               mono_profiler_set_sample_hit_callback (log_profiler.handle, NULL);
+       }
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+
+       return result;
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_GetExceptionEvents (void)
+{
+       return ENABLED (PROFLOG_EXCEPTION_EVENTS);
+}
+
+ICALL_EXPORT void
+proflog_icall_SetExceptionEvents (MonoBoolean value)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       if (value) {
+               ENABLE (PROFLOG_EXCEPTION_EVENTS);
+               mono_profiler_set_exception_throw_callback (log_profiler.handle, throw_exc);
+               mono_profiler_set_exception_clause_callback (log_profiler.handle, clause_exc);
+       } else {
+               DISABLE (PROFLOG_EXCEPTION_EVENTS);
+               mono_profiler_set_exception_throw_callback (log_profiler.handle, NULL);
+               mono_profiler_set_exception_clause_callback (log_profiler.handle, NULL);
+       }
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_GetMonitorEvents (void)
+{
+       return ENABLED (PROFLOG_MONITOR_EVENTS);
+}
+
+ICALL_EXPORT void
+proflog_icall_SetMonitorEvents (MonoBoolean value)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       if (value) {
+               ENABLE (PROFLOG_EXCEPTION_EVENTS);
+               mono_profiler_set_monitor_contention_callback (log_profiler.handle, monitor_contention);
+               mono_profiler_set_monitor_acquired_callback (log_profiler.handle, monitor_acquired);
+               mono_profiler_set_monitor_failed_callback (log_profiler.handle, monitor_failed);
+       } else {
+               DISABLE (PROFLOG_EXCEPTION_EVENTS);
+               mono_profiler_set_monitor_contention_callback (log_profiler.handle, NULL);
+               mono_profiler_set_monitor_acquired_callback (log_profiler.handle, NULL);
+               mono_profiler_set_monitor_failed_callback (log_profiler.handle, NULL);
+       }
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_GetGCEvents (void)
+{
+       return ENABLED (PROFLOG_GC_EVENTS);
+}
+
+ICALL_EXPORT void
+proflog_icall_SetGCEvents (MonoBoolean value)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       if (value)
+               ENABLE (PROFLOG_GC_EVENTS);
+       else
+               DISABLE (PROFLOG_GC_EVENTS);
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_GetGCAllocationEvents (void)
+{
+       return ENABLED (PROFLOG_GC_ALLOCATION_EVENTS);
+}
+
+ICALL_EXPORT void
+proflog_icall_SetGCAllocationEvents (MonoBoolean value)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       if (value) {
+               ENABLE (PROFLOG_GC_ALLOCATION_EVENTS);
+               mono_profiler_set_gc_allocation_callback (log_profiler.handle, gc_alloc);
+       } else {
+               DISABLE (PROFLOG_GC_ALLOCATION_EVENTS);
+               mono_profiler_set_gc_allocation_callback (log_profiler.handle, NULL);
+       }
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_GetGCMoveEvents (void)
+{
+       return ENABLED (PROFLOG_GC_MOVE_EVENTS);
+}
+
+ICALL_EXPORT void
+proflog_icall_SetGCMoveEvents (MonoBoolean value)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       if (value) {
+               ENABLE (PROFLOG_GC_MOVE_EVENTS);
+               mono_profiler_set_gc_moves_callback (log_profiler.handle, gc_moves);
+       } else {
+               DISABLE (PROFLOG_GC_MOVE_EVENTS);
+               mono_profiler_set_gc_moves_callback (log_profiler.handle, NULL);
+       }
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_GetGCRootEvents (void)
+{
+       return ENABLED (PROFLOG_GC_ROOT_EVENTS);
+}
+
+ICALL_EXPORT void
+proflog_icall_SetGCRootEvents (MonoBoolean value)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       if (value)
+               ENABLE (PROFLOG_GC_ROOT_EVENTS);
+       else
+               DISABLE (PROFLOG_GC_ROOT_EVENTS);
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_GetGCHandleEvents (void)
+{
+       return ENABLED (PROFLOG_GC_HANDLE_EVENTS);
+}
+
+ICALL_EXPORT void
+proflog_icall_SetGCHandleEvents (MonoBoolean value)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       if (value) {
+               ENABLE (PROFLOG_GC_HANDLE_EVENTS);
+               mono_profiler_set_gc_handle_created_callback (log_profiler.handle, gc_handle_created);
+               mono_profiler_set_gc_handle_deleted_callback (log_profiler.handle, gc_handle_deleted);
+       } else {
+               DISABLE (PROFLOG_GC_HANDLE_EVENTS);
+               mono_profiler_set_gc_handle_created_callback (log_profiler.handle, NULL);
+               mono_profiler_set_gc_handle_deleted_callback (log_profiler.handle, NULL);
+       }
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_GetGCFinalizationEvents (void)
+{
+       return ENABLED (PROFLOG_GC_FINALIZATION_EVENTS);
+}
+
+ICALL_EXPORT void
+proflog_icall_SetGCFinalizationEvents (MonoBoolean value)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       if (value) {
+               ENABLE (PROFLOG_GC_FINALIZATION_EVENTS);
+               mono_profiler_set_gc_finalizing_callback (log_profiler.handle, finalize_begin);
+               mono_profiler_set_gc_finalizing_object_callback (log_profiler.handle, finalize_object_begin);
+               mono_profiler_set_gc_finalized_object_callback (log_profiler.handle, finalize_object_end);
+       } else {
+               DISABLE (PROFLOG_GC_FINALIZATION_EVENTS);
+               mono_profiler_set_gc_finalizing_callback (log_profiler.handle, NULL);
+               mono_profiler_set_gc_finalizing_object_callback (log_profiler.handle, NULL);
+               mono_profiler_set_gc_finalized_object_callback (log_profiler.handle, NULL);
+       }
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_GetCounterEvents (void)
+{
+       return ENABLED (PROFLOG_COUNTER_EVENTS);
+}
+
+ICALL_EXPORT void
+proflog_icall_SetCounterEvents (MonoBoolean value)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       if (value)
+               ENABLE (PROFLOG_COUNTER_EVENTS);
+       else
+               DISABLE (PROFLOG_COUNTER_EVENTS);
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+}
+
+ICALL_EXPORT MonoBoolean
+proflog_icall_GetJitEvents (void)
+{
+       return ENABLED (PROFLOG_JIT_EVENTS);
+}
+
+ICALL_EXPORT void
+proflog_icall_SetJitEvents (MonoBoolean value)
+{
+       mono_coop_mutex_lock (&log_profiler.api_mutex);
+
+       if (value) {
+               ENABLE (PROFLOG_JIT_EVENTS);
+               mono_profiler_set_jit_code_buffer_callback (log_profiler.handle, code_buffer_new);
+       } else {
+               DISABLE (PROFLOG_JIT_EVENTS);
+               mono_profiler_set_jit_code_buffer_callback (log_profiler.handle, NULL);
+       }
+
+       mono_coop_mutex_unlock (&log_profiler.api_mutex);
+}
+
 static void
 runtime_initialized (MonoProfiler *profiler)
 {
-       InterlockedWrite (&runtime_inited, 1);
+       InterlockedWrite (&log_profiler.runtime_inited, 1);
 
        register_counter ("Sample events allocated", &sample_allocations_ctr);
        register_counter ("Log buffers allocated", &buffer_allocations_ctr);
@@ -4515,48 +4500,80 @@ runtime_initialized (MonoProfiler *profiler)
        register_counter ("Event: Coverage classes", &coverage_classes_ctr);
        register_counter ("Event: Coverage assemblies", &coverage_assemblies_ctr);
 
-       counters_init (profiler);
+       counters_init ();
 
        /*
         * We must start the helper thread before the writer thread. This is
         * because the helper thread sets up the command port which is written to
         * the log header by the writer thread.
         */
-       start_helper_thread (profiler);
-       start_writer_thread (profiler);
-       start_dumper_thread (profiler);
+       start_helper_thread ();
+       start_writer_thread ();
+       start_dumper_thread ();
+
+       mono_coop_mutex_init (&log_profiler.api_mutex);
+
+#define ADD_ICALL(NAME) \
+       mono_add_internal_call ("Mono.Profiler.Log.LogProfiler::" EGLIB_STRINGIFY (NAME), proflog_icall_ ## NAME);
+
+       ADD_ICALL (GetMaxStackTraceFrames);
+       ADD_ICALL (GetStackTraceFrames);
+       ADD_ICALL (SetStackTraceFrames);
+       ADD_ICALL (GetHeapshotMode);
+       ADD_ICALL (SetHeapshotMode);
+       ADD_ICALL (GetHeapshotMillisecondsFrequency);
+       ADD_ICALL (SetHeapshotMillisecondsFrequency);
+       ADD_ICALL (GetHeapshotCollectionsFrequency);
+       ADD_ICALL (SetHeapshotCollectionsFrequency);
+       ADD_ICALL (GetCallDepth);
+       ADD_ICALL (SetCallDepth);
+       ADD_ICALL (GetSampleMode);
+       ADD_ICALL (SetSampleMode);
+       ADD_ICALL (GetExceptionEvents);
+       ADD_ICALL (SetExceptionEvents);
+       ADD_ICALL (GetMonitorEvents);
+       ADD_ICALL (SetMonitorEvents);
+       ADD_ICALL (GetGCEvents);
+       ADD_ICALL (SetGCEvents);
+       ADD_ICALL (GetGCAllocationEvents);
+       ADD_ICALL (SetGCAllocationEvents);
+       ADD_ICALL (GetGCMoveEvents);
+       ADD_ICALL (SetGCMoveEvents);
+       ADD_ICALL (GetGCRootEvents);
+       ADD_ICALL (SetGCRootEvents);
+       ADD_ICALL (GetGCHandleEvents);
+       ADD_ICALL (SetGCHandleEvents);
+       ADD_ICALL (GetGCFinalizationEvents);
+       ADD_ICALL (SetGCFinalizationEvents);
+       ADD_ICALL (GetCounterEvents);
+       ADD_ICALL (SetCounterEvents);
+       ADD_ICALL (GetJitEvents);
+       ADD_ICALL (SetJitEvents);
+
+#undef ADD_ICALL
 }
 
 static void
 create_profiler (const char *args, const char *filename, GPtrArray *filters)
 {
        char *nf;
-       int force_delete = 0;
 
-       log_profiler = (MonoProfiler *) g_calloc (1, sizeof (MonoProfiler));
-       log_profiler->args = pstrdup (args);
-       log_profiler->command_port = command_port;
-
-       if (filename && *filename == '-') {
-               force_delete = 1;
-               filename++;
-               g_warning ("WARNING: the output:-FILENAME option is deprecated, the profiler now always overrides the output file\n");
-       }
+       log_profiler.args = pstrdup (args);
+       log_profiler.command_port = log_config.command_port;
 
        //If filename begin with +, append the pid at the end
        if (filename && *filename == '+')
                filename = g_strdup_printf ("%s.%d", filename + 1, getpid ());
 
-
        if (!filename) {
-               if (do_report)
+               if (log_config.do_report)
                        filename = "|mprof-report -";
                else
                        filename = "output.mlpd";
                nf = (char*)filename;
        } else {
                nf = new_filename (filename);
-               if (do_report) {
+               if (log_config.do_report) {
                        int s = strlen (nf) + 32;
                        char *p = (char *) g_malloc (s);
                        snprintf (p, s, "|mprof-report '--out=%s' -", nf);
@@ -4565,24 +4582,22 @@ create_profiler (const char *args, const char *filename, GPtrArray *filters)
                }
        }
        if (*nf == '|') {
-               log_profiler->file = popen (nf + 1, "w");
-               log_profiler->pipe_output = 1;
+               log_profiler.file = popen (nf + 1, "w");
+               log_profiler.pipe_output = 1;
        } else if (*nf == '#') {
                int fd = strtol (nf + 1, NULL, 10);
-               log_profiler->file = fdopen (fd, "a");
-       } else {
-               if (force_delete)
-                       unlink (nf);
-               log_profiler->file = fopen (nf, "wb");
-       }
-       if (!log_profiler->file) {
-               fprintf (stderr, "Cannot create profiler output: %s\n", nf);
+               log_profiler.file = fdopen (fd, "a");
+       } else
+               log_profiler.file = fopen (nf, "wb");
+
+       if (!log_profiler.file) {
+               mono_profiler_printf_err ("Could not create log profiler output file '%s'.", nf);
                exit (1);
        }
 
 #if defined (HAVE_SYS_ZLIB)
-       if (use_zip)
-               log_profiler->gzfile = gzdopen (fileno (log_profiler->file), "wb");
+       if (log_config.use_zip)
+               log_profiler.gzfile = gzdopen (fileno (log_profiler.file), "wb");
 #endif
 
        /*
@@ -4592,84 +4607,49 @@ create_profiler (const char *args, const char *filename, GPtrArray *filters)
        g_assert (SAMPLE_SLOT_SIZE (MAX_FRAMES) * 2 < LOCK_FREE_ALLOC_SB_USABLE_SIZE (SAMPLE_BLOCK_SIZE));
 
        // FIXME: We should free this stuff too.
-       mono_lock_free_allocator_init_size_class (&log_profiler->sample_size_class, SAMPLE_SLOT_SIZE (num_frames), SAMPLE_BLOCK_SIZE);
-       mono_lock_free_allocator_init_allocator (&log_profiler->sample_allocator, &log_profiler->sample_size_class, MONO_MEM_ACCOUNT_PROFILER);
+       mono_lock_free_allocator_init_size_class (&log_profiler.sample_size_class, SAMPLE_SLOT_SIZE (log_config.num_frames), SAMPLE_BLOCK_SIZE);
+       mono_lock_free_allocator_init_allocator (&log_profiler.sample_allocator, &log_profiler.sample_size_class, MONO_MEM_ACCOUNT_PROFILER);
 
-       mono_lock_free_queue_init (&log_profiler->sample_reuse_queue);
+       mono_lock_free_queue_init (&log_profiler.sample_reuse_queue);
 
        g_assert (sizeof (WriterQueueEntry) * 2 < LOCK_FREE_ALLOC_SB_USABLE_SIZE (WRITER_ENTRY_BLOCK_SIZE));
 
        // FIXME: We should free this stuff too.
-       mono_lock_free_allocator_init_size_class (&log_profiler->writer_entry_size_class, sizeof (WriterQueueEntry), WRITER_ENTRY_BLOCK_SIZE);
-       mono_lock_free_allocator_init_allocator (&log_profiler->writer_entry_allocator, &log_profiler->writer_entry_size_class, MONO_MEM_ACCOUNT_PROFILER);
+       mono_lock_free_allocator_init_size_class (&log_profiler.writer_entry_size_class, sizeof (WriterQueueEntry), WRITER_ENTRY_BLOCK_SIZE);
+       mono_lock_free_allocator_init_allocator (&log_profiler.writer_entry_allocator, &log_profiler.writer_entry_size_class, MONO_MEM_ACCOUNT_PROFILER);
 
-       mono_lock_free_queue_init (&log_profiler->writer_queue);
-       mono_os_sem_init (&log_profiler->writer_queue_sem, 0);
+       mono_lock_free_queue_init (&log_profiler.writer_queue);
+       mono_os_sem_init (&log_profiler.writer_queue_sem, 0);
 
-       mono_lock_free_queue_init (&log_profiler->dumper_queue);
-       mono_os_sem_init (&log_profiler->dumper_queue_sem, 0);
+       mono_lock_free_queue_init (&log_profiler.dumper_queue);
+       mono_os_sem_init (&log_profiler.dumper_queue_sem, 0);
 
-       mono_os_mutex_init (&log_profiler->method_table_mutex);
-       log_profiler->method_table = mono_conc_hashtable_new (NULL, NULL);
+       mono_os_mutex_init (&log_profiler.method_table_mutex);
+       log_profiler.method_table = mono_conc_hashtable_new (NULL, NULL);
 
-       if (do_coverage)
-               coverage_init (log_profiler);
-       log_profiler->coverage_filters = filters;
+       if (log_config.collect_coverage)
+               coverage_init ();
 
-       log_profiler->startup_time = current_time ();
-}
+       log_profiler.coverage_filters = filters;
 
-/*
- * declaration to silence the compiler: this is the entry point that
- * mono will load from the shared library and call.
- */
-extern void
-mono_profiler_init (const char *desc);
+       log_profiler.startup_time = current_time ();
+}
 
-extern void
+MONO_API void
 mono_profiler_init_log (const char *desc);
 
-/*
- * this is the entry point that will be used when the profiler
- * is embedded inside the main executable.
- */
 void
 mono_profiler_init_log (const char *desc)
-{
-       mono_profiler_init (desc);
-}
-
-void
-mono_profiler_init (const char *desc)
 {
        GPtrArray *filters = NULL;
 
-       proflog_parse_args (&config, desc [3] == ':' ? desc + 4 : "");
-
-       //XXX maybe later cleanup to use config directly
-       nocalls = !(config.effective_mask & PROFLOG_CALL_EVENTS);
-       no_counters = !(config.effective_mask & PROFLOG_COUNTER_EVENTS);
-       do_report = config.do_report;
-       do_debug = config.do_debug;
-       do_heap_shot = (config.effective_mask & PROFLOG_HEAPSHOT_FEATURE);
-       hs_mode_ondemand = config.hs_mode_ondemand;
-       hs_mode_ms = config.hs_mode_ms;
-       hs_mode_gc = config.hs_mode_gc;
-       do_mono_sample = (config.effective_mask & PROFLOG_SAMPLING_FEATURE);
-       use_zip = config.use_zip;
-       command_port = config.command_port;
-       num_frames = config.num_frames;
-       notraces = config.notraces;
-       max_allocated_sample_hits = config.max_allocated_sample_hits;
-       max_call_depth = config.max_call_depth;
-       do_coverage = (config.effective_mask & PROFLOG_CODE_COV_FEATURE);
-       debug_coverage = config.debug_coverage;
-
-       if (config.cov_filter_files) {
+       proflog_parse_args (&log_config, desc [3] == ':' ? desc + 4 : "");
+
+       if (log_config.cov_filter_files) {
                filters = g_ptr_array_new ();
                int i;
-               for (i = 0; i < config.cov_filter_files->len; ++i) {
-                       const char *name = config.cov_filter_files->pdata [i];
+               for (i = 0; i < log_config.cov_filter_files->len; ++i) {
+                       const char *name = log_config.cov_filter_files->pdata [i];
                        parse_cov_filter_file (filters, name);
                }
        }
@@ -4678,111 +4658,109 @@ mono_profiler_init (const char *desc)
 
        PROF_TLS_INIT ();
 
-       create_profiler (desc, config.output_filename, filters);
+       create_profiler (desc, log_config.output_filename, filters);
 
-       mono_lls_init (&profiler_thread_list, NULL);
+       mono_lls_init (&log_profiler.profiler_thread_list, NULL);
 
-       MonoProfilerHandle handle = log_profiler->handle = mono_profiler_install (log_profiler);
+       MonoProfilerHandle handle = log_profiler.handle = mono_profiler_create (&log_profiler);
 
-       //Required callbacks
+       /*
+        * Required callbacks. These are either necessary for the profiler itself
+        * to function, or provide metadata that's needed if other events (e.g.
+        * allocations, exceptions) are dynamically enabled/disabled.
+        */
+
+       mono_profiler_set_runtime_shutdown_begin_callback (handle, log_early_shutdown);
        mono_profiler_set_runtime_shutdown_end_callback (handle, log_shutdown);
        mono_profiler_set_runtime_initialized_callback (handle, runtime_initialized);
 
        mono_profiler_set_gc_event_callback (handle, gc_event);
-       mono_profiler_set_gc_resize_callback (handle, gc_resize);
+
        mono_profiler_set_thread_started_callback (handle, thread_start);
        mono_profiler_set_thread_stopped_callback (handle, thread_end);
-
-       //It's questionable whether we actually want this to be mandatory, maybe put it behind the actual event?
        mono_profiler_set_thread_name_callback (handle, thread_name);
 
-       if (config.effective_mask & PROFLOG_DOMAIN_EVENTS) {
-               mono_profiler_set_domain_loaded_callback (handle, domain_loaded);
-               mono_profiler_set_domain_unloading_callback (handle, domain_unloaded);
-               mono_profiler_set_domain_name_callback (handle, domain_name);
-       }
+       mono_profiler_set_domain_loaded_callback (handle, domain_loaded);
+       mono_profiler_set_domain_unloading_callback (handle, domain_unloaded);
+       mono_profiler_set_domain_name_callback (handle, domain_name);
 
-       if (config.effective_mask & PROFLOG_ASSEMBLY_EVENTS) {
-               mono_profiler_set_assembly_loaded_callback (handle, assembly_loaded);
-               mono_profiler_set_assembly_unloading_callback (handle, assembly_unloaded);
-       }
+       mono_profiler_set_context_loaded_callback (handle, context_loaded);
+       mono_profiler_set_context_unloaded_callback (handle, context_unloaded);
 
-       if (config.effective_mask & PROFLOG_MODULE_EVENTS) {
-               mono_profiler_set_image_loaded_callback (handle, image_loaded);
-               mono_profiler_set_image_unloading_callback (handle, image_unloaded);
-       }
+       mono_profiler_set_assembly_loaded_callback (handle, assembly_loaded);
+       mono_profiler_set_assembly_unloading_callback (handle, assembly_unloaded);
 
-       if (config.effective_mask & PROFLOG_CLASS_EVENTS)
-               mono_profiler_set_class_loaded_callback (handle, class_loaded);
+       mono_profiler_set_image_loaded_callback (handle, image_loaded);
+       mono_profiler_set_image_unloading_callback (handle, image_unloaded);
 
-       if (config.effective_mask & PROFLOG_JIT_COMPILATION_EVENTS) {
-               mono_profiler_set_jit_done_callback (handle, method_jitted);
-               mono_profiler_set_jit_code_buffer_callback (handle, code_buffer_new);
-       }
+       mono_profiler_set_class_loaded_callback (handle, class_loaded);
+
+       mono_profiler_set_jit_done_callback (handle, method_jitted);
 
-       if (config.effective_mask & PROFLOG_EXCEPTION_EVENTS) {
+       if (ENABLED (PROFLOG_EXCEPTION_EVENTS)) {
                mono_profiler_set_exception_throw_callback (handle, throw_exc);
                mono_profiler_set_exception_clause_callback (handle, clause_exc);
        }
 
-       if (config.effective_mask & PROFLOG_ALLOCATION_EVENTS) {
-               mono_profiler_enable_allocations ();
-               mono_profiler_set_gc_allocation_callback (handle, gc_alloc);
-       }
-
-       //PROFLOG_GC_EVENTS is mandatory
-       //PROFLOG_THREAD_EVENTS is mandatory
-
-       if (config.effective_mask & PROFLOG_CALL_EVENTS) {
-               mono_profiler_set_call_instrumentation_filter_callback (handle, method_filter);
-               mono_profiler_set_method_enter_callback (handle, method_enter);
-               mono_profiler_set_method_leave_callback (handle, method_leave);
-               mono_profiler_set_method_exception_leave_callback (handle, method_exc_leave);
-       }
-
-       if (config.effective_mask & PROFLOG_INS_COVERAGE_EVENTS)
-               mono_profiler_set_coverage_filter_callback (handle, coverage_filter);
-
-       if (config.effective_mask & PROFLOG_SAMPLING_EVENTS) {
-               mono_profiler_enable_sampling (handle);
-
-               if (!mono_profiler_set_sample_mode (handle, config.sampling_mode, config.sample_freq))
-                       g_warning ("Another profiler controls sampling parameters; the log profiler will not be able to modify them");
-
-               mono_profiler_set_sample_hit_callback (handle, mono_sample_hit);
-       }
-
-       if (config.effective_mask & PROFLOG_MONITOR_EVENTS) {
+       if (ENABLED (PROFLOG_MONITOR_EVENTS)) {
                mono_profiler_set_monitor_contention_callback (handle, monitor_contention);
                mono_profiler_set_monitor_acquired_callback (handle, monitor_acquired);
                mono_profiler_set_monitor_failed_callback (handle, monitor_failed);
        }
 
-       if (config.effective_mask & PROFLOG_GC_MOVES_EVENTS)
+       if (ENABLED (PROFLOG_GC_EVENTS))
+               mono_profiler_set_gc_resize_callback (handle, gc_resize);
+
+       if (ENABLED (PROFLOG_GC_ALLOCATION_EVENTS))
+               mono_profiler_set_gc_allocation_callback (handle, gc_alloc);
+
+       if (ENABLED (PROFLOG_GC_MOVE_EVENTS))
                mono_profiler_set_gc_moves_callback (handle, gc_moves);
 
-       if (config.effective_mask & PROFLOG_GC_ROOT_EVENTS)
+       if (ENABLED (PROFLOG_GC_ROOT_EVENTS))
                mono_profiler_set_gc_roots_callback (handle, gc_roots);
 
-       if (config.effective_mask & PROFLOG_CONTEXT_EVENTS) {
-               mono_profiler_set_context_loaded_callback (handle, context_loaded);
-               mono_profiler_set_context_unloaded_callback (handle, context_unloaded);
+       if (ENABLED (PROFLOG_GC_HANDLE_EVENTS)) {
+               mono_profiler_set_gc_handle_created_callback (handle, gc_handle_created);
+               mono_profiler_set_gc_handle_deleted_callback (handle, gc_handle_deleted);
        }
 
-       if (config.effective_mask & PROFLOG_FINALIZATION_EVENTS) {
+       if (ENABLED (PROFLOG_GC_FINALIZATION_EVENTS)) {
                mono_profiler_set_gc_finalizing_callback (handle, finalize_begin);
                mono_profiler_set_gc_finalized_callback (handle, finalize_end);
                mono_profiler_set_gc_finalizing_object_callback (handle, finalize_object_begin);
-               mono_profiler_set_gc_finalized_object_callback (handle, finalize_object_end);
-       } else if (ENABLED (PROFLOG_HEAPSHOT_FEATURE) && config.hs_mode_ondemand) {
-               //On Demand heapshot uses the finalizer thread to force a collection and thus a heapshot
-               mono_profiler_set_gc_finalized_callback (handle, finalize_end);
        }
 
-       //PROFLOG_COUNTER_EVENTS is a pseudo event controled by the no_counters global var
+       //On Demand heapshot uses the finalizer thread to force a collection and thus a heapshot
+       mono_profiler_set_gc_finalized_callback (handle, finalize_end);
 
-       if (config.effective_mask & PROFLOG_GC_HANDLE_EVENTS) {
-               mono_profiler_set_gc_handle_created_callback (handle, gc_handle_created);
-               mono_profiler_set_gc_handle_deleted_callback (handle, gc_handle_deleted);
+       if (ENABLED (PROFLOG_SAMPLE_EVENTS))
+               mono_profiler_set_sample_hit_callback (handle, mono_sample_hit);
+
+       if (ENABLED (PROFLOG_JIT_EVENTS))
+               mono_profiler_set_jit_code_buffer_callback (handle, code_buffer_new);
+
+       if (log_config.enter_leave) {
+               mono_profiler_set_call_instrumentation_filter_callback (handle, method_filter);
+               mono_profiler_set_method_enter_callback (handle, method_enter);
+               mono_profiler_set_method_leave_callback (handle, method_leave);
+               mono_profiler_set_method_tail_call_callback (handle, tail_call);
+               mono_profiler_set_method_exception_leave_callback (handle, method_exc_leave);
+       }
+
+       if (log_config.collect_coverage) {
+               mono_profiler_enable_coverage ();
+               mono_profiler_set_coverage_filter_callback (handle, coverage_filter);
        }
+
+       mono_profiler_enable_allocations ();
+       mono_profiler_enable_sampling (handle);
+
+       /*
+        * If no sample option was given by the user, this just leaves the sampling
+        * thread in idle mode. We do this even if no option was given so that we
+        * can warn if another profiler controls sampling parameters.
+        */
+       if (!mono_profiler_set_sample_mode (handle, log_config.sampling_mode, log_config.sample_freq))
+               mono_profiler_printf_err ("Another profiler controls sampling parameters; the log profiler will not be able to modify them.");
 }
index f972489ffd4d4a7f45d6fa85221b6f77d5a0faf6..d8182d90ee27dfc7d3b266e31124bd7f3dae2baa 100644 (file)
                added an exception object field to TYPE_CLAUSE
                class unload events no longer exist (they were never emitted)
                removed type field from TYPE_SAMPLE_HIT
+               removed MONO_GC_EVENT_{MARK,RECLAIM}_{START,END}
+ */
+
+/*
+ * file format:
+ * [header] [buffer]*
+ *
+ * The file is composed by a header followed by 0 or more buffers.
+ * Each buffer contains events that happened on a thread: for a given thread
+ * buffers that appear later in the file are guaranteed to contain events
+ * that happened later in time. Buffers from separate threads could be interleaved,
+ * though.
+ * Buffers are not required to be aligned.
+ *
+ * header format:
+ * [id: 4 bytes] constant value: LOG_HEADER_ID
+ * [major: 1 byte] [minor: 1 byte] major and minor version of the log profiler
+ * [format: 1 byte] version of the data format for the rest of the file
+ * [ptrsize: 1 byte] size in bytes of a pointer in the profiled program
+ * [startup time: 8 bytes] time in milliseconds since the unix epoch when the program started
+ * [timer overhead: 4 bytes] approximate overhead in nanoseconds of the timer
+ * [flags: 4 bytes] file format flags, should be 0 for now
+ * [pid: 4 bytes] pid of the profiled process
+ * [port: 2 bytes] tcp port for server if != 0
+ * [args size: 4 bytes] size of args
+ * [args: string] arguments passed to the profiler
+ * [arch size: 4 bytes] size of arch
+ * [arch: string] architecture the profiler is running on
+ * [os size: 4 bytes] size of os
+ * [os: string] operating system the profiler is running on
+ *
+ * The multiple byte integers are in little-endian format.
+ *
+ * buffer format:
+ * [buffer header] [event]*
+ * Buffers have a fixed-size header followed by 0 or more bytes of event data.
+ * Timing information and other values in the event data are usually stored
+ * as uleb128 or sleb128 integers. To save space, as noted for each item below,
+ * some data is represented as a difference between the actual value and
+ * either the last value of the same type (like for timing information) or
+ * as the difference from a value stored in a buffer header.
+ *
+ * For timing information the data is stored as uleb128, since timing
+ * increases in a monotonic way in each thread: the value is the number of
+ * nanoseconds to add to the last seen timing data in a buffer. The first value
+ * in a buffer will be calculated from the time_base field in the buffer head.
+ *
+ * Object or heap sizes are stored as uleb128.
+ * Pointer differences are stored as sleb128, instead.
+ *
+ * If an unexpected value is found, the rest of the buffer should be ignored,
+ * as generally the later values need the former to be interpreted correctly.
+ *
+ * buffer header format:
+ * [bufid: 4 bytes] constant value: BUF_ID
+ * [len: 4 bytes] size of the data following the buffer header
+ * [time_base: 8 bytes] time base in nanoseconds since an unspecified epoch
+ * [ptr_base: 8 bytes] base value for pointers
+ * [obj_base: 8 bytes] base value for object addresses
+ * [thread id: 8 bytes] system-specific thread ID (pthread_t for example)
+ * [method_base: 8 bytes] base value for MonoMethod pointers
+ *
+ * event format:
+ * [extended info: upper 4 bits] [type: lower 4 bits]
+ * [time diff: uleb128] nanoseconds since last timing
+ * [data]*
+ * The data that follows depends on type and the extended info.
+ * Type is one of the enum values in mono-profiler-log.h: TYPE_ALLOC, TYPE_GC,
+ * TYPE_METADATA, TYPE_METHOD, TYPE_EXCEPTION, TYPE_MONITOR, TYPE_HEAP.
+ * The extended info bits are interpreted based on type, see
+ * each individual event description below.
+ * strings are represented as a 0-terminated utf8 sequence.
+ *
+ * backtrace format:
+ * [num: uleb128] number of frames following
+ * [frame: sleb128]* mum MonoMethod* as a pointer difference from the last such
+ * pointer or the buffer method_base
+ *
+ * type alloc format:
+ * type: TYPE_ALLOC
+ * exinfo: zero or TYPE_ALLOC_BT
+ * [ptr: sleb128] class as a byte difference from ptr_base
+ * [obj: sleb128] object address as a byte difference from obj_base
+ * [size: uleb128] size of the object in the heap
+ * If exinfo == TYPE_ALLOC_BT, a backtrace follows.
+ *
+ * type GC format:
+ * type: TYPE_GC
+ * exinfo: one of TYPE_GC_EVENT, TYPE_GC_RESIZE, TYPE_GC_MOVE, TYPE_GC_HANDLE_CREATED[_BT],
+ * TYPE_GC_HANDLE_DESTROYED[_BT], TYPE_GC_FINALIZE_START, TYPE_GC_FINALIZE_END,
+ * TYPE_GC_FINALIZE_OBJECT_START, TYPE_GC_FINALIZE_OBJECT_END
+ * if exinfo == TYPE_GC_RESIZE
+ *     [heap_size: uleb128] new heap size
+ * if exinfo == TYPE_GC_EVENT
+ *     [event type: byte] GC event (MONO_GC_EVENT_* from profiler.h)
+ *     [generation: byte] GC generation event refers to
+ * if exinfo == TYPE_GC_MOVE
+ *     [num_objects: uleb128] number of object moves that follow
+ *     [objaddr: sleb128]+ num_objects object pointer differences from obj_base
+ *     num is always an even number: the even items are the old
+ *     addresses, the odd numbers are the respective new object addresses
+ * if exinfo == TYPE_GC_HANDLE_CREATED[_BT]
+ *     [handle_type: uleb128] MonoGCHandleType enum value
+ *     upper bits reserved as flags
+ *     [handle: uleb128] GC handle value
+ *     [objaddr: sleb128] object pointer differences from obj_base
+ *     If exinfo == TYPE_GC_HANDLE_CREATED_BT, a backtrace follows.
+ * if exinfo == TYPE_GC_HANDLE_DESTROYED[_BT]
+ *     [handle_type: uleb128] MonoGCHandleType enum value
+ *     upper bits reserved as flags
+ *     [handle: uleb128] GC handle value
+ *     If exinfo == TYPE_GC_HANDLE_DESTROYED_BT, a backtrace follows.
+ * if exinfo == TYPE_GC_FINALIZE_OBJECT_{START,END}
+ *     [object: sleb128] the object as a difference from obj_base
+ *
+ * type metadata format:
+ * type: TYPE_METADATA
+ * exinfo: one of: TYPE_END_LOAD, TYPE_END_UNLOAD (optional for TYPE_THREAD and TYPE_DOMAIN,
+ * doesn't occur for TYPE_CLASS)
+ * [mtype: byte] metadata type, one of: TYPE_CLASS, TYPE_IMAGE, TYPE_ASSEMBLY, TYPE_DOMAIN,
+ * TYPE_THREAD, TYPE_CONTEXT
+ * [pointer: sleb128] pointer of the metadata type depending on mtype
+ * if mtype == TYPE_CLASS
+ *     [image: sleb128] MonoImage* as a pointer difference from ptr_base
+ *     [name: string] full class name
+ * if mtype == TYPE_IMAGE
+ *     [name: string] image file name
+ * if mtype == TYPE_ASSEMBLY
+ *     [image: sleb128] MonoImage* as a pointer difference from ptr_base
+ *     [name: string] assembly name
+ * if mtype == TYPE_DOMAIN && exinfo == 0
+ *     [name: string] domain friendly name
+ * if mtype == TYPE_CONTEXT
+ *     [domain: sleb128] domain id as pointer
+ * if mtype == TYPE_THREAD && exinfo == 0
+ *     [name: string] thread name
+ *
+ * type method format:
+ * type: TYPE_METHOD
+ * exinfo: one of: TYPE_LEAVE, TYPE_ENTER, TYPE_EXC_LEAVE, TYPE_JIT
+ * [method: sleb128] MonoMethod* as a pointer difference from the last such
+ * pointer or the buffer method_base
+ * if exinfo == TYPE_JIT
+ *     [code address: sleb128] pointer to the native code as a diff from ptr_base
+ *     [code size: uleb128] size of the generated code
+ *     [name: string] full method name
+ *
+ * type exception format:
+ * type: TYPE_EXCEPTION
+ * exinfo: zero, TYPE_CLAUSE, or TYPE_THROW_BT
+ * if exinfo == TYPE_CLAUSE
+ *     [clause type: byte] MonoExceptionEnum enum value
+ *     [clause index: uleb128] index of the current clause
+ *     [method: sleb128] MonoMethod* as a pointer difference from the last such
+ *     pointer or the buffer method_base
+ *     [object: sleb128] the exception object as a difference from obj_base
+ * else
+ *     [object: sleb128] the exception object as a difference from obj_base
+ *     If exinfo == TYPE_THROW_BT, a backtrace follows.
+ *
+ * type runtime format:
+ * type: TYPE_RUNTIME
+ * exinfo: one of: TYPE_JITHELPER
+ * if exinfo == TYPE_JITHELPER
+ *     [type: byte] MonoProfilerCodeBufferType enum value
+ *     [buffer address: sleb128] pointer to the native code as a diff from ptr_base
+ *     [buffer size: uleb128] size of the generated code
+ *     if type == MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE
+ *             [name: string] buffer description name
+ *
+ * type monitor format:
+ * type: TYPE_MONITOR
+ * exinfo: zero or TYPE_MONITOR_BT
+ * [type: byte] MonoProfilerMonitorEvent enum value
+ * [object: sleb128] the lock object as a difference from obj_base
+ * If exinfo == TYPE_MONITOR_BT, a backtrace follows.
+ *
+ * type heap format
+ * type: TYPE_HEAP
+ * exinfo: one of TYPE_HEAP_START, TYPE_HEAP_END, TYPE_HEAP_OBJECT, TYPE_HEAP_ROOT
+ * if exinfo == TYPE_HEAP_OBJECT
+ *     [object: sleb128] the object as a difference from obj_base
+ *     [class: sleb128] the object MonoClass* as a difference from ptr_base
+ *     [size: uleb128] size of the object on the heap
+ *     [num_refs: uleb128] number of object references
+ *     each referenced objref is preceded by a uleb128 encoded offset: the
+ *     first offset is from the object address and each next offset is relative
+ *     to the previous one
+ *     [objrefs: sleb128]+ object referenced as a difference from obj_base
+ *     The same object can appear multiple times, but only the first time
+ *     with size != 0: in the other cases this data will only be used to
+ *     provide additional referenced objects.
+ * if exinfo == TYPE_HEAP_ROOT
+ *     [num_roots: uleb128] number of root references
+ *     [num_gc: uleb128] number of major gcs
+ *     [object: sleb128] the object as a difference from obj_base
+ *     [root_type: byte] the root_type: MonoProfileGCRootType (profiler.h)
+ *     [extra_info: uleb128] the extra_info value
+ *     object, root_type and extra_info are repeated num_roots times
+ *
+ * type sample format
+ * type: TYPE_SAMPLE
+ * exinfo: one of TYPE_SAMPLE_HIT, TYPE_SAMPLE_USYM, TYPE_SAMPLE_UBIN, TYPE_SAMPLE_COUNTERS_DESC, TYPE_SAMPLE_COUNTERS
+ * if exinfo == TYPE_SAMPLE_HIT
+ *     [thread: sleb128] thread id as difference from ptr_base
+ *     [count: uleb128] number of following instruction addresses
+ *     [ip: sleb128]* instruction pointer as difference from ptr_base
+ *     [mbt_count: uleb128] number of managed backtrace frames
+ *     [method: sleb128]* MonoMethod* as a pointer difference from the last such
+ *     pointer or the buffer method_base (the first such method can be also indentified by ip, but this is not neccessarily true)
+ * if exinfo == TYPE_SAMPLE_USYM
+ *     [address: sleb128] symbol address as a difference from ptr_base
+ *     [size: uleb128] symbol size (may be 0 if unknown)
+ *     [name: string] symbol name
+ * if exinfo == TYPE_SAMPLE_UBIN
+ *     [address: sleb128] address where binary has been loaded as a difference from ptr_base
+ *     [offset: uleb128] file offset of mapping (the same file can be mapped multiple times)
+ *     [size: uleb128] memory size
+ *     [name: string] binary name
+ * if exinfo == TYPE_SAMPLE_COUNTERS_DESC
+ *     [len: uleb128] number of counters
+ *     for i = 0 to len
+ *             [section: uleb128] section of counter
+ *             if section == MONO_COUNTER_PERFCOUNTERS:
+ *                     [section_name: string] section name of counter
+ *             [name: string] name of counter
+ *             [type: byte] type of counter
+ *             [unit: byte] unit of counter
+ *             [variance: byte] variance of counter
+ *             [index: uleb128] unique index of counter
+ * if exinfo == TYPE_SAMPLE_COUNTERS
+ *     while true:
+ *             [index: uleb128] unique index of counter
+ *             if index == 0:
+ *                     break
+ *             [type: byte] type of counter value
+ *             if type == string:
+ *                     if value == null:
+ *                             [0: byte] 0 -> value is null
+ *                     else:
+ *                             [1: byte] 1 -> value is not null
+ *                             [value: string] counter value
+ *             else:
+ *                     [value: uleb128/sleb128/double] counter value, can be sleb128, uleb128 or double (determined by using type)
+ *
+ * type coverage format
+ * type: TYPE_COVERAGE
+ * exinfo: one of TYPE_COVERAGE_METHOD, TYPE_COVERAGE_STATEMENT, TYPE_COVERAGE_ASSEMBLY, TYPE_COVERAGE_CLASS
+ * if exinfo == TYPE_COVERAGE_METHOD
+ *  [assembly: string] name of assembly
+ *  [class: string] name of the class
+ *  [name: string] name of the method
+ *  [signature: string] the signature of the method
+ *  [filename: string] the file path of the file that contains this method
+ *  [token: uleb128] the method token
+ *  [method_id: uleb128] an ID for this data to associate with the buffers of TYPE_COVERAGE_STATEMENTS
+ *  [len: uleb128] the number of TYPE_COVERAGE_BUFFERS associated with this method
+ * if exinfo == TYPE_COVERAGE_STATEMENTS
+ *  [method_id: uleb128] an the TYPE_COVERAGE_METHOD buffer to associate this with
+ *  [offset: uleb128] the il offset relative to the previous offset
+ *  [counter: uleb128] the counter for this instruction
+ *  [line: uleb128] the line of filename containing this instruction
+ *  [column: uleb128] the column containing this instruction
+ * if exinfo == TYPE_COVERAGE_ASSEMBLY
+ *  [name: string] assembly name
+ *  [guid: string] assembly GUID
+ *  [filename: string] assembly filename
+ *  [number_of_methods: uleb128] the number of methods in this assembly
+ *  [fully_covered: uleb128] the number of fully covered methods
+ *  [partially_covered: uleb128] the number of partially covered methods
+ *    currently partially_covered will always be 0, and fully_covered is the
+ *    number of methods that are fully and partially covered.
+ * if exinfo == TYPE_COVERAGE_CLASS
+ *  [name: string] assembly name
+ *  [class: string] class name
+ *  [number_of_methods: uleb128] the number of methods in this class
+ *  [fully_covered: uleb128] the number of fully covered methods
+ *  [partially_covered: uleb128] the number of partially covered methods
+ *    currently partially_covered will always be 0, and fully_covered is the
+ *    number of methods that are fully and partially covered.
+ *
+ * type meta format:
+ * type: TYPE_META
+ * exinfo: one of: TYPE_SYNC_POINT
+ * if exinfo == TYPE_SYNC_POINT
+ *     [type: byte] MonoProfilerSyncPointType enum value
  */
 
 enum {
@@ -133,7 +419,6 @@ enum {
        TYPE_COVERAGE_CLASS = 3 << 4,
        /* extended type for TYPE_META */
        TYPE_SYNC_POINT = 0 << 4,
-       TYPE_END
 };
 
 enum {
@@ -147,9 +432,9 @@ enum {
 };
 
 typedef enum {
-       SYNC_POINT_PERIODIC,
-       SYNC_POINT_WORLD_STOP,
-       SYNC_POINT_WORLD_START
+       SYNC_POINT_PERIODIC = 0,
+       SYNC_POINT_WORLD_STOP = 1,
+       SYNC_POINT_WORLD_START = 2,
 } MonoProfilerSyncPointType;
 
 typedef enum {
@@ -159,95 +444,82 @@ typedef enum {
 } MonoProfilerMonitorEvent;
 
 enum {
-       MONO_PROFILER_GC_HANDLE_CREATED,
-       MONO_PROFILER_GC_HANDLE_DESTROYED,
+       MONO_PROFILER_GC_HANDLE_CREATED = 0,
+       MONO_PROFILER_GC_HANDLE_DESTROYED = 1,
 };
 
+typedef enum {
+       MONO_PROFILER_HEAPSHOT_NONE = 0,
+       MONO_PROFILER_HEAPSHOT_MAJOR = 1,
+       MONO_PROFILER_HEAPSHOT_ON_DEMAND = 2,
+       MONO_PROFILER_HEAPSHOT_X_GC = 3,
+       MONO_PROFILER_HEAPSHOT_X_MS = 4,
+} MonoProfilerHeapshotMode;
+
 // If you alter MAX_FRAMES, you may need to alter SAMPLE_BLOCK_SIZE too.
 #define MAX_FRAMES 32
 
 //The following flags control emitting individual events
-#define PROFLOG_DOMAIN_EVENTS (1 << 0)
-#define PROFLOG_ASSEMBLY_EVENTS        (1 << 1)
-#define PROFLOG_MODULE_EVENTS (1 << 2)
-#define PROFLOG_CLASS_EVENTS (1 << 3)
-#define PROFLOG_JIT_COMPILATION_EVENTS (1 << 4)
-#define PROFLOG_EXCEPTION_EVENTS (1 << 5)
-#define PROFLOG_ALLOCATION_EVENTS (1 << 6)
-#define PROFLOG_GC_EVENTS (1 << 7)
-#define PROFLOG_THREAD_EVENTS (1 << 8)
-//This generate enter/leave events
-#define PROFLOG_CALL_EVENTS (1 << 9)
-#define PROFLOG_INS_COVERAGE_EVENTS (1 << 10)
-#define PROFLOG_SAMPLING_EVENTS (1 << 11)
-#define PROFLOG_MONITOR_EVENTS (1 << 12)
-#define PROFLOG_GC_MOVES_EVENTS (1 << 13)
-
-#define PROFLOG_GC_ROOT_EVENTS (1 << 14)
-#define PROFLOG_CONTEXT_EVENTS (1 << 15)
-#define PROFLOG_FINALIZATION_EVENTS (1 << 16)
-#define PROFLOG_COUNTER_EVENTS (1 << 17)
-#define PROFLOG_GC_HANDLE_EVENTS (1 << 18)
-
-//The following flags control whole subsystems
-//Enables code coverage generation
-#define PROFLOG_CODE_COV_FEATURE (1 << 19)
-//This enables sampling to be generated
-#define PROFLOG_SAMPLING_FEATURE (1 << 20)
-//This enable heap dumping during GCs and filter GCRoots and GCHandle events outside of the dumped collections
-#define PROFLOG_HEAPSHOT_FEATURE (1 << 21)
-
-
-
-//The follow flags are the common aliases we want ppl to use
-#define PROFLOG_TYPELOADING_ALIAS (PROFLOG_DOMAIN_EVENTS | PROFLOG_ASSEMBLY_EVENTS | PROFLOG_MODULE_EVENTS | PROFLOG_CLASS_EVENTS)
-#define PROFLOG_CODECOV_ALIAS (PROFLOG_INS_COVERAGE_EVENTS | PROFLOG_CODE_COV_FEATURE)
-#define PROFLOG_PERF_SAMPLING_ALIAS (PROFLOG_TYPELOADING_ALIAS | PROFLOG_THREAD_EVENTS | PROFLOG_SAMPLING_EVENTS | PROFLOG_SAMPLING_FEATURE)
-#define PROFLOG_GC_ALLOC_ALIAS (PROFLOG_TYPELOADING_ALIAS | PROFLOG_THREAD_EVENTS | PROFLOG_GC_EVENTS | PROFLOG_ALLOCATION_EVENTS)
-#define PROFLOG_HEAPSHOT_ALIAS (PROFLOG_TYPELOADING_ALIAS | PROFLOG_THREAD_EVENTS | PROFLOG_GC_EVENTS | PROFLOG_GC_ROOT_EVENTS | PROFLOG_HEAPSHOT_FEATURE)
-#define PROFLOG_LEGACY_ALIAS (PROFLOG_TYPELOADING_ALIAS | PROFLOG_GC_EVENTS | PROFLOG_THREAD_EVENTS | PROFLOG_JIT_COMPILATION_EVENTS | PROFLOG_EXCEPTION_EVENTS | PROFLOG_MONITOR_EVENTS | PROFLOG_GC_ROOT_EVENTS | PROFLOG_CONTEXT_EVENTS | PROFLOG_FINALIZATION_EVENTS | PROFLOG_COUNTER_EVENTS)
-
+#define PROFLOG_EXCEPTION_EVENTS (1 << 0)
+#define PROFLOG_MONITOR_EVENTS (1 << 1)
+#define PROFLOG_GC_EVENTS (1 << 2)
+#define PROFLOG_GC_ALLOCATION_EVENTS (1 << 3)
+#define PROFLOG_GC_MOVE_EVENTS (1 << 4)
+#define PROFLOG_GC_ROOT_EVENTS (1 << 5)
+#define PROFLOG_GC_HANDLE_EVENTS (1 << 6)
+#define PROFLOG_GC_FINALIZATION_EVENTS (1 << 7)
+#define PROFLOG_COUNTER_EVENTS (1 << 8)
+#define PROFLOG_SAMPLE_EVENTS (1 << 9)
+#define PROFLOG_JIT_EVENTS (1 << 10)
+
+#define PROFLOG_ALLOC_ALIAS (PROFLOG_GC_EVENTS | PROFLOG_GC_ALLOCATION_EVENTS | PROFLOG_GC_MOVE_EVENTS)
+#define PROFLOG_HEAPSHOT_ALIAS (PROFLOG_GC_EVENTS | PROFLOG_GC_ROOT_EVENTS)
+#define PROFLOG_LEGACY_ALIAS (PROFLOG_EXCEPTION_EVENTS | PROFLOG_MONITOR_EVENTS | PROFLOG_GC_EVENTS | PROFLOG_GC_MOVE_EVENTS | PROFLOG_GC_ROOT_EVENTS | PROFLOG_GC_HANDLE_EVENTS | PROFLOG_GC_FINALIZATION_EVENTS | PROFLOG_COUNTER_EVENTS)
 
 typedef struct {
        //Events explicitly enabled
        int enable_mask;
+
        //Events explicitly disabled
        int disable_mask;
 
-       //Actual mask the profiler should use
+       // Actual mask the profiler should use. Can be changed at runtime.
        int effective_mask;
 
+       // Whether to do method prologue/epilogue instrumentation. Only used at startup.
+       gboolean enter_leave;
+
+       // Whether to collect code coverage by instrumenting basic blocks.
+       gboolean collect_coverage;
+
        //Emit a report at the end of execution
        gboolean do_report;
 
        //Enable profiler internal debugging
        gboolean do_debug;
 
-       //Enable code coverage specific debugging
-       gboolean debug_coverage;
-
        //Where to compress the output file
        gboolean use_zip;
 
-       //If true, don't generate stacktraces
-       gboolean notraces;
+       // Heapshot mode (every major, on demand, XXgc, XXms). Can be changed at runtime.
+       MonoProfilerHeapshotMode hs_mode;
 
-       //If true, heapshots are generated on demand only
-       gboolean hs_mode_ondemand;
+       // Heapshot frequency in milliseconds (for MONO_HEAPSHOT_X_MS). Can be changed at runtime.
+       unsigned int hs_freq_ms;
 
-       //HeapShort frequency in milliseconds
-       unsigned int hs_mode_ms;
+       // Heapshot frequency in number of collections (for MONO_HEAPSHOT_X_GC). Can be changed at runtime.
+       unsigned int hs_freq_gc;
 
-       //HeapShort frequency in number of collections
-       unsigned int hs_mode_gc;
+       // Whether to do a heapshot on shutdown.
+       gboolean hs_on_shutdown;
 
-       //Sample frequency in Hertz
+       // Sample frequency in Hertz. Only used at startup.
        int sample_freq;
 
-       //Maximum number of frames to collect
+       // Maximum number of frames to collect. Can be changed at runtime.
        int num_frames;
 
-       //Max depth to record enter/leave events
+       // Max depth to record enter/leave events. Can be changed at runtime.
        int max_call_depth;
 
        //Name of the generated mlpd file
@@ -256,12 +528,13 @@ typedef struct {
        //Filter files used by the code coverage mode
        GPtrArray *cov_filter_files;
 
-       //Port to listen for profiling commands
+       // Port to listen for profiling commands (e.g. "heapshot" for on-demand heapshot).
        int command_port;
 
-       //Max size of the sample hit buffer, we'll drop frames if it's reached
+       // Maximum number of SampleHit structures. We'll drop samples if this number is not sufficient.
        int max_allocated_sample_hits;
 
+       // Sample mode. Only used at startup.
        MonoProfilerSampleMode sampling_mode;
 } ProfilerConfig;
 
index 1c63e9abde7fda14b8887b2e29a2ba9ba8c1a037..4251a164ff56623acb10f147837edbf2b8b0b858 100644 (file)
@@ -906,6 +906,13 @@ enum {
        SAMPLE_BRANCH_MISSES,
 };
 
+enum {
+       MONO_GC_EVENT_MARK_START = 1,
+       MONO_GC_EVENT_MARK_END = 2,
+       MONO_GC_EVENT_RECLAIM_START = 3,
+       MONO_GC_EVENT_RECLAIM_END = 4,
+};
+
 static const char*
 sample_type_name (int type)
 {
index ab9cb1f663f7ec789d6de4f1b0aa126e27abe418..0f2f5edf5aae83383aa6a9ce5aaca50c682136d0 100755 (executable)
@@ -62,7 +62,7 @@ if ($report ne "missing binary") {
        report_errors ();
 }
 # test heapshot traces
-$report = run_test_sgen ("test-heapshot.exe", "heapshot,output=-traces.mlpd,legacy", "--traces traces.mlpd");
+$report = run_test_sgen ("test-heapshot.exe", "heapshot,output=traces.mlpd,legacy", "--traces traces.mlpd");
 if ($report ne "missing binary") {
        check_report_basics ($report);
        check_report_heapshot ($report, 0, {"T" => 5000});
@@ -76,7 +76,7 @@ if ($report ne "missing binary") {
        report_errors ();
 }
 # test traces
-$report = run_test ("test-traces.exe", "legacy,calls,alloc,output=-traces.mlpd", "--maxframes=7 --traces traces.mlpd");
+$report = run_test ("test-traces.exe", "legacy,calls,alloc,output=traces.mlpd", "--maxframes=7 --traces traces.mlpd");
 check_report_basics ($report);
 check_call_traces ($report,
        "T:level3 (int)" => [2020, "T:Main (string[])"],
@@ -92,7 +92,7 @@ check_alloc_traces ($report,
 );
 report_errors ();
 # test traces without enter/leave events
-$report = run_test ("test-traces.exe", "legacy,alloc,output=-traces.mlpd", "--traces traces.mlpd");
+$report = run_test ("test-traces.exe", "legacy,alloc,output=traces.mlpd", "--traces traces.mlpd");
 check_report_basics ($report);
 # this has been broken recently
 check_exception_traces ($report,
index a11650951a4d52a25ed2669122c669f386428c98..e372724393b2cd5cae1e6654e573f0fe32eaf7ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * mono-codeanalyst.c: VTune profiler
+ * vtune.c: VTune profiler
  *
  * Author:
  *   Virgile Bello (virgile.bello@gmail.com)
@@ -161,12 +161,12 @@ code_buffer_new (MonoProfiler *prof, void *buffer, int size, MonoProfilerCodeBuf
 
 /* the entry point */
 void
-mono_profiler_init (const char *desc)
+mono_profiler_init_vtune (const char *desc)
 {
        iJIT_IsProfilingActiveFlags flags = iJIT_IsProfilingActive();
        if (flags == iJIT_SAMPLING_ON)
        {
-               MonoProfilerHandle handle = mono_profiler_install (NULL);
+               MonoProfilerHandle handle = mono_profiler_create (NULL);
                mono_profiler_set_runtime_shutdown_end_callback (handle, codeanalyst_shutdown);
                mono_profiler_set_jit_done_callback (handle, method_jit_done);
                mono_profiler_set_jit_code_buffer_callback (handle, code_buffer_new);
index 0247a6b12695c3e1368d327fefd5f58dd31fd2da..2fd54d986d0d6ded4b26dc3efb5203198bd4d3ec 100644 (file)
@@ -207,4 +207,27 @@ sgen_array_list_default_is_slot_set (volatile gpointer *slot)
        return *slot != NULL;
 }
 
+/* Removes all NULL pointers from the array. Not thread safe */
+void
+sgen_array_list_remove_nulls (SgenArrayList *array)
+{
+       guint32 start = 0;
+       volatile gpointer *slot;
+       gboolean skipped = FALSE;
+
+       SGEN_ARRAY_LIST_FOREACH_SLOT (array, slot) {
+               if (*slot) {
+                       *sgen_array_list_get_slot (array, start++) = *slot;
+                       if (skipped)
+                               *slot = NULL;
+               } else {
+                       skipped = TRUE;
+               }
+       } SGEN_ARRAY_LIST_END_FOREACH_SLOT;
+
+       mono_memory_write_barrier ();
+       array->next_slot = start;
+       array->slot_hint = start;
+}
+
 #endif
index 12e8bcdecf70f419c23c0cc65bcad7faac32e396..2ae3e63c2e2e5a3566af29a6dba2c369ee570807 100644 (file)
@@ -135,6 +135,6 @@ guint32 sgen_array_list_add (SgenArrayList *array, gpointer ptr, int data, gbool
 guint32 sgen_array_list_find (SgenArrayList *array, gpointer ptr);
 gboolean sgen_array_list_default_cas_setter (volatile gpointer *slot, gpointer ptr, int data);
 gboolean sgen_array_list_default_is_slot_set (volatile gpointer *slot);
-
+void sgen_array_list_remove_nulls (SgenArrayList *array);
 
 #endif
index 8f6ee8aa833b60c240bb421bea0236c118fd28ad..49c630f03f373ef59a4a37d6aafc96f29a157f0f 100644 (file)
@@ -282,7 +282,8 @@ static guint64 time_major_pre_collection_fragment_clear = 0;
 static guint64 time_major_pinning = 0;
 static guint64 time_major_scan_pinned = 0;
 static guint64 time_major_scan_roots = 0;
-static guint64 time_major_scan_mod_union = 0;
+static guint64 time_major_scan_mod_union_blocks = 0;
+static guint64 time_major_scan_mod_union_los = 0;
 static guint64 time_major_finish_gray_stack = 0;
 static guint64 time_major_free_bigobjs = 0;
 static guint64 time_major_los_sweep = 0;
@@ -1279,7 +1280,8 @@ init_stats (void)
        mono_counters_register ("Major pinning", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_pinning);
        mono_counters_register ("Major scan pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_pinned);
        mono_counters_register ("Major scan roots", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_roots);
-       mono_counters_register ("Major scan mod union", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_mod_union);
+       mono_counters_register ("Major scan mod union blocks", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_mod_union_blocks);
+       mono_counters_register ("Major scan mod union los", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_mod_union_los);
        mono_counters_register ("Major finish gray stack", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_finish_gray_stack);
        mono_counters_register ("Major free big objects", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_free_bigobjs);
        mono_counters_register ("Major LOS sweep", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_los_sweep);
@@ -1361,6 +1363,7 @@ typedef struct {
 typedef struct {
        ScanJob scan_job;
        int job_index, job_split_count;
+       int data;
 } ParallelScanJob;
 
 static ScanCopyContext
@@ -1444,9 +1447,12 @@ job_scan_major_card_table (void *worker_data_untyped, SgenThreadPoolJob *job)
        ScanCopyContext ctx = scan_copy_context_for_scan_job (worker_data_untyped, (ScanJob*)job_data);
 
        SGEN_TV_GETTIME (atv);
-       major_collector.scan_card_table (CARDTABLE_SCAN_GLOBAL, ctx, job_data->job_index, job_data->job_split_count);
+       major_collector.scan_card_table (CARDTABLE_SCAN_GLOBAL, ctx, job_data->job_index, job_data->job_split_count, job_data->data);
        SGEN_TV_GETTIME (btv);
        time_minor_scan_major_blocks += SGEN_TV_ELAPSED (atv, btv);
+
+       if (worker_data_untyped)
+               ((WorkerData*)worker_data_untyped)->major_scan_time += SGEN_TV_ELAPSED (atv, btv);
 }
 
 static void
@@ -1461,48 +1467,79 @@ job_scan_los_card_table (void *worker_data_untyped, SgenThreadPoolJob *job)
        sgen_los_scan_card_table (CARDTABLE_SCAN_GLOBAL, ctx, job_data->job_index, job_data->job_split_count);
        SGEN_TV_GETTIME (btv);
        time_minor_scan_los += SGEN_TV_ELAPSED (atv, btv);
+
+       if (worker_data_untyped)
+               ((WorkerData*)worker_data_untyped)->los_scan_time += SGEN_TV_ELAPSED (atv, btv);
 }
 
 static void
 job_scan_major_mod_union_card_table (void *worker_data_untyped, SgenThreadPoolJob *job)
 {
+       SGEN_TV_DECLARE (atv);
+       SGEN_TV_DECLARE (btv);
        ParallelScanJob *job_data = (ParallelScanJob*)job;
        ScanCopyContext ctx = scan_copy_context_for_scan_job (worker_data_untyped, (ScanJob*)job_data);
 
        g_assert (concurrent_collection_in_progress);
-       major_collector.scan_card_table (CARDTABLE_SCAN_MOD_UNION, ctx, job_data->job_index, job_data->job_split_count);
+       SGEN_TV_GETTIME (atv);
+       major_collector.scan_card_table (CARDTABLE_SCAN_MOD_UNION, ctx, job_data->job_index, job_data->job_split_count, job_data->data);
+       SGEN_TV_GETTIME (btv);
+       time_major_scan_mod_union_blocks += SGEN_TV_ELAPSED (atv, btv);
+
+       if (worker_data_untyped)
+               ((WorkerData*)worker_data_untyped)->major_scan_time += SGEN_TV_ELAPSED (atv, btv);
 }
 
 static void
 job_scan_los_mod_union_card_table (void *worker_data_untyped, SgenThreadPoolJob *job)
 {
+       SGEN_TV_DECLARE (atv);
+       SGEN_TV_DECLARE (btv);
        ParallelScanJob *job_data = (ParallelScanJob*)job;
        ScanCopyContext ctx = scan_copy_context_for_scan_job (worker_data_untyped, (ScanJob*)job_data);
 
        g_assert (concurrent_collection_in_progress);
+       SGEN_TV_GETTIME (atv);
        sgen_los_scan_card_table (CARDTABLE_SCAN_MOD_UNION, ctx, job_data->job_index, job_data->job_split_count);
+       SGEN_TV_GETTIME (btv);
+       time_major_scan_mod_union_los += SGEN_TV_ELAPSED (atv, btv);
+
+       if (worker_data_untyped)
+               ((WorkerData*)worker_data_untyped)->los_scan_time += SGEN_TV_ELAPSED (atv, btv);
 }
 
 static void
 job_major_mod_union_preclean (void *worker_data_untyped, SgenThreadPoolJob *job)
 {
+       SGEN_TV_DECLARE (atv);
+       SGEN_TV_DECLARE (btv);
        ParallelScanJob *job_data = (ParallelScanJob*)job;
        ScanCopyContext ctx = scan_copy_context_for_scan_job (worker_data_untyped, (ScanJob*)job_data);
 
        g_assert (concurrent_collection_in_progress);
+       SGEN_TV_GETTIME (atv);
+       major_collector.scan_card_table (CARDTABLE_SCAN_MOD_UNION_PRECLEAN, ctx, job_data->job_index, job_data->job_split_count, job_data->data);
+       SGEN_TV_GETTIME (btv);
 
-       major_collector.scan_card_table (CARDTABLE_SCAN_MOD_UNION_PRECLEAN, ctx, job_data->job_index, job_data->job_split_count);
+       g_assert (worker_data_untyped);
+       ((WorkerData*)worker_data_untyped)->major_scan_time += SGEN_TV_ELAPSED (atv, btv);
 }
 
 static void
 job_los_mod_union_preclean (void *worker_data_untyped, SgenThreadPoolJob *job)
 {
+       SGEN_TV_DECLARE (atv);
+       SGEN_TV_DECLARE (btv);
        ParallelScanJob *job_data = (ParallelScanJob*)job;
        ScanCopyContext ctx = scan_copy_context_for_scan_job (worker_data_untyped, (ScanJob*)job_data);
 
        g_assert (concurrent_collection_in_progress);
-
+       SGEN_TV_GETTIME (atv);
        sgen_los_scan_card_table (CARDTABLE_SCAN_MOD_UNION_PRECLEAN, ctx, job_data->job_index, job_data->job_split_count);
+       SGEN_TV_GETTIME (btv);
+
+       g_assert (worker_data_untyped);
+       ((WorkerData*)worker_data_untyped)->los_scan_time += SGEN_TV_ELAPSED (atv, btv);
 }
 
 static void
@@ -1521,6 +1558,7 @@ workers_finish_callback (void)
 {
        ParallelScanJob *psj;
        ScanJob *sj;
+       size_t num_major_sections = major_collector.get_num_major_sections ();
        int split_count = sgen_workers_get_job_split_count (GENERATION_OLD);
        int i;
        /* Mod union preclean jobs */
@@ -1529,6 +1567,7 @@ workers_finish_callback (void)
                psj->scan_job.gc_thread_gray_queue = NULL;
                psj->job_index = i;
                psj->job_split_count = split_count;
+               psj->data = num_major_sections / split_count;
                sgen_workers_enqueue_job (GENERATION_OLD, &psj->scan_job.job, TRUE);
        }
 
@@ -1555,6 +1594,7 @@ static void
 enqueue_scan_remembered_set_jobs (SgenGrayQueue *gc_thread_gray_queue, SgenObjectOperations *ops, gboolean enqueue)
 {
        int i, split_count = sgen_workers_get_job_split_count (GENERATION_NURSERY);
+       size_t num_major_sections = major_collector.get_num_major_sections ();
        ScanJob *sj;
 
        sj = (ScanJob*)sgen_thread_pool_job_alloc ("scan wbroots", job_scan_wbroots, sizeof (ScanJob));
@@ -1570,6 +1610,7 @@ enqueue_scan_remembered_set_jobs (SgenGrayQueue *gc_thread_gray_queue, SgenObjec
                psj->scan_job.gc_thread_gray_queue = gc_thread_gray_queue;
                psj->job_index = i;
                psj->job_split_count = split_count;
+               psj->data = num_major_sections / split_count;
                sgen_workers_enqueue_job (GENERATION_NURSERY, &psj->scan_job.job, enqueue);
 
                psj = (ParallelScanJob*)sgen_thread_pool_job_alloc ("scan LOS remsets", job_scan_los_card_table, sizeof (ParallelScanJob));
@@ -1650,6 +1691,9 @@ collect_nursery (const char *reason, gboolean is_overflow, SgenGrayQueue *unpin_
        TV_DECLARE (btv);
        SGEN_TV_DECLARE (last_minor_collection_start_tv);
        SGEN_TV_DECLARE (last_minor_collection_end_tv);
+       guint64 major_scan_start = time_minor_scan_major_blocks;
+       guint64 los_scan_start = time_minor_scan_los;
+       guint64 finish_gray_start = time_minor_finish_gray_stack;
 
        if (disable_minor_collections)
                return TRUE;
@@ -1844,6 +1888,14 @@ collect_nursery (const char *reason, gboolean is_overflow, SgenGrayQueue *unpin_
        current_collection_generation = -1;
        objects_pinned = 0;
 
+       if (is_parallel)
+               binary_protocol_collection_end_stats (0, 0, time_minor_finish_gray_stack - finish_gray_start);
+       else
+               binary_protocol_collection_end_stats (
+                       time_minor_scan_major_blocks - major_scan_start,
+                       time_minor_scan_los - los_scan_start,
+                       time_minor_finish_gray_stack - finish_gray_start);
+
        binary_protocol_collection_end (gc_stats.minor_gc_count - 1, GENERATION_NURSERY, 0, 0);
 
        if (check_nursery_objects_pinned && !sgen_minor_collector.is_split)
@@ -1990,10 +2042,13 @@ major_copy_or_mark_from_roots (SgenGrayQueue *gc_thread_gray_queue, size_t *old_
        if (mode == COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT) {
                if (object_ops_par != NULL)
                        sgen_workers_set_num_active_workers (GENERATION_OLD, 0);
-               if (sgen_workers_have_idle_work (GENERATION_OLD)) {
+               if (object_ops_par == NULL && sgen_workers_have_idle_work (GENERATION_OLD)) {
                        /*
                         * We force the finish of the worker with the new object ops context
-                        * which can also do copying. We need to have finished pinning.
+                        * which can also do copying. We need to have finished pinning. On the
+                        * parallel collector, there is no need to drain the private queues
+                        * here, since we can do it as part of the finishing work, achieving
+                        * better work distribution.
                         */
                        sgen_workers_start_all_workers (GENERATION_OLD, object_ops_nopar, object_ops_par, NULL);
 
@@ -2034,6 +2089,7 @@ major_copy_or_mark_from_roots (SgenGrayQueue *gc_thread_gray_queue, size_t *old_
 
        if (mode == COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT) {
                int i, split_count = sgen_workers_get_job_split_count (GENERATION_OLD);
+               size_t num_major_sections = major_collector.get_num_major_sections ();
                gboolean parallel = object_ops_par != NULL;
 
                /* If we're not parallel we finish the collection on the gc thread */
@@ -2049,6 +2105,7 @@ major_copy_or_mark_from_roots (SgenGrayQueue *gc_thread_gray_queue, size_t *old_
                        psj->scan_job.gc_thread_gray_queue = gc_thread_gray_queue;
                        psj->job_index = i;
                        psj->job_split_count = split_count;
+                       psj->data = num_major_sections / split_count;
                        sgen_workers_enqueue_job (GENERATION_OLD, &psj->scan_job.job, parallel);
 
                        psj = (ParallelScanJob*)sgen_thread_pool_job_alloc ("scan LOS mod union cardtable", job_scan_los_mod_union_card_table, sizeof (ParallelScanJob));
@@ -2138,8 +2195,9 @@ major_finish_collection (SgenGrayQueue *gc_thread_gray_queue, const char *reason
        mword fragment_total;
        TV_DECLARE (atv);
        TV_DECLARE (btv);
-
-       TV_GETTIME (btv);
+       guint64 major_scan_start = time_major_scan_mod_union_blocks;
+       guint64 los_scan_start = time_major_scan_mod_union_los;
+       guint64 finish_gray_start = time_major_finish_gray_stack;
 
        if (concurrent_collection_in_progress) {
                SgenObjectOperations *object_ops_par = NULL;
@@ -2159,6 +2217,7 @@ major_finish_collection (SgenGrayQueue *gc_thread_gray_queue, const char *reason
 
        sgen_workers_assert_gray_queue_is_empty (GENERATION_OLD);
 
+       TV_GETTIME (btv);
        finish_gray_stack (GENERATION_OLD, CONTEXT_FROM_OBJECT_OPERATIONS (object_ops_nopar, gc_thread_gray_queue));
        TV_GETTIME (atv);
        time_major_finish_gray_stack += TV_ELAPSED (btv, atv);
@@ -2260,6 +2319,13 @@ major_finish_collection (SgenGrayQueue *gc_thread_gray_queue, const char *reason
        binary_protocol_flush_buffers (FALSE);
 
        //consistency_check ();
+       if (major_collector.is_parallel)
+                binary_protocol_collection_end_stats (0, 0, time_major_finish_gray_stack - finish_gray_start);
+        else
+                binary_protocol_collection_end_stats (
+                        time_major_scan_mod_union_blocks - major_scan_start,
+                        time_major_scan_mod_union_los - los_scan_start,
+                        time_major_finish_gray_stack - finish_gray_start);
 
        binary_protocol_collection_end (gc_stats.major_gc_count - 1, GENERATION_OLD, counts.num_scanned_objects, counts.num_unique_scanned_objects);
 }
@@ -3171,9 +3237,8 @@ init_sgen_mode (SgenMode mode)
                /*
                 * Use concurrent major and dynamic nursery with a more
                 * aggressive shrinking relative to pause times.
-                * FIXME use parallel minors
                 */
-               minor = SGEN_MINOR_SIMPLE;
+               minor = SGEN_MINOR_SIMPLE_PARALLEL;
                major = SGEN_MAJOR_CONCURRENT;
                dynamic_nursery = TRUE;
                sgen_max_pause_margin = SGEN_PAUSE_MODE_MAX_PAUSE_MARGIN;
index 2faad109d1ec06e3496ebd23f1ac4ab1d5d39de7..3e2620b219fdfca712a8afec98468c49b63945b7 100644 (file)
@@ -650,7 +650,7 @@ struct _SgenMajorCollector {
        void (*free_non_pinned_object) (GCObject *obj, size_t size);
        void (*pin_objects) (SgenGrayQueue *queue);
        void (*pin_major_object) (GCObject *obj, SgenGrayQueue *queue);
-       void (*scan_card_table) (CardTableScanType scan_type, ScanCopyContext ctx, int job_index, int job_split_count);
+       void (*scan_card_table) (CardTableScanType scan_type, ScanCopyContext ctx, int job_index, int job_split_count, int block_count);
        void (*iterate_live_block_ranges) (sgen_cardtable_block_callback callback);
        void (*iterate_block_ranges) (sgen_cardtable_block_callback callback);
        void (*update_cardtable_mod_union) (void);
index 2d1bc5b279917b626d7615ea89d0c5ca305d7f7c..35e1195dbfbbfc27c96546a05684c22ad1b6fa3e 100644 (file)
@@ -212,6 +212,7 @@ static SgenArrayList allocated_blocks = SGEN_ARRAY_LIST_INIT (NULL, sgen_array_l
 /* non-allocated block free-list */
 static void *empty_blocks = NULL;
 static size_t num_empty_blocks = 0;
+static gboolean compact_blocks = FALSE;
 
 /*
  * We can iterate the block list also while sweep is in progress but we
@@ -234,6 +235,16 @@ static size_t num_empty_blocks = 0;
                (bl) = BLOCK_UNTAG ((bl));
 #define END_FOREACH_BLOCK_NO_LOCK      } SGEN_ARRAY_LIST_END_FOREACH_SLOT; }
 
+#define FOREACH_BLOCK_RANGE_HAS_REFERENCES_NO_LOCK(bl,begin,end,index,hr) {    \
+       volatile gpointer *slot;                                        \
+       SGEN_ARRAY_LIST_FOREACH_SLOT_RANGE (&allocated_blocks, begin, end, slot, index) { \
+               (bl) = (MSBlockInfo *) (*slot);                         \
+               if (!(bl))                                              \
+                       continue;                                       \
+               (hr) = BLOCK_IS_TAGGED_HAS_REFERENCES ((bl));           \
+               (bl) = BLOCK_UNTAG ((bl));
+#define END_FOREACH_BLOCK_RANGE_NO_LOCK        } SGEN_ARRAY_LIST_END_FOREACH_SLOT_RANGE; }
+
 static volatile size_t num_major_sections = 0;
 /*
  * One free block list for each block object size.  We add and remove blocks from these
@@ -1601,6 +1612,8 @@ sweep_start (void)
 
        sgen_workers_foreach (GENERATION_NURSERY, sgen_worker_clear_free_block_lists);
        sgen_workers_foreach (GENERATION_OLD, sgen_worker_clear_free_block_lists);
+
+       compact_blocks = TRUE;
 }
 
 static void sweep_finish (void);
@@ -1974,6 +1987,18 @@ major_start_nursery_collection (void)
 #endif
 
        old_num_major_sections = num_major_sections;
+
+       /* Compact the block list if it hasn't been compacted in a while and nobody is using it */
+       if (compact_blocks && !sweep_in_progress () && !sweep_blocks_job && !sgen_concurrent_collection_in_progress ()) {
+               /*
+                * We support null elements in the array but do regular compaction to avoid
+                * excessive traversal of the array and to facilitate splitting into well
+                * balanced sections for parallel modes. We compact as soon as possible after
+                * sweep.
+                */
+               sgen_array_list_remove_nulls (&allocated_blocks);
+               compact_blocks = FALSE;
+       }
 }
 
 static void
@@ -2137,7 +2162,7 @@ major_free_swept_blocks (size_t section_reserve)
 {
        SGEN_ASSERT (0, sweep_state == SWEEP_STATE_SWEPT, "Sweeping must have finished before freeing blocks");
 
-#ifdef TARGET_WIN32
+#if defined(HOST_WIN32) || defined(HOST_ORBIS)
                /*
                 * sgen_free_os_memory () asserts in mono_vfree () because windows doesn't like freeing the middle of
                 * a VirtualAlloc ()-ed block.
@@ -2603,10 +2628,24 @@ scan_card_table_for_block (MSBlockInfo *block, CardTableScanType scan_type, Scan
 }
 
 static void
-major_scan_card_table (CardTableScanType scan_type, ScanCopyContext ctx, int job_index, int job_split_count)
+major_scan_card_table (CardTableScanType scan_type, ScanCopyContext ctx, int job_index, int job_split_count, int block_count)
 {
        MSBlockInfo *block;
        gboolean has_references, was_sweeping, skip_scan;
+       int first_block, last_block, index;
+
+       /*
+        * The last_block's index is at least (num_major_sections - 1) since we
+        * can have nulls in the allocated_blocks list. The last worker will
+        * scan the left-overs of the list. We expect few null entries in the
+        * allocated_blocks list, therefore using num_major_sections for computing
+        * block_count shouldn't affect work distribution.
+        */
+       first_block = block_count * job_index;
+       if (job_index == job_split_count - 1)
+               last_block = allocated_blocks.next_slot;
+       else
+               last_block = block_count * (job_index + 1);
 
        if (!concurrent_mark)
                g_assert (scan_type == CARDTABLE_SCAN_GLOBAL);
@@ -2616,11 +2655,9 @@ major_scan_card_table (CardTableScanType scan_type, ScanCopyContext ctx, int job
        was_sweeping = sweep_in_progress ();
 
        binary_protocol_major_card_table_scan_start (sgen_timestamp (), scan_type & CARDTABLE_SCAN_MOD_UNION);
-       FOREACH_BLOCK_HAS_REFERENCES_NO_LOCK (block, has_references) {
-               if (__index % job_split_count != job_index)
-                       continue;
+       FOREACH_BLOCK_RANGE_HAS_REFERENCES_NO_LOCK (block, first_block, last_block, index, has_references) {
 #ifdef PREFETCH_CARDS
-               int prefetch_index = __index + 6 * job_split_count;
+               int prefetch_index = index + 6;
                if (prefetch_index < allocated_blocks.next_slot) {
                        MSBlockInfo *prefetch_block = BLOCK_UNTAG (*sgen_array_list_get_slot (&allocated_blocks, prefetch_index));
                        PREFETCH_READ (prefetch_block);
@@ -2631,7 +2668,6 @@ major_scan_card_table (CardTableScanType scan_type, ScanCopyContext ctx, int job
                        }
                 }
 #endif
-
                if (!has_references)
                        continue;
                skip_scan = FALSE;
@@ -2655,16 +2691,16 @@ major_scan_card_table (CardTableScanType scan_type, ScanCopyContext ctx, int job
                                 * sweep start since we are in a nursery collection. Also avoid CAS-ing
                                 */
                                if (sweep_in_progress ()) {
-                                       skip_scan = !ensure_block_is_checked_for_sweeping (__index, TRUE, NULL);
+                                       skip_scan = !ensure_block_is_checked_for_sweeping (index, TRUE, NULL);
                                } else if (was_sweeping) {
                                        /* Recheck in case sweep finished after dereferencing the slot */
-                                       skip_scan = *sgen_array_list_get_slot (&allocated_blocks, __index) == 0;
+                                       skip_scan = *sgen_array_list_get_slot (&allocated_blocks, index) == 0;
                                }
                        }
                }
                if (!skip_scan)
                        scan_card_table_for_block (block, scan_type, ctx);
-       } END_FOREACH_BLOCK_NO_LOCK;
+       } END_FOREACH_BLOCK_RANGE_NO_LOCK;
        binary_protocol_major_card_table_scan_end (sgen_timestamp (), scan_type & CARDTABLE_SCAN_MOD_UNION);
 }
 
index 08bfdfe890ee2d9ddf8a4e91f1f8158d66363a36..7406ab2c5b335e69e7e5973ca253803e5d17ba80 100644 (file)
@@ -380,47 +380,47 @@ MATCH_INDEX (ptr == entry->obj ? 0 : ptr == entry->ptr ? 1 : ptr == entry->value
 IS_VTABLE_MATCH (ptr == entry->value_vtable)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY2 (binary_protocol_major_card_table_scan_start, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union)
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_major_card_table_scan_start, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (TRUE)
 MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
-END_PROTOCOL_ENTRY
+END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY2 (binary_protocol_major_card_table_scan_end, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union)
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_major_card_table_scan_end, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (TRUE)
 MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
-END_PROTOCOL_ENTRY
+END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY2 (binary_protocol_los_card_table_scan_start, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union)
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_los_card_table_scan_start, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (TRUE)
 MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
-END_PROTOCOL_ENTRY
+END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY2 (binary_protocol_los_card_table_scan_end, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union)
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_los_card_table_scan_end, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (TRUE)
 MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
-END_PROTOCOL_ENTRY
+END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY2 (binary_protocol_finish_gray_stack_start, TYPE_LONGLONG, timestamp, TYPE_INT, generation)
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_finish_gray_stack_start, TYPE_LONGLONG, timestamp, TYPE_INT, generation)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (TRUE)
 MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
-END_PROTOCOL_ENTRY
+END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY2 (binary_protocol_finish_gray_stack_end, TYPE_LONGLONG, timestamp, TYPE_INT, generation)
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_finish_gray_stack_end, TYPE_LONGLONG, timestamp, TYPE_INT, generation)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (TRUE)
 MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
-END_PROTOCOL_ENTRY
+END_PROTOCOL_ENTRY_HEAVY
 
 BEGIN_PROTOCOL_ENTRY2 (binary_protocol_worker_finish, TYPE_LONGLONG, timestamp, TYPE_BOOL, forced)
 DEFAULT_PRINT ()
@@ -457,6 +457,20 @@ MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY
 
+BEGIN_PROTOCOL_ENTRY6 (binary_protocol_worker_finish_stats, TYPE_INT, worker_index, TYPE_INT, generation, TYPE_BOOL, forced, TYPE_LONGLONG, major_scan, TYPE_LONGLONG, los_scan, TYPE_LONGLONG, work_time)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (TRUE)
+MATCH_INDEX (BINARY_PROTOCOL_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY
+
+BEGIN_PROTOCOL_ENTRY3 (binary_protocol_collection_end_stats, TYPE_LONGLONG, major_scan, TYPE_LONGLONG, los_scan, TYPE_LONGLONG, finish_stack)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (TRUE)
+MATCH_INDEX (BINARY_PROTOCOL_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY
+
 #undef BEGIN_PROTOCOL_ENTRY0
 #undef BEGIN_PROTOCOL_ENTRY1
 #undef BEGIN_PROTOCOL_ENTRY2
index 6a03bc3d69d164b5cd949b0b71760fc84f41d04b..211bc8b7277975471954dec78c7775c9a8e8c9f6 100644 (file)
@@ -21,6 +21,7 @@ static mono_cond_t done_cond;
 
 static int threads_num;
 static MonoNativeThreadId threads [SGEN_THREADPOOL_MAX_NUM_THREADS];
+static int threads_context [SGEN_THREADPOOL_MAX_NUM_THREADS];
 
 static volatile gboolean threadpool_shutdown;
 static volatile int threads_finished;
@@ -166,8 +167,9 @@ get_work (int worker_index, int *work_context, int *do_idle, SgenThreadPoolJob *
 }
 
 static mono_native_thread_return_t
-thread_func (int worker_index)
+thread_func (void *data)
 {
+       int worker_index = (int)(gsize)data;
        int current_context;
        void *thread_data = NULL;
 
@@ -190,7 +192,9 @@ thread_func (int worker_index)
                SgenThreadPoolJob *job = NULL;
                SgenThreadPoolContext *context = NULL;
 
+               threads_context [worker_index] = -1;
                get_work (worker_index, &current_context, &do_idle, &job);
+               threads_context [worker_index] = current_context;
 
                if (!threadpool_shutdown) {
                        context = &pool_contexts [current_context];
@@ -358,13 +362,13 @@ sgen_thread_pool_idle_signal (int context_id)
 }
 
 void
-sgen_thread_pool_idle_wait (int context_id)
+sgen_thread_pool_idle_wait (int context_id, SgenThreadPoolContinueIdleWaitFunc continue_wait)
 {
        SGEN_ASSERT (0, pool_contexts [context_id].idle_job_func, "Why are we waiting for idle without an idle function?");
 
        mono_os_mutex_lock (&lock);
 
-       while (pool_contexts [context_id].continue_idle_job_func (NULL, context_id))
+       while (continue_wait (context_id, threads_context))
                mono_os_cond_wait (&done_cond, &lock);
 
        mono_os_mutex_unlock (&lock);
index b13848a5a80d20ef938cde11c3ce8371b4a6cec6..b62e85fe35ba6e552814e9d68b62a7a4000e31f6 100644 (file)
@@ -24,6 +24,7 @@ typedef void (*SgenThreadPoolThreadInitFunc) (void*);
 typedef void (*SgenThreadPoolIdleJobFunc) (void*);
 typedef gboolean (*SgenThreadPoolContinueIdleJobFunc) (void*, int);
 typedef gboolean (*SgenThreadPoolShouldWorkFunc) (void*);
+typedef gboolean (*SgenThreadPoolContinueIdleWaitFunc) (int, int*);
 
 struct _SgenThreadPoolJob {
        const char *name;
@@ -60,7 +61,7 @@ void sgen_thread_pool_job_enqueue (int context_id, SgenThreadPoolJob *job);
 void sgen_thread_pool_job_wait (int context_id, SgenThreadPoolJob *job);
 
 void sgen_thread_pool_idle_signal (int context_id);
-void sgen_thread_pool_idle_wait (int context_id);
+void sgen_thread_pool_idle_wait (int context_id, SgenThreadPoolContinueIdleWaitFunc continue_wait);
 
 void sgen_thread_pool_wait_for_all_jobs (int context_id);
 
index 8a615ede6388b42fd1e4b90f50347264e64bba94..ccb9f9c5f27e9678ebc1078607b5c863e527517f 100644 (file)
@@ -56,8 +56,6 @@ set_state (WorkerData *data, State old_state, State new_state)
                SGEN_ASSERT (0, old_state == STATE_WORKING, "We can only transition to NOT WORKING from WORKING");
        else if (new_state == STATE_WORKING)
                SGEN_ASSERT (0, old_state == STATE_WORK_ENQUEUED, "We can only transition to WORKING from WORK ENQUEUED");
-       if (new_state == STATE_NOT_WORKING || new_state == STATE_WORKING)
-               SGEN_ASSERT (6, sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()), "Only the worker thread is allowed to transition to NOT_WORKING or WORKING");
 
        return InterlockedCompareExchange (&data->state, new_state, old_state) == old_state;
 }
@@ -94,6 +92,9 @@ sgen_workers_ensure_awake (WorkerContext *context)
                                break;
 
                        did_set_state = set_state (&context->workers_data [i], old_state, STATE_WORK_ENQUEUED);
+
+                       if (did_set_state && old_state == STATE_NOT_WORKING)
+                               context->workers_data [i].last_start = sgen_timestamp ();
                } while (!did_set_state);
 
                if (!state_is_working_or_enqueued (old_state))
@@ -110,6 +111,7 @@ worker_try_finish (WorkerData *data)
        State old_state;
        int i, working = 0;
        WorkerContext *context = data->context;
+       gint64 last_start = data->last_start;
 
        ++stat_workers_num_finished;
 
@@ -132,6 +134,12 @@ worker_try_finish (WorkerData *data)
                        /* Make sure each worker has a chance of seeing the enqueued jobs */
                        sgen_workers_ensure_awake (context);
                        SGEN_ASSERT (0, data->state == STATE_WORK_ENQUEUED, "Why did we fail to set our own state to ENQUEUED");
+
+                       /*
+                        * Log to be able to get the duration of normal concurrent M&S phase.
+                        * Worker indexes are 1 based, since 0 is logically considered gc thread.
+                        */
+                       binary_protocol_worker_finish_stats (data - &context->workers_data [0] + 1, context->generation, context->forced_stop, data->major_scan_time, data->los_scan_time, data->total_time + sgen_timestamp () - last_start);
                        goto work_available;
                }
        }
@@ -156,7 +164,8 @@ worker_try_finish (WorkerData *data)
        context->workers_finished = TRUE;
        mono_os_mutex_unlock (&context->finished_lock);
 
-       binary_protocol_worker_finish (sgen_timestamp (), context->forced_stop);
+       data->total_time += (sgen_timestamp () - last_start);
+       binary_protocol_worker_finish_stats (data - &context->workers_data [0] + 1, context->generation, context->forced_stop, data->major_scan_time, data->los_scan_time, data->total_time);
 
        sgen_gray_object_queue_trim_free_list (&data->private_gray_queue);
        return;
@@ -378,17 +387,63 @@ sgen_workers_create_context (int generation, int num_workers)
        }
 }
 
+/* This is called with thread pool lock so no context switch can happen */
+static gboolean
+continue_idle_wait (int calling_context, int *threads_context)
+{
+       WorkerContext *context;
+       int i;
+
+       if (worker_contexts [GENERATION_OLD].workers_num && calling_context == worker_contexts [GENERATION_OLD].thread_pool_context)
+               context = &worker_contexts [GENERATION_OLD];
+       else if (worker_contexts [GENERATION_NURSERY].workers_num && calling_context == worker_contexts [GENERATION_NURSERY].thread_pool_context)
+               context = &worker_contexts [GENERATION_NURSERY];
+       else
+               g_assert_not_reached ();
+
+       /*
+        * We assume there are no pending jobs, since this is called only after
+        * we waited for all the jobs.
+        */
+       for (i = 0; i < context->active_workers_num; i++) {
+               if (threads_context [i] == calling_context)
+                       return TRUE;
+       }
+
+       if (sgen_workers_have_idle_work (context->generation) && !context->forced_stop)
+               return TRUE;
+
+       /*
+        * At this point there are no jobs to be done, and no objects to be scanned
+        * in the gray queues. We can simply asynchronously finish all the workers
+        * from the context that were not finished already (due to being stuck working
+        * in another context)
+        */
+
+       for (i = 0; i < context->active_workers_num; i++) {
+               if (context->workers_data [i].state == STATE_WORK_ENQUEUED)
+                       set_state (&context->workers_data [i], STATE_WORK_ENQUEUED, STATE_WORKING);
+               if (context->workers_data [i].state == STATE_WORKING)
+                       worker_try_finish (&context->workers_data [i]);
+       }
+
+       return FALSE;
+}
+
+
 void
 sgen_workers_stop_all_workers (int generation)
 {
        WorkerContext *context = &worker_contexts [generation];
 
+       mono_os_mutex_lock (&context->finished_lock);
        context->finish_callback = NULL;
-       mono_memory_write_barrier ();
+       mono_os_mutex_unlock (&context->finished_lock);
+
        context->forced_stop = TRUE;
 
        sgen_thread_pool_wait_for_all_jobs (context->thread_pool_context);
-       sgen_thread_pool_idle_wait (context->thread_pool_context);
+       sgen_thread_pool_idle_wait (context->thread_pool_context, continue_idle_wait);
        SGEN_ASSERT (0, !sgen_workers_are_working (context), "Can only signal enqueue work when in no work state");
 
        context->started = FALSE;
@@ -410,6 +465,7 @@ void
 sgen_workers_start_all_workers (int generation, SgenObjectOperations *object_ops_nopar, SgenObjectOperations *object_ops_par, SgenWorkersFinishCallback callback)
 {
        WorkerContext *context = &worker_contexts [generation];
+       int i;
        SGEN_ASSERT (0, !context->started, "Why are we starting to work without finishing previous cycle");
 
        context->idle_func_object_ops_par = object_ops_par;
@@ -418,6 +474,13 @@ sgen_workers_start_all_workers (int generation, SgenObjectOperations *object_ops
        context->finish_callback = callback;
        context->worker_awakenings = 0;
        context->started = TRUE;
+
+       for (i = 0; i < context->active_workers_num; i++) {
+               context->workers_data [i].major_scan_time = 0;
+               context->workers_data [i].los_scan_time = 0;
+               context->workers_data [i].total_time = 0;
+               context->workers_data [i].last_start = 0;
+       }
        mono_memory_write_barrier ();
 
        /*
@@ -435,16 +498,10 @@ sgen_workers_join (int generation)
        WorkerContext *context = &worker_contexts [generation];
        int i;
 
-       /*
-        * It might be the case that a worker didn't get to run anything
-        * in this context, because it was stuck working on a long job
-        * in another context. In this case its state is active (WORK_ENQUEUED)
-        * and we need to wait for it to finish itself.
-        * FIXME Avoid having to wait for the worker to report its own finish.
-        */
+       SGEN_ASSERT (0, !context->finish_callback, "Why are we joining concurrent mark early");
 
        sgen_thread_pool_wait_for_all_jobs (context->thread_pool_context);
-       sgen_thread_pool_idle_wait (context->thread_pool_context);
+       sgen_thread_pool_idle_wait (context->thread_pool_context, continue_idle_wait);
        SGEN_ASSERT (0, !sgen_workers_are_working (context), "Can only signal enqueue work when in no work state");
 
        /* At this point all the workers have stopped. */
@@ -457,8 +514,8 @@ sgen_workers_join (int generation)
 }
 
 /*
- * Can only be called if the workers are stopped.
- * If we're stopped, there are also no pending jobs.
+ * Can only be called if the workers are not working in the
+ * context and there are no pending jobs.
  */
 gboolean
 sgen_workers_have_idle_work (int generation)
@@ -466,8 +523,6 @@ sgen_workers_have_idle_work (int generation)
        WorkerContext *context = &worker_contexts [generation];
        int i;
 
-       SGEN_ASSERT (0, context->forced_stop && !sgen_workers_are_working (context), "Checking for idle work should only happen if the workers are stopped.");
-
        if (!sgen_section_gray_queue_is_empty (&context->workers_distribute_gray_queue))
                return TRUE;
 
index 42dc16ac4aef7c6eb18cd5fe0b73dd5f49b6497e..e3147f051af78a87304ce3ffb150f0daeb7f2b74 100644 (file)
@@ -32,6 +32,15 @@ struct _WorkerData {
         */
        gpointer free_block_lists;
        WorkerContext *context;
+
+       /* Work time distribution. Measured in ticks. */
+       gint64 major_scan_time, los_scan_time, total_time;
+       /*
+        * When changing the state of the worker from not working to work enqueued
+        * we set the timestamp so we can compute for how long the worker did actual
+        * work during the phase
+        */
+       gint64 last_start;
 };
 
 struct _WorkerContext {
index d9c5afefee31164afd3b05a2b8434be0f7af4b08..e93fb7de81fe72e9473bece369a46c8fbe661770 100755 (executable)
@@ -69,11 +69,12 @@ if HYBRID_AOT_TESTS
 PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY 
 endif
 
-MCS_NO_LIB = $(TOOLS_RUNTIME) $(CSC) -unsafe -debug:portable \
+MCS_NO_UNSAFE = $(TOOLS_RUNTIME) $(CSC) -debug:portable \
        -noconfig -nologo \
        -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 \
        -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 \
        -nowarn:0197 $(PROFILE_MCS_FLAGS)
+MCS_NO_LIB = $(MCS_NO_UNSAFE) -unsafe
 
 MCS = $(MCS_NO_LIB)
 
@@ -893,6 +894,7 @@ CI_PR_DISABLED_TESTS = \
 
 # appdomain-threadpool-unload.exe creates 100 appdomains, takes too long with llvm
 LLVM_DISABLED_TESTS = \
+       finally_block_ending_in_dead_bb.exe \
        appdomain-threadpool-unload.exe
 
 LLVM = $(filter --llvm, $(MONO_ENV_OPTIONS))
@@ -2001,20 +2003,70 @@ endif
 libtest_la_SOURCES = libtest.c
 libtest_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
 
-test-internalsvisibleto: internalsvisibleto-runtimetest.exe internalsvisibleto-compilertest.exe internalsvisibleto-library.dll
-       $(Q) $(RUNTIME) internalsvisibleto-runtimetest.exe 1>internalsvisibleto-runtimetest.exe.stdout 2>internalsvisibleto-runtimetest.exe.stderr
-       $(Q) $(RUNTIME) internalsvisibleto-compilertest.exe 1>internalsvisibleto-compilertest.exe.stdout 2>internalsvisibleto-compilertest.exe.stderr
-
-internalsvisibleto-runtimetest.exe: internalsvisibleto-runtimetest.cs internalsvisibleto-library.cs
-       $(Q) $(MCS) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE -d:PERMISSIVE internalsvisibleto-library.cs 
-       $(Q) $(MCS) -out:internalsvisibleto-wrongcase.dll -target:library -d:WRONG_CASE -d:PERMISSIVE internalsvisibleto-library.cs
-       $(Q) $(MCS) -out:internalsvisibleto-runtimetest.exe -warn:0 -r:internalsvisibleto-correctcase.dll -r:internalsvisibleto-wrongcase.dll internalsvisibleto-runtimetest.cs
-       $(Q) $(MCS) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs       
-       $(Q) $(MCS) -out:internalsvisibleto-wrongcase.dll -target:library -d:WRONG_CASE internalsvisibleto-library.cs
-
-internalsvisibleto-compilertest.exe: internalsvisibleto-compilertest.cs internalsvisibleto-library.cs
-       $(Q) $(MCS) -out:internalsvisibleto-correctcase-2.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs     
-       $(Q) $(MCS) -out:internalsvisibleto-wrongcase-2.dll -target:library -d:WRONG_CASE internalsvisibleto-library.cs
-       $(Q) $(MCS) -out:internalsvisibleto-compilertest.exe -warn:0 -r:internalsvisibleto-correctcase-2.dll -r:internalsvisibleto-wrongcase-2.dll internalsvisibleto-compilertest.cs
+INTERNALSVISIBLETO_TEST_SRC = \
+       internalsvisibleto-runtimetest.cs \
+       internalsvisibleto-compilertest.cs
+
+INTERNALSVISIBLETO_TEST_LIB_SRC = \
+       internalsvisibleto-library.cs
+
+INTERNALSVISIBLETO_TEST_LIBS = \
+       internalsvisibleto-correctcase.dll \
+       internalsvisibleto-wrongcase.dll \
+       internalsvisibleto-correctcase-2.dll \
+       internalsvisibleto-wrongcase-2.dll \
+       internalsvisibleto-correctcase-sign2048.dll \
+       internalsvisibleto-wrongcase-sign2048.dll \
+       internalsvisibleto-correctcase-2-sign2048.dll \
+       internalsvisibleto-wrongcase-2-sign2048.dll
+
+
+INTERNALSVISIBLETO_TEST = \
+       $(INTERNALSVISIBLETO_TEST_SRC:.cs=.exe) \
+       $(INTERNALSVISIBLETO_TEST_SRC:.cs=-sign2048.exe)
+
+if FULL_AOT_TESTS
+INTERNALSVISIBLETO_TESTAOT = \
+       $(INTERNALSVISIBLETO_TEST:.exe=.exe$(PLATFORM_AOT_SUFFIX))
+INTERNALSVISIBLETO_TESTAOT_LIBS = \
+       $(INTERNALSVISIBLETO_TEST_LIBS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
+endif
+
+if HYBRID_AOT_TESTS
+INTERNALSVISIBLETO_TESTAOT = \
+       $(INTERNALSVISIBLETO_TEST:.exe=.exe$(PLATFORM_AOT_SUFFIX))
+INTERNALSVISIBLETO_TESTAOT_LIBS = \
+       $(INTERNALSVISIBLETO_TEST_LIBS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
+endif
+
+EXTRA_DIST += $(INTERNALSVISIBLETO_TEST_SRC) $(INTERNALSVISIBLETO_TEST_LIB_SRC)
+
+test-internalsvisibleto: test-runner.exe $(INTERNALSVISIBLETO_TEST) $(INTERNALSVISIBLETO_TESTAOT) $(INTERNALSVISIBLETO_TESTAOT_LIBS)
+       $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ $(INTERNALSVISIBLETO_TEST)
+
+internalsvisibleto-correctcase.dll internalsvisibleto-wrongcase.dll internalsvisibleto-runtimetest.exe: internalsvisibleto-runtimetest.cs internalsvisibleto-library.cs
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE -d:PERMISSIVE internalsvisibleto-library.cs       
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase.dll -target:library -d:WRONG_CASE -d:PERMISSIVE internalsvisibleto-library.cs
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-runtimetest.exe -warn:0 -r:internalsvisibleto-correctcase.dll -r:internalsvisibleto-wrongcase.dll internalsvisibleto-runtimetest.cs
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs     
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase.dll -target:library -d:WRONG_CASE internalsvisibleto-library.cs
+
+internalsvisibleto-correctcase-2.dll internalsvisibleto-wrongcase-2.dll  internalsvisibleto-compilertest.exe: internalsvisibleto-compilertest.cs internalsvisibleto-library.cs
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-2.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs   
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-2.dll -target:library -d:WRONG_CASE internalsvisibleto-library.cs
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-compilertest.exe -warn:0 -r:internalsvisibleto-correctcase-2.dll -r:internalsvisibleto-wrongcase-2.dll internalsvisibleto-compilertest.cs
+
+internalsvisibleto-correctcase-sign2048.dll internalsvisibleto-wrongcase-sign2048.dll internalsvisibleto-runtimetest-sign2048.exe: internalsvisibleto-runtimetest.cs internalsvisibleto-library.cs internalsvisibleto-2048.snk
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-sign2048.dll -target:library -d:CORRECT_CASE -d:PERMISSIVE -d:SIGN2048 internalsvisibleto-library.cs
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-sign2048.dll -target:library -d:WRONG_CASE -d:PERMISSIVE -d:SIGN2048 internalsvisibleto-library.cs
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-runtimetest-sign2048.exe -warn:0 -r:internalsvisibleto-correctcase-sign2048.dll -r:internalsvisibleto-wrongcase-sign2048.dll -d:SIGN2048 internalsvisibleto-runtimetest.cs
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-sign2048.dll -target:library -d:CORRECT_CASE -d:SIGN2048 internalsvisibleto-library.cs
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-sign2048.dll -target:library -d:WRONG_CASE -d:SIGN2048 internalsvisibleto-library.cs
+
+internalsvisibleto-correctcase-2-sign2048.dll internalsvisibleto-wrongcase-2-sign2048.dll internalsvisibleto-compilertest-sign2048.exe: internalsvisibleto-compilertest.cs internalsvisibleto-library.cs internalsvisibleto-2048.snk
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-2-sign2048.dll -target:library -d:CORRECT_CASE -d:SIGN2048 internalsvisibleto-library.cs      
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-2-sign2048.dll -target:library -d:WRONG_CASE -d:SIGN2048 internalsvisibleto-library.cs
+       $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-compilertest-sign2048.exe -warn:0 -r:internalsvisibleto-correctcase-2-sign2048.dll -r:internalsvisibleto-wrongcase-2-sign2048.dll -d:SIGN2048 internalsvisibleto-compilertest.cs
+
 
 CLEANFILES = $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH) $(TESTS_STRESS) $(TESTSAOT_CS) $(TESTSAOT_IL) $(TESTSAOT_BENCH) $(TESTSAOT_STRESS) *.dll *.stdout *.aotlog *.exe stest.dat
index aecae40401d0b921845a313fde973fe7d126c7cc..4a5bd8fbc6fddfd4f0ac16635bca10ae077060ee 100644 (file)
@@ -251,6 +251,9 @@ public class Tests
        [DllImport ("libtest")]
        public static extern int mono_test_marshal_ccw_itest ([MarshalAs (UnmanagedType.Interface)]ITestPresSig itest);
 
+       [DllImport ("libtest")]
+       public static extern int mono_test_marshal_array_ccw_itest (int count, [MarshalAs (UnmanagedType.LPArray, SizeParamIndex=0)] ITest[] ppUnk);
+
        [DllImport("libtest")]
        public static extern int mono_test_marshal_safearray_out_1dim_vt_bstr_empty ([MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)]out Array array);
 
@@ -564,6 +567,11 @@ public class Tests
 
                        mono_test_marshal_ccw_itest (test_pres_sig);
 
+                       // test for Xamarin-47560
+                       var tests = new[] { test.Test };
+                       if (mono_test_marshal_array_ccw_itest (1, tests) != 0)
+                               return 201;
+
                        #endregion // COM Callable Wrapper Tests
 
                        #region SAFEARRAY tests
diff --git a/mono/tests/internalsvisibleto-2048.snk b/mono/tests/internalsvisibleto-2048.snk
new file mode 100644 (file)
index 0000000..37a8f26
Binary files /dev/null and b/mono/tests/internalsvisibleto-2048.snk differ
index c38fb0d918551bc26994763d7022e60c55639264..196627e73e9792764c91750697685a549261a9b3 100755 (executable)
@@ -1,5 +1,11 @@
 using System;
 
+#if SIGN2048
+using System.Reflection;
+[assembly: AssemblyDelaySign(true)]
+[assembly: AssemblyKeyFile(@"internalsvisibleto-2048.snk")]
+#endif
+
 namespace InternalsVisibleTo {
     class Program {
         static void Main (string[] args) {
@@ -7,6 +13,15 @@ namespace InternalsVisibleTo {
 
             Console.WriteLine("-- Correct case --");
 
+           try {
+                   var a = new CorrectCaseFriendAssembly.PublicClass ();
+                   a.InternalMethod ();
+                   Console.WriteLine ("Access friend internal method: OK");
+           } catch (MemberAccessException) {
+                   failCount += 1;
+                   Console.WriteLine ("Access friend internal method: Fail");
+           }
+
             try {
                 var a = new CorrectCaseFriendAssembly.InternalClass(@internal: 0);
                 Console.WriteLine("Access internal class internal ctor: OK");
index a27547a9fab6407e9acb629cb08a5fa49e065dd7..f08d859305bca2fc879e8b6f47c2d06ce2084bad 100644 (file)
@@ -1,13 +1,29 @@
 using System;
 using System.Runtime.CompilerServices;
 
+#if SIGN2048
+using System.Reflection;
+[assembly: AssemblyDelaySign(true)]
+[assembly: AssemblyKeyFile(@"internalsvisibleto-2048.snk")]
+#endif
+
 #if CORRECT_CASE
+#if !SIGN2048
 [assembly: InternalsVisibleTo("internalsvisibleto-runtimetest")]
 [assembly: InternalsVisibleTo("internalsvisibleto-compilertest")]
 #else
+[assembly: InternalsVisibleTo("internalsvisibleto-runtimetest-sign2048, PublicKey=00240000048000001401000006020000002400005253413100080000010001002b524ed36058e444d0f2b12aeeeadab6f9a614dae43300d489746d143103a63c0178d0e316cc7a83156637d02b95b617c34bfa6877bc418118ce6d652e73211fdb80e5bc1878c6ef1b488dae12925390e7932dae9b22ada65ec76694a73b8e940db558d03ff5a3bee28017cb4448cd41dc946cc248e3313417f59092b9b62996de506c9446c7dceffed8e854cfa3d42eee30cdccbce934318b64ee20489178c00fa587f4ea666e4421eeae157fddf5ce7cfcf76e3b8b390005297f1b7e502c0f211c8c3f6886012cc4173aeedb4dc915d6d8f3821c19c0f1eedcccec8e839c1443ac96db7231ddebb391a5a92373aa87a6f2b2c8a9d57ad204e61813cc280da3")]
+[assembly: InternalsVisibleTo("internalsvisibleto-compilertest-sign2048, PublicKey=00240000048000001401000006020000002400005253413100080000010001002b524ed36058e444d0f2b12aeeeadab6f9a614dae43300d489746d143103a63c0178d0e316cc7a83156637d02b95b617c34bfa6877bc418118ce6d652e73211fdb80e5bc1878c6ef1b488dae12925390e7932dae9b22ada65ec76694a73b8e940db558d03ff5a3bee28017cb4448cd41dc946cc248e3313417f59092b9b62996de506c9446c7dceffed8e854cfa3d42eee30cdccbce934318b64ee20489178c00fa587f4ea666e4421eeae157fddf5ce7cfcf76e3b8b390005297f1b7e502c0f211c8c3f6886012cc4173aeedb4dc915d6d8f3821c19c0f1eedcccec8e839c1443ac96db7231ddebb391a5a92373aa87a6f2b2c8a9d57ad204e61813cc280da3")]
+#endif // SIGN2048
+#else
+#if !SIGN2048
 [assembly: InternalsVisibleTo("iNtErnAlsVisibLETo-RUntimeTesT")]
 [assembly: InternalsVisibleTo("iNtErnAlsVisibLETo-COmpilerTesT")]
-#endif
+#else
+[assembly: InternalsVisibleTo("iNtErnAlsVisibLETo-RUntimeTesT-sign2048, PublicKey=00240000048000001401000006020000002400005253413100080000010001002b524ed36058e444d0f2b12aeeeadab6f9a614dae43300d489746d143103a63c0178d0e316cc7a83156637d02b95b617c34bfa6877bc418118ce6d652e73211fdb80e5bc1878c6ef1b488dae12925390e7932dae9b22ada65ec76694a73b8e940db558d03ff5a3bee28017cb4448cd41dc946cc248e3313417f59092b9b62996de506c9446c7dceffed8e854cfa3d42eee30cdccbce934318b64ee20489178c00fa587f4ea666e4421eeae157fddf5ce7cfcf76e3b8b390005297f1b7e502c0f211c8c3f6886012cc4173aeedb4dc915d6d8f3821c19c0f1eedcccec8e839c1443ac96db7231ddebb391a5a92373aa87a6f2b2c8a9d57ad204e61813cc280da3")]
+[assembly: InternalsVisibleTo("iNtErnAlsVisibLETo-COmpilerTesT-sign2048, PublicKey=00240000048000001401000006020000002400005253413100080000010001002b524ed36058e444d0f2b12aeeeadab6f9a614dae43300d489746d143103a63c0178d0e316cc7a83156637d02b95b617c34bfa6877bc418118ce6d652e73211fdb80e5bc1878c6ef1b488dae12925390e7932dae9b22ada65ec76694a73b8e940db558d03ff5a3bee28017cb4448cd41dc946cc248e3313417f59092b9b62996de506c9446c7dceffed8e854cfa3d42eee30cdccbce934318b64ee20489178c00fa587f4ea666e4421eeae157fddf5ce7cfcf76e3b8b390005297f1b7e502c0f211c8c3f6886012cc4173aeedb4dc915d6d8f3821c19c0f1eedcccec8e839c1443ac96db7231ddebb391a5a92373aa87a6f2b2c8a9d57ad204e61813cc280da3")]
+#endif // SIGN2048
+#endif // !CORRECT_CASE
 
 #if CORRECT_CASE
 namespace CorrectCaseFriendAssembly {
index ec8805574afc144ba7aefbe1d77ae2a7957f32ca..9bf5e70ddc4daa6e6e603b896e9711ef4af72fcd 100755 (executable)
@@ -1,5 +1,11 @@
 using System;
 
+#if SIGN2048
+using System.Reflection;
+[assembly: AssemblyDelaySign(true)]
+[assembly: AssemblyKeyFile(@"internalsvisibleto-2048.snk")]
+#endif
+
 namespace InternalsVisibleTo {
     class Program {
         static void Main (string[] args) {
@@ -7,6 +13,15 @@ namespace InternalsVisibleTo {
 
             Console.WriteLine("-- Correct case --");
 
+           try {
+                   var a = new CorrectCaseFriendAssembly.PublicClass ();
+                   a.InternalMethod ();
+                   Console.WriteLine ("Access friend internal method: OK");
+           } catch (MemberAccessException) {
+                   failCount += 1;
+                   Console.WriteLine ("Access friend internal method: Fail");
+           }
+
             try {
                 var a = new CorrectCaseFriendAssembly.InternalClass(@private: false);
                 Console.WriteLine("Access internal class private ctor: OK");
index b94b29d52fd8eae95c11e0877adcc1269a91093d..9950476e4cac4a62f22e18559a11652cc0b2a8d4 100644 (file)
@@ -3581,6 +3581,28 @@ mono_test_marshal_ccw_itest (MonoComObject *pUnk)
        return 0;
 }
 
+// Xamarin-47560
+LIBTEST_API int STDCALL
+mono_test_marshal_array_ccw_itest (int count, MonoComObject ** ppUnk)
+{
+       int hr = 0;
+
+       if (!ppUnk)
+               return 1;
+
+       if (count < 1)
+               return 2;
+
+       if (!ppUnk[0])
+               return 3;
+
+       hr = ppUnk[0]->vtbl->SByteIn (ppUnk[0], -100);
+       if (hr != 0)
+               return 4;
+
+       return 0;
+}
+
 /*
  * mono_method_get_unmanaged_thunk tests
  */
index e16931a28881757afdbc91db5950eb92841fda37..b277688859176ae54ff3a4d3c5b16ff574eccbb5 100644 (file)
@@ -175,7 +175,8 @@ monoutils_sources = \
        checked-build.h \
        os-event.h \
        refcount.h      \
-       w32api.h
+       w32api.h        \
+       unlocked.h
 
 arch_sources = 
 
index 57fa81aebafb142b19689541f166e661f6d53d59..746c84fb5131455564551cf4186402cbf41820f0 100644 (file)
@@ -113,5 +113,22 @@ typedef SSIZE_T ssize_t;
 #define MONO_GNUC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
 #endif
 
+#if defined(__has_feature)
+#if __has_feature(thread_sanitizer)
+#define MONO_HAS_CLANG_THREAD_SANITIZER 1
+#else
+#define MONO_HAS_CLANG_THREAD_SANITIZER 0
+#endif
+#else
+#define MONO_HAS_CLANG_THREAD_SANITIZER 0
+#endif
+
+/* Used to tell Clang's ThreadSanitizer to not report data races that occur within a certain function */
+#if MONO_HAS_CLANG_THREAD_SANITIZER
+#define MONO_NO_SANITIZE_THREAD __attribute__ ((no_sanitize("thread")))
+#else
+#define MONO_NO_SANITIZE_THREAD
+#endif
+
 #endif /* __UTILS_MONO_COMPILER_H__*/
 
index 0933903e747c4d88e8a0cd380a81703a3f16a47d..e28b3f361035b0c13167140acc67cad724d3da60 100644 (file)
@@ -36,8 +36,8 @@ typedef enum {
                                          MONO_TRACE_W32HANDLE
 } MonoTraceMask;
 
-extern GLogLevelFlags mono_internal_current_level;
-extern MonoTraceMask mono_internal_current_mask;
+MONO_API extern GLogLevelFlags mono_internal_current_level;
+MONO_API extern MonoTraceMask mono_internal_current_mask;
 
 void 
 mono_trace_init (void);
@@ -45,7 +45,7 @@ mono_trace_init (void);
 void 
 mono_trace_cleanup (void);
 
-void 
+MONO_API void
 mono_tracev_inner (GLogLevelFlags level, MonoTraceMask mask, const char *format, va_list args);
 
 void 
@@ -139,6 +139,8 @@ mono_trace_message(MonoTraceMask mask, const char *format, ...)
 #define mono_gc_printf(gc_log_file, format, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, format, ##__VA_ARGS__)
 #define mono_runtime_printf(format, ...) g_log ("mono-rt", G_LOG_LEVEL_MESSAGE, format "\n", ##__VA_ARGS__)
 #define mono_runtime_printf_err(format, ...) g_log ("mono-rt", G_LOG_LEVEL_CRITICAL, format "\n", ##__VA_ARGS__)
+#define mono_profiler_printf(format, ...) g_log ("mono-prof", G_LOG_LEVEL_MESSAGE, format "\n", ##__VA_ARGS__)
+#define mono_profiler_printf_err(format, ...) g_log ("mono-prof", G_LOG_LEVEL_CRITICAL, format "\n", ##__VA_ARGS__)
 #define mono_runtime_stdout_fflush() do { } while (0)
 
 #else
@@ -150,6 +152,8 @@ mono_trace_message(MonoTraceMask mask, const char *format, ...)
 
 #define mono_runtime_printf(format, ...) fprintf (stdout, format "\n", ##__VA_ARGS__)
 #define mono_runtime_printf_err(format, ...) fprintf (stderr, format "\n", ##__VA_ARGS__)
+#define mono_profiler_printf(format, ...) fprintf (stdout, format "\n", ##__VA_ARGS__)
+#define mono_profiler_printf_err(format, ...) fprintf (stderr, format "\n", ##__VA_ARGS__)
 #define mono_runtime_stdout_fflush() do { fflush (stdout); } while (0)
 
 #endif
index b372b5031137949c5d89b7899d381db30d8e7ae9..356a1ab7e0b2916e2d97507d2a93bcfbc41892bd 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <glib.h>
 #include <mono/utils/mono-compiler.h>
+#include <mono/utils/mono-publib.h>
 
 /* never remove or reorder these enums values: they are used in corlib/System */
 
@@ -71,7 +72,7 @@ gint64    mono_process_get_data_with_error (gpointer pid, MonoProcessData data,
 
 int       mono_process_current_pid (void);
 
-int       mono_cpu_count    (void);
+MONO_API int       mono_cpu_count    (void);
 gint64    mono_cpu_get_data (int cpu_id, MonoCpuData data, MonoProcessError *error);
 gint32    mono_cpu_usage (MonoCpuUsageState *prev);
 
index f4980b6b6c5d0a3ffd262eb6e2ff2b0a41605a37..d757cd66c318ec6e87a072d2597e2606909d8c3c 100644 (file)
@@ -13,13 +13,27 @@ void
 mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize)
 {
        pthread_attr_t attr;
+       gint res;
 
        *staddr = NULL;
        *stsize = (size_t)-1;
 
-       pthread_getattr_np (pthread_self (), &attr);
-       pthread_attr_getstack (&attr, (void**)staddr, stsize);
-       pthread_attr_destroy (&attr);
+       res = pthread_attr_init (&attr);
+       if (G_UNLIKELY (res != 0))
+               g_error ("%s: pthread_attr_init failed with \"%s\" (%d)", __func__, g_strerror (res), res);
+
+       res = pthread_getattr_np (pthread_self (), &attr);
+       if (G_UNLIKELY (res != 0))
+               g_error ("%s: pthread_getattr_np failed with \"%s\" (%d)", __func__, g_strerror (res), res);
+
+       res = pthread_attr_getstack (&attr, (void**)staddr, stsize);
+       if (G_UNLIKELY (res != 0))
+               g_error ("%s: pthread_attr_getstack failed with \"%s\" (%d)", __func__, g_strerror (res), res);
+
+       res = pthread_attr_destroy (&attr);
+       if (G_UNLIKELY (res != 0))
+               g_error ("%s: pthread_attr_destroy failed with \"%s\" (%d)", __func__, g_strerror (res), res);
+
 }
 
 #endif
index 79cc366d78f780dd9b01d9b9286e46616ac70c0b..138cc9e4b6aebd411ea1e0f75b88ce42b1cb5176 100644 (file)
@@ -206,7 +206,7 @@ mono_native_thread_set_name (MonoNativeThreadId tid, const char *name)
        } else {
                char n [63];
 
-               memcpy (n, name, sizeof (n) - 1);
+               strncpy (n, name, sizeof (n) - 1);
                n [sizeof (n) - 1] = '\0';
                pthread_setname_np (n);
        }
@@ -216,7 +216,7 @@ mono_native_thread_set_name (MonoNativeThreadId tid, const char *name)
        } else {
                char n [PTHREAD_MAX_NAMELEN_NP];
 
-               memcpy (n, name, sizeof (n) - 1);
+               strncpy (n, name, sizeof (n) - 1);
                n [sizeof (n) - 1] = '\0';
                pthread_setname_np (tid, "%s", (void*)n);
        }
@@ -226,7 +226,7 @@ mono_native_thread_set_name (MonoNativeThreadId tid, const char *name)
        } else {
                char n [16];
 
-               memcpy (n, name, sizeof (n) - 1);
+               strncpy (n, name, sizeof (n) - 1);
                n [sizeof (n) - 1] = '\0';
                pthread_setname_np (tid, n);
        }
diff --git a/mono/utils/unlocked.h b/mono/utils/unlocked.h
new file mode 100644 (file)
index 0000000..5b812ac
--- /dev/null
@@ -0,0 +1,42 @@
+/**
+ * \file
+ * Contains inline functions to explicitly mark data races that should not be changed.
+ * This way, instruments like Clang's ThreadSanitizer can be told to ignore very specific instructions.
+ *
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+#ifndef _UNLOCKED_H_
+#define _UNLOCKED_H_
+
+#include <glib.h>
+#include <mono/utils/mono-compiler.h>
+
+#if MONO_HAS_CLANG_THREAD_SANITIZER
+#define MONO_UNLOCKED_ATTRS MONO_NO_SANITIZE_THREAD MONO_NEVER_INLINE static
+#else
+#define MONO_UNLOCKED_ATTRS MONO_ALWAYS_INLINE static inline
+#endif
+
+MONO_UNLOCKED_ATTRS
+gint32
+UnlockedIncrement (gint32 *val)
+{
+       return ++*val;
+}
+
+MONO_UNLOCKED_ATTRS
+gint64
+UnlockedIncrement64 (gint64 *val)
+{
+       return ++*val;
+}
+
+MONO_UNLOCKED_ATTRS
+gsize
+UnlockedIncrementSize (gsize *val)
+{
+       return ++*val;
+}
+
+#endif /* _UNLOCKED_H_ */
index 0b72e5a97e9ce284184fa937d41e7bd8b9ef9182..fa56697667214d900e7cb4ebbd6df749a82bef7d 100644 (file)
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\garray.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gbytearray.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gerror.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gfile.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\ghashtable.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\giconv.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\glist.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gmarkup.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gmem.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\goutput.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gpattern.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gptrarray.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gqsort.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gqueue.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gshell.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gslist.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gspawn.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gstr.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gstring.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gunicode.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gutf8.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\garray.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gbytearray.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gerror.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gfile.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\ghashtable.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\giconv.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\glist.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gmarkup.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gmem.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\goutput.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gpattern.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gptrarray.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gqsort.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gqueue.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gshell.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gslist.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gspawn.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gstr.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gstring.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gunicode.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gutf8.c" />
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="$(MonoSourceLocation)\eglib\src\glib.h" />
-    <ClInclude Include="$(MonoSourceLocation)\eglib\src\gmodule.h" />
-    <ClInclude Include="$(MonoSourceLocation)\eglib\src\sort.frag.h" />
+    <ClInclude Include="$(MonoSourceLocation)\mono\eglib\glib.h" />
+    <ClInclude Include="$(MonoSourceLocation)\mono\eglib\gmodule.h" />
+    <ClInclude Include="$(MonoSourceLocation)\mono\eglib\sort.frag.h" />
   </ItemGroup>
 </Project>
index 92996f7e592092264afd5428f7a601823d5ac7ba..dcd4a5942fbed87ea4bc5076f660e25e340737f0 100644 (file)
@@ -1,78 +1,78 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\garray.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\garray.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gbytearray.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gbytearray.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gfile.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gfile.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gerror.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gerror.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\ghashtable.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\ghashtable.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\giconv.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\giconv.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\glist.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\glist.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gmarkup.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gmarkup.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gmem.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gmem.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\goutput.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\goutput.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gpattern.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gpattern.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gptrarray.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gptrarray.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gqsort.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gqsort.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gqueue.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gqueue.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gshell.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gshell.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gslist.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gslist.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gspawn.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gspawn.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gstr.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gstr.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gstring.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gstring.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gunicode.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gunicode.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gutf8.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gutf8.c">
       <Filter>Source Files\Common</Filter>
     </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="$(MonoSourceLocation)\eglib\src\glib.h">
+    <ClInclude Include="$(MonoSourceLocation)\mono\eglib\glib.h">
       <Filter>Header Files\Common</Filter>
     </ClInclude>
-    <ClInclude Include="$(MonoSourceLocation)\eglib\src\gmodule.h">
+    <ClInclude Include="$(MonoSourceLocation)\mono\eglib\gmodule.h">
       <Filter>Header Files\Common</Filter>
     </ClInclude>
-    <ClInclude Include="$(MonoSourceLocation)\eglib\src\sort.frag.h">
+    <ClInclude Include="$(MonoSourceLocation)\mono\eglib\sort.frag.h">
       <Filter>Header Files\Common</Filter>
     </ClInclude>
   </ItemGroup>
index ab3165e3e8cbb7429214f4dc4be2db61ec9fdeb5..8e5d3fa59253b34b07a3e4f1831477f1c5ed5058 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gfile-posix.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gfile-posix.c" />
   </ItemGroup>
 </Project>
index a714ed878129d63a4b6add33d1b753242917f8d8..76265435b1491750d6476ceb9042ffa96e218527 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gfile-posix.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gfile-posix.c">
       <Filter>Source Files\Posix</Filter>
     </ClCompile>
   </ItemGroup>
index b95abe37f8c6308a3d5ad49d36c5d4034032bdfa..572c50626f944b0c1300bd7e5da748466f0bcade 100644 (file)
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gdate-win32.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gdir-win32.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gfile-win32.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gmisc-win32.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gmodule-win32.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gpath.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gtimer-win32.c" />
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gunicode-win32.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gdate-win32.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gdir-win32.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gfile-win32.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gmisc-win32.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gmodule-win32.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gpath.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gtimer-win32.c" />
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gunicode-win32.c" />
    </ItemGroup>
    <ItemGroup>
-    <ClInclude Include="$(MonoSourceLocation)\eglib\src\gmodule-win32-internals.h" />
+    <ClInclude Include="$(MonoSourceLocation)\mono\eglib\gmodule-win32-internals.h" />
   </ItemGroup>
 </Project>
index 69939794efa473e0afa375d6de5c0f46f8ffac54..a1ed81ba268983510fd9ac15eb2fdc39194e4d8d 100644 (file)
@@ -1,33 +1,33 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gdate-win32.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gdate-win32.c">
       <Filter>Source Files\Win32</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gdir-win32.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gdir-win32.c">
       <Filter>Source Files\Win32</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gfile-win32.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gfile-win32.c">
       <Filter>Source Files\Win32</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gmisc-win32.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gmisc-win32.c">
       <Filter>Source Files\Win32</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gmodule-win32.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gmodule-win32.c">
       <Filter>Source Files\Win32</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gpath.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gpath.c">
       <Filter>Source Files\Win32</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gtimer-win32.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gtimer-win32.c">
       <Filter>Source Files\Win32</Filter>
     </ClCompile>
-    <ClCompile Include="$(MonoSourceLocation)\eglib\src\gunicode-win32.c">
+    <ClCompile Include="$(MonoSourceLocation)\mono\eglib\gunicode-win32.c">
       <Filter>Source Files\Win32</Filter>
     </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="$(MonoSourceLocation)\eglib\src\gmodule-win32-internals.h">
+    <ClInclude Include="$(MonoSourceLocation)\mono\eglib\gmodule-win32-internals.h">
       <Filter>Header Files\Win32</Filter>
     </ClInclude>
   </ItemGroup>
index 5e482d86b453ce5568d8cb1a00e6d7f0aa334819..e4f706775c39d1c433398a4614696231f22fbb15 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>\r
+<?xml version="1.0" encoding="utf-8"?>\r
 <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|Win32">\r
@@ -83,7 +83,7 @@
     </PreBuildEvent>\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_EGLIB_SOURCE_DIR);$(MONO_EGLIB_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_EGLIB_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
       <PrecompiledHeader>\r
     </PreBuildEvent>\r
     <ClCompile>\r
       <Optimization>MinSpace</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_EGLIB_SOURCE_DIR);$(MONO_EGLIB_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_EGLIB_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PrecompiledHeader>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_EGLIB_SOURCE_DIR);$(MONO_EGLIB_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_EGLIB_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
       <PrecompiledHeader>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>MinSpace</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_EGLIB_SOURCE_DIR);$(MONO_EGLIB_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_EGLIB_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PrecompiledHeader>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
index 70dc4b0554c6eb8d780d1a2c8dcd7feb348ab91a..b23daec250520a61e23c30e04a16991f9cb7426b 100644 (file)
     <ClCompile Include="..\mono\mini\type-checking.c" />\r
     <ClCompile Include="..\mono\mini\lldb.c" />\r
     <ClCompile Include="..\mono\mini\interp\interp-stubs.c" />\r
+    <ClCompile Include="..\mono\mini\mini-profiler.c" />\r
   </ItemGroup>\r
   <PropertyGroup Label="Globals">\r
     <ProjectGuid>{CB0D9E92-293C-439C-9AC7-C5F59B6E0772}</ProjectGuid>\r
index 029b9d162c15144f2740162e2726bb56fb2572ac..672e6052f41a69606d0d2f407964fa33ee1a5dd1 100644 (file)
     <ClCompile Include="..\mono\mini\interp\interp-stubs.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\mono\mini\mini-profiler.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\mono\mini\abcremoval.h">\r
index 904bb51f570fc0b934a3977016f1380de8f2fd7b..d2e5ad512cd78a353af0e1e05eb4308b9bd287b6 100644 (file)
     <ClInclude Include="..\mono\metadata\object-internals.h" />\r
     <ClInclude Include="..\mono\metadata\object.h" />\r
     <ClInclude Include="..\mono\metadata\opcodes.h" />\r
+    <ClInclude Include="..\mono\metadata\profiler-events.h" />\r
     <ClInclude Include="..\mono\metadata\profiler-private.h" />\r
     <ClInclude Include="..\mono\metadata\profiler.h" />\r
     <ClInclude Include="..\mono\metadata\rand.h" />\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index 6c8dcdfb4fe6c64f05c3335567d566570843348a..554e61985bdb1745ac9df6d44d0c7d1423bdd6f3 100644 (file)
     <ClInclude Include="..\mono\metadata\w32process-win32-internals.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\mono\metadata\profiler.h">\r
+    <ClInclude Include="..\mono\metadata\profiler-events.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
     <ClInclude Include="..\mono\metadata\profiler-private.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\profiler.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
     <ClInclude Include="..\mono\metadata\rand.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
       <Filter>Resource Files</Filter>\r
     </None>\r
   </ItemGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index 29903290d3381140bf7742288fbc2128591c5f4a..350a54654e475e39aa163f1c125cbaff0c19b47b 100644 (file)
     <ClInclude Include="..\mono\utils\strenc.h" />\r
     <ClInclude Include="..\mono\utils\valgrind.h" />\r
     <ClInclude Include="..\mono\utils\atomic.h" />\r
+    <ClInclude Include="..\mono\utils\unlocked.h" />
     <ClInclude Include="..\mono\utils\mono-hwcap.h" />\r
     <ClInclude Include="..\mono\utils\mono-hwcap-x86.h" />\r
     <ClInclude Include="..\mono\utils\bsearch.h" />\r
index 30b819626b6fc91f3f5f3cea2ffabec06f416384..30badee3648d03e88c2a0eec33f164a87902f672 100644 (file)
     <ClInclude Include="..\mono\utils\os-event.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\mono\utils\unlocked.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="Header Files">\r
index 5c3c2b7a83c7f0884b40f003008aa0c206006449..b5e2a1f479362ffd292f2946dda3cfb990a9f71e 100644 (file)
@@ -7,7 +7,7 @@
     <MONO_CFG_DIR>$(MONO_DIR)/runtime/etc</MONO_CFG_DIR>
     <MONO_NUNIT_RUN_TARGET>net_4_x_System_test.dll</MONO_NUNIT_RUN_TARGET>
     <MONO_NUNIT_FIXTURE></MONO_NUNIT_FIXTURE>
-    <MONO_NUNIT_ARGS>-noshadow -exclude=NotWorking,ValueAdd,CAS,InetAccess /labels</MONO_NUNIT_ARGS>
+    <MONO_NUNIT_ARGS>-noshadow -exclude=NotWorking,CAS /labels</MONO_NUNIT_ARGS>
     <MONO_NUNIT_ARGS Condition="'$(MONO_NUNIT_FIXTURE)'!=''">$(MONO_NUNIT_ARGS) -fixture $(MONO_NUNIT_FIXTURE)</MONO_NUNIT_ARGS>
     <MONO_NUNIT_RUN_ADDITIONAL_ARGS>
     </MONO_NUNIT_RUN_ADDITIONAL_ARGS>
@@ -43,4 +43,4 @@
     </BuildMacro>
   </ItemGroup>
   <ItemDefinitionGroup />
-</Project>
\ No newline at end of file
+</Project>
index 1da827afb1d724bbf84c5cbe0e6a1271f50b61d2..5463b53b3f8def9e80b47a5664b45c045bcf7695 100644 (file)
@@ -1,4 +1,4 @@
 ; file generated by create-windef.pl
 LIBRARY mono-profiler-vtune.dll
 EXPORTS
-mono_profiler_startup
\ No newline at end of file
+mono_profiler_init_vtune
index c7ca647cfabfbc9b544eacc59b0ab201bc82b832..a07e7c74fd51577db19b4be0b0507adea8849c48 100644 (file)
@@ -2,7 +2,6 @@
 EXPORTS
 MonoFixupCorEE
 mono_add_internal_call
-mono_aot_get_method
 mono_aot_register_module
 mono_array_addr_with_size
 mono_array_class_get
@@ -187,6 +186,7 @@ mono_counters_on_register
 mono_counters_register
 mono_counters_register_with_size
 mono_counters_sample
+mono_cpu_count
 mono_custom_attrs_construct
 mono_custom_attrs_free
 mono_custom_attrs_from_assembly
@@ -413,7 +413,6 @@ mono_get_int16_class
 mono_get_int32_class
 mono_get_int64_class
 mono_get_intptr_class
-mono_get_jit_info_from_method
 mono_get_machine_config
 mono_get_method
 mono_get_method_constrained
@@ -703,11 +702,21 @@ mono_print_method_from_ip
 mono_print_thread_dump
 mono_print_thread_dump_from_ctx
 mono_print_unhandled_exception
+mono_profiler_call_context_free_buffer
+mono_profiler_call_context_get_argument
+mono_profiler_call_context_get_local
+mono_profiler_call_context_get_result
+mono_profiler_call_context_get_this
+mono_profiler_create
 mono_profiler_enable_allocations
+mono_profiler_enable_call_context_introspection
 mono_profiler_enable_sampling
 mono_profiler_get_coverage_data
 mono_profiler_get_sample_mode
 mono_profiler_install
+mono_profiler_install_gc
+mono_profiler_install_jit_end
+mono_profiler_install_thread
 mono_profiler_load
 mono_profiler_set_assembly_loaded_callback
 mono_profiler_set_assembly_loading_callback
@@ -725,6 +734,7 @@ mono_profiler_set_domain_loading_callback
 mono_profiler_set_domain_name_callback
 mono_profiler_set_domain_unloaded_callback
 mono_profiler_set_domain_unloading_callback
+mono_profiler_set_events
 mono_profiler_set_exception_clause_callback
 mono_profiler_set_exception_throw_callback
 mono_profiler_set_gc_allocation_callback
@@ -928,6 +938,7 @@ mono_trace_set_log_handler
 mono_trace_set_mask_string
 mono_trace_set_print_handler
 mono_trace_set_printerr_handler
+mono_tracev_inner
 mono_type_create_from_typespec
 mono_type_full_name
 mono_type_generic_inst_is_valuetype
index 4ef38268b18d2fc5bf3e3750c79722c0fcbcaf17..5b77ed2c27501c4567552db9489985e20a5a6ec7 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup Label="UserMacros">
     <!-- Change this to custom build tree location to enable out of source tree builds, example c:/mono-build/ -->
@@ -21,8 +21,8 @@
     <top_srcdir>$(MSBuildProjectDirectory)/$(MonoSourceLocation)</top_srcdir>
     <MONO_DIR>$(top_srcdir)</MONO_DIR>
     <MONO_INCLUDE_DIR>$(MONO_DIR)/mono</MONO_INCLUDE_DIR>
-    <MONO_EGLIB_INCLUDE_DIR>$(MONO_DIR)/eglib;$(MONO_DIR)/eglib/include;$(MONO_DIR)/eglib/test</MONO_EGLIB_INCLUDE_DIR>
-    <MONO_EGLIB_SOURCE_DIR>$(MONO_DIR)/eglib/src</MONO_EGLIB_SOURCE_DIR>
+    <MONO_EGLIB_INCLUDE_DIR>$(MONO_DIR)/mono/eglib</MONO_EGLIB_INCLUDE_DIR>
+    <MONO_EGLIB_SOURCE_DIR>$(MONO_DIR)/mono/eglib</MONO_EGLIB_SOURCE_DIR>
     <MONO_LIBGC_INCLUDE_DIR>$(MONO_DIR)/libgc/include</MONO_LIBGC_INCLUDE_DIR>
     <MONO_LIBGC_SOURCE_DIR>$(MONO_DIR)/libgc/src</MONO_LIBGC_SOURCE_DIR>
     <MONO_JIT_INCLUDE_DIR>$(MONO_INCLUDE_DIR)/jit</MONO_JIT_INCLUDE_DIR>
index 829e68352358f0cd263326c09972fa11a856577f..5e6485787c7518f6c7c6dffeca576d0927bb5f6a 100644 (file)
@@ -2,7 +2,6 @@
 EXPORTS
 MonoFixupCorEE
 mono_add_internal_call
-mono_aot_get_method
 mono_aot_register_module
 mono_array_addr_with_size
 mono_array_class_get
@@ -187,6 +186,7 @@ mono_counters_on_register
 mono_counters_register
 mono_counters_register_with_size
 mono_counters_sample
+mono_cpu_count
 mono_custom_attrs_construct
 mono_custom_attrs_free
 mono_custom_attrs_from_assembly
@@ -415,7 +415,6 @@ mono_get_int16_class
 mono_get_int32_class
 mono_get_int64_class
 mono_get_intptr_class
-mono_get_jit_info_from_method
 mono_get_machine_config
 mono_get_method
 mono_get_method_constrained
@@ -705,11 +704,21 @@ mono_print_method_from_ip
 mono_print_thread_dump
 mono_print_thread_dump_from_ctx
 mono_print_unhandled_exception
+mono_profiler_call_context_free_buffer
+mono_profiler_call_context_get_argument
+mono_profiler_call_context_get_local
+mono_profiler_call_context_get_result
+mono_profiler_call_context_get_this
+mono_profiler_create
 mono_profiler_enable_allocations
+mono_profiler_enable_call_context_introspection
 mono_profiler_enable_sampling
 mono_profiler_get_coverage_data
 mono_profiler_get_sample_mode
 mono_profiler_install
+mono_profiler_install_gc
+mono_profiler_install_jit_end
+mono_profiler_install_thread
 mono_profiler_load
 mono_profiler_set_assembly_loaded_callback
 mono_profiler_set_assembly_loading_callback
@@ -727,6 +736,7 @@ mono_profiler_set_domain_loading_callback
 mono_profiler_set_domain_name_callback
 mono_profiler_set_domain_unloaded_callback
 mono_profiler_set_domain_unloading_callback
+mono_profiler_set_events
 mono_profiler_set_exception_clause_callback
 mono_profiler_set_exception_throw_callback
 mono_profiler_set_gc_allocation_callback
@@ -930,6 +940,7 @@ mono_trace_set_log_handler
 mono_trace_set_mask_string
 mono_trace_set_print_handler
 mono_trace_set_printerr_handler
+mono_tracev_inner
 mono_type_create_from_typespec
 mono_type_full_name
 mono_type_generic_inst_is_valuetype
index 544a89d32a2bb0a27ec120f80b791caf98a5bd9f..73ace6bdc745252f4ad5e7e95453ee1d26a31d55 100644 (file)
     </ProjectReference>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
-    <ClCompile Include="..\mono\profiler\mono-profiler-vtune.c" />\r
+    <ClCompile Include="..\mono\profiler\vtune.c" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <None Include="mono-profiler-vtune.def" />\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index 7b3e25ba85bcc1c8574fb96ea692c8501c16bfb5..bb72a170bb2a160fea17d0d65f86363cf5612f91 100644 (file)
@@ -12,7 +12,7 @@
     </Filter>\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <ClCompile Include="..\mono\profiler\mono-profiler-vtune.c">\r
+    <ClCompile Include="..\mono\profiler\vtune.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
   </ItemGroup>\r
@@ -21,4 +21,4 @@
       <Filter>Resource Files</Filter>\r
     </None>\r
   </ItemGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index 1b2e850e5e3330287beaf5c14cbcf1efaf54ff79..b43ad7901c12614d27dcc78e061ff40e49b41dd2 100644 (file)
@@ -25,8 +25,8 @@
     <AssemblyName>@ASSEMBLYNAME@</AssemblyName>\r
     <TargetFrameworkVersion>v@FX_VERSION</TargetFrameworkVersion>\r
     <FileAlignment>512</FileAlignment>\r
+@SIGNATURE@\r
   </PropertyGroup>\r
-  @SIGNATURE@\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
index 378d1c00db7210c098bc3bd9b84f275633f77e4b..c60bc5397ce28ad027f8856df3061ebfad69d4f6 100644 (file)
@@ -915,13 +915,10 @@ class MsbuildGenerator {
                string strongNameSection = "";
                if (StrongNameKeyFile != null){
                        strongNameSection = String.Format (
-                               "  <PropertyGroup>" + NewLine +
                                "    <SignAssembly>true</SignAssembly>" + NewLine +
                                "{1}" +
-                               "  </PropertyGroup>" + NewLine +
-                               "  <PropertyGroup>" + NewLine +
-                               "    <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>" + NewLine +
-                               "  </PropertyGroup>", StrongNameKeyFile, StrongNameDelaySign ? "    <DelaySign>true</DelaySign>" + NewLine : "");
+                               "    <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>",
+                               StrongNameKeyFile, StrongNameDelaySign ? "    <DelaySign>true</DelaySign>" + NewLine : "");
                }
                Csproj.output = template.
                        Replace ("@OUTPUTTYPE@", Target == Target.Library ? "Library" : "Exe").
index d5e0fc41cd5343e8d3118ed336f30fe1f7b7e2ba..826b9b62633eb7d630f1af39741e32e3714afd49 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>\r
+<?xml version="1.0" encoding="utf-8"?>\r
 <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|Win32">\r
@@ -85,7 +85,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_EGLIB_INCLUDE_DIR);$(MONO_EGLIB_SOURCE_DIR)%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_INCLUDE_DIR);$(MONO_EGLIB_SOURCE_DIR)%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBTEST_EGLIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
     <ClCompile>\r
       <Optimization>MinSpace</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_EGLIB_INCLUDE_DIR);$(MONO_EGLIB_SOURCE_DIR)%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_INCLUDE_DIR);$(MONO_EGLIB_SOURCE_DIR)%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBTEST_EGLIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PrecompiledHeader>\r
       </PrecompiledHeader>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_EGLIB_INCLUDE_DIR);$(MONO_EGLIB_SOURCE_DIR)%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_INCLUDE_DIR);$(MONO_EGLIB_SOURCE_DIR)%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBTEST_EGLIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>MinSpace</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_EGLIB_INCLUDE_DIR);$(MONO_EGLIB_SOURCE_DIR)%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_INCLUDE_DIR);$(MONO_EGLIB_SOURCE_DIR)%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBTEST_EGLIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PrecompiledHeader>\r
       </PrecompiledHeader>\r
     </Link>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
-    <ClCompile Include="..\eglib\test\array.c" />\r
-    <ClCompile Include="..\eglib\test\dir.c" />\r
-    <ClCompile Include="..\eglib\test\driver.c" />\r
-    <ClCompile Include="..\eglib\test\endian.c" />\r
-    <ClCompile Include="..\eglib\test\fake.c" />\r
-    <ClCompile Include="..\eglib\test\file.c" />\r
+    <ClCompile Include="..\mono\eglib\test\array.c" />\r
+    <ClCompile Include="..\mono\eglib\test\dir.c" />\r
+    <ClCompile Include="..\mono\eglib\test\driver.c" />\r
+    <ClCompile Include="..\mono\eglib\test\endian.c" />\r
+    <ClCompile Include="..\mono\eglib\test\fake.c" />\r
+    <ClCompile Include="..\mono\eglib\test\file.c" />\r
     <ClCompile Include="getopt.c" />\r
     <ClCompile Include="getopt_long.c" />\r
-    <ClCompile Include="..\eglib\test\hashtable.c" />\r
-    <ClCompile Include="..\eglib\test\list.c" />\r
-    <ClCompile Include="..\eglib\test\markup.c" />\r
-    <ClCompile Include="..\eglib\test\memory.c" />\r
-    <ClCompile Include="..\eglib\test\module.c" />\r
-    <ClCompile Include="..\eglib\test\path.c" />\r
-    <ClCompile Include="..\eglib\test\pattern.c" />\r
-    <ClCompile Include="..\eglib\test\ptrarray.c" />\r
-    <ClCompile Include="..\eglib\test\queue.c" />\r
-    <ClCompile Include="..\eglib\test\shell.c" />\r
-    <ClCompile Include="..\eglib\test\sizes.c" />\r
-    <ClCompile Include="..\eglib\test\slist.c" />\r
-    <ClCompile Include="..\eglib\test\spawn.c" />\r
-    <ClCompile Include="..\eglib\test\string-util.c" />\r
-    <ClCompile Include="..\eglib\test\string.c" />\r
-    <ClCompile Include="..\eglib\test\test.c" />\r
-    <ClCompile Include="..\eglib\test\timer.c" />\r
-    <ClCompile Include="..\eglib\test\unicode.c" />\r
-    <ClCompile Include="..\eglib\test\utf8.c" />\r
+    <ClCompile Include="..\mono\eglib\test\hashtable.c" />\r
+    <ClCompile Include="..\mono\eglib\test\list.c" />\r
+    <ClCompile Include="..\mono\eglib\test\markup.c" />\r
+    <ClCompile Include="..\mono\eglib\test\memory.c" />\r
+    <ClCompile Include="..\mono\eglib\test\module.c" />\r
+    <ClCompile Include="..\mono\eglib\test\path.c" />\r
+    <ClCompile Include="..\mono\eglib\test\pattern.c" />\r
+    <ClCompile Include="..\mono\eglib\test\ptrarray.c" />\r
+    <ClCompile Include="..\mono\eglib\test\queue.c" />\r
+    <ClCompile Include="..\mono\eglib\test\shell.c" />\r
+    <ClCompile Include="..\mono\eglib\test\sizes.c" />\r
+    <ClCompile Include="..\mono\eglib\test\slist.c" />\r
+    <ClCompile Include="..\mono\eglib\test\spawn.c" />\r
+    <ClCompile Include="..\mono\eglib\test\string-util.c" />\r
+    <ClCompile Include="..\mono\eglib\test\string.c" />\r
+    <ClCompile Include="..\mono\eglib\test\test.c" />\r
+    <ClCompile Include="..\mono\eglib\test\timer.c" />\r
+    <ClCompile Include="..\mono\eglib\test\unicode.c" />\r
+    <ClCompile Include="..\mono\eglib\test\utf8.c" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="getopt.h" />\r
     <ClInclude Include="getopt_long.h" />\r
-    <ClInclude Include="..\eglib\src\glib.h" />\r
-    <ClInclude Include="..\eglib\test\test.h" />\r
-    <ClInclude Include="..\eglib\test\tests.h" />\r
+    <ClInclude Include="..\mono\eglib\src\glib.h" />\r
+    <ClInclude Include="..\mono\eglib\test\test.h" />\r
+    <ClInclude Include="..\mono\eglib\test\tests.h" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ProjectReference Include="eglib.vcxproj">\r
index a93fb6f29fa059a1bf30884dcad7aa174e7dbb85..9307397c7379f5437ca6c215445dc6f64cf6309e 100644 (file)
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="utf-8"?>\r
+<?xml version="1.0" encoding="utf-8"?>\r
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup>\r
-    <ClCompile Include="..\eglib\test\array.c">\r
+    <ClCompile Include="..\mono\eglib\test\array.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\dir.c">\r
+    <ClCompile Include="..\mono\eglib\test\dir.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\driver.c">\r
+    <ClCompile Include="..\mono\eglib\test\driver.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\endian.c">\r
+    <ClCompile Include="..\mono\eglib\test\endian.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\fake.c">\r
+    <ClCompile Include="..\mono\eglib\test\fake.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\file.c">\r
+    <ClCompile Include="..\mono\eglib\test\file.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
     <ClCompile Include="getopt.c">\r
     <ClCompile Include="getopt_long.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\hashtable.c">\r
+    <ClCompile Include="..\mono\eglib\test\hashtable.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\list.c">\r
+    <ClCompile Include="..\mono\eglib\test\list.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\markup.c">\r
+    <ClCompile Include="..\mono\eglib\test\markup.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\memory.c">\r
+    <ClCompile Include="..\mono\eglib\test\memory.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\module.c">\r
+    <ClCompile Include="..\mono\eglib\test\module.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\path.c">\r
+    <ClCompile Include="..\mono\eglib\test\path.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\pattern.c">\r
+    <ClCompile Include="..\mono\eglib\test\pattern.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\ptrarray.c">\r
+    <ClCompile Include="..\mono\eglib\test\ptrarray.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\queue.c">\r
+    <ClCompile Include="..\mono\eglib\test\queue.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\shell.c">\r
+    <ClCompile Include="..\mono\eglib\test\shell.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\sizes.c">\r
+    <ClCompile Include="..\mono\eglib\test\sizes.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\slist.c">\r
+    <ClCompile Include="..\mono\eglib\test\slist.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\spawn.c">\r
+    <ClCompile Include="..\mono\eglib\test\spawn.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\string.c">\r
+    <ClCompile Include="..\mono\eglib\test\string.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\string-util.c">\r
+    <ClCompile Include="..\mono\eglib\test\string-util.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\test.c">\r
+    <ClCompile Include="..\mono\eglib\test\test.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\utf8.c">\r
+    <ClCompile Include="..\mono\eglib\test\utf8.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\timer.c">\r
+    <ClCompile Include="..\mono\eglib\test\timer.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\test\unicode.c">\r
+    <ClCompile Include="..\mono\eglib\test\unicode.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
   </ItemGroup>\r
     <ClInclude Include="getopt_long.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\eglib\src\glib.h">\r
+    <ClInclude Include="..\mono\eglib\src\glib.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\eglib\test\test.h">\r
+    <ClInclude Include="..\mono\eglib\test\test.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\eglib\test\tests.h">\r
+    <ClInclude Include="..\mono\eglib\test\tests.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
   </ItemGroup>\r
index d3729144a610939269165092422bce631af42d6a..7cf6a0acdf4e140ba80dbd06a54f359acb8d49ec 100755 (executable)
@@ -1,11 +1,8 @@
 @ECHO off
 
 SET CONFIG_H=..\config.h
-SET EGLIB_CONFIG_H=..\eglib\config.h
 SET CYG_CONFIG_H=..\cygconfig.h
-SET EGLIB_CYG_CONFIG_H=..\eglib\cygconfig.h
 SET WIN_CONFIG_H=..\winconfig.h
-SET EGLIB_WIN_CONFIG_H=..\eglib\winconfig.h
 SET CONFIGURE_AC=..\configure.ac
 SET VERSION_H=..\mono\mini\version.h
 
@@ -14,7 +11,6 @@ ECHO Setting up Mono configuration headers...
 
 REM Backup existing config.h into cygconfig.h if its not already replaced.
 %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File backup-config-files.ps1 %CONFIG_H% %CYG_CONFIG_H% 2>&1
-%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File backup-config-files.ps1 %EGLIB_CONFIG_H% %EGLIB_CYG_CONFIG_H% 2>&1
 
 %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-files.ps1 %WIN_CONFIG_H% %CONFIG_H% %CONFIGURE_AC% 2>&1
 
@@ -25,13 +21,6 @@ IF NOT %ERRORLEVEL% == 0 (
        %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "$mono_version=[int[]](Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value.Split('.'); $corlib_counter=[int](Select-String -path %CONFIGURE_AC% -pattern 'MONO_CORLIB_COUNTER=(.*)').Matches[0].Groups[1].Value; (Get-Content %CONFIG_H%) -replace '#MONO_CORLIB_VERSION#',('1{0:00}{1:00}{2:00}{3:000}' -f $mono_version[0],$mono_version[1],$mono_version[2],$corlib_counter) | Set-Content %CONFIG_H%" 2>&1
 )
 
-%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-files.ps1 %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H% 2>&1
-
-IF NOT %ERRORLEVEL% == 0 (
-       ECHO copy %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H%
-       copy %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H%
-)
-
 SET VERSION_CONTENT="#define FULL_VERSION \"Visual Studio built mono\""
 %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-content.ps1 %VERSION_CONTENT% %VERSION_H%  2>&1
 
index c25087cf307f0689c0ae514745081be4a2ccf643..58b04b904f72de607c83994e92e0011cdcfd66a1 100644 (file)
@@ -581,21 +581,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-console-net_4_x", "mc
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ilasm-net_4_x", "mcs/ilasm/ilasm-net_4_x.csproj", "{D32B01EF-8E8D-41C1-848D-6DAEAA3FCA6C}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resgen-net_4_x", "mcs/tools/resgen/resgen-net_4_x.csproj", "{647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gacutil-net_4_x", "mcs/tools/gacutil/gacutil-net_4_x.csproj", "{6B9993FC-E28D-4D55-8F96-C8A35B2BC6E7}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "culevel-net_4_x", "mcs/tools/culevel/culevel-net_4_x.csproj", "{ED867AC1-079C-4B5E-ADF9-E7722053B360}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cil-stringreplacer-net_4_x", "mcs/tools/cil-stringreplacer/cil-stringreplacer-net_4_x.csproj", "{FD725431-CB26-466D-BD55-C739485A50C9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "commoncryptogenerator-net_4_x", "mcs/tools/commoncryptogenerator/commoncryptogenerator-net_4_x.csproj", "{12527E95-60D3-4A66-91C6-7F8031519299}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resx2sr-net_4_x", "mcs/tools/resx2sr/resx2sr-net_4_x.csproj", "{07D30676-A919-4763-8C3C-B2C4DAFFC662}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "al-net_4_x", "mcs/tools/al/al-net_4_x.csproj", "{D237CE6E-EA8F-4E8E-8413-295B27714AC6}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "monolinker-net_4_x", "mcs/tools/linker/monolinker-net_4_x.csproj", "{FA920637-C202-4E75-AC0F-1A8DBD631DF1}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "al-net_4_x", "mcs/tools/al/al-net_4_x.csproj", "{D237CE6E-EA8F-4E8E-8413-295B27714AC6}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "culevel-net_4_x", "mcs/tools/culevel/culevel-net_4_x.csproj", "{ED867AC1-079C-4B5E-ADF9-E7722053B360}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "genxs-net_4_x", "mcs/tools/genxs/genxs-net_4_x.csproj", "{DCD2613C-B1A0-489B-BCA1-79BEBB9B9541}"
 EndProject
@@ -607,6 +599,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mono-service-net_4_x", "mcs
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xsd-net_4_x", "mcs/tools/mono-xsd/xsd-net_4_x.csproj", "{3CB8E3C0-0EFA-4AB3-9F60-02DC274F77F8}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resgen-net_4_x", "mcs/tools/resgen/resgen-net_4_x.csproj", "{647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}"
+EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wsdl-net_4_x", "mcs/tools/wsdl/wsdl-net_4_x.csproj", "{69D00FEC-59AA-43A0-90AD-87F400B8613C}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "csharp-net_4_x", "mcs/tools/csharp/csharp-net_4_x.csproj", "{3E3DE804-DF6C-43D0-9DFC-13C7FFD949CA}"
@@ -1847,38 +1841,22 @@ Global
                {D32B01EF-8E8D-41C1-848D-6DAEAA3FCA6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {D32B01EF-8E8D-41C1-848D-6DAEAA3FCA6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {D32B01EF-8E8D-41C1-848D-6DAEAA3FCA6C}.Release|Any CPU.Build.0 = Release|Any CPU
-               {647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Release|Any CPU.Build.0 = Release|Any CPU
                {6B9993FC-E28D-4D55-8F96-C8A35B2BC6E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {6B9993FC-E28D-4D55-8F96-C8A35B2BC6E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {6B9993FC-E28D-4D55-8F96-C8A35B2BC6E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {6B9993FC-E28D-4D55-8F96-C8A35B2BC6E7}.Release|Any CPU.Build.0 = Release|Any CPU
-               {ED867AC1-079C-4B5E-ADF9-E7722053B360}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {ED867AC1-079C-4B5E-ADF9-E7722053B360}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {ED867AC1-079C-4B5E-ADF9-E7722053B360}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {ED867AC1-079C-4B5E-ADF9-E7722053B360}.Release|Any CPU.Build.0 = Release|Any CPU
-               {FD725431-CB26-466D-BD55-C739485A50C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {FD725431-CB26-466D-BD55-C739485A50C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {FD725431-CB26-466D-BD55-C739485A50C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {FD725431-CB26-466D-BD55-C739485A50C9}.Release|Any CPU.Build.0 = Release|Any CPU
-               {12527E95-60D3-4A66-91C6-7F8031519299}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {12527E95-60D3-4A66-91C6-7F8031519299}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {12527E95-60D3-4A66-91C6-7F8031519299}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {12527E95-60D3-4A66-91C6-7F8031519299}.Release|Any CPU.Build.0 = Release|Any CPU
-               {07D30676-A919-4763-8C3C-B2C4DAFFC662}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {07D30676-A919-4763-8C3C-B2C4DAFFC662}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {07D30676-A919-4763-8C3C-B2C4DAFFC662}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {07D30676-A919-4763-8C3C-B2C4DAFFC662}.Release|Any CPU.Build.0 = Release|Any CPU
-               {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Release|Any CPU.Build.0 = Release|Any CPU
                {D237CE6E-EA8F-4E8E-8413-295B27714AC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {D237CE6E-EA8F-4E8E-8413-295B27714AC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {D237CE6E-EA8F-4E8E-8413-295B27714AC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {D237CE6E-EA8F-4E8E-8413-295B27714AC6}.Release|Any CPU.Build.0 = Release|Any CPU
+               {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Release|Any CPU.Build.0 = Release|Any CPU
+               {ED867AC1-079C-4B5E-ADF9-E7722053B360}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {ED867AC1-079C-4B5E-ADF9-E7722053B360}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {ED867AC1-079C-4B5E-ADF9-E7722053B360}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {ED867AC1-079C-4B5E-ADF9-E7722053B360}.Release|Any CPU.Build.0 = Release|Any CPU
                {DCD2613C-B1A0-489B-BCA1-79BEBB9B9541}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {DCD2613C-B1A0-489B-BCA1-79BEBB9B9541}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {DCD2613C-B1A0-489B-BCA1-79BEBB9B9541}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1899,6 +1877,10 @@ Global
                {3CB8E3C0-0EFA-4AB3-9F60-02DC274F77F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {3CB8E3C0-0EFA-4AB3-9F60-02DC274F77F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {3CB8E3C0-0EFA-4AB3-9F60-02DC274F77F8}.Release|Any CPU.Build.0 = Release|Any CPU
+               {647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Release|Any CPU.Build.0 = Release|Any CPU
                {69D00FEC-59AA-43A0-90AD-87F400B8613C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {69D00FEC-59AA-43A0-90AD-87F400B8613C}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {69D00FEC-59AA-43A0-90AD-87F400B8613C}.Release|Any CPU.ActiveCfg = Release|Any CPU
index d7e9be7716900487738c36d19e5879a6af1d057b..eeab6c36a927c82329a4337ce14a54705e29b6e4 100644 (file)
@@ -1,24 +1,14 @@
 class FsharpPackage(GitHubTarballPackage):
-
     def __init__(self):
-        GitHubTarballPackage.__init__(
-            self,
-            'fsharp',
-            'fsharp',
-            '4.1.8',
-            '991186f6c95b30a80f217b9319354b32c86212de',
+        GitHubTarballPackage.__init__(self,
+            'fsharp', 'fsharp',
+            '4.1.25',
+            '9687f27c3e6be7b9e1646bb9ee1ae0b02080daae',
             configure='./configure --prefix="%{package_prefix}"',
-            override_properties={
-                'make': 'make'})
+            override_properties={ 'make': 'make' })
 
-        self.extra_stage_files = [
-            'lib/mono/xbuild/Microsoft/VisualStudio/v/FSharp/Microsoft.FSharp.Targets']
-        self.sources.extend(
-            [
-                'patches/fsharp-enable-jit-tracking-for-portable-pdb.patch',
-                'patches/fsharp-fix-mdb-support.patch',
-                'patches/fsharp-Fix-mono-gac-location.patch',
-                'patches/fsharp-fix-xbuild-check.patch'])
+        self.extra_stage_files = ['lib/mono/xbuild/Microsoft/VisualStudio/v/FSharp/Microsoft.FSharp.Targets']
+        self.sources.extend(['patches/fsharp-fix-mdb-support.patch'])
 
     def prep(self):
         Package.prep(self)
index cf9e89ba9bdd54790931017e18a2062b90b4cd63..bcb1e7501a51e202d1e488e6c7c990a532b50ba9 100644 (file)
@@ -21,11 +21,12 @@ class MonoLlvmPackage (GitHubPackage):
         self.cpp_flags = []
 
     def arch_build(self, arch):
+        Package.profile.arch_build(arch, self)
         if arch == 'darwin-64':  # 64-bit  build pass
-            self.local_configure_flags = ['--build=x86_64-apple-darwin11.2.0']
+            self.local_configure_flags.extend(['--build=x86_64-apple-darwin11.2.0'])
 
         if arch == 'darwin-32':
-            self.local_configure_flags = ['--build=i386-apple-darwin11.2.0']
+            self.local_configure_flags.extend(['--build=i386-apple-darwin11.2.0'])
 
         # LLVM says that libstdc++4.6 is broken and we should use libstdc++4.7.
         # This switches it to the right libstdc++.
index 34f7afe3107adc49b5e64a6826bf9dbba2b59bdd..bbbf8db091da50b49b87fdc1cc623695e46cdb4a 100644 (file)
@@ -63,13 +63,12 @@ class MonoMasterPackage(Package):
             self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"')
 
     def arch_build(self, arch):
+        Package.profile.arch_build(arch, self)
         if arch == 'darwin-64':  # 64-bit build pass
-            self.local_gcc_flags = ['-m64']
-            self.local_configure_flags = ['--build=x86_64-apple-darwin11.2.0', '--disable-boehm']
+            self.local_configure_flags.extend (['--build=x86_64-apple-darwin11.2.0', '--disable-boehm'])
 
         if arch == 'darwin-32':  # 32-bit build pass
-            self.local_gcc_flags = ['-m32']
-            self.local_configure_flags = ['--build=i386-apple-darwin11.2.0']
+            self.local_configure_flags.extend (['--build=i386-apple-darwin11.2.0'])
 
         self.local_configure_flags.extend(
             ['--cache-file=%s/%s-%s.cache' % (self.profile.bockbuild.build_root, self.name, arch)])
index b02ac199983bc741ea2ab05cddcbe5bda96e7ed0..6db7f65953bc17ef9731e446d0fef35318d6d2a0 100644 (file)
@@ -2,8 +2,8 @@ import fileinput
 
 class MSBuild (GitHubPackage):
        def __init__ (self):
-               GitHubPackage.__init__ (self, 'mono', 'msbuild', '15.3',
-                       revision = 'f7dcc3900c808775adad970f047202b4de34e986')
+               GitHubPackage.__init__ (self, 'mono', 'msbuild', '15.4',
+                       revision = '0f250921e0b91ca1bda6494df49ae8ad703aeb5c')
 
        def build (self):
                self.sh ('./cibuild.sh --scope Compile --target Mono --host Mono --config Release')
diff --git a/packaging/MacSDK/patches/fsharp-Fix-mono-gac-location.patch b/packaging/MacSDK/patches/fsharp-Fix-mono-gac-location.patch
deleted file mode 100644 (file)
index 67e088b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-From 208aa8170bede4c176b5e3afa6811d1d7a5a330c Mon Sep 17 00:00:00 2001
-From: nosami <jasonimison@gmail.com>
-Date: Tue, 11 Apr 2017 12:10:04 +0100
-Subject: [PATCH] Fix mono/gac location
-
----
- src/fsharp/targets.make | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/fsharp/targets.make b/src/fsharp/targets.make
-index 014294a..716adb7 100644
---- a/src/fsharp/targets.make
-+++ b/src/fsharp/targets.make
-@@ -157,9 +157,9 @@ install-gac-lib:
-                               echo "Using gacutil to install $(outdir)$(ASSEMBLY) into GAC root $(DESTDIR)$(libdir) as package $(TARGET)"; \
-                               $(monobindir)/gacutil -i $(outdir)$(ASSEMBLY) -root $(DESTDIR)$(libdir) -package $(TARGET); \
-                       else \
--                              echo "Installing $(outdir)$(NAME).dll to $(DESTDIR)$(gacdir)/gac/$(NAME)/$(VERSION)__$(TOKEN)/"; \
--                              mkdir -p $(DESTDIR)$(gacdir)/gac/$(NAME)/$(VERSION)__$(TOKEN)/; \
--                              $(INSTALL_LIB) $(outdir)$(NAME).dll $(DESTDIR)$(gacdir)/gac/$(NAME)/$(VERSION)__$(TOKEN)/; \
-+                              echo "Installing $(outdir)$(NAME).dll to $(DESTDIR)$(monodir)/gac/$(NAME)/$(VERSION)__$(TOKEN)/"; \
-+                              mkdir -p $(DESTDIR)$(monodir)/gac/$(NAME)/$(VERSION)__$(TOKEN)/; \
-+                              $(INSTALL_LIB) $(outdir)$(NAME).dll $(DESTDIR)$(monodir)/gac/$(NAME)/$(VERSION)__$(TOKEN)/; \
-                       fi; \
-       fi
--- 
-2.8.0
-
diff --git a/packaging/MacSDK/patches/fsharp-enable-jit-tracking-for-portable-pdb.patch b/packaging/MacSDK/patches/fsharp-enable-jit-tracking-for-portable-pdb.patch
deleted file mode 100644 (file)
index d3fef81..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From f28dbdfaa4427c1e62c16bc6d59106f9f5db15f7 Mon Sep 17 00:00:00 2001
-From: nosami <jasonimison@gmail.com>
-Date: Fri, 21 Apr 2017 16:34:27 +0100
-Subject: [PATCH] Enable JIT tracking for portable PDB debugging
-
-Setting JIT tracking to true adds the `DebuggableAttribute.DebuggingModes.Default`
-flag to the generated Debuggable attribute
-See https://msdn.microsoft.com/en-us/library/system.diagnostics.debuggableattribute.debuggingmodes(v=vs.110).aspx
-
-Without this flag I see the following message when debugging unless I have "Debug project code only: do not step into framework code" unchecked to allow stepping into framework code.
-```
-Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
-```
-Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55092
----
- src/fsharp/CompileOptions.fs | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs
-index 209cdd90..97860085 100755
---- a/src/fsharp/CompileOptions.fs
-+++ b/src/fsharp/CompileOptions.fs
-@@ -466,9 +466,9 @@ let SetDebugSwitch (tcConfigB : TcConfigBuilder) (dtype : string option) (s : Op
-     match dtype with
-     | Some(s) ->
-        match s with 
--       | "portable" ->  tcConfigB.portablePDB <- true;  tcConfigB.embeddedPDB <- false; tcConfigB.jitTracking <- false; tcConfigB.ignoreSymbolStoreSequencePoints <- true
-+       | "portable" ->  tcConfigB.portablePDB <- true;  tcConfigB.embeddedPDB <- false; tcConfigB.jitTracking <- true; tcConfigB.ignoreSymbolStoreSequencePoints <- true
-        | "pdbonly" ->   tcConfigB.portablePDB <- false; tcConfigB.embeddedPDB <- false; tcConfigB.jitTracking <- false
--       | "embedded" ->  tcConfigB.portablePDB <- true;  tcConfigB.embeddedPDB <- true;  tcConfigB.jitTracking <- false; tcConfigB.ignoreSymbolStoreSequencePoints <- true
-+       | "embedded" ->  tcConfigB.portablePDB <- true;  tcConfigB.embeddedPDB <- true;  tcConfigB.jitTracking <- true; tcConfigB.ignoreSymbolStoreSequencePoints <- true
-        | "full" ->      tcConfigB.portablePDB <- false; tcConfigB.embeddedPDB <- false; tcConfigB.jitTracking <- true
-        | _ -> error(Error(FSComp.SR.optsUnrecognizedDebugType(s), rangeCmdArgs))
-     | None ->           tcConfigB.portablePDB <- false; tcConfigB.embeddedPDB <- false; tcConfigB.jitTracking <- s = OptionSwitch.On;
--- 
-2.11.0 (Apple Git-81)
-
diff --git a/packaging/MacSDK/patches/fsharp-fix-xbuild-check.patch b/packaging/MacSDK/patches/fsharp-fix-xbuild-check.patch
deleted file mode 100644 (file)
index 47ebfa3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-commit 8f93ad340dc81a23155e68c79a5c3eab53b6eeb5
-Author: Ankit Jain <ankit.jain@xamarin.com>
-Date:   Sat Apr 15 04:17:18 2017 -0400
-
-    [msbuild] Fix test for is-running-on-xbuild
-
-diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.targets
-index ec28077d..10840ada 100644
---- a/src/fsharp/FSharp.Build/Microsoft.FSharp.targets
-+++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.targets
-@@ -66,7 +66,7 @@ this file.
-     <PropertyGroup>
-         <UsingXBuild>false</UsingXBuild>
--        <UsingXBuild Condition="$(MSBuildExtensionsPath32.Contains('xbuild'))">true</UsingXBuild>
-+        <UsingXBuild Condition="'$(MSBuildAssemblyVersion)' == ''">true</UsingXBuild>
-     </PropertyGroup>
-     <Target
index f0f5082c47a779aa684af95527d6f314783a79ed..37f0191d1c6417da97a162e486144cb69ab5ccd0 100644 (file)
@@ -1,3 +1,3 @@
 Package('sqlite-autoconf', '3090200', sources=[
-    'http://www.sqlite.org/2015/%{name}-%{version}.tar.gz'
+    'https://www.sqlite.org/2015/%{name}-%{version}.tar.gz'
 ])
index 052a45eeaeb3bf235e56a49bec0550313c14c96e..326158c3af8f680573cc7eed9196df4a56ce66a2 100644 (file)
@@ -68,6 +68,10 @@ if INSTALL_ORBIS
 build_profiles += orbis
 endif
 
+if INSTALL_UNREAL
+build_profiles += unreal
+endif
+
 test_profiles = $(build_profiles)
 
 if BUILD_MCS
index 75e2f779590a3d43267625f2650644de75be969c..a210317e913b7740b4d564c94849c82c21902d8f 100644 (file)
@@ -2,11 +2,14 @@
 
 /*
  * Bare bones profiler. Compile with:
- * 
- * linux : gcc -shared -o mono-profiler-sample.so sample.c `pkg-config --cflags --libs mono`
- * mac : gcc sample.c -o mono-profiler-sample.dylib -Dmono_free=free -lz `pkg-config --cflags mono-2` -undefined suppress -flat_namespace  
  *
- * Install the binary where the dynamic loader can find it. eg /usr/lib etc
+ * linux : gcc -fPIC -shared -o libmono-profiler-sample.so sample.c `pkg-config --cflags --libs mono-2`
+ * mac : gcc -o mono-profiler-sample.dylib sample.c -lz `pkg-config --cflags mono-2` -undefined suppress -flat_namespace
+ * linux with a custom prefix (e.g. --prefix=/opt/my-mono-build):
+ *     gcc -fPIC -shared -o libmono-profiler-sample.so sample.c `PKG_CONFIG_PATH=/opt/my-mono-build/lib/pkgconfig/ pkg-config --cflags --libs mono-2`
+ *
+ * Install the binary where the dynamic loader can find it. eg /usr/lib etc.
+ * For a custom prefix build, <prefix>/lib would also work.
  * Then run mono with:
  * mono --profile=sample your_application.exe
  *
  */
 
 struct _MonoProfiler {
-       int ncalls;
+       unsigned long long ncalls;
 };
 
+static MonoProfiler prof_instance;
+
 /* called at the end of the program */
 static void
 sample_shutdown (MonoProfiler *prof)
 {
-       g_print ("total number of calls: %d\n", prof->ncalls);
+       printf("total number of calls: %llu\n", prof->ncalls);
 }
 
 static void
-sample_method_enter (MonoProfiler *prof, MonoMethod *method)
+sample_method_enter (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *ctx)
 {
        prof->ncalls++;
 }
 
-static void
-sample_method_leave (MonoProfiler *prof, MonoMethod *method)
-{
-}
-
 static MonoProfilerCallInstrumentationFlags
 sample_instrumentation_filter (MonoProfiler *prof, MonoMethod *method)
 {
-       return MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE | MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE;
+       return MONO_PROFILER_CALL_INSTRUMENTATION_ENTER;
 }
 
 /* the entry point */
 void
-mono_profiler_init (const char *desc)
+mono_profiler_init_sample (const char *desc)
 {
-       MonoProfiler *prof;
-
-       prof = g_new0 (MonoProfiler, 1);
+       MonoProfiler *prof = &prof_instance;
 
-       MonoProfilerHandle handle = mono_profiler_install (prof);
-       mono_profiler_set_runtime_shutdown_callback (handle, sample_shutdown);
+       MonoProfilerHandle handle = mono_profiler_create (prof);
+       mono_profiler_set_runtime_shutdown_end_callback (handle, sample_shutdown);
        mono_profiler_set_call_instrumentation_filter_callback (handle, sample_instrumentation_filter);
        mono_profiler_set_method_enter_callback (handle, sample_method_enter);
-       mono_profiler_set_method_leave_callback (handle, sample_method_leave);
 }
 
 
index 86ec27dfd6da4fe6942232aa351e4003c6283b5f..a0f2690f6d9022278d111ba333f85fee55e298b7 100644 (file)
@@ -131,8 +131,8 @@ void install_icall (MonoProfiler *prof, MonoMethod *method, MonoJitInfo* jinfo)
 }
 
 void
-mono_profiler_init (const char *desc)
+mono_profiler_init_size (const char *desc)
 {
-       MonoProfilerHandle handle = mono_profiler_install (NULL);
+       MonoProfilerHandle handle = mono_profiler_create (NULL);
        mono_profiler_set_jit_done_callback (handle, install_icall);
 }
diff --git a/scripts/ci/clang-thread-sanitizer-blacklist b/scripts/ci/clang-thread-sanitizer-blacklist
new file mode 100644 (file)
index 0000000..ef12456
--- /dev/null
@@ -0,0 +1,351 @@
+# ------------------------------------------------------------ #
+#   mono/eglib
+# ------------------------------------------------------------ #
+
+fun:monoeg_g_hash_table_iter_next
+
+# ------------------------------------------------------------ #
+#   mono/metadata
+# ------------------------------------------------------------ #
+
+# class.c #
+
+fun:inflate_generic_type
+fun:init_sizes_with_info
+fun:make_generic_param_class
+fun:mono_class_create_from_typedef
+fun:mono_class_from_generic_parameter_internal
+fun:mono_class_get_field_count
+fun:mono_class_get_method_from_name_flags
+fun:mono_class_get_methods
+fun:mono_class_has_failure
+fun:mono_class_has_finalizer
+fun:mono_class_inflate_generic_method_full_checked
+fun:mono_class_inflate_generic_type_no_copy
+fun:mono_class_inflate_generic_type_with_mempool
+fun:mono_class_init
+fun:mono_class_layout_fields
+fun:mono_class_setup_basic_field_info
+fun:mono_class_setup_fields
+fun:mono_class_setup_methods
+fun:mono_class_setup_vtable_full
+fun:mono_class_setup_vtable_general
+fun:mono_generic_class_get_class
+fun:mono_method_get_context_general
+fun:mono_type_get_basic_type_from_generic
+fun:mono_type_get_underlying_type
+
+# class-accessors.c #
+
+fun:mono_class_get_flags
+fun:mono_class_get_method_count
+fun:mono_class_set_method_count
+
+# class-inlines.h #
+
+fun:mono_class_is_ginst
+fun:mono_class_is_gtd
+
+# domain.c #
+
+fun:mono_domain_alloc0
+
+# gc.c #
+
+fun:finalize_domain_objects
+fun:finalizer_thread
+fun:mono_domain_finalize
+fun:mono_gc_cleanup
+
+# handle.h #
+
+fun:mono_stack_mark_pop
+
+# handle.c #
+
+fun:mono_handle_new
+fun:mono_handle_stack_scan
+
+# icall.c #
+
+fun:ves_icall_System_Array_FastCopy
+fun:ves_icall_System_Reflection_MonoMethodInfo_get_parameter_info
+fun:ves_icall_RuntimeType_GetConstructors_native
+
+# image.c #
+
+fun:mono_image_alloc
+fun:mono_image_alloc0
+fun:mono_image_strdup
+
+# jit-info.c #
+
+fun:jit_info_table_add
+fun:jit_info_table_chunk_index
+fun:jit_info_table_find
+fun:jit_info_table_index
+fun:mono_jit_compile_method_with_opt
+fun:mono_jit_info_init
+fun:mono_jit_info_table_find_internal
+
+# loader.c #
+
+fun:cache_memberref_sig
+fun:mon_new
+fun:mono_get_method_from_token
+fun:mono_method_get_signature_checked
+fun:mono_method_signature_checked
+
+# marshal.c #
+
+fun:mono_marshal_get_native_wrapper
+fun:mono_marshal_isinst_with_cache
+
+# metadata.c #
+
+fun:img_set_cache_get
+fun:_mono_metadata_generic_class_equal
+fun:mono_metadata_lookup_generic_class
+fun:mono_type_get_type
+fun:mono_type_is_struct
+
+# monitor.c #
+
+fun:mono_monitor_ensure_owned
+fun:mono_monitor_exit_inflated
+fun:mono_monitor_try_enter_inflated
+fun:mono_monitor_try_enter_internal
+fun:mono_object_hash
+fun:ves_icall_System_Threading_Monitor_Monitor_pulse_all
+fun:ves_icall_System_Threading_Monitor_Monitor_test_synchronised
+fun:ves_icall_System_Threading_Monitor_Monitor_wait
+
+# mono-conc-hash.c #
+
+fun:mono_conc_g_hash_table_lookup_extended
+fun:set_key
+
+# mono-hash.c #
+
+fun:mono_g_hash_table_find_slot
+fun:mono_g_hash_table_max_chain_length
+
+# object.c #
+
+fun:mono_class_compute_gc_descriptor
+fun:mono_class_create_runtime_vtable
+fun:mono_class_vtable_full
+fun:mono_delegate_ctor_with_method
+fun:mono_object_handle_isinst
+fun:mono_runtime_class_init_full
+
+# reflection.c #
+
+fun:method_object_construct
+fun:reflected_equal
+
+# reflection-cache.h #
+
+fun:cache_object_handle
+
+# runtime.c #
+
+fun:mono_runtime_is_shutting_down
+fun:mono_runtime_try_shutdown
+
+# sgen-mono.c #
+
+fun:mono_gc_alloc_string
+fun:mono_gc_alloc_vector
+fun:mono_gc_thread_in_critical_region
+fun:mono_gc_wbarrier_set_arrayref
+fun:sgen_client_gchandle_created
+fun:sgen_client_gchandle_destroyed
+
+# threadpool.c #
+
+fun:worker_callback
+
+# threadpool-worker-default.c #
+
+fun:heuristic_adjust
+fun:heuristic_notify_work_completed
+fun:heuristic_should_adjust
+fun:hill_climbing_update
+fun:monitor_should_keep_running
+fun:monitor_thread
+
+# threads.c #
+
+fun:build_wait_tids
+fun:create_thread
+fun:mono_thread_clr_state
+fun:mono_thread_detach_internal
+fun:mono_threads_add_joinable_thread
+fun:mono_threads_join_threads
+fun:remove_and_abort_threads
+
+# w32handle.c #
+
+fun:mono_w32handle_init_handle
+fun:mono_w32handle_lookup_data
+fun:mono_w32handle_unref_core
+
+# ------------------------------------------------------------ #
+#   mono/mini
+# ------------------------------------------------------------ #
+
+# alias-analysis.c #
+
+fun:recompute_aliased_variables
+
+# method-to-ir.c #
+
+fun:mono_method_to_ir
+
+# mini.c #
+
+fun:mini_method_compile
+fun:mono_allocate_stack_slots
+fun:mono_jit_compile_method_inner
+fun:mono_save_seq_point_info
+fun:mono_time_track_end
+fun:mono_type_to_load_membase
+
+# mini-amd64.c #
+
+fun:mono_arch_get_delegate_invoke_impl
+
+# mini-exceptions.c #
+
+fun:mono_thread_state_init_from_sigctx
+
+# mini-generic-sharing.c #
+
+fun:mini_get_basic_type_from_generic
+fun:mini_is_gsharedvt_type
+fun:mini_type_get_underlying_type
+fun:mono_class_fill_runtime_generic_context
+fun:mono_generic_context_check_used
+fun:mono_method_check_context_used
+
+# mini-native-types.c #
+
+fun:mini_native_type_replace_type
+
+# mini-runtime.c #
+
+fun:mono_jit_find_compiled_method_with_jit_info
+
+# mini-trampolines.c #
+
+fun:common_call_trampoline
+fun:mini_resolve_imt_method
+fun:mono_create_jit_trampoline
+fun:mono_delegate_trampoline
+fun:mono_magic_trampoline
+fun:mono_rgctx_lazy_fetch_trampoline
+fun:mono_vcall_trampoline
+
+# ------------------------------------------------------------ #
+#   mono/sgen
+# ------------------------------------------------------------ #
+
+# sgen-alloc.c #
+
+fun:sgen_alloc_obj
+fun:sgen_clear_tlabs
+fun:sgen_try_alloc_obj_nolock
+
+# sgen-array-list.h #
+
+fun:sgen_array_list_bucketize
+
+# sgen-array-list.c #
+
+fun:sgen_array_list_add
+fun:sgen_array_list_find_unset
+
+# sgen-cardtable.h #
+
+fun:sgen_card_table_mark_address
+
+# sgen-fin-weak-hash.c #
+
+fun:add_stage_entry
+
+# sgen-gc.h #
+
+fun:sgen_set_nursery_scan_start
+
+# sgen-gc.c #
+
+fun:mono_gc_wbarrier_generic_store
+fun:sgen_conservatively_pin_objects_from
+
+# sgen-gchandles.c #
+
+fun:is_slot_set
+fun:link_get
+fun:mono_gchandle_free
+fun:sgen_gchandle_iterate
+
+# sgen-marksweep.c #
+
+fun:ensure_block_is_checked_for_sweeping
+fun:major_finish_sweep_checking
+fun:set_block_state
+fun:sweep_block
+fun:sweep_block_for_size
+fun:unlink_slot_from_free_list_uncontested
+
+# sgen-nursery-allocator.c #
+
+fun:sgen_fragment_allocator_add
+fun:sgen_fragment_allocator_alloc
+fun:sgen_fragment_allocator_par_range_alloc
+fun:sgen_fragment_allocator_release
+
+# ------------------------------------------------------------ #
+#   mono/utils
+# ------------------------------------------------------------ #
+
+# hazard-pointer.c #
+
+fun:is_pointer_hazardous
+fun:mono_get_hazardous_pointer
+
+# memfuncs.c #
+
+fun:mono_gc_bzero_aligned
+fun:mono_gc_memmove_aligned
+
+# mono-conc-hashtable.c #
+
+fun:mono_conc_hashtable_lookup
+
+# mono-context.c #
+
+fun:mono_sigctx_to_monoctx
+
+# mono-lazy-init.h #
+
+fun:mono_lazy_initialize
+
+# mono-threads-posix-signals.c #
+
+fun:restart_signal_handler
+fun:suspend_signal_handler
+
+# mono-threads-state-machine.c #
+
+fun:check_thread_state
+fun:mono_threads_transition_finish_async_suspend
+
+# os-event-unix.c #
+
+fun:mono_os_event_set
+
+# refcount.h #
+
+fun:mono_refcount_decrement
index a308f1b252b528b0c4c2ce34e8d0f042641c2136..fcc26b7eff6e02dcbe4470a76569be0cae8c8109 100755 (executable)
@@ -5,12 +5,23 @@ export TESTCMD=${MONO_REPO_ROOT}/scripts/ci/run-step.sh
 
 export TEST_HARNESS_VERBOSE=1
 
+make_timeout=300m
+
 if [[ $CI_TAGS == *'collect-coverage'* ]]; then
     # Collect coverage for further use by lcov and similar tools.
     # Coverage must be collected with -O0 and debug information.
     export CFLAGS="-ggdb3 --coverage -O0"
     # Collect coverage on all optimizations
     export MONO_ENV_OPTIONS="$MONO_ENV_OPTIONS -O=all"
+elif [[ ${CI_TAGS} == *'clang-sanitizer'* ]]; then
+       export CC="clang"
+       export CXX="clang++"
+       export CFLAGS="-g -O1 -fsanitize=thread -fsanitize-blacklist=${MONO_REPO_ROOT}/scripts/ci/clang-thread-sanitizer-blacklist -mllvm -tsan-instrument-atomics=false"
+       export LDFLAGS="-fsanitize=thread"
+       # TSAN_OPTIONS are used by programs that were compiled with Clang's ThreadSanitizer
+       # see https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags for more details
+       export TSAN_OPTIONS="history_size=7:exitcode=0:force_seq_cst_atomics=1"
+       make_timeout=30m
 elif [[ ${label} == w* ]]; then
     # Passing -ggdb3 on Cygwin breaks linking against libmonosgen-x.y.dll
     export CFLAGS="-g -O2"
@@ -29,6 +40,7 @@ if [[ ${CI_TAGS} == *'checked-coop'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLA
 if [[ ${CI_TAGS} == *'checked-all'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=all"; fi
 
 if [[ ${CI_TAGS} == *'mcs-compiler'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-csc=mcs"; fi
+if [[ ${CI_TAGS} == *'disable-mcs-build'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --disable-mcs-build"; fi
 
 if   [[ ${CI_TAGS} == *'fullaot_llvm'* ]];       then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime_preset=fullaot ";
 elif [[ ${CI_TAGS} == *'hybridaot_llvm'* ]];     then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime_preset=hybridaot";
@@ -87,7 +99,7 @@ if [[ ${CI_TAGS} == *'monolite'* ]]; then make get-monolite-latest; fi
 make_parallelism=-j4
 if [[ ${label} == 'debian-8-ppc64el' ]]; then make_parallelism=-j1; fi
 
-${TESTCMD} --label=make --timeout=300m --fatal make ${make_parallelism} -w V=1
+${TESTCMD} --label=make --timeout=${make_timeout} --fatal make ${make_parallelism} -w V=1
 
 if [[ ${CI_TAGS} == *'checked-coop'* ]]; then export MONO_CHECK_MODE=gc,thread; fi
 if [[ ${CI_TAGS} == *'checked-all'* ]]; then export MONO_CHECK_MODE=all; fi
index 1529f2cf391800ea750bc0543531f4b4dca5c0d1..de0ec47d2ca7403a6d854458fd4d1a86b2c491b1 100755 (executable)
@@ -5,10 +5,12 @@ if [[ ${label} == w* ]]
 then ${TESTCMD} --label=aot-test --skip;
 else ${TESTCMD} --label=aot-test --timeout=30m make -w -C mono/tests -j4 -k test-aot
 fi
+${TESTCMD} --label=compile-bcl-tests --timeout=40m make -i -w -C runtime -j4 test
 ${TESTCMD} --label=compile-runtime-tests --timeout=40m make -w -C mono/tests -j4 tests
 ${TESTCMD} --label=runtime --timeout=160m make -w -C mono/tests -k test-wrench V=1 CI=1 CI_PR=${ghprbPullId}
 ${TESTCMD} --label=runtime-unit-tests --timeout=5m make -w -C mono/unit-tests -k check
 ${TESTCMD} --label=corlib --timeout=30m make -w -C mcs/class/corlib run-test
+if [[ ${label} == w* ]]; then ${TESTCMD} --label=corlib-xunit --skip; else ${TESTCMD} --label=corlib-xunit --timeout=5m make -w -C mcs/class/corlib run-xunit-test; fi
 ${TESTCMD} --label=verify --timeout=15m make -w -C runtime mcs-compileall
 ${TESTCMD} --label=profiler --timeout=30m make -w -C mono/profiler -k check
 ${TESTCMD} --label=compiler --timeout=30m make -w -C mcs/tests run-test
index d4e7763f5740a02535143c2f6bb1ec64dc57aad3..56e150e8676726da9ab53b2aa99d4c174a137357 100644 (file)
@@ -34,12 +34,13 @@ class Driver {
                }
        }
 
-       static bool dump_asm, dump_ver;
+       static bool dump_asm, dump_ver, dump_guids_for_msbuild;
        static void Main (string[] args) {
 
                if (args.Length > 1) {
                        dump_asm = args [1].Equals ("asm");
                        dump_ver = args [1].Equals ("ver");
+                       dump_guids_for_msbuild = args [1].Equals ("guids_for_msbuild");
                } else {
                        dump_asm = true;
                }
@@ -61,7 +62,7 @@ class Driver {
                var data = StreamToArray (entry.Open ());
                AppDomain ad = AppDomain.CreateDomain ("parse_" + ++domain_id);
                DoParse p = (DoParse)ad.CreateInstanceAndUnwrap (typeof (DoParse).Assembly.FullName, typeof (DoParse).FullName);
-               p.ParseAssembly (data, version, entry.Name, entry.FullName, dump_asm, dump_ver);
+               p.ParseAssembly (data, version, entry.Name, entry.FullName, dump_asm, dump_ver, dump_guids_for_msbuild);
                AppDomain.Unload (ad);
        }
 }
@@ -92,7 +93,7 @@ class DoParse : MarshalByRefObject {
                return parts[parts.Length - 2];
        }
 
-       public void ParseAssembly (byte[] data, string version, string name, string fullname, bool dump_asm, bool dump_ver) {
+       public void ParseAssembly (byte[] data, string version, string name, string fullname, bool dump_asm, bool dump_ver, bool dump_guids_for_msbuild) {
                var a = Assembly.ReflectionOnlyLoad (data);
                var m = a.GetModules ()[0];
                var id = m.ModuleVersionId.ToString ().ToUpper ();
@@ -106,8 +107,12 @@ class DoParse : MarshalByRefObject {
 
                //IGNORED_ASM_VER (SYS_IO_COMPRESSION, 4, 1, 2, 0),
                var ver = a.GetName ().Version;
-               if (dump_ver)
+               if (dump_ver) {
                        Console.WriteLine ($"IGNORED_ASM_VER ({str}, {ver.Major}, {ver.Minor}, {ver.Build}, {ver.Revision}),");
+               } else if (dump_guids_for_msbuild) {
+                       // This needs to be kept in sync with FilterDeniedAssemblies msbuild task in msbuild
+                       Console.WriteLine ($"{name},{id},{ver.Major},{ver.Minor},{ver.Build},{ver.Revision}");
+               }
                
        }
-}
\ No newline at end of file
+}
index 0775292a10665800551ee99ffbbc20a515efa8bd..517cdbd0de4b786cb714fbd70a3de33f3d9eb366 100644 (file)
@@ -28,6 +28,7 @@ namespace CppSharp
         static string AndroidNdkPath = @"";
         static string MaccoreDir = @"";
         static string TargetDir = @"";
+        static bool GenIOS;
 
         public enum TargetPlatform
         {
@@ -206,7 +207,7 @@ namespace CppSharp
                 MaccoreDir = Path.Combine (maccoreDir);
             }
 
-            if (Directory.Exists(MaccoreDir))
+            if (Directory.Exists(MaccoreDir) || GenIOS)
                 SetupiOSTargets();
 
             foreach (var target in Targets)
@@ -244,6 +245,7 @@ namespace CppSharp
 
                 source.Options.AddDefines ("HAVE_SGEN_GC");
                 source.Options.AddDefines ("HAVE_MOVING_COLLECTOR");
+                source.Options.AddDefines("MONO_GENERATING_OFFSETS");
             }
         }
 
@@ -274,6 +276,7 @@ namespace CppSharp
                 { "android-ndk=", "Path to Android NDK", v => AndroidNdkPath = v },
                 { "targetdir=", "Path to the directory containing the mono build", v =>TargetDir = v },
                 { "mono=", "include directory", v => MonoDir = v },
+                { "gen-ios", "generate iOS offsets", v => GenIOS = v != null },
                 { "h|help",  "show this message and exit",  v => showHelp = v != null },
             };
 
@@ -307,6 +310,7 @@ namespace CppSharp
             parserOptions.AddArguments("-xc");
             parserOptions.AddArguments("-std=gnu99");
             parserOptions.AddDefines("CPPSHARP");
+            parserOptions.AddDefines("MONO_GENERATING_OFFSETS");
 
             foreach (var define in target.Defines)
                 parserOptions.AddDefines(define);
@@ -357,11 +361,11 @@ namespace CppSharp
             var includeDirs = new[]
             {
                 targetBuild,
-                Path.Combine(targetBuild, "eglib", "src"),
+                Path.Combine(targetBuild, "mono", "eglib"),
                 MonoDir,
                 Path.Combine(MonoDir, "mono"),
                 Path.Combine(MonoDir, "mono", "mini"),
-                Path.Combine(MonoDir, "eglib", "src")
+                Path.Combine(MonoDir, "mono", "eglib")
             };
 
             foreach (var inc in includeDirs)
@@ -783,7 +787,8 @@ namespace CppSharp
                 "MonoTypedRef",
                 "MonoThreadsSync",
                 "SgenThreadInfo",
-                "SgenClientThreadInfo"
+                "SgenClientThreadInfo",
+                "MonoProfilerCallContext"
             };
 
             DumpClasses(writer, ctx, types);
index 5b76dfd19bd76e10557d59590a0a179bde0add9d..322185faaf7dfd8049a94c213c41a76be9beb4b7 100644 (file)
@@ -488,13 +488,21 @@ verify_image_file (const char *fname)
                }
                mono_class_init (klass);
                if (mono_class_has_failure (klass)) {
-                       printf ("Error verifying class(0x%08x) %s.%s a type load error happened\n", token, klass->name_space, klass->name);
+                       MonoError type_load_error;
+                       error_init (&type_load_error);
+                       mono_error_set_for_class_failure (&type_load_error, klass);
+                       printf ("Could not initialize class(0x%08x) %s.%s due to %s\n", token, klass->name_space, klass->name, mono_error_get_message (&type_load_error));
+                       mono_error_cleanup (&type_load_error);
                        ++count;
                }
 
                mono_class_setup_vtable (klass);
                if (mono_class_has_failure (klass)) {
-                       printf ("Error verifying class(0x%08x) %s.%s a type load error happened\n", token, klass->name_space, klass->name);
+                       MonoError type_load_error;
+                       error_init (&type_load_error);
+                       mono_error_set_for_class_failure (&type_load_error, klass);
+                       printf ("Could not initialize vtable of class(0x%08x) %s.%s due to %s\n", token, klass->name_space, klass->name, mono_error_get_message (&type_load_error));
+                       mono_error_cleanup (&type_load_error);
                        ++count;
                }
        }
index bc9c003c0adf4d369086ca9dd28406f5df1c199f..97d9f4c433a1a6462c6e92f3b25e7bd83098f713 100644 (file)
@@ -1,6 +1,3 @@
-/* config.h.  Generated from config.h.in by configure.  */
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
 #ifndef _MSC_VER
 #include "cygconfig.h"
 #else
 /* Define to 1 if you have IPv6 support. */
 #define HAVE_STRUCT_SOCKADDR_IN6 1
 
+/* Defined as strtok_s in eglib-config.hw */
+#define HAVE_STRTOK_R 1
+
 /* Have a working sigaltstack */
 /* #undef HAVE_WORKING_SIGALTSTACK */