ParseNumber.StringToInt now check for overflows.
compile
mono.h
mono-*.tar.*
-mono.spec
-mono-core.spec
tmpinst-dir.stamp
msvc/scripts/inputs/
+++ /dev/null
-Miguel de Icaza (miguel@ximian.com)
-Paolo Molaro (lupus@ximian.com)
-Dietmar Maurer (dietmar@ximian.com)
README.md \
LICENSE \
autogen.sh \
- build-mingw32.sh \
mkinstalldirs \
mono-uninstalled.pc.in \
winconfig.h \
- mono-core.spec \
external
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
rm -rf `find $(top_distdir)/external -path '*\.git'`
rm -f `find $(top_distdir)/external -path '*\.exe'`
- rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/v4\.0*'`
+ rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*'`
cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/
cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/
# Disable this for now because it is very slow and causes wrench to timeout:
Community supported architectures:
-| debian-ppc64el | centos-s390x |
-|-----------------------------|---------------------------|
-| [![debian-ppc64el][11]][12] | [![centos-s390x][13]][14] |
+| centos-s390x |
+|---------------------------|
+| [![centos-s390x][11]][12] |
[1]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/badge/icon
[2]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/
[8]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armhf/
[9]: https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true
[10]: https://ci.appveyor.com/project/ajlennon/mono-817/branch/master
-[11]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=debian-ppc64el/badge/icon
-[12]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=debian-ppc64el/
-[13]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=centos-s390x/badge/icon
-[14]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=centos-s390x/
+[11]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=nealef-s390x-1/badge/icon
+[12]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=nealef-s390x-1/
Compilation and Installation
============================
This will download and place the files appropriately so that you can then
just run:
- make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/basic.exe
+ make
The build will then use the files downloaded by `make get-monolite-latest`.
* `scripts/` - Scripts used to invoke Mono and the corresponding program.
-* `../olive/` - Incubation code from [Olive](https://github.com/mono/olive).
-
- * If the directory ../olive is present (as an
-independent checkout) from the Mono module, that
-directory is automatically configured to share the
-same prefix than this module gets.
-
Contributing to Mono
====================
+++ /dev/null
-README.vsnet Last updated: 2006-02-01
-
-
-SVN includes a Visual Studio .NET 2005 solution, mono.sln, and some
-projects files to build most of the unmanaged parts in Mono.
-
-The "mono.sln" solution file contains the VC projects files for:
-
- * Embedded Samples
- * test-invoke.vcproj
- * test-metadata.vcproj
- * teste.vcproj
- * Libraries
- * libgc.vcproj
- * libmono.vcproj
- * Tools
- * genmdesc.vcproj
- * monoburg.vcproj
- * monodiet.vcproj
- * monodis.vcproj
- * monograph.vcproj
- * pedump.vcproj
- * mono.vcproj
-
-
-REQUIREMENTS
-
-* A working (i.e. where you could succesfully build mono) cygwin
-(http://www.cygwin.com/) setup! This is required to:
- * generate some files (via monoburg and genmdesc);
- * build the class libraries; and
- * test for regressions.
-
-* Visual Studio .NET 2005. Previous Visual Studio versions may work or
-requires, hopefully minimal, changes.
-
-* VSDependencies.zip must be decompressed under the /mono/ directory
-(otherwise you will need to edit all the projects files). This file can
-be downloaded from http://www.go-mono.com/archive/VSDependencies.zip
-
-
-LOCAL CHANGES
-
-Sadly solution/projects files aren't easy to move from computers to
-computers (well unless everyone follow the same naming convention) so
-you'll likely have to changes some options in order to compile the
-solution.
-
- * each executed assembly (i.e. the EXE) must be able to find a
- working mscorlib.dll (and all the other required assemblies).
- This can be done in different ways. My preference is to use the
- project "properties pages" in the "Configuration Properties
- \Debugging\Environment" options and set MONO_PATH to the class
- libraries directory build by cygwin (local) or on Linux
- (remote).
-
- e.g. MONO_PATH=z:\svn\mcs\class\lib\default\
- allows me to use the class libs build under Linux, while
- MONO_PATH=C:\cygwin\opt\mono\lib\mono\1.0
- use the one built from cygwin (after a make install)
-
-Some useful informations to adapt the solution/project files...
-
- * My cygwin root dir is: c:\cygwin\
- * My username is: poupou
- * My mono install prefix is: /opt/mono
-
-
-BUILDING
-
-Once everything is installed (and edited) you can right-click on the
-"mono" solution (in the "Solution Explorer"), select "Clean
-Solution" (for the first time) then "Build Solution".
-
-
-KNOWN ISSUES
-
-[1] Most, BUT NOT ALL, the regressions tests pass under this build. The
-failures seems limited to some mathematical differences and to code
-relying on the stack walking functions. The hacks to replace the GCC
-functions (__builtin_frame_address and __builtin_return_address) are
-incomplete;
-
-[2] The solution doesn't provide complete (i.e. from scratch) build. It
-requires a working cygwin environment to create some files (e.g. via
-genmdesc, monoburg). This isn't so bad as without cygwin you wouldn't be
-able to test Mono properly (see REQUIREMENTS);
-
-[3] Only the Debug target is configured properly (that would be easy to
-fix, but would require turning off some optimizations like omitting
-stack frames). Anyway there are other issues [1] to fix before switching
-to Release and IMHO the _biggest_ advantage to VS.NET is it's debugger/
-debugging tools;
-
-[4] The C compiler emits _lots_ of warning during compilation. Some
-warnings have been turned off for some projects (there was so much that
-it slowed down compilation). You can bring them back (or hide more of
-them) using the project "properties pages" windows, "Configuration
-Properties\C/C++\Advanced\Disable Specific Warnings";
-
-[5] Visual Studio 2005 should have all the latest header files required,
-but if not (or if you're using an older version of VS) then install MS
-Platform SDK (Windows Server 2003 is the latest) to ensure you have the
-latest Windows header files. You can download it from:
-http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
-
-[6] Not everyone has VS.NET so it is possible you may have to add some
-(new) files to the build from time to time. See "more informations" for
-reporting those changes.
-
-[7] Probably a lot more I didn't discover... or has changed since.
-
-
-MORE INFORMATION
-
-Please email <mono-devel-list@lists.ximian.com> if you have any problem
-and/or if there's something wrong/missing in the instructions.
-
-An online version of this file is available at
-http://www.mono-project.com/Compiling_Mono_VSNET
+++ /dev/null
-#!/bin/bash -e
-CURDIR="`pwd`"
-MINGW=i386-mingw32msvc
-CROSS_DIR=/opt/cross/$MINGW
-EXTRA_CROSS_DIR=
-INSTALL_DESTDIR="$CURDIR/mono-win32"
-PROFILES="default net_2_0 net_3_5 net_4_0 net_4_5 moonlight"
-TEMPORARY_PKG_CONFIG_DIR=/tmp/$RANDOM-pkg-config-$RANDOM
-ORIGINAL_PATH="$PATH"
-
-export CPPFLAGS_FOR_EGLIB CFLAGS_FOR_EGLIB CPPFLAGS_FOR_LIBGC CFLAGS_FOR_LIBGC
-
-function cleanup ()
-{
- if [ -d "$TEMPORARY_PKG_CONFIG_DIR" ]; then
- rm -rf "$TEMPORARY_PKG_CONFIG_DIR"
- fi
-}
-
-function check_pkg_config_dir ()
-{
- local DIR="$1"
- local DIR_PREFIX="$2"
-
- if [ ! -d "$DIR" ]; then
- return
- fi
-
- install -d -m 755 "$TEMPORARY_PKG_CONFIG_DIR"
- for pc in "$DIR"/*.pc; do
- if [ -f $pc ]; then
- pcname="`basename $pc`"
- sed -e "s;^prefix=.*;prefix=$DIR_PREFIX;g" < $pc > "$TEMPORARY_PKG_CONFIG_DIR"/$pcname
- fi;
- done
-
- if [ -z "$CROSS_PKG_CONFIG_DIR" ]; then
- CROSS_PKG_CONFIG_DIR="$TEMPORARY_PKG_CONFIG_DIR"
- fi
-}
-
-function show_build_info ()
-{
- cat <<EOF
-Installation prefix: $MONO_PREFIX
- CPPFLAGS: ${CPPFLAGS:=not set}
- LDFLAGS: ${LDFLAGS:=not set}
- MONO_PATH: ${MONO_PATH:=not set}
-EOF
-}
-
-function setup ()
-{
- local pcname
-
- CROSS_BIN_DIR="$CROSS_DIR/bin"
- CROSS_DLL_DIR="$CROSS_DIR/bin"
- PATH=$CROSS_BIN_DIR:$PATH
-
- MONO_VERSION=`grep AC_INIT configure.ac | cut -d ',' -f 2|tr -d '\[ \]'`
-
- if [ -d ./.git ]; then
- MONO_GIT_COMMIT="`git log -1 --format=format:%t`"
- MONO_GIT_BRANCH="`git branch|grep '\*'|cut -d ' ' -f 2|tr -d '\)'|tr -d '\('`"
- MONO_RELEASE="$MONO_VERSION-$MONO_GIT_BRANCH-$MONO_GIT_COMMIT"
- else
- MONO_RELEASE="$MONO_VERSION"
- fi
-
- MONO_PREFIX="$MONO_PREFIX/mono-$MONO_RELEASE"
-
- NOCONFIGURE=yes
- export NOCONFIGURE
-
- check_pkg_config_dir "$CROSS_DIR/lib/pkgconfig" "$CROSS_DIR"
-
- if [ -n "$EXTRA_CROSS_DIR" -a -d "$EXTRA_CROSS_DIR" ]; then
- if [ -d "$EXTRA_CROSS_DIR/bin" ]; then
- PATH="$EXTRA_CROSS_DIR/bin":$PATH
- fi
-
- check_pkg_config_dir "$EXTRA_CROSS_DIR/lib/pkgconfig" "$EXTRA_CROSS_DIR"
-
- if [ -d "$EXTRA_CROSS_DIR/include" ]; then
- if [ -z "$CPPFLAGS" ]; then
- CPPFLAGS="-I \"$EXTRA_CROSS_DIR/include\""
- else
- CPPFLAGS="-I \"$EXTRA_CROSS_DIR/include\" $CFLAGS"
- fi
- fi
-
- if [ -d "$EXTRA_CROSS_DIR/lib" ]; then
- if [ -z "$LDFLAGS" ]; then
- LDFLAGS="-I \"$EXTRA_CROSS_DIR/lib\""
- else
- LDFLAGS="-I \"$EXTRA_CROSS_DIR/lib\" $LDFLAGS"
- fi
- fi
-
- if [ -d "$EXTRA_CROSS_DIR/share/aclocal" ]; then
- if [ -z "$MONO_PATH" ]; then
- MONO_PATH="\"$EXTRA_CROSS_DIR\""
- else
- MONO_PATH="\"$EXTRA_CROSS_DIR\":$MONO_PATH"
- fi
- fi
- fi
-
- export PATH MONO_PATH CPPFLAGS
- show_build_info
-}
-
-function build ()
-{
- if [ -f ./Makefile ]; then
- make distclean
- fi
-
- if [ -d ./autom4te.cache ]; then
- rm -rf ./autom4te.cache
- fi
-
- if [ -f ./config.status ]; then
- for f in `find -name config.status -type f`; do
- rm $f
- done
- fi
-
- ./autogen.sh
-
- BUILD="`./config.guess`"
-
- if [ ! -d "$CURDIR/build-cross-windows" ]; then
- mkdir "$CURDIR/build-cross-windows"
- fi
-
- cd "$CURDIR/build-cross-windows"
- rm -rf *
- ../configure --prefix=$MONO_PREFIX --with-crosspkgdir=$CROSS_PKG_CONFIG_DIR --build=$BUILD --target=$MINGW --host=$MINGW --enable-parallel-mark --program-transform-name="" --with-tls=none --disable-mcs-build --disable-embed-check --enable-win32-dllmain=yes --with-libgc-threads=win32 --with-profile4=yes
- make
- cd "$CURDIR"
-
- if [ ! -d "$CURDIR/build-cross-windows-mcs" ]; then
- mkdir "$CURDIR/build-cross-windows-mcs"
- fi
-
- rm -rf autom4te.cache
- unset PATH
- PATH="$ORIGINAL_PATH"
- export PATH
- cd "$CURDIR/build-cross-windows-mcs"
- rm -rf *
- ../configure --prefix=$MONO_PREFIX --enable-parallel-mark
- make
-}
-
-function doinstall ()
-{
- if [ -d "$INSTALL_DIR" ]; then
- rm -rf "$INSTALL_DIR"
- fi
- cd "$CURDIR/build-cross-windows"
- make DESTDIR="$INSTALL_DESTDIR" USE_BATCH_FILES=yes install
-
- if test -d $CURDIR/mcs; then
- mcsdir=$CURDIR/mcs
- else
- mcsdir=$CURDIR/../mcs
- fi
-
- cd "$mcsdir/mcs"
- for p in $PROFILES; do
- make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "mcs profile $p installation failed"
- done
-
- cd "$mcsdir/class"
- for p in $PROFILES; do
- make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "class library profile $p installation failed"
- done
-
- cd "$mcsdir/tools"
- for p in $PROFILES; do
- make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "tools profile $p installation failed"
- done
-
- cd "$CURDIR/mono-win32"
- rm -f "$CURDIR/mono-win32-$MONO_RELEASE".zip
- zip -9r "$CURDIR/mono-win32-$MONO_RELEASE".zip .
-
-}
-
-function usage ()
-{
- cat <<EOF
-Usage: build-mingw32.sh [OPTIONS]
-
-where OPTIONS are:
-
- -d DIR Sets the location of directory where MINGW is installed [$CROSS_DIR]
- -e DIR Sets the location of directory where additional cross develoment packages are installed [${EXTRA_CROSS_DIR:=none}]
- -m MINGW Sets the MINGW target name to be passed to configure [$MINGW]
- -p PREFIX Prefix at which Mono is to be installed. Build will append the 'mono-X.Y' string to that path
-EOF
-
- exit 1
-}
-
-trap cleanup 0
-
-pushd . > /dev/null
-
-while getopts "d:m:e:p:" opt; do
- case "$opt" in
- d) CROSS_DIR="$OPTARG" ;;
- m) MINGW="$OPTARG" ;;
- e) EXTRA_CROSS_DIR="$OPTARG" ;;
- p) MONO_PREFIX="$OPTARG" ;;
- *) usage ;;
- esac
-done
-
-setup
-build
-doinstall
-show_build_info
-
-popd > /dev/null
platform_darwin=no
case "$host" in
*-mingw*|*-*-cygwin*)
- AC_DEFINE(HOST_WIN32,1,[Host Platform is Win32])
AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
host_win32=yes
mono_cv_clang=no
if test "x$cross_compiling" = "xno"; then
- target_win32=yes
if test "x$host" == "x$build" -a "x$host" == "x$target"; then
- AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
+ target_win32=yes
fi
else
target_win32=yes
- AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32/MinGW])
- AC_DEFINE(MINGW_CROSS_COMPILE,1,[Cross-compiling using MinGW])
fi
HOST_CC="gcc"
# Windows XP SP2 is required
AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
fi
+if test x$host_win32 = xyes; then
+ AC_DEFINE(HOST_WIN32, 1, [Host Platform is Win32])
+fi
+
+if test x$target_win32 = xyes; then
+ AC_DEFINE(TARGET_WIN32, 1, [Target Platform is Win32])
+fi
+
AC_SUBST(extra_runtime_ldflags)
AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
AM_ICONV()
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h sys/sysctl.h libproc.h)
-AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h)
+AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h)
AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
[], [], [#include <stddef.h>
#include <sys/socket.h>
AC_SUBST([mcs_topdir])
AC_SUBST([mcs_topdir_from_srcdir])
-# Where's the 'olive' source tree?
-if test -d $srcdir/olive; then
- olivedir=olive
-else
- olivedir=../olive
-fi
-
-if test -d $srcdir/$olivedir; then
-olive_topdir='$(top_srcdir)/'$olivedir
-fi
-
# gettext: prepare the translation directories.
# we do not configure the full gettext, as we consume it dynamically from C#
AM_PO_SUBDIRS
AC_DEFINE(ENABLE_GSHAREDVT,1,[Gsharing])
fi
+# A synonym
+AC_ARG_ENABLE(gsharedvt, [ --enable-gsharedvt Enable generic valuetype sharing], enable_gsharedvt=$enableval, enable_gsharedvt=no)
+if test x$enable_gsharedvt = xyes; then
+ AC_DEFINE(ENABLE_GSHAREDVT,1,[Gsharedvt])
+fi
+
AC_ARG_ENABLE(native-types, [ --enable-native-types Enable native types], enable_native_types=$enableval, enable_native_types=no)
if test x$enable_native_types = xyes; then
AC_DEFINE(MONO_NATIVE_TYPES,1,[native types])
with_tls=pthread
target_mach=no
;;
+ x86_64-ps4-freebsd)
+ TARGET=AMD64;
+ arch_target=amd64;
+ AC_DEFINE(TARGET_AMD64, 1, [...])
+ AC_DEFINE(TARGET_PS4, 1, [...])
+ CPPFLAGS="$CPPFLAGS"
+ sgen_supported=true
+ # Can't use tls, since it depends on the runtime detection of tls offsets
+ # in mono-compiler.h
+ with_tls=pthread
+ target_mach=no
+ target_win32=no
+ ;;
aarch64*-linux-*)
TARGET=ARM64;
arch_target=arm64;
AC_OUTPUT([
Makefile
-mono-core.spec
mono-uninstalled.pc
scripts/mono-find-provides
scripts/mono-find-requires
fi
- # if we have an olive folder, override the default settings
- if test -d $olivedir; then
-
- if test x$cross_compiling = xno && test x$enable_olive_build != xno; then
-
- test -w $srcdir/$olivedir/build || chmod +w $srcdir/$olivedir/build
-
- echo "prefix=$prefix" > $srcdir/$olivedir/build/config.make
- echo "exec_prefix=$exec_prefix" >> $srcdir/$olivedir/build/config.make
- echo 'mono_libdir=${exec_prefix}/lib' >> $srcdir/$olivedir/build/config.make
- echo 'MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)' >> $srcdir/$olivedir/build/config.make
- echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $srcdir/$olivedir/build/config.make
- echo "MONO_VERSION = $myver" >> $srcdir/$olivedir/build/config.make
- fi
- fi
-
)
libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
EXTRA_DIST = \
abc-removal.txt \
api-style.css \
- assembly-bundle \
check-exports \
check-coverage \
convert.cs \
docs.make \
documented \
embedded-api \
- exceptions \
exdoc \
file-share-modes \
gc-issues \
jit-imt \
jit-thoughts \
jit-trampolines \
- local-regalloc.txt \
- magic.diff \
mini-doc.txt \
mono-api-metadata.html \
mono-file-formats.config\
mono-file-formats.source\
- mono_handle_d \
mono-tools.config \
mono-tools.source \
monoapi.source \
- new-regalloc \
object-layout \
- opcode-decomp.txt \
precise-gc \
produce-lists \
public \
public-api \
README \
- release-notes-1.0.html \
remoting \
ssapre.txt \
- stack-alignment \
stack-overflow.txt \
threading \
toc.xml \
TODO \
- tree-mover.txt \
unmanaged-calls
dist-hook:
+++ /dev/null
-
- HOWTO bundle assemblies inside the mono runtime.
- Paolo Molaro (lupus@ximian.com)
-
-* Intent
-
- Bundling assemblies inside the mono runtime may be useful for a number
- of reasons:
-
- * creating a standalone complete runtime that can be more easily
- distributed
-
- * having an application run against a known set of assemblies
- that has been tested
-
- Of course, there are drawbacks, too: if there has been fixes
- to the assemblies, replacing them means recompiling the
- runtime as well and if there are other mono apps, unless they
- use the same mono binary, there will be less opportunities for
- the operating system to optimize memory usage. So use this
- feature only when really needed.
-
-* Creating the Bundle
-
- To bundle a set of assemblies, you need to create a file that
- lists the assembly names and the relative files. Empty lines
- and lines starting with # are ignored:
-
- == cut cut ==
- # Sample bundle template
- mscorlib: /path/to/mscorlib/assembly.dll
- myapp: /path/to/myapp.exe
- == cut cut ==
-
- Next you need to build the mono runtime using a special configure option:
-
- ./configure --with-bundle=/path/to/bundle/template
-
- The path to the template should be an absolute path.
-
- The script metadata/make-bundle.pl will take the specifie
- assemblies and embed them inside the runtime where the loading
- routines can find them before searching for them on disk.
-
-* Open Issues
-
- There are still two issues to solve:
-
- * config files: sometimes they are needed but they are
- not yet bundled inside the library ()
-
- * building with the included libgc makes it not
- possible to build a mono binary statically linked to
- libmono: this needs to be fixed to make bundles
- really useful.
-
-
catch handler: catch hanlders are always called from the stack unwinding
code. The exception object is passed in a local variable (cfg->exvar).
-
-gcc support for Exceptions
-==========================
-
-gcc supports exceptions in files compiled with the -fexception option. gcc
-generates DWARF exceptions tables in that case, so it is possible to unwind the
-stack. The method to read those exception tables is contained in libgcc.a, and
-in newer versions of glibc (glibc 2.2.5 for example), and it is called
-__frame_state_for(). Another usable glibc function is backtrace_symbols() which
-returns the function name corresponding to a code address.
-
-We dynamically check if those features are available using g_module_symbol(),
-and we use them only when available. If not available we use the LMF as
-fallback.
-
-Using gcc exception information prevents us from saving the LMF at each native
-call, so this is a way to speed up native calls. This is especially valuable
-for internal calls, because we can make sure that all internal calls are
-compiled with -fexceptions (we compile the whole mono runtime with that
-option).
-
-All native function are able to call function without exception tables, and so
-we are unable to restore all caller saved registers if an exception is raised
-in such function. Well, its possible if the previous function already saves all
-registers. So we only omit the the LMF if a function has an exception table
-able to restore all caller saved registers.
-
-One problem is that gcc almost never saves all caller saved registers, because
-it is just unnecessary in normal situations. But there is a trick forcing gcc
-to save all register, we just need to call __builtin_unwind_init() at the
-beginning of a function. That way gcc generates code to save all caller saved
-register on the stack.
-
-
-
-
-
\ No newline at end of file
+++ /dev/null
-
-* Proposal for the local register allocator
-
- The local register allocator deals with allocating registers
- for temporaries inside a single basic block, while the global
- register allocator is concerned with method-wide allocation of
- variables.
- The global register allocator uses callee-saved register for it's
- purpouse so that there is no need to save and restore these registers
- at call sites.
-
- There are a number of issues the local allocator needs to deal with:
- *) some instructions expect operands in specific registers (for example
- the shl instruction on x86, or the call instruction with thiscall
- convention, or the equivalent call instructions on other architectures,
- such as the need to put output registers in %oX on sparc)
- *) some instructions deliver results only in specific registers (for example
- the div instruction on x86, or the call instructionson on almost all
- the architectures).
- *) it needs to know what registers may be clobbered by an instruction
- (such as in a method call)
- *) it should avoid excessive reloads or stores to improve performance
-
- While which specific instructions have limitations is architecture-dependent,
- the problem shold be solved in an arch-independent way to reduce code duplication.
- The register allocator will be 'driven' by the arch-dependent code, but it's
- implementation should be arch-independent.
-
- To improve the current local register allocator, we need to
- keep more state in it than the current setup that only keeps busy/free info.
-
- Possible state information is:
-
- free: the resgister is free to use and it doesn't contain useful info
- freeable: the register contains data loaded from a local (there is
- also info about _which_ local it contains) as a result from previous
- instructions (like, there was a store from the register to the local)
- moveable: it contains live data that is needed in a following instruction, but
- the contents may be moved to a different register
- busy: the register contains live data and it is placed there because
- the following instructions need it exactly in that register
- allocated: the register is used by the global allocator
-
- The local register allocator will have the following interfaces:
-
- int get_register ();
- Searches for a register in the free state. If it doesn't find it,
- searches for a freeable register. Sets the status to moveable.
- Looking for a 'free' register before a freeable one should allow for
- removing a few redundant loads (though I'm still unsure if such
- things should be delegated entirely to the peephole pass).
-
- int get_register_force (int reg);
- Returns 'reg' if it is free or freeable. If it is moveable, it moves it
- to another free or freeable register.
- Sets the status of 'reg' to busy.
-
- void set_register_freeable (int reg);
- Sets the status of 'reg' to freeable.
-
- void set_register_free (int reg);
- Sets the status of 'reg' to free.
-
- void will_clobber (int reg);
- Spills the register to the stack. Sets the status to freeable.
- After the clobbering has occurred, set the status to free.
-
- void register_unspill (int reg);
- Un-spills register reg and sets the status to moveable.
-
- FIXME: how is the 'local' information represented? Maybe a MonoInst* pointer.
-
- Note: the register allocator will insert instructions in the basic block
- during it's operation.
-
-* Examples
-
- Given the tree (on x86 the right argument to shl needs to be in ecx):
-
- store (local1, shl (local1, call (some_arg)))
-
- At the start of the basic block, the registers are set to the free state.
- The sequence of instructions may be:
- instruction register status -> [%eax %ecx %edx]
- start free free free
- eax = load local1 mov free free
- /* call clobbers eax, ecx, edx */
- spill eax free free free
- call mov free free
- /* now eax contains the right operand of the shl */
- mov %eax -> %ecx free busy free
- un-spill mov busy free
- shl %cl, %eax mov free free
-
- The resulting x86 code is:
- mov $fffc(%ebp), %eax
- mov %eax, $fff0(%ebp)
- push some_arg
- call func
- mov %eax, %ecx
- mov $fff0(%ebp), %eax
- shl %cl, %eax
-
- Note that since shl could operate directly on memory, we could have:
-
- push some_arg
- call func
- mov %eax, %ecx
- shl %cl, $fffc(%ebp)
-
- The above example with loading the operand in a register is just to complicate
- the example and show that the algorithm should be able to handle it.
-
- Let's take another example with the this-call call convention (the first argument
- is passed in %ecx).
- In this case, will_clobber() will be called only on %eax and %edx, while %ecx
- will be allocated with get_register_force ().
- Note: when a register is allocated with get_register_force(), it should be set
- to a different state as soon as possible.
-
- store (local1, shl (local1, this-call (local1)))
-
- instruction register status -> [%eax %ecx %edx]
- start free free free
- eax = load local1 mov free free
- /* force load in %ecx */
- ecx = load local1 mov busy free
- spill eax free busy free
- call mov free free
- /* now eax contains the right operand of the shl */
- mov %eax -> %ecx free busy free
- un-spill mov busy free
- shl %cl, %eax mov free free
-
- What happens when a register that we need to allocate with get_register_force ()
- contains an operand for the next instruction?
-
- instruction register status -> [%eax %ecx %edx]
- eax = load local0 mov free free
- ecx = load local1 mov mov free
- get_register_force (ecx) here.
- We have two options:
- mov %ecx, %edx
- or:
- spill %ecx
- The first option is way better (and allows the peephole pass to
- just load the value in %edx directly, instead of loading first to %ecx).
- This doesn't work, though, if the instruction clobbers the %edx register
- (like in a this-call). So, we first need to clobber the registers
- (so the state of %ecx changes to freebale and there is no issue
- with get_register_force ()).
- What if an instruction both clobbers a register and requires it as
- an operand? Lets' take the x86 idiv instruction as an example: it
- requires the dividend in edx:eax and returns the result in eax,
- with the modulus in edx.
-
- store (local1, div (local1, local2))
-
- instruction register status -> [%eax %ecx %edx]
- eax = load local0 mov free free
- will_clobber eax, edx free mov free
- force mov %ecx, %eax busy free free
- set %edx busy free busy
- idiv mov free free
-
- Note: edx is set to free after idiv, because the modulus is not needed
- (if it was a rem, eax would have been freed).
- If we load the divisor before will_clobber(), we'll have to spill
- eax and reload it later. If we load it just after the idiv, there is no issue.
- In any case, the algorithm should give the correct results and allow the operation.
-
- Working recursively on the isntructions there shouldn't be huge issues
- with this algorithm (though, of course, it's not optimal and it may
- introduce excessive spills or register moves). The advantage over the current
- local reg allocator is that:
- 1) the number of spills/moves would be smaller anyway
- 2) a separate peephole pass could be able to eliminate reg moves
- 3) we'll be able to remove the 'forced' spills we currently do with
- the return value of method calls
-
-* Issues
-
- How to best integrate such a reg allocator with the burg stuff.
-
- Think about a call os sparc with two arguments: they got into %o0 and %o1
- and each of them sets the register as busy. But what if the values to put there
- are themselves the result of a call? %o0 is no problem, but for all the
- next argument n the above algorithm would spill all the 0...n-1 registers...
-
-* Papers
-
- More complex solutions to the local register allocator problem:
- http://dimacs.rutgers.edu/TechnicalReports/abstracts/1997/97-33.html
-
- Combining register allocation and instruction scheduling:
- http://citeseer.nj.nec.com/motwani95combining.html
-
- More on LRA euristics:
- http://citeseer.nj.nec.com/liberatore97hardness.html
-
- Linear-time optimal code scheduling for delayedload architectures
- http://www.cs.wisc.edu/~fischer/cs701.f01/inst.sched.ps.gz
-
- Precise Register Allocation for Irregular Architectures
- http://citeseer.nj.nec.com/kong98precise.html
-
- Allocate registers first to subtrees that need more of them.
- http://www.upb.de/cs/ag-kastens/compii/folien/comment401-409.2.pdf
+++ /dev/null
-=pod
-
-=head1 Internal design document for the mono_handle_d
-
-This document is designed to hold the design of the mono_handle_d and
-not as an api reference.
-
-=head2 Primary goal and purpose
-
-The mono_handle_d is a process which takes care of the (de)allocation
-of scratch shared memory and handles (of files, threads, mutexes,
-sockets etc. see L<WapiHandleType>) and refcounts of the
-filehandles. It is designed to be run by a user and to be fast, thus
-minimal error checking on input is done and will most likely crash if
-given a faulty package. No effort has been, or should be, made to have
-the daemon talking to machine of different endianness/size of int.
-
-=head2 How to start the daemon
-
-To start the daemon you either run the mono_handle_d executable or try
-to attach to the shared memory segment via L<_wapi_shm_attach> which
-will start a daemon if one does not exist.
-
-=head1 Internal details
-
-The daemon works by opening a socket and listening to clients. These
-clients send packages over the socket complying to L<struct
-WapiHandleRequest>.
-
-=head2 Possible requests
-
-=over
-
-=item WapiHandleRequest_New
-
-Find a handle in the shared memory segment that is free and allocate
-it to the specified type. To destroy use
-L</WapiHandleRequest_Close>. A L<WapiHandleResponse> with
-.type=WapiHandleResponseType_New will be sent back with .u.new.handle
-set to the handle that was allocated. .u.new.type is the type that was
-requested.
-
-=item WapiHandleRequestType_Open
-
-Increase the ref count of an already created handle. A
-L<WapiHandleResponse> with .type=WapiHandleResponseType_Open will be sent
-back with .u.new.handle set to the handle, .u.new.type is set to the
-type of handle this is.
-
-=item WapiHandleRequestType_Close
-
-Decrease the ref count of an already created handle. A
-L<WapiHandleResponse> with .type=WapiHandleResponseType_Close will be
-sent back with .u.close.destroy set to TRUE if ref count for this
-client reached 0.
-
-=item WapiHandleRequestType_Scratch
-
-Allocate a shared memory area of size .u.scratch.length in bytes. A
-L<WapiHandleResponse> with .type=WapiHandleResponseType_Scratch will be
-sent back with .u.scratch.idx set to the index into the shared
-memory's scratch area where to memory begins. (works just like
-malloc(3))
-
-=item WapiHandleRequestType_Scratch
-
-Deallocate a shared memory area, this must have been allocated before
-deallocating. A L<WapiHandleResponse> with
-.type=WapiHandleResponseType_ScratchFree will be sent back (works just
-like free(3))
-
-=back
-
-=head1 Why a daemon
-
-From an email:
-
-Dennis: I just have one question about the daemon... Why does it
-exist? Isn't it better performancewise to just protect the shared area
-with a mutex when allocation a new handle/shared mem segment or
-changing refcnt? It will however be a less resilient to clients that
-crash (the deamon cleans up ref'd handles if socket closes)
-
-Dick: It's precisely because with a mutex the shared memory segment
-can be left in a locked state. Also, it's not so easy to clean up
-shared memory without it (you can't just mark it deleted when creating
-it, because you can't attach any more readers to the same segment
-after that). I did some minimal performance testing, and I don't
-think the daemon is particularly slow.
-
-
-=head1 Authors
-
-Documentaion: Dennis Haney
-
-Implementation: Dick Porter
-
-=cut
+++ /dev/null
-We need to switch to a new register allocator.
-The current one is split in a global and a local register allocator.
-The global one can assign only callee-saves registers and happens
-on the tree-based internal representation: it assigns local variables
-to hardware registers.
-The local one happens on the linear representation on a per basic
-block basis and assigns hard registers to virtual registers (which
-hold temporary values during expression executions) and it deals also
-with the platform-specific issues (fixed registers, call conventions).
-
-Moving to a different register will help solve some of the performance
-issues introduced by the above split, make the register more easily
-portable and solve some of the issues generated by dealing with trees.
-
-The general design ideas are below.
-
-The new allocator should have a global view of all the method, so it can be
-able to assign variables also to some of the volatile registers if possible,
-even across basic blocks (this would improve performance).
-
-The allocator would be driven by per-arch declarative data, so porting
-should be easier: an architecture needs to specify register classes,
-call convention and instructions requirements (similar to the gcc code).
-
-The allocator should operate on the linear representation, this way it's
-easier and faster to track usages more correctly. We need to assign virtual
-registers on a per-method basis instead of per basic block. We can assign
-virtual registers to variables, too. Note that since we fix the stack offset
-of local vars only after this step (which happens after the burg rules are run),
-some of the burg rules that try to optimize the code won't apply anymore:
-the peephole code may need to be enhanced to do the optimizations instead.
-
-We need to handle floating point registers in the global allocator, too.
-
-The new allocator also needs to keep track precisely of which registers
-contain references or managed pointers to allow us to move to a precise GC.
-
-It may be worth to use a single increasing set of integers for the virtual
-registers, with the class of the register stored separately (unless the
-current local allocator which keeps interger and fp registers separate).
-
-Since this is a large task, we need to do it in steps as much as possible.
-The first is to run the register allocator _after_ the burg rules: this
-requires a rewrite of the liveness code, too, to use linear indexes instead
-of basic-block/tree number combinations. This can be done by:
-*) allocating virtual regs to all the locals that can be register allocated
-*) running the burg rules (some may require adjustments): the local virtual
-registers are assigned starting from global-virt-regs+1, instead of the current
-hardware-regs+1, so we can tell apart global and local virt regs.
-*) running the liveness/whatever code is needed to allocate the global registers
-*) allocate the rest of the local variables to stack slots
-*) continue with the current local allocator
-
-This work could take 2-3 weeks.
-
-The next step is to define the kind of declarative data an architecture needs
-and assigning virtual regs to all the registers and making the allocator
-assign from the volatile registers, too.
-Note that some of the code that is currently emitted in the arch-specific
-code, will need to be emitted as instructions that the reg allocator
-can inspect: think of a method that returns the first argument which is
-received in a register: the current code copies it to either a local slot or
-to a global reg in the prolog an copies it back to the return register
-int he basic block, but since neither the regallocator nor the peephole code
-knows about the prolog code, the first store cannot be optimized away.
-The gcc code has some example of how to specify register classes in a
-declarative way.
-
+++ /dev/null
-
-* How to handle complex IL opcodes in an arch-independent way
-
- Many IL opcodes are very simple: add, ldind etc.
- Such opcodes can be implemented with a single cpu instruction
- in most architectures (on some, a group of IL instructions
- can be converted to a single cpu op).
- There are many IL opcodes, though, that are more complex, but
- can be expressed as a series of trees or a single tree of
- simple operations. Such simple operations are architecture-independent.
- It makes sense to decompose such complex IL instructions in their
- simpler equivalent so that we gain in several ways:
- *) porting effort is easier, because only the simple instructions
- need to be implemented in arch-specific code
- *) we could apply BURG rules to the trees and do pattern matching
- on them to optimize the expressions according to the host cpu
-
- The issue is: where do we do such conversion from coarse opcodes to
- simple expressions?
-
-* Doing the conversion in method_to_ir ()
-
- Some of these conversions can certainly be done in method_to_ir (),
- but it's not always easy to decide which are better done there and
- which in a different pass.
- For example, let's take ldlen: in the mono implementation, ldlen
- can be simply implemented with a load from a fixed position in the
- array object:
-
- len = [reg + maxlen_offset]
-
- However, ldlen carries also semantics information: the result is the
- length of the array, and since in the CLR arrays are of fixed size,
- this information can be useful to later do bounds check removal.
- If we convert this opcode in method_to_ir () we lost some useful
- information for further optimizations.
-
- In some other ways, decomposing an opcode in method_to_ir() may
- allow for better optimizations later on (need to come up with an
- example here ...).
-
-* Doing the conversion in inssel.brg
-
- Some conversion may be done inside the burg rules: this has the
- disadvantage that the instruction selector is not run again on
- the resulting expression tree and we could miss some optimization
- (this is what effectively happens with the coarse opcodes in the old
- jit). This may also interfere with an efficient local register allocator.
- It may be possible to add an extension in monoburg that allows a rule
- such as:
-
- recheck: LDLEN (reg) {
- create an expression tree representing LDLEN
- and return it
- }
-
- When the monoburg label process gets back a recheck, it will run
- the labeling again on the resulting expression tree.
- If this is possible at all (and in an efficient way) is a
- question for dietmar:-)
- It should be noted, though, that this may not always work, since
- some complex IL opcodes may require a series of expression trees
- and handling such cases in monoburg could become quite hairy.
- For example, think of opcode that need to do multiple actions on the
- same object: this basically means a DUP...
- On the other end, if a complex opcode needs a DUP, monoburg doesn't
- actually need to create trees if it emits the instructions in
- the correct sequence and maintains the right values in the registers
- (usually the values that need a DUP are not changed...). How
- this integrates with the current register allocator is not clear, since
- that assigns registers based on the rule, but the instructions emitted
- by the rules may be different (this already happens with the current JIT
- where a MULT is replaced with lea etc...).
-
-* Doing it in a separate pass.
-
- Doing the conversion in a separate pass over the instructions
- is another alternative. This can be done right after method_to_ir ()
- or after the SSA pass (since the IR after the SSA pass should look
- almost like the IR we get back from method_to_ir ()).
-
- This has the following advantages:
- *) monoburg will handle only the simple opcodes (makes porting easier)
- *) the instruction selection will be run on all the additional trees
- *) it's easier to support coarse opcodes that produce multiple expression
- trees (and apply the monoburg selector on all of them)
- *) the SSA optimizer will see the original opcodes and will be able to use
- the semantic info associated with them
-
- The disadvantage is that this is a separate pass on the code and
- it takes time (how much has not been measured yet, though).
-
- With this approach, we may also be able to have C implementations
- of some of the opcodes: this pass would insert a function call to
- the C implementation (for example in the cases when first porting
- to a new arch and implemenating some stuff may be too hard in asm).
-
-* Extended basic blocks
-
- IL code needs a lot of checks, bounds checks, overflow checks,
- type checks and so on. This potentially increases by a lot
- the number of basic blocks in a control flow graph. However,
- all such blocks end up with a throw opcode that gives control to the
- exception handling mechanism.
- After method_to_ir () a MonoBasicBlock can be considered a sort
- of extended basic block where the additional exits don't point
- to basic blocks in the same procedure (at least when the method
- doesn't have exception tables).
- We need to make sure the passes following method_to_ir () can cope
- with such kinds of extended basic blocks (especially the passes
- that we need to apply to all the methods: as a start, we could
- skip SSA optimizations for methods with exception clauses...)
-
+++ /dev/null
-With this change, we bundle Reactive Extensions from Microsoft.
-
-Steps to do:
-
-- Until we add submodule, check out Rx sources from http://rx.codeplex.com:
-
- $ cd external
- $ git clone git://github.com/atsushieno/rx.git
- $ cd rx
- $ git checkout rx-oss-v1.0
- $ cd ../..
-
- Note that the original repo at rx.codeplex.com will *fail* on Linux!
- codeplex.codeplex.com/workitem/26133
- Also note that rx.codeplex.com is huge and takes very long time to checkout.
-
-- expand rx-mono-changes-3.tar.bz2
-
- $ tar jxvf rx-mono-changes-3.tar.bz2
-
-- Apply changes to mcs/class/Makefile:
-
- $ cd mcs/class
- $ patch -i add-rx-libs.patch -p3
- $ cd ../..
-
-Then it should be done.
-
-Note that this does not include Mono.Reactive.Testing into the build yet -
-this library depends on nunit.framework.dll but it wouldn't be built before
-this assembly is built. This needs to be resolved.
-
-** Current Status
-
-- We don't have Microsoft.Reactive.Testing.dll. Instead, I created an
- alternative Mono.Reactive.Testing.dll which *mostly* uses MS sources for
- that assembly but uses NUnit.Framework instead.
-
- To make it happen, I added a small script that automatically replaces
- MSTest dependency parts with that for NUnit (replacer.sh under rx tree).
-
- (We'll also have to rename namespaces and have more source changes, but
- so far it is to get things runnable.)
-
-- To check the build sanity, I imported unit tests (as explained above)
- and it is supposed to run by "make run-test" in Mono.Reactive.Testing
- directory (the tests were all in one place in MS tests, so I made it
- in Mono.Reactive.Testing directory instead).
-
+++ /dev/null
-<h1>Mono 1.0 Release Notes</h1>
-
-<h2>What does Mono Include</h2>
-
-<h2>Missing functionality</h2>
-
- <p>COM support.
-
- <p>EnterpriseServices are non-existant.
-
- <p>Windows.Forms is only available as a preview, it is not
- completed nor stable.
-
-<h3>Assembly: System.Drawing</h3>
-
- <p>System.Drawing.Printing is not supported.
\ No newline at end of file
+++ /dev/null
-Size and alignment requirements of stack values
-===============================================
-
-P ... System.IntPtr
-I1 ... System.Int8
-I2 ... System.Int16
-I4 ... System.Int32
-I8 ... System.Int64
-F ... System.Single
-D ... System.Double
-LD ... native long double
-
------------------------------------------------------------
-ARCH | P | I1 | I2 | I4 | I8 | F | D | LD |
------------------------------------------------------------
-X86 | 4/4 | 4/4 | 4/4 | 4/4 | 8/4 | 4/4 | 8/4 |12/4 |
------------------------------------------------------------
-X86/W32 | 4/4 | 4/4 | 4/4 | 4/4 | 8/4 | 4/4 | 8/4 |12/4 |
------------------------------------------------------------
-ARM | 4/4 | 4/4 | 4/4 | 4/4 | 8/4 | 4/4 | 8/4 | 8/4 |
------------------------------------------------------------
-M68K | 4/4 | 4/4 | 4/4 | 4/4 | 8/4 | 4/4 | 8/4 |12/4 |
------------------------------------------------------------
-ALPHA | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 |
------------------------------------------------------------
-SPARC | 4/4 | 4/4 | 4/4 | 4/4 | 8/8 | 4/4 | 8/8 |16/8 |
------------------------------------------------------------
-SPARC64 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 |16/16|
------------------------------------------------------------
-MIPS | 4/4 | 4/4 | 4/4 | 4/4 | ?/? | 4/4 | 8/8 | 8/8 |
------------------------------------------------------------
- | | | | | | | | |
------------------------------------------------------------
+++ /dev/null
-
-Purpose
-
-Especially when inlining is active, it can happen that temporary
-variables add pressure to the register allocator, producing bad
-code.
-
-The idea is that some of these temporaries can be totally eliminated
-my moving the MonoInst tree that defines them directly to the use
-point in the code (so the name "tree mover").
-
-Please note that this is *not* an optimization: it is mostly a
-workaround to issues we have in the regalloc.
-Actually, with the new linear IR this will not be possible at all
-(there will be no more trees in the code!).
-Anyway, this workaround turns out to be useful in the current state
-of things...
-
------------------------------------------------------------------------
-
-Base logic
-
-If a local is defined by a value which is a proper expression (a tree
-of MonoInst, not just another local or a constant), and this definition
-is used only once, the tree can be moved directly to the use location,
-and the definition eliminated.
-Of course, none of the variables used in the tree must be defined in
-the code path between the definition and the use, and the tree must be
-free of side effects.
-We do not handle the cases when the tree is just a local or a constant
-because they are handled by copyprop and consprop, respectively.
-
-To make things simpler, we restrict the tree move to the case when:
-- the definition and the use are in the same BB, and
-- the use is followed by another definition in the same BB (it is not
- possible that the 1st value is used again), or alternatively there
- is no BB in the whole CFG that contains a use of this local before a
- definition (so, again, there is no code path that can lead to a
- subsequent use).
-
-To handle this, we maintain an ACT array (Available Copy Tree, similar
-to the ACP), where we store the "state" of every local.
-Ideally, every local can be in the following state:
-[E] Undefined (by a tree, it could be in the ACP but we don't care).
-[D] Defined (by a tree), and waiting for a use.
-[U] Used, with a tree definition available in the same BB, but still
- without a definition following the use (always in the same BB).
-Of course state [E] (empty) is the initial one.
-
-Besides, there are two sort of "meta states", or flags:
-[W] Still waiting for a use or definition in this BB (we have seen no
- occurrence of the local yet).
-[X] Used without being previously defined in the same BB (note that if
- there is a definition that precedes the use in the same BB, even if
- the definition is not a tree or is not available because of side
- effects or because the tree value has changed the local is not in
- state [X]).
-Also note that state [X] is a sort of "global" condition, which if set
-in one BB will stay valid for the whole CFG, even if the local will
-otherwise change state. The idea of flagging a local as [X] is that if
-there is a definition/use pair that reaches the end of a BB, it could
-be that there is a CFG path that then leads to the BB flagging it as
-[X] (which contains a use), so the tree cannot be moved.
-So state [X] will always be set, and never examined in all the state
-transitions we will describe.
-In practice, we use flag [W] to set state [X]: if, when traversing a
-BB, we find a use for a local in state [W], then that local is flagged
-[X].
-
-
-For each BB, we initialize all states to [E] and [W], and then we
-traverse the code one inst at a time, and update the variable states
-in the ACT in the following ways:
-
-[Definition]
- - Flag [W] is cleared.
- - All "affected trees" are killed (go from state [D] to [E]).
- The "affected trees" are the trees which contain (use) the defined
- local, and the rationale is that the tree value changed, so the
- tree is no longer available.
- - If the local was in state [U], *that* tree move is marked "safe"
- (because *this* definition makes us sure that the previous tree
- cannot be used again in any way).
- The idea is that "safe" moves can happen even if the local is
- flagged [X], because the second definition "covers" the use.
- The tree move is then saved in the "todo" list (and the affecting
- nodes are cleared).
- - If the local was defined by a tree, it goes to state [D], the tree
- is recorded, and all the locals used in it are marked as "affecting
- this tree" (of course these markers are lists, because each local
- could affect more than one tree).
-
-[IndirectDefinition]
- - All potentially affected trees (in state [D]) are killed.
-
-[Use]
- - If the local is still [W], it is flagged [X] (the [W] goes away).
- - If the local is in state [D], it goes to state [U].
- The tree move must not yet be recorded in the "todo" list, it still
- stays in the ACT slot belonging to this local.
- Anyway, the "affecting" nodes are updated, because now a definition
- of a local used in this tree will affect only "indirect" (or also
- "propagated") moves, but not *this* move (see below).
- - If the local is in state [U], then the tree cannot be moved (it is
- used two times): the move is canceled, and the state goes [E].
- - If the local is in state [E], the use is ignored.
-
-[IndirectUse]
- - All potentially affected trees (in state [D] or [U]) are killed.
-
-[SideEffect]
- - Tree is marked as "unmovable".
-
-Then, at the end of the BB, for each ACT slot:
- - If state is [U], the tree move is recorded in the "todo" list, but
- flagged "unsafe".
- - Anyway, state goes to [E], the [W] flag is set, and all "affecting"
- lists are cleared (we get ready to traverse the next BB).
-Finally, when all BBs has been scanned, we traverse the "todo" list,
-moving all "safe" entries, and moving "unsafe" ones only if their ACT
-slot is not flagged [X].
-
-So far, so good.
-But there are two issues that make things harder :-(
-
-The first is the concept of "indirect tree move".
-It can happen that a tree is scheduled for moving, and its destination
-is a use that is located in a second tree, which could also be moved.
-The main issue is that a definition of a variable of the 1st tree on
-the path between the definition and the use of the 2nd one must prevent
-the move.
-But which move? The 1st or the 2nd?
-Well, any of the two!
-The point is, the 2nd move must be prevented *only* if the 1st one
-happens: if it is aborted (for an [X] flag or any other reason), the
-2nd move is OK, and vice versa...
-We must handle this in the following way:
-- The ACT must still remember if a slot is scheduled for moving in
- this BB, and if it is, all the locals used in the tree.
- We say that the slot is in state [M].
- Note that [M] is (like [X] and [W]) a sort of "meta state": a local
- is flagged [M] when it goes to state [U], and the flag is cleared
- when the tree move is cancelled
-- A tree that uses a local whose slot is in state [M] is also using all
- the locals used by the tree in state [M], but the use is "indirect".
- These use nodes are also included in the "affecting" lists.
-- The definition of a variable used in an "indirect" way has the
- effect of "linking" the two involved tree moves, saying that only one
- of the two can happen in practice, but not both.
-- When the 2nd tree is scheduled for moving, the 1st one is *still* in
- state [M], because a third move could "carry it forward", and all the
- *three* moves should be mutually exclusive (to be safe!).
-
-The second tricky complication is the "tree forwarding" that can happen
-when copyprop is involved.
-It is conceptually similar to the "indirect tree move".
-Only, the 2nd tree is not really a tree, it is just the local defined
-in the 1st tree move.
-It can happen that copyprop will propagate the definition.
-We cannot make treeprop do the same job of copyprop, because copyprop
-has less constraints, and is therefore more powerful in its scope.
-The main issue is that treeprop cannot propagate a tree to *two* uses,
-while copyprop is perfectly capable of propagating one definition to
-two (or more) different places.
-So we must let copyprop do its job otherwise we'll miss optimizations,
-but we must also make it play safe with treeprop.
-Let's clarify with an example:
- a = v1 + v2; //a is defined by a tree, state [D], uses v2 and v2
- b = a; //a is used, state [U] with move scheduled, and
- //b is defined by a, ACP[b] is a, and b is in state [DC]
- c = b + v3; // b is used, goes to state [U]
-The real trouble is that copyprop happens *immediately*, while treeprop
-is deferred to the end of the CFG traversal.
-So, in the 3rd statement, the "b" is immediately turned into an "a" by
-copyprop, regardless of what treeprop will do.
-Anyway, if we are careful, this is not so bad.
-First of all, we must "accept" the fact that in the 3rd statement the
-"b" is in fact an "a", as treeprop must happen *after* copyprop.
-The real problem is that "a" is used twice: in the 2nd and 3rd lines.
-In our usual setup, the 2nd line would set it to [U], and the 3rd line
-would kill the move (and set "a" to [E]).
-I have tried to play tricks, and reason as of copyprop didn't happen,
-but everything becomes really messy.
-Instead, we should note that the 2nd line is very likely to be dead.
-At least in this BB, copyprop will turn all "b"s into "a"s as long as
-it can, and when it cannot, it will be because either "a" or "b" have
-been redefined, which would be after the tree move anyway.
-So, the reasoning gets different: let's pretend that "b" will be dead.
-This will make the "a" use in the 2nd statement useless, so there we
-can "reset" "a" to [D], but also take note that if "b" will end up
-not being dead, the tree move associated to this [D] must be aborted.
-We can detect this in the following way:
-- Either "b" is used before being defined in this BB, or
-- It will be flagged "unsafe".
-Both things are very easy to check.
-The only quirk is that the "affecting" lists must not be cleared when
-a slot goes to state [U], because a "propagation" could put it back
-to state [D] (where those lists are needed, because it can be killed
-by a definition to a used slot).
-
------------------------------------------------------------------------
-
-Implementation notes
-
-All the implementation runs inside the existing mono_local_cprop
-function, and a separate memory pool is used to hold the temporary
-data.
-
-A struct, MonoTreeMover, contains the pointers to the pool, the ACT,
-the list of scheduled moves and auxiliary things.
-This struct is allocated if the tree move pass is requested, and is
-then passed along to all the involved functions, which are therefore
-aware of the tree mover state.
-
-The ACT is an array of slots, obviously one per local.
-Each slot is of type MonoTreeMoverActSlot, and contains the used and
-affected locals, a pointer to the pending tree move and the "waiting"
-and "unsafe" flags.
-
-The "affecting" lists a built from "dependency nodes", of type
-MonoTreeMoverDependencyNode.
-Each of the nodes contains the used and affected local, and is in
-two lists: the locals used by a slot, and the locals affected by a
-slot (obviously a different one).
-So, each node means: "variable x is used in tree t, so a definition
-of x affects tree t".
-The "affecting" lists are doubly linked, to allow for O(1) deletion.
-The "used" lists are simply linked, but when they are mantained there
-is always a pointer to the last element to allow for O(1) list moving.
-When a used list is dismissed (which happens often, any time a node is
-killed), its nodes are unlinked from their respective affecting lists
-and are then put in a "free" list in the MonoTreeMover to be reused.
-
-Each tree move is represented by a struct (MonoTreeMoverTreeMove),
-which contains:
-- the definition and use points,
-- the "affected" moves (recall the concept of "indirect tree move"),
-- the "must be dead" slots (recall "tree forwarding"). and
-- a few utility flags.
-The tree moves stays in the relevant ACT slot until it is ready to be
-scheduled for moving, at which point it is put in a list in the
-MonoTreeMover.
-The tree moves structs are reused when they are killed, so there is
-also a "free" list for them in the MonoTreeMover.
-
-The tree mover code has been added to all the relevant functions that
-participate in consprop and copyprop, particularly:
-- mono_cprop_copy_values takes care of variable uses (transitions from
- states [D] to [U] and [U] to [E] because of killing),
-- mono_cprop_invalidate_values takes care of side effects (indirect
- accesses, calls...),
-- mono_local_cprop_bb sets up and cleans the traversals for each BB,
- and for each MonoInst it takes care of variable definitions.
-To each of them has been added a MonoTreeMover parameter, which is not
-NULL if the tree mover is running.
-After mono_local_cprop_bb has run for all BBs, the MonoTreeMover has
-the list of all the pending moves, which must be walked to actually
-perform the moves (when possible, because "unsafe" flags, "affected"
-moves and "must be dead" slots can still have their effects, which
-must be handled now because they are fully known only at the end of
-the CFG traversal).
-Subproject commit 4abf9a74bd9a807380ba8f55a73b322625e15565
+Subproject commit 7120b21603354fced392a43ab7c581d0114fecac
-Subproject commit d589df6e8a206e28b84304a75917006a0e076c29
+Subproject commit 061a13cc772ef15f4d5528eb84fea4d51d4bda1d
-Subproject commit 3176b17a2c636dfd5f885435f8449598ecd4197f
+Subproject commit 47a27ffa170d7ebdef2a5723682da6a5379b2b66
available on a typical dotnet framework installation, notice that this
does not include all of the Mono libraries, only the System.* ones. This
is a convenient shortcut for those porting code.
-.TP
-.I \-pkg:olive
-Use this to reference the "Olive" libraries (the 3.0 and 3.5 extended
-libraries).
-.TP
-.I \-pkg:silver
-References the assemblies for creating Moonlight/Silverlight
-applications.
-.TP
-.I \-pkg:silverdesktop
-Use this option to create Moonlight/Silverlight applications that
-target the desktop. This option allows developers to consume the
-Silverlight APIs with the full 2.0 profile API available to them,
-unlike
-.I smcs
-it gives full access to all the APIs that are part of Mono. The only
-downside is that applications created with silverdesktop will not run
-on the browser. Typically these applications will be launched
-with the
-.I mopen
-command line tool.
-.TP
-For more details see the PACKAGE section in this document
.ne
.RE
.TP
.TP
\fB(no-)lazy-sweep\fR
Enables or disables lazy sweep for the Mark&Sweep collector. If
-enabled, the sweep phase of the garbage collection is done piecemeal
-whenever the need arises, typically during nursery collections. Lazy
-sweeping is enabled by default.
+enabled, the sweeping of individual major heap blocks is done
+piecemeal whenever the need arises, typically during nursery
+collections. Lazy sweeping is enabled by default.
+.TP
+\fB(no-)concurrent-sweep\fR
+Enables or disables concurrent sweep for the Mark&Sweep collector. If
+enabled, the iteration of all major blocks to determine which ones can
+be freed and which ones have to be kept and swept, is done
+concurrently with the running program. Concurrent sweeping is enabled
+by default.
.TP
\fBstack-mark=\fImark-mode\fR
Specifies how application threads should be scanned. Options are
.Sp
The default is "win32".
.TP
+\fBMONO_THREAPOOL\fR
+This environment variable can be used to choose the implementation of
+the ThreadPool used at runtime. By default this uses the long term
+Mono threadpool implementation. But a new "microsoft" value switches
+the threadpool implementation to Microsoft's CoreCLR/ReferenceSource implementation.
+.TP
\fBMONO_TLS_SESSION_CACHE_TIMEOUT\fR
The time, in seconds, that the SSL/TLS session cache will keep it's entry to
avoid a new negotiation between the client and a server. Negotiation are very
xammac_SUBDIRS := build class
mobile_SUBDIRS := build class
mobile_static_SUBDIRS := build class
-net_4_0_SUBDIRS := build class
+binary_reference_assemblies_SUBDIRS := build class
net_4_5_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
xbuild_12_SUBDIRS := build class tools/xbuild
xbuild_14_SUBDIRS := build class tools/xbuild
# fun specialty targets
-PROFILES = net_4_5 net_4_0 xbuild_12 xbuild_14
+PROFILES = net_4_5 binary_reference_assemblies xbuild_12 xbuild_14
.PHONY: all-profiles $(STD_TARGETS:=-profiles)
all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--%
_boot_ = all clean install
$(_boot_:%=profile-do--xbuild_14--%): profile-do--xbuild_14--%: profile-do--net_4_5--%
$(_boot_:%=profile-do--xbuild_12--%): profile-do--xbuild_12--%: profile-do--net_4_5--%
-$(_boot_:%=profile-do--net_4_0--%): profile-do--net_4_0--%: profile-do--build--%
+$(_boot_:%=profile-do--binary_reference_assemblies--%): profile-do--binary_reference_assemblies--%: profile-do--build--%
$(_boot_:%=profile-do--net_4_5--%): profile-do--net_4_5--%: profile-do--build--%
$(_boot_:%=profile-do--monodroid--%): profile-do--monodroid--%: profile-do--build--%
$(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--build--%
PROFILES = \
basic \
build \
- net_4_0 \
+ binary_reference_assemblies \
net_4_5 \
xbuild_12 \
xbuild_14
internal const string System = "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
public const string EcmaPublicKey = "b77a5c561934e089";
+#if NET_2_1
+ public const string FrameworkPublicKeyFull = "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
+ public const string FrameworkPublicKeyFull2 = "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB";
+#else
+ public const string FrameworkPublicKeyFull = "00000000000000000400000000000000";
+ public const string FrameworkPublicKeyFull2 = "00000000000000000400000000000000";
+#endif
public const string MicrosoftPublicKey = "b03f5f7f11d50a3a";
public const string MicrosoftJScript = Consts.AssemblyMicrosoft_JScript;
--- /dev/null
+# -*- makefile -*-
+
+profile-check:
+ @:
+
+NO_BUILD = yes
+NO_TEST = yes
+++ /dev/null
-# -*- makefile -*-
-
-profile-check:
- @:
-
-FRAMEWORK_VERSION = 4.0
-XBUILD_VERSION = 4.0
-
-LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
-
-NO_BUILD = yes
-NO_TEST = yes
Mono.Security \
System \
I18N \
+ System.ServiceModel.Internals \
+ SMDiagnostics \
System.Runtime.Serialization \
System.Xml.Linq \
System.ServiceModel \
System.Web.Services \
Mono.Data.Tds \
System.Transactions \
+ System.Numerics \
System.Data \
Mono.Cairo \
Mono.Data.Sqlite \
- System.Numerics \
System.Data.Services.Client \
System.IO.Compression \
System.IO.Compression.FileSystem \
System.Transactions \
System.EnterpriseServices \
Mono.Data.Tds \
+ System.Numerics \
System.Data \
System.ComponentModel.DataAnnotations \
Accessibility \
System.IO.Compression.FileSystem \
System.Windows \
System.Xml.Serialization \
- System.Numerics \
Novell.Directory.Ldap \
System.DirectoryServices \
System.DirectoryServices.Protocols \
mobile_static_SUBDIRS := $(mobile_static_dirs)
mobile_SUBDIRS := $(mobile_dynamic_dirs)
xammac_SUBDIRS := $(xammac_dirs)
-net_4_0_SUBDIRS := reference-assemblies
+binary_reference_assemblies_SUBDIRS := reference-assemblies
net_4_5_SUBDIRS := $(net_4_5_dirs) $(xbuild_4_0_dirs)
net_4_5_PARALLEL_SUBDIRS := $(net_4_5_parallel_dirs) aot-compiler
xbuild_12_SUBDIRS := $(xbuild_4_0_dirs)
doc/TemplateTest.cs \
notes/BitVecto32.txt \
MicrosoftAjaxLibrary/License.htm \
+ test-helpers/NetworkHelpers.cs \
$(monolite_files)
.PHONY: all-local $(STD_TARGETS:=-local)
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{BF8AC1F8-37FC-49D4-BC64-A4481523212D}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699</NoWarn>\r
- <OutputPath>./../../class/lib/net_3_5</OutputPath>\r
- <NoStdLib>True</NoStdLib>\r
- <NoConfig>True</NoConfig>\r
- \r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Microsoft.Build.Tasks.v3.5</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5</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</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_1_1;NET_2_0;NET_3_5</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
- <Compile Include="..\..\tools\xbuild\XBuildConsts.cs" />\r
- <Compile Include="..\Microsoft.Build.Engine\Microsoft.Build.BuildEngine\DirectoryScanner.cs" />\r
- <Compile Include="..\Microsoft.Build.Engine\Microsoft.Build.BuildEngine\UnknownToolsVersionException.cs" />\r
- <Compile Include="..\Microsoft.Build.Utilities\Mono.XBuild.Utilities\MSBuildUtils.cs" />\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\BootstrapperBuilder.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\BuildMessage.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\BuildMessageSeverity.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\BuildResults.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\BuildSettings.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\ComponentsLocation.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\IBootstrapperBuilder.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\IBuildMessage.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\IBuildResults.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\IBuildSettings.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\IProduct.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\IProductBuilder.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\IProductBuilderCollection.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\IProductCollection.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\Product.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\ProductBuilder.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\ProductBuilderCollection.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.Bootstrapper\ProductCollection.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\ApplicationIdentity.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\ApplicationManifest.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\AssemblyIdentity.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\AssemblyManifest.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\AssemblyReference.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\AssemblyReferenceCollection.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\AssemblyReferenceType.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\BaseReference.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\ComClass.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\DeployManifest.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\FileReference.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\FileReferenceCollection.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\Manifest.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\ManifestReader.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\ManifestWriter.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\OutputMessage.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\OutputMessageCollection.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\OutputMessageType.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\ProxyStub.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\SecurityUtilities.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\TrustInfo.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\TypeLib.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\UpdateMode.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\UpdateUnit.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Deployment.ManifestUtilities\WindowClass.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Hosting\ICscHostObject.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Hosting\ICscHostObject4.cs" />\r
- <Compile Include="Microsoft.Build.Tasks.Hosting\IVbcHostObject.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\AL.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\AppDomainIsolatedTaskExtension.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\AspNetCompiler.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\AssemblyResolver.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\AssignCulture.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\AssignLinkMetadata.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\AssignProjectConfiguration.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\AssignTargetPath.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\CallTarget.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\CombinePath.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\CommandLineBuilderExtension.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\Copy.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\CreateCSharpManifestResourceName.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\CreateItem.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\CreateManifestResourceName.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\CreateProperty.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\CreateTemporaryVCProject.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\CreateVisualBasicManifestResourceName.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\Csc.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\Delete.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\Error.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\Exec.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\ExtractedClassName.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\FindAppConfigFile.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\FindUnderPath.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\FormatUrl.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\FormatVersion.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\GenerateApplicationManifest.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\GenerateBootstrapper.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\GenerateDeploymentManifest.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\GenerateManifestBase.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\GenerateResource.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\GenerateTrustInfo.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\GetAssemblyIdentity.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\GetFrameworkPath.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\GetFrameworkSdkPath.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\GetReferenceAssemblyPaths.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\LC.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\MakeDir.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\ManagedCompiler.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\Message.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\MSBuild.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\ReadLinesFromFile.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\RegisterAssembly.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\RemoveDir.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\RemoveDuplicates.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\ResolveAssemblyReference.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\ResolvedReference.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\ResolveManifestFiles.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\ResolveProjectBase.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\SGen.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\SignFile.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\TaskExtension.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\TaskLoggingHelperExtension.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\ToolTaskExtension.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\Touch.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\UnregisterAssembly.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\UpdateManifest.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\Vbc.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\VCBuild.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\Warning.cs" />\r
- <Compile Include="Microsoft.Build.Tasks\WriteLinesToFile.cs" />\r
- <Compile Include="Mono.XBuild.Tasks.GenerateResourceInternal\PoResourceReader.cs" />\r
- <Compile Include="Mono.XBuild.Tasks.GenerateResourceInternal\PoResourceWriter.cs" />\r
- <Compile Include="Mono.XBuild.Tasks.GenerateResourceInternal\TxtResourceReader.cs" />\r
- <Compile Include="Mono.XBuild.Tasks.GenerateResourceInternal\TxtResourceWriter.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent>\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
-
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\corlib\corlib-net_2_0.csproj">\r
- <Project>{5A00133C-6D08-48F7-A164-8B796CE6DB83}</Project>\r
- <Name>corlib\corlib-net_2_0</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\System\System-net_2_0-2.csproj">\r
- <Project>{1F3B168C-A4D0-44AA-B116-792D8804971F}</Project>\r
- <Name>System\System-net_2_0-2</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\System.Core\System.Core-net_2_0.csproj">\r
- <Project>{FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E}</Project>\r
- <Name>System.Core\System.Core-net_2_0</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\System.XML\System.Xml-net_2_0-1.csproj">\r
- <Project>{080698DE-8AF0-496E-9AD7-58B6C605328A}</Project>\r
- <Name>System.XML\System.Xml-net_2_0-1</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\System.Windows.Forms\System.Windows.Forms-net_2_0.csproj">\r
- <Project>{EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630}</Project>\r
- <Name>System.Windows.Forms\System.Windows.Forms-net_2_0</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_3_5.csproj">\r
- <Project>{C3F8A358-9DA1-423C-8466-58AB30893EB0}</Project>\r
- <Name>Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_3_5</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Framework\Microsoft.Build.Framework-net_3_5.csproj">\r
- <Project>{88FC8C2C-9157-41EB-A47C-981B2205ED7E}</Project>\r
- <Name>Microsoft.Build.Framework\Microsoft.Build.Framework-net_3_5</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Engine\Microsoft.Build.Engine-net_3_5.csproj">\r
- <Project>{9DEA0C0A-BF6D-4C05-B3C5-1429F70A6FF5}</Project>\r
- <Name>Microsoft.Build.Engine\Microsoft.Build.Engine-net_3_5</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_3_5.csproj">\r
- <Project>{A5EB5B9E-9335-43AD-A9C7-41FDF9A52045}</Project>\r
- <Name>Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_3_5</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{9F28ECCF-DED4-4082-AF73-9360557BD741}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699</NoWarn>\r
- <OutputPath>bin\Debug\Microsoft.Build.Tasks-tests-net_3_5</OutputPath>\r
- <NoStdLib>True</NoStdLib>\r
- <NoConfig>False</NoConfig>\r
- \r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Microsoft.Build.Tasks_test_net_3_5</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5</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</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_1_1;NET_2_0;NET_3_5</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\Microsoft.Build.Engine\Test\Microsoft.Build.BuildEngine\Consts.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\ALTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\AssignCultureTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\AssignProjectConfigurationTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\AssignTargetPathTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\CombinePathTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\CopyTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\CreateCSharpManifestResourceNameTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\CreateItemTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\CreatePropertyTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\CreateVisualBasicManifestResourceNameTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\CscTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\DeleteTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\ErrorTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\FindAppConfigFileTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\GetFrameworkPathTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\GetFrameworkSdkPathTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\LCTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\MakeDirTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\ManagedCompilerTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\MessageTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\RemoveDirTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\RemoveDuplicatesTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\ResolveAssemblyReferenceTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\TaskBatchingTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\TestEngine.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\TestMessageLogger.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\WarningTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Tasks\WriteLinesToFileTest.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent>\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
-
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="..\lib\net_3_5\nunit.framework.dll" />\r
- <ProjectReference Include="..\corlib\corlib-net_2_0.csproj">\r
- <Project>{5A00133C-6D08-48F7-A164-8B796CE6DB83}</Project>\r
- <Name>corlib\corlib-net_2_0</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Tasks\Microsoft.Build.Tasks-net_3_5.csproj">\r
- <Project>{BF8AC1F8-37FC-49D4-BC64-A4481523212D}</Project>\r
- <Name>Microsoft.Build.Tasks\Microsoft.Build.Tasks-net_3_5</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Engine\Microsoft.Build.Engine-net_3_5.csproj">\r
- <Project>{9DEA0C0A-BF6D-4C05-B3C5-1429F70A6FF5}</Project>\r
- <Name>Microsoft.Build.Engine\Microsoft.Build.Engine-net_3_5</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Framework\Microsoft.Build.Framework-net_3_5.csproj">\r
- <Project>{88FC8C2C-9157-41EB-A47C-981B2205ED7E}</Project>\r
- <Name>Microsoft.Build.Framework\Microsoft.Build.Framework-net_3_5</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_3_5.csproj">\r
- <Project>{A5EB5B9E-9335-43AD-A9C7-41FDF9A52045}</Project>\r
- <Name>Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_3_5</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_3_5.csproj">\r
- <Project>{C3F8A358-9DA1-423C-8466-58AB30893EB0}</Project>\r
- <Name>Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_3_5</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\System.Core\System.Core-net_2_0.csproj">\r
- <Project>{FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E}</Project>\r
- <Name>System.Core\System.Core-net_2_0</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-<Project name="Microsoft.Build.Tasks" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject">
- <Configurations active="Debug">
- <Configuration name="Debug" ctype="DotNetProjectConfiguration">
- <Output directory="./bin/Debug" assembly="Microsoft.Build.Tasks" />
- <Build debugmode="True" target="Library" />
- <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
- </Configuration>
- <Configuration name="Release" ctype="DotNetProjectConfiguration">
- <Output directory="./bin/Release" assembly="Microsoft.Build.Tasks" />
- <Build debugmode="False" target="Library" />
- <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
- </Configuration>
- </Configurations>
- <DeploymentInformation strategy="File">
- <excludeFiles />
- </DeploymentInformation>
- <Contents>
- <File name="./Microsoft.Build.Tasks/AL.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/AppDomainIsolatedTaskExtension.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/CommandLineBuilderExtension.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/Copy.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/CreateItem.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/CreateProperty.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/Csc.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/Delete.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/Error.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/Exec.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/FindUnderPath.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/GenerateResource.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/GenerateTrustInfo.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/GetFrameworkPath.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/GetFrameworkSdkPath.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/MakeDir.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/ManagedCompiler.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/Message.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/MSBuild.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/ReadLinesFromFile.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/RegisterAssembly.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/RemoveDir.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/SignFile.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/TaskExtension.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/ToolTaskExtension.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/Touch.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/UnregisterAssembly.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/Warning.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/WriteLinesToFile.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks.Hosting/ICscHostObject.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks.Hosting/IVbcHostObject.cs" subtype="Code" buildaction="Compile" />
- <File name="./Mono.XBuild.Tasks.GenerateResourceInternal/PoResourceReader.cs" subtype="Code" buildaction="Compile" />
- <File name="./Mono.XBuild.Tasks.GenerateResourceInternal/PoResourceWriter.cs" subtype="Code" buildaction="Compile" />
- <File name="./Mono.XBuild.Tasks.GenerateResourceInternal/TxtResourceReader.cs" subtype="Code" buildaction="Compile" />
- <File name="./Mono.XBuild.Tasks.GenerateResourceInternal/TxtResourceWriter.cs" subtype="Code" buildaction="Compile" />
- <File name="./Assembly/AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Tasks/CombinePath.cs" subtype="Code" buildaction="Compile" />
- </Contents>
- <References>
- <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <ProjectReference type="Gac" localcopy="True" refto="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- </References>
-</Project>
\ No newline at end of file
+++ /dev/null
-<Combine name="Microsoft.Build.Tasks" fileversion="2.0">
- <Configurations active="Debug">
- <Configuration name="Debug" ctype="CombineConfiguration">
- <Entry build="True" name="Microsoft.Build.Tasks" configuration="Debug" />
- </Configuration>
- <Configuration name="Release" ctype="CombineConfiguration">
- <Entry build="True" name="Microsoft.Build.Tasks" configuration="Debug" />
- </Configuration>
- </Configurations>
- <StartMode startupentry="Microsoft.Build.Tasks" single="True">
- <Execute type="None" entry="Microsoft.Build.Tasks" />
- </StartMode>
- <Entries>
- <Entry filename="./Microsoft.Build.Tasks.mdp" />
- </Entries>
-</Combine>
\ No newline at end of file
+++ /dev/null
-<?xml version ="1.0"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
- <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
- <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{C3F8A358-9DA1-423C-8466-58AB30893EB0}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699</NoWarn>\r
- <OutputPath>./../../class/lib/net_3_5</OutputPath>\r
- <NoStdLib>True</NoStdLib>\r
- <NoConfig>True</NoConfig>\r
- \r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Microsoft.Build.Utilities.v3.5</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5</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</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_1_1;NET_2_0;NET_3_5</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
- <Compile Include="..\..\tools\xbuild\XBuildConsts.cs" />\r
- <Compile Include="..\System\System.Collections.Specialized\ProcessStringDictionary.cs" />\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\AppDomainIsolatedTask.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\CommandLineBuilder.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\HostObjectInitializationStatus.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\IAsyncOperation.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\IProcessAsyncOperation.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\Logger.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\ProcessService.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\ProcessWrapper.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\TargetDotNetFrameworkVersion.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\Task.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\TaskItem.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\TaskLoggingHelper.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\ToolLocationHelper.cs" />\r
- <Compile Include="Microsoft.Build.Utilities\ToolTask.cs" />\r
- <Compile Include="Mono.XBuild.Utilities\MonoLocationHelper.cs" />\r
- <Compile Include="Mono.XBuild.Utilities\MSBuildUtils.cs" />\r
- <Compile Include="Mono.XBuild.Utilities\ReservedNameUtils.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent>\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
-
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\corlib\corlib-net_2_0.csproj">\r
- <Project>{5A00133C-6D08-48F7-A164-8B796CE6DB83}</Project>\r
- <Name>corlib\corlib-net_2_0</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\System\System-net_2_0-2.csproj">\r
- <Project>{1F3B168C-A4D0-44AA-B116-792D8804971F}</Project>\r
- <Name>System\System-net_2_0-2</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Framework\Microsoft.Build.Framework-net_3_5.csproj">\r
- <Project>{88FC8C2C-9157-41EB-A47C-981B2205ED7E}</Project>\r
- <Name>Microsoft.Build.Framework\Microsoft.Build.Framework-net_3_5</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{80DC5F86-732F-4BF7-87E2-4891B63AAAB1}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699</NoWarn>\r
- <OutputPath>bin\Debug\Microsoft.Build.Utilities-tests-net_3_5</OutputPath>\r
- <NoStdLib>True</NoStdLib>\r
- <NoConfig>False</NoConfig>\r
- \r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Microsoft.Build.Utilities_test_net_3_5</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5</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</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_1_1;NET_2_0;NET_3_5</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="Test\Microsoft.Build.Utilities\CommandLineBuilderTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Utilities\LoggerTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Utilities\TaskItemTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Utilities\TaskLoggingHelperTest.cs" />\r
- <Compile Include="Test\Microsoft.Build.Utilities\ToolTaskTest.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent>\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
-
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="..\lib\net_3_5\nunit.framework.dll" />\r
- <ProjectReference Include="..\corlib\corlib-net_2_0.csproj">\r
- <Project>{5A00133C-6D08-48F7-A164-8B796CE6DB83}</Project>\r
- <Name>corlib\corlib-net_2_0</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_3_5.csproj">\r
- <Project>{C3F8A358-9DA1-423C-8466-58AB30893EB0}</Project>\r
- <Name>Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_3_5</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Engine\Microsoft.Build.Engine-net_2_0.csproj">\r
- <Project>{6A56A8BD-4228-4865-8112-9D31C6829638}</Project>\r
- <Name>Microsoft.Build.Engine\Microsoft.Build.Engine-net_2_0</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\Microsoft.Build.Framework\Microsoft.Build.Framework-net_3_5.csproj">\r
- <Project>{88FC8C2C-9157-41EB-A47C-981B2205ED7E}</Project>\r
- <Name>Microsoft.Build.Framework\Microsoft.Build.Framework-net_3_5</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\System\System-net_2_0-2.csproj">\r
- <Project>{1F3B168C-A4D0-44AA-B116-792D8804971F}</Project>\r
- <Name>System\System-net_2_0-2</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\System.Core\System.Core-net_2_0.csproj">\r
- <Project>{FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E}</Project>\r
- <Name>System.Core\System.Core-net_2_0</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-<Project name="Microsoft.Build.Utilities" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject">
- <Configurations active="Debug">
- <Configuration name="Debug" ctype="DotNetProjectConfiguration">
- <Output directory="./bin/Debug" assembly="Microsoft.Build.Utilities" />
- <Build debugmode="True" target="Library" />
- <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
- </Configuration>
- <Configuration name="Release" ctype="DotNetProjectConfiguration">
- <Output directory="./bin/Release" assembly="Microsoft.Build.Utilities" />
- <Build debugmode="False" target="Library" />
- <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
- </Configuration>
- </Configurations>
- <DeploymentInformation strategy="File">
- <excludeFiles />
- </DeploymentInformation>
- <Contents>
- <File name="./Microsoft.Build.Utilities/AppDomainIsolatedTask.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/CommandLineBuilder.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/ConcurrentLoggingHelper.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/Logger.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/Task.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/TaskItem.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/TaskLoggingHelper.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/ToolLocationHelper.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/ToolTask.cs" subtype="Code" buildaction="Compile" />
- </Contents>
- <References>
- <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <ProjectReference type="Gac" localcopy="True" refto="Microsoft.Build.Framework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- </References>
-</Project>
\ No newline at end of file
+++ /dev/null
-<Combine name="Microsoft.Build.Utilities" fileversion="2.0">
- <Configurations active="Debug">
- <Configuration name="Debug" ctype="CombineConfiguration">
- <Entry build="True" name="Microsoft.Build.Utilities" configuration="Debug" />
- </Configuration>
- <Configuration name="Release" ctype="CombineConfiguration">
- <Entry build="True" name="Microsoft.Build.Utilities" configuration="Debug" />
- </Configuration>
- </Configurations>
- <StartMode startupentry="Microsoft.Build.Utilities" single="True">
- <Execute type="None" entry="Microsoft.Build.Utilities" />
- </StartMode>
- <Entries>
- <Entry filename="./Microsoft.Build.Utilities.mdp" />
- </Entries>
-</Combine>
\ No newline at end of file
+++ /dev/null
-<Project name="Microsoft.Build.Utilities.Test" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject">
- <Configurations active="Debug">
- <Configuration name="Debug" ctype="DotNetProjectConfiguration">
- <Output directory="./bin/Debug" assembly="Microsoft.Build.Utilities.Test" />
- <Build debugmode="True" target="Library" />
- <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
- </Configuration>
- <Configuration name="Release" ctype="DotNetProjectConfiguration">
- <Output directory="./bin/Release" assembly="Microsoft.Build.Utilities.Test" />
- <Build debugmode="False" target="Library" />
- <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
- </Configuration>
- </Configurations>
- <DeploymentInformation strategy="File">
- <excludeFiles />
- </DeploymentInformation>
- <Contents>
- <File name="./Microsoft.Build.Utilities/TaskItemTest.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/CommandLineBuilderTest.cs" subtype="Code" buildaction="Compile" />
- <File name="./Microsoft.Build.Utilities/TaskLoggingHelperTest.cs" subtype="Code" buildaction="Compile" />
- </Contents>
- <References>
- <ProjectReference type="Gac" localcopy="True" refto="nunit.framework, Version=2.2.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
- <ProjectReference type="Gac" localcopy="True" refto="Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <ProjectReference type="Gac" localcopy="True" refto="Microsoft.Build.Framework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- </References>
-</Project>
\ No newline at end of file
+++ /dev/null
-<Combine name="Microsoft.Build.Utilities.Test" fileversion="2.0">
- <Configurations active="Debug">
- <Configuration name="Debug" ctype="CombineConfiguration">
- <Entry build="True" name="Microsoft.Build.Utilities.Test" configuration="Debug" />
- </Configuration>
- <Configuration name="Release" ctype="CombineConfiguration">
- <Entry build="True" name="Microsoft.Build.Utilities.Test" configuration="Debug" />
- </Configuration>
- </Configurations>
- <StartMode startupentry="Microsoft.Build.Utilities.Test" single="True">
- <Execute type="None" entry="Microsoft.Build.Utilities.Test" />
- </StartMode>
- <Entries>
- <Entry filename="./Microsoft.Build.Utilities.Test.mdp" />
- </Entries>
-</Combine>
\ No newline at end of file
* If the value is null, not setting the size to 0 will cause varchar
* fields to get inserted as an empty string rather than an null.
*/
- if (param.Value == null || param.Value == DBNull.Value)
- size = 0;
+ if (colType != TdsColumnType.IntN && colType != TdsColumnType.DateTimeN) {
+ if (param.Value == null || param.Value == DBNull.Value)
+ size = 0;
+ }
// Change colType according to the following table
/*
c, v => { string ignore = v.OptionValues [0]; });
c.Option = p [0];
Utils.AssertException (typeof(ArgumentOutOfRangeException),
- "Argument is out of range.\nParameter name: index",
+ "Specified argument was out of the range of valid values.\nParameter name: index",
c, v => { string ignore = v.OptionValues [2]; });
c.OptionName = "-a";
Utils.AssertException (typeof(OptionException),
p, v => { v.Parse (_("-a", "-b")); });
Assert.AreEqual (a, "-b");
Utils.AssertException (typeof(ArgumentNullException),
- "Argument cannot be null.\nParameter name: option",
+ "Value cannot be null.\nParameter name: option",
p, v => { v.Add ((Option) null); });
Utils.AssertException (typeof(ArgumentNullException),
- "Argument cannot be null.\nParameter name: header",
+ "Value cannot be null.\nParameter name: header",
p, v => { v.Add ((string) null); });
// bad type
p, v => { v.Parse (_("-cz", "extra")); });
Utils.AssertException (typeof(ArgumentNullException),
- "Argument cannot be null.\nParameter name: action",
+ "Value cannot be null.\nParameter name: action",
p, v => { v.Add ("foo", (Action<string>) null); });
Utils.AssertException (typeof(ArgumentException),
"Cannot provide maxValueCount of 2 for OptionValueType.None.\nParameter name: maxValueCount",
Utils.AssertException (typeof(ArgumentException), "prototypes must be null!",
p, v => { v.Add ("N|NUM=", (int n) => {}); });
Utils.AssertException (typeof(ArgumentNullException),
- "Argument cannot be null.\nParameter name: option",
+ "Value cannot be null.\nParameter name: option",
p, v => { v.GetOptionForName (null); });
}
{
object p = null;
Utils.AssertException (typeof(ArgumentNullException),
- "Argument cannot be null.\nParameter name: prototype",
+ "Value cannot be null.\nParameter name: prototype",
p, v => { new DefaultOption (null, null); });
Utils.AssertException (typeof(ArgumentException),
"Cannot be the empty string.\nParameter name: prototype",
Utils.AssertException (null, null,
p, v => { new DefaultOption ("a|b=", null, 2); });
Utils.AssertException (typeof(ArgumentOutOfRangeException),
- "Argument is out of range.\nParameter name: maxValueCount",
+ "Specified argument was out of the range of valid values.\nParameter name: maxValueCount",
p, v => { new DefaultOption ("a", null, -1); });
Utils.AssertException (typeof(ArgumentException),
"Cannot provide maxValueCount of 0 for OptionValueType.Required or " +
--- /dev/null
+// ConcurrentOrderedList.cs
+//
+// Copyright (c) 2010 Jérémie "Garuma" Laval
+//
+// 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.Threading;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+
+#if INSIDE_MONO_PARALLEL
+using System.Collections.Concurrent;
+
+namespace Mono.Collections.Concurrent
+#else
+namespace System.Collections.Concurrent
+#endif
+{
+#if INSIDE_MONO_PARALLEL
+ public
+#endif
+ class ConcurrentOrderedList<T>: ICollection<T>, IEnumerable<T>
+ {
+ class Node
+ {
+ public T Data;
+ public int Key;
+ public Node Next;
+ public bool Marked;
+
+ public Node ()
+ {
+
+ }
+
+ public Node (Node wrapped)
+ {
+ Marked = true;
+ Next = wrapped;
+ }
+ }
+
+ Node head;
+ Node tail;
+
+ IEqualityComparer<T> comparer;
+
+ int count;
+
+ public ConcurrentOrderedList () : this (EqualityComparer<T>.Default)
+ {
+
+ }
+
+ public ConcurrentOrderedList (IEqualityComparer<T> comparer)
+ {
+ if (comparer == null)
+ throw new ArgumentNullException ("comparer");
+
+ this.comparer = comparer;
+
+ head = new Node ();
+ tail = new Node ();
+ head.Next = tail;
+ }
+
+ public bool TryAdd (T data)
+ {
+ Node node = new Node ();
+ node.Data = data;
+ node.Key = comparer.GetHashCode (data);
+
+ if (ListInsert (node)) {
+ Interlocked.Increment (ref count);
+ return true;
+ }
+
+ return false;
+ }
+
+ public bool TryRemove (T data)
+ {
+ T dummy;
+ return TryRemoveHash (comparer.GetHashCode (data), out dummy);
+ }
+
+ public bool TryRemoveHash (int key, out T data)
+ {
+ if (ListDelete (key, out data)) {
+ Interlocked.Decrement (ref count);
+ return true;
+ }
+
+ return false;
+ }
+
+ public bool TryPop (out T data)
+ {
+ return ListPop (out data);
+ }
+
+ public bool Contains (T data)
+ {
+ return ContainsHash (comparer.GetHashCode (data));
+ }
+
+ public bool ContainsHash (int key)
+ {
+ Node node;
+
+ if (!ListFind (key, out node))
+ return false;
+
+ return true;
+
+ }
+
+ public bool TryGetFromHash (int key, out T data)
+ {
+ data = default (T);
+ Node node;
+
+ if (!ListFind (key, out node))
+ return false;
+
+ data = node.Data;
+ return true;
+ }
+
+ public void Clear ()
+ {
+ head.Next = tail;
+ }
+
+ public void CopyTo (T[] array, int startIndex)
+ {
+ if (array == null)
+ throw new ArgumentNullException ("array");
+ if (startIndex < 0)
+ throw new ArgumentOutOfRangeException ("startIndex");
+ if (count > array.Length - startIndex)
+ throw new ArgumentException ("array", "The number of elements is greater than the available space from startIndex to the end of the destination array.");
+
+ foreach (T item in this) {
+ if (startIndex >= array.Length)
+ break;
+
+ array[startIndex++] = item;
+ }
+ }
+
+ public IEqualityComparer<T> Comparer {
+ get {
+ return comparer;
+ }
+ }
+
+ public int Count {
+ get {
+ return count;
+ }
+ }
+
+ Node ListSearch (int key, ref Node left)
+ {
+ Node leftNodeNext = null, rightNode = null;
+
+ do {
+ Node t = head;
+ Node tNext = t.Next;
+ do {
+ if (!tNext.Marked) {
+ left = t;
+ leftNodeNext = tNext;
+ }
+ t = tNext.Marked ? tNext.Next : tNext;
+ if (t == tail)
+ break;
+
+ tNext = t.Next;
+ } while (tNext.Marked || t.Key < key);
+
+ rightNode = t;
+
+ if (leftNodeNext == rightNode) {
+ if (rightNode != tail && rightNode.Next.Marked)
+ continue;
+ else
+ return rightNode;
+ }
+
+ if (Interlocked.CompareExchange (ref left.Next, rightNode, leftNodeNext) == leftNodeNext) {
+ if (rightNode != tail && rightNode.Next.Marked)
+ continue;
+ else
+ return rightNode;
+ }
+ } while (true);
+ }
+
+ bool ListDelete (int key, out T data)
+ {
+ Node rightNode = null, rightNodeNext = null, leftNode = null;
+ data = default (T);
+
+ do {
+ rightNode = ListSearch (key, ref leftNode);
+ if (rightNode == tail || rightNode.Key != key)
+ return false;
+
+ data = rightNode.Data;
+
+ rightNodeNext = rightNode.Next;
+ if (!rightNodeNext.Marked)
+ if (Interlocked.CompareExchange (ref rightNode.Next, new Node (rightNodeNext), rightNodeNext) == rightNodeNext)
+ break;
+ } while (true);
+
+ if (Interlocked.CompareExchange (ref leftNode.Next, rightNodeNext, rightNode) != rightNodeNext)
+ ListSearch (rightNode.Key, ref leftNode);
+
+ return true;
+ }
+
+ bool ListPop (out T data)
+ {
+ Node rightNode = null, rightNodeNext = null, leftNode = head;
+ data = default (T);
+
+ do {
+ rightNode = head.Next;
+ if (rightNode == tail)
+ return false;
+
+ data = rightNode.Data;
+
+ rightNodeNext = rightNode.Next;
+ if (!rightNodeNext.Marked)
+ if (Interlocked.CompareExchange (ref rightNode.Next, new Node (rightNodeNext), rightNodeNext) == rightNodeNext)
+ break;
+ } while (true);
+
+ if (Interlocked.CompareExchange (ref leftNode.Next, rightNodeNext, rightNode) != rightNodeNext)
+ ListSearch (rightNode.Key, ref leftNode);
+
+ return true;
+ }
+
+ bool ListInsert (Node newNode)
+ {
+ int key = newNode.Key;
+ Node rightNode = null, leftNode = null;
+
+ do {
+ rightNode = ListSearch (key, ref leftNode);
+ if (rightNode != tail && rightNode.Key == key)
+ return false;
+
+ newNode.Next = rightNode;
+ if (Interlocked.CompareExchange (ref leftNode.Next, newNode, rightNode) == rightNode)
+ return true;
+ } while (true);
+ }
+
+ bool ListFind (int key, out Node data)
+ {
+ Node rightNode = null, leftNode = null;
+ data = null;
+
+ data = rightNode = ListSearch (key, ref leftNode);
+
+ return rightNode != tail && rightNode.Key == key;
+ }
+
+ IEnumerator<T> IEnumerable<T>.GetEnumerator ()
+ {
+ return GetEnumeratorInternal ();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator ()
+ {
+ return GetEnumeratorInternal ();
+ }
+
+ IEnumerator<T> GetEnumeratorInternal ()
+ {
+ Node node = head.Next;
+
+ while (node != tail) {
+ while (node.Marked) {
+ node = node.Next;
+ if (node == tail)
+ yield break;
+ }
+ yield return node.Data;
+ node = node.Next;
+ }
+ }
+
+ bool ICollection<T>.IsReadOnly {
+ get {
+ return false;
+ }
+ }
+
+ void ICollection<T>.Add (T item)
+ {
+ TryAdd (item);
+ }
+
+ bool ICollection<T>.Remove (T item)
+ {
+ return TryRemove (item);
+ }
+ }
+}
+
../../build/common/Locale.cs
Assembly/AssemblyInfo.cs
Mono.Collections.Concurrent/ConcurrentSkipList.cs
+Mono.Collections.Concurrent/ConcurrentOrderedList.cs
Mono.Threading/CSnzi.cs
Mono.Threading/Snzi.cs
Mono.Threading/SpinLockWrapper.cs
Mono.Threading/ReaderWriterLockSlimmer.cs
Mono.Threading/AtomicBoolean.cs
-../corlib/System.Collections.Concurrent/ConcurrentOrderedList.cs
Mono.Threading.Tasks/CyclicDeque.cs
Mono.Threading.Tasks/IConcurrentDeque.cs
Mono.Threading.Tasks/PopResult.cs
throw new ArgumentOutOfRangeException ("inputCount", "< 0");
// ordered to avoid possible integer overflow
if (inputOffset > inputBuffer.Length - inputCount)
- throw new ArgumentException ("inputBuffer", Locale.GetText ("Overflow"));
+ throw new ArgumentException (Locale.GetText ("Overflow"), "inputBuffer");
}
public int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
throw new ArgumentOutOfRangeException ("outputOffset", "< 0");
// ordered to avoid possible integer overflow
if (outputOffset > outputBuffer.Length - inputCount)
- throw new ArgumentException ("outputBuffer", Locale.GetText ("Overflow"));
+ throw new ArgumentException (Locale.GetText ("Overflow"), "outputBuffer");
return InternalTransformBlock (inputBuffer, inputOffset, inputCount, outputBuffer, outputOffset);
}
--- /dev/null
+//
+// AssemblyInfo.cs
+//
+//
+// 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.Reflection;
+using System.Resources;
+using System.Security;
+using System.Security.Permissions;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+[assembly: AssemblyTitle ("SMDiagnostics.dll")]
+[assembly: AssemblyDescription ("Contains share code for some System.ServiceModel libraries")]
+[assembly: AssemblyDefaultAlias ("System.ServiceModel.dll")]
+
+[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
+[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
+
+[assembly: NeutralResourcesLanguage ("en-US")]
+[assembly: CLSCompliant (true)]
+[assembly: AssemblyDelaySign (true)]
+#if NET_2_1
+[assembly: AssemblyKeyFile ("../winfx.pub")]
+#else
+[assembly: AssemblyKeyFile ("../ecma.pub")]
+[assembly: AllowPartiallyTrustedCallers]
+[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
+[assembly: SecurityCritical (SecurityCriticalScope.Explicit)]
+#endif
+[assembly: InternalsVisibleTo ("System.Runtime.Serialization, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+[assembly: InternalsVisibleTo ("System.IdentityModel, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+[assembly: InternalsVisibleTo ("System.IdentityModel.Selectors, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+[assembly: InternalsVisibleTo ("System.ServiceModel, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+
+[assembly: ComVisible (false)]
+
--- /dev/null
+thisdir = class/SMDiagnostics
+SUBDIRS =
+include ../../build/rules.make
+
+LIBRARY = SMDiagnostics.dll
+LIB_REFS = System System.Core System.Xml System.ServiceModel.Internals
+LIB_MCS_FLAGS =
+ifneq (2.1, $(FRAMEWORK_VERSION))
+ LIB_REFS += System.Configuration
+else
+ LIB_MCS_FLAGS += -d:NO_CONFIGURATION
+endif
+
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+
+EXTRA_DISTFILES =
+
+include ../../build/library.make
--- /dev/null
+using System.Globalization;
+
+static partial class TraceSR
+{
+ public const string ThrowingException = "throwing exception.";
+ public const string StringNullOrEmpty = "Argument string is null or empty.";
+ public const string GenericCallbackException = "Callback exception has occured.";
+ public const string TraceHandledException = "Trace handled exception.";
+ public const string TraceCodeTraceTruncatedQuotaExceeded = "TraceTruncatedQuotaExceeded";
+ public const string TraceCodeAppDomainUnload = "AppDomainUnload";
+ public const string UnhandledException = "Unhandled exception.";
+ public const string TraceCodeEventLog = "EventLog";
+ public const string WriteCharsInvalidContent = "invalid content.";
+
+ internal static string GetString(string name, params object[] args)
+ {
+ return GetString (CultureInfo.InvariantCulture, name, args);
+ }
+
+ internal static string GetString(CultureInfo culture, string name, params object[] args)
+ {
+ return string.Format (culture, name, args);
+ }
+
+ internal static string GetString(string name)
+ {
+ return name;
+ }
+
+ internal static string GetString(CultureInfo culture, string name)
+ {
+ return name;
+ }
+}
+
--- /dev/null
+../../build/common/Consts.cs
+../../build/common/Locale.cs
+../../build/common/SR.cs
+
+Assembly/AssemblyInfo.cs
+ReferenceSources/TraceSR.cs
+
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/Activity.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticsTraceCode.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticStrings.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticTraceSource.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EncodingFallbackAwareXmlTextWriter.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogCategory.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogEventId.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogger.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/ExceptionUtility.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/LegacyDiagnosticTrace.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/MachineSettingsSection.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/NativeMethods.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/PiiTraceSource.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/PlainXmlWriter.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/SafeEventLogWriteHandle.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceSourceKind.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceXPathNavigator.cs
+../../../external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/Utility.cs
if (leftCol == null || rightCol == null)
return false;
- ValueType vt = leftCol as ValueType;
+ var vt = leftCol as System.ValueType;
if (vt != null && vt.Equals (rightCol))
return true;
EnumerableRowCollection source;
IEnumerator e;
int depth;
+ bool done;
public RowEnumerableDataReader (IEnumerable source, int depth)
{
}
public bool IsClosed {
- get { return e == null; }
+ get { return done; }
}
public int RecordsAffected {
public void Close ()
{
- e = null;
+ done = true;
}
public DataTable GetSchemaTable ()
using System;
using System.Collections.Generic;
using System.Data;
+using System.Linq;
using NUnit.Framework;
namespace MonoTests.System.Data
dt.AsEnumerable ().CopyToDataTable<DataRow> (dst, LoadOption.PreserveChanges);
}
+ [Test]
+ public void AsEnumerable ()
+ {
+ DataSet ds = new DataSet ();
+ ds.ReadXml ("Test/System.Data/testdataset1.xml");
+ DataTable dt = ds.Tables [0];
+ Assert.AreEqual ("ScoreList", dt.TableName, "TableName");
+ var dv = dt.AsEnumerable ();
+ Assert.AreEqual (4, dv.Count (), "#0");
+ var i = dv.GetEnumerator ();
+ Assert.IsTrue (i.MoveNext (), "#1");
+ Assert.AreEqual (1, i.Current ["ID"], "#2");
+ Assert.IsTrue (i.MoveNext (), "#3");
+ Assert.AreEqual (2, i.Current ["ID"], "#4");
+ }
+
[Test]
public void AsDataView ()
{
y.output
+/gen_OdbcConnection.cs
+/gen_OdbcParameter.cs
+/gen_OdbcParameterCollection.cs
+/gen_OleDbConnection.cs
+/gen_OleDbParameter.cs
+/gen_OleDbParameterCollection.cs
\ No newline at end of file
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
+[assembly: InternalsVisibleTo ("System.Data.DataSetExtensions, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
[assembly: InternalsVisibleTo ("System.Design, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: InternalsVisibleTo ("System.Web, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
LIBRARY = System.Data.dll
-LIB_REFS = System System.Xml System.Core
+LIB_REFS = System System.Xml System.Core System.Numerics
LIB_MCS_FLAGS = \
-nowarn:649 \
+ -d:PLATFORM_UNIX \
+ -d:USEOFFSET \
+ -d:MONO_PARTIAL_DATA_IMPORT \
-unsafe
MOBILE := $(filter monotouch monodroid xammac mobile mobile_static, $(PROFILE))
ifdef MOBILE
LIB_REFS += Mono.Data.Tds System.Transactions
+LIB_MCS_FLAGS += -d:NO_CODEDOM -d:NO_OLEDB -d:NO_ODBC -d:NO_CONFIGURATION -nowarn:618
else
LIB_REFS += System.EnterpriseServices Mono.Data.Tds System.Configuration System.Transactions
+BUILT_SOURCES = \
+ gen_OdbcConnection.cs \
+ gen_OleDbConnection.cs \
+ gen_OdbcParameter.cs \
+ gen_OleDbParameter.cs \
+ gen_OdbcParameterCollection.cs \
+ gen_OleDbParameterCollection.cs
endif
RESOURCE_STRINGS = ../../../external/referencesource/System.Data/system.data.txt
app_test_net_2_0.config \
app_test_net_4_5.config \
Test/System.Data/binserialize/*.bin \
- SqliteTest.db
+ SqliteTest.db \
+ referencesource.sources
-BUILT_SOURCES = Mono.Data.SqlExpressions/Parser.cs
-
-Mono.Data.SqlExpressions/Parser.cs: Mono.Data.SqlExpressions/Parser.jay $(topdir)/jay/skeleton.cs
- $(topdir)/jay/jay -vct < $(topdir)/jay/skeleton.cs $(CURDIR)/$< >$@
- rm -f y.output
+gen_OdbcConnection.cs: ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs
+ sed -e "s/NAMESPACE/System.Data.Odbc/g" $< |\
+ sed -e "s/CONNECTIONFACTORYOBJECTNAME/OdbcConnectionFactory.SingletonInstance/g" |\
+ sed -e "s/CONNECTIONOBJECTNAME/OdbcConnection/g" >$@
+gen_OleDbConnection.cs: ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs
+ sed -e s/NAMESPACE/System.Data.OleDb/g $< |\
+ sed -e s/CONNECTIONFACTORYOBJECTNAME/OleDbConnectionFactory.SingletonInstance/g |\
+ sed -e s/CONNECTIONOBJECTNAME/OleDbConnection/g >$@
+gen_SqlConnection.cs: ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs
+ sed -e s/NAMESPACE/System.Data.SqlClient/g $< |\
+ sed -e s/CONNECTIONFACTORYOBJECTNAME/SqlConnectionFactory.SingletonInstance/g |\
+ sed -e s/CONNECTIONOBJECTNAME/SqlConnection/g >$@
+gen_OdbcParameter.cs: ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs
+ sed -e s/RESNAMESPACE/System.Data/g $< |\
+ sed -e s/NAMESPACE/System.Data.Odbc/g |\
+ sed -e s/PARAMETEROBJECTNAME/OdbcParameter/g >$@
+gen_OleDbParameter.cs: ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs
+ sed -e s/RESNAMESPACE/System.Data/g $< |\
+ sed -e s/NAMESPACE/System.Data.OleDb/g |\
+ sed -e s/PARAMETEROBJECTNAME/OleDbParameter/g >$@
+gen_SqlParameter.cs: ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs
+ sed -e s/RESNAMESPACE/System.Data/g $< |\
+ sed -e s/NAMESPACE/System.Data.SqlClient/g |\
+ sed -e s/PARAMETEROBJECTNAME/SqlParameter/g >$@
+gen_OdbcParameterCollection.cs: ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs
+ sed -e s/RESNAMESPACE/System.Data/g $< |\
+ sed -e s/NAMESPACE/System.Data.Odbc/g |\
+ sed -e s/PARAMETERCOLLECTIONOBJECTNAME/OdbcParameterCollection/g |\
+ sed -e s/PARAMETEROBJECTNAME/OdbcParameter/g >$@
+gen_OleDbParameterCollection.cs: ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs
+ sed -e s/RESNAMESPACE/System.Data/g $< |\
+ sed -e s/NAMESPACE/System.Data.OleDb/g |\
+ sed -e s/PARAMETERCOLLECTIONOBJECTNAME/OleDbParameterCollection/g |\
+ sed -e s/PARAMETEROBJECTNAME/OleDbParameter/g >$@
+gen_SqlParameterCollection.cs: ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs
+ sed -e s/RESNAMESPACE/System.Data/g $< |\
+ sed -e s/NAMESPACE/System.Data.SqlClient/g |\
+ sed -e s/PARAMETERCOLLECTIONOBJECTNAME/SqlParameterCollection/g |\
+ sed -e s/PARAMETEROBJECTNAME/SqlParameter/g >$@
include ../../build/library.make
--- /dev/null
+using System;
+
+class NativeOledbWrapper
+{
+ const string msg = "It is native method used by Microsoft System.Data.OleDb implementation that Mono or non-Windows platform does not support.";
+
+#if !MOBILE
+ public static int SizeOfPROPVARIANT {
+ get { throw new NotSupportedException (msg); }
+ }
+
+ public static int ITransactionAbort (IntPtr handle)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static int ITransactionCommit (IntPtr handle)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static bool MemoryCompare (IntPtr dst, IntPtr src, int bytes)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static IntPtr IChapteredRowsetReleaseChapter (IntPtr handle, IntPtr chapter)
+ {
+ throw new NotSupportedException (msg);
+ }
+#endif
+
+
+ public static int MemoryCopy (IntPtr dst, IntPtr src, int bytes)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+}
-static class Res
-{
- public const string ADP_BadParameterName = "ADP_BadParameterName";
- public const string ADP_CalledTwice = "ADP_CalledTwice";
- public const string ADP_ClosedConnectionError = "ADP_ClosedConnectionError";
- public const string ADP_CollectionIndexInt32 = "ADP_CollectionIndexInt32";
- public const string ADP_CollectionIndexString = "ADP_CollectionIndexString";
- public const string ADP_CollectionInvalidType = "ADP_CollectionInvalidType";
- public const string ADP_CollectionIsNotParent = "ADP_CollectionIsNotParent";
- public const string ADP_CollectionNullValue = "ADP_CollectionNullValue";
- public const string ADP_CollectionRemoveInvalidObject = "ADP_CollectionRemoveInvalidObject";
- public const string ADP_CollectionUniqueValue = "ADP_CollectionUniqueValue";
- public const string ADP_ColumnSchemaExpression = "ADP_ColumnSchemaExpression";
- public const string ADP_ColumnSchemaMismatch = "ADP_ColumnSchemaMismatch";
- public const string ADP_ColumnSchemaMissing1 = "ADP_ColumnSchemaMissing1";
- public const string ADP_ColumnSchemaMissing2 = "ADP_ColumnSchemaMissing2";
- public const string ADP_CommandTextRequired = "ADP_CommandTextRequired";
- public const string ADP_ComputerNameEx = "ADP_ComputerNameEx";
- public const string ADP_ConnecitonRequired_UpdateRows = "ADP_ConnecitonRequired_UpdateRows";
- public const string ADP_ConnectionAlreadyOpen = "ADP_ConnectionAlreadyOpen";
- public const string ADP_ConnectionIsDisabled = "ADP_ConnectionIsDisabled";
- public const string ADP_ConnectionRequired = "ADP_ConnectionRequired";
- public const string ADP_ConnectionRequired_Batch = "ADP_ConnectionRequired_Batch";
- public const string ADP_ConnectionRequired_Clone = "ADP_ConnectionRequired_Clone";
- public const string ADP_ConnectionRequired_Delete = "ADP_ConnectionRequired_Delete";
- public const string ADP_ConnectionRequired_Fill = "ADP_ConnectionRequired_Fill";
- public const string ADP_ConnectionRequired_FillPage = "ADP_ConnectionRequired_FillPage";
- public const string ADP_ConnectionRequired_FillSchema = "ADP_ConnectionRequired_FillSchema";
- public const string ADP_ConnectionRequired_Insert = "ADP_ConnectionRequired_Insert";
- public const string ADP_ConnectionRequired_Update = "ADP_ConnectionRequired_Update";
- public const string ADP_ConnectionStateMsg = "ADP_ConnectionStateMsg";
- public const string ADP_ConnectionStateMsg_Closed = "ADP_ConnectionStateMsg_Closed";
- public const string ADP_ConnectionStateMsg_Connecting = "ADP_ConnectionStateMsg_Connecting";
- public const string ADP_ConnectionStateMsg_Open = "ADP_ConnectionStateMsg_Open";
- public const string ADP_ConnectionStateMsg_OpenExecuting = "ADP_ConnectionStateMsg_OpenExecuting";
- public const string ADP_ConnectionStateMsg_OpenFetching = "ADP_ConnectionStateMsg_OpenFetching";
- public const string ADP_ConnectionStringSyntax = "ADP_ConnectionStringSyntax";
- public const string ADP_DBConcurrencyExceptionMessage = "ADP_DBConcurrencyExceptionMessage";
- public const string ADP_DataReaderClosed = "ADP_DataReaderClosed";
- public const string ADP_DataReaderNoData = "ADP_DataReaderNoData";
- public const string ADP_DatabaseNameTooLong = "ADP_DatabaseNameTooLong";
- public const string ADP_DbRecordReadOnly = "ADP_DbRecordReadOnly";
- public const string ADP_DbTypeNotSupported = "ADP_DbTypeNotSupported";
- public const string ADP_DelegatedTransactionPresent = "ADP_DelegatedTransactionPresent";
- public const string ADP_DeriveParametersNotSupported = "ADP_DeriveParametersNotSupported";
- public const string ADP_DoubleValuedProperty = "ADP_DoubleValuedProperty";
- public const string ADP_DynamicSQLJoinUnsupported = "ADP_DynamicSQLJoinUnsupported";
- public const string ADP_DynamicSQLNestedQuote = "ADP_DynamicSQLNestedQuote";
- public const string ADP_DynamicSQLNoKeyInfoDelete = "ADP_DynamicSQLNoKeyInfoDelete";
- public const string ADP_DynamicSQLNoKeyInfoRowVersionDelete = "ADP_DynamicSQLNoKeyInfoRowVersionDelete";
- public const string ADP_DynamicSQLNoKeyInfoRowVersionUpdate = "ADP_DynamicSQLNoKeyInfoRowVersionUpdate";
- public const string ADP_DynamicSQLNoKeyInfoUpdate = "ADP_DynamicSQLNoKeyInfoUpdate";
- public const string ADP_DynamicSQLNoTableInfo = "ADP_DynamicSQLNoTableInfo";
- public const string ADP_EmptyArray = "ADP_EmptyArray";
- public const string ADP_EmptyDatabaseName = "ADP_EmptyDatabaseName";
- public const string ADP_EmptyKeyValue = "ADP_EmptyKeyValue";
- public const string ADP_EmptyString = "ADP_EmptyString";
- public const string ADP_EvenLengthLiteralValue = "ADP_EvenLengthLiteralValue";
- public const string ADP_FillChapterAutoIncrement = "ADP_FillChapterAutoIncrement";
- public const string ADP_FillRequiresSourceTableName = "ADP_FillRequiresSourceTableName";
- public const string ADP_FillSchemaRequiresSourceTableName = "ADP_FillSchemaRequiresSourceTableName";
- public const string ADP_HexDigitLiteralValue = "ADP_HexDigitLiteralValue";
- public const string ADP_IncorrectAsyncResult = "ADP_IncorrectAsyncResult";
- public const string ADP_InternalConnectionError = "ADP_InternalConnectionError";
- public const string ADP_InternalProviderError = "ADP_InternalProviderError";
- public const string ADP_InvalidArgumentLength = "ADP_InvalidArgumentLength";
- public const string ADP_InvalidArgumentValue = "ADP_InvalidArgumentValue";
- public const string ADP_InvalidCommandTimeout = "ADP_InvalidCommandTimeout";
- public const string ADP_InvalidConnectTimeoutValue = "ADP_InvalidConnectTimeoutValue";
- public const string ADP_InvalidConnectionOptionValue = "ADP_InvalidConnectionOptionValue";
- public const string ADP_InvalidConnectionOptionValueLength = "ADP_InvalidConnectionOptionValueLength";
- public const string ADP_InvalidDataDirectory = "ADP_InvalidDataDirectory";
- public const string ADP_InvalidDataLength2 = "ADP_InvalidDataLength2";
- public const string ADP_InvalidDataType = "ADP_InvalidDataType";
- public const string ADP_InvalidDateTimeDigits = "ADP_InvalidDateTimeDigits";
- public const string ADP_InvalidDestinationBufferIndex = "ADP_InvalidDestinationBufferIndex";
- public const string ADP_InvalidEnumerationValue = "The {0} enumeration value, {1}, is invalid.";
- public const string ADP_InvalidFormatValue = "ADP_InvalidFormatValue";
- public const string ADP_InvalidImplicitConversion = "ADP_InvalidImplicitConversion";
- public const string ADP_InvalidKey = "ADP_InvalidKey";
- public const string ADP_InvalidMaxRecords = "ADP_InvalidMaxRecords";
- public const string ADP_InvalidMaximumScale = "ADP_InvalidMaximumScale";
- public const string ADP_InvalidMetaDataValue = "ADP_InvalidMetaDataValue";
- public const string ADP_InvalidMinMaxPoolSizeValues = "ADP_InvalidMinMaxPoolSizeValues";
- public const string ADP_InvalidMixedUsageOfSecureAndClearCredential = "ADP_InvalidMixedUsageOfSecureAndClearCredential";
- public const string ADP_InvalidMixedUsageOfSecureCredentialAndContextConnection = "ADP_InvalidMixedUsageOfSecureCredentialAndContextConnection";
- public const string ADP_InvalidMixedUsageOfSecureCredentialAndIntegratedSecurity = "ADP_InvalidMixedUsageOfSecureCredentialAndIntegratedSecurity";
- public const string ADP_InvalidMultipartName = "ADP_InvalidMultipartName";
- public const string ADP_InvalidMultipartNameQuoteUsage = "ADP_InvalidMultipartNameQuoteUsage";
- public const string ADP_InvalidMultipartNameToManyParts = "ADP_InvalidMultipartNameToManyParts";
- public const string ADP_InvalidOffsetValue = "ADP_InvalidOffsetValue";
- public const string ADP_InvalidPrefixSuffix = "ADP_InvalidPrefixSuffix";
- public const string ADP_InvalidSeekOrigin = "ADP_InvalidSeekOrigin";
- public const string ADP_InvalidSizeValue = "ADP_InvalidSizeValue";
- public const string ADP_InvalidSourceBufferIndex = "ADP_InvalidSourceBufferIndex";
- public const string ADP_InvalidSourceColumn = "ADP_InvalidSourceColumn";
- public const string ADP_InvalidSourceTable = "SourceTable is required to be a non-empty string";
- public const string ADP_InvalidStartRecord = "ADP_InvalidStartRecord";
- public const string ADP_InvalidUDL = "ADP_InvalidUDL";
- public const string ADP_InvalidValue = "ADP_InvalidValue";
- public const string ADP_InvalidXMLBadVersion = "ADP_InvalidXMLBadVersion";
- public const string ADP_KeywordNotSupported = "Keyword not supported: '{0}'.";
- public const string ADP_LiteralValueIsInvalid = "ADP_LiteralValueIsInvalid";
- public const string ADP_LocalTransactionPresent = "ADP_LocalTransactionPresent";
- public const string ADP_MismatchedAsyncResult = "ADP_MismatchedAsyncResult";
- public const string ADP_MissingColumnMapping = "ADP_MissingColumnMapping";
- public const string ADP_MissingConnectionOptionValue = "ADP_MissingConnectionOptionValue";
- public const string ADP_MissingDataReaderFieldType = "ADP_MissingDataReaderFieldType";
- public const string ADP_MissingSelectCommand = "ADP_MissingSelectCommand";
- public const string ADP_MissingSourceCommand = "ADP_MissingSourceCommand";
- public const string ADP_MissingSourceCommandConnection = "ADP_MissingSourceCommandConnection";
- public const string ADP_MissingTableMapping = "ADP_MissingTableMapping";
- public const string ADP_MissingTableMappingDestination = "ADP_MissingTableMappingDestination";
- public const string ADP_MissingTableSchema = "ADP_MissingTableSchema";
- public const string ADP_MultipleReturnValue = "ADP_MultipleReturnValue";
- public const string ADP_MustBeReadOnly = "ADP_MustBeReadOnly";
- public const string ADP_NegativeParameter = "ADP_NegativeParameter";
- public const string ADP_NoConnectionString = "ADP_NoConnectionString";
- public const string ADP_NoQuoteChange = "ADP_NoQuoteChange";
- public const string ADP_NoStoredProcedureExists = "ADP_NoStoredProcedureExists";
- public const string ADP_NonPooledOpenTimeout = "ADP_NonPooledOpenTimeout";
- public const string ADP_NonSeqByteAccess = "ADP_NonSeqByteAccess";
- public const string ADP_NonSequentialColumnAccess = "ADP_NonSequentialColumnAccess";
- public const string ADP_NotAPermissionElement = "ADP_NotAPermissionElement";
- public const string ADP_NotRowType = "ADP_NotRowType";
- public const string ADP_NotSupportedEnumerationValue = "ADP_NotSupportedEnumerationValue";
- public const string ADP_NumericToDecimalOverflow = "ADP_NumericToDecimalOverflow";
- public const string ADP_OdbcNoTypesFromProvider = "ADP_OdbcNoTypesFromProvider";
- public const string ADP_OffsetOutOfRangeException = "ADP_OffsetOutOfRangeException";
- public const string ADP_OnlyOneTableForStartRecordOrMaxRecords = "ADP_OnlyOneTableForStartRecordOrMaxRecords";
- public const string ADP_OpenConnectionPropertySet = "ADP_OpenConnectionPropertySet";
- public const string ADP_OpenConnectionRequired = "ADP_OpenConnectionRequired";
- public const string ADP_OpenConnectionRequired_Clone = "ADP_OpenConnectionRequired_Clone";
- public const string ADP_OpenConnectionRequired_Delete = "ADP_OpenConnectionRequired_Delete";
- public const string ADP_OpenConnectionRequired_Insert = "ADP_OpenConnectionRequired_Insert";
- public const string ADP_OpenConnectionRequired_Update = "ADP_OpenConnectionRequired_Update";
- public const string ADP_OpenReaderExists = "ADP_OpenReaderExists";
- public const string ADP_OperationAborted = "ADP_OperationAborted";
- public const string ADP_OperationAbortedExceptionMessage = "ADP_OperationAbortedExceptionMessage";
- public const string ADP_ParallelTransactionsNotSupported = "ADP_ParallelTransactionsNotSupported";
- public const string ADP_ParameterConversionFailed = "ADP_ParameterConversionFailed";
- public const string ADP_ParameterValueOutOfRange = "ADP_ParameterValueOutOfRange";
- public const string ADP_PendingAsyncOperation = "ADP_PendingAsyncOperation";
- public const string ADP_PermissionTypeMismatch = "ADP_PermissionTypeMismatch";
- public const string ADP_PooledOpenTimeout = "ADP_PooledOpenTimeout";
- public const string ADP_PrepareParameterScale = "ADP_PrepareParameterScale";
- public const string ADP_PrepareParameterSize = "ADP_PrepareParameterSize";
- public const string ADP_PrepareParameterType = "ADP_PrepareParameterType";
- public const string ADP_PropertyNotSupported = "ADP_PropertyNotSupported";
- public const string ADP_QuotePrefixNotSet = "ADP_QuotePrefixNotSet";
- public const string ADP_ResultsNotAllowedDuringBatch = "ADP_ResultsNotAllowedDuringBatch";
- public const string ADP_RowUpdatedErrors = "ADP_RowUpdatedErrors";
- public const string ADP_RowUpdatingErrors = "ADP_RowUpdatingErrors";
- public const string ADP_SingleValuedProperty = "ADP_SingleValuedProperty";
- public const string ADP_StreamClosed = "ADP_StreamClosed";
- public const string ADP_TransactionCompleted = "ADP_TransactionCompleted";
- public const string ADP_TransactionCompletedButNotDisposed = "ADP_TransactionCompletedButNotDisposed";
- public const string ADP_TransactionConnectionMismatch = "ADP_TransactionConnectionMismatch";
- public const string ADP_TransactionPresent = "ADP_TransactionPresent";
- public const string ADP_TransactionRequired = "ADP_TransactionRequired";
- public const string ADP_TransactionZombied = "ADP_TransactionZombied";
- public const string ADP_UdlFileError = "ADP_UdlFileError";
- public const string ADP_UnableToCreateBooleanLiteral = "ADP_UnableToCreateBooleanLiteral";
- public const string ADP_UninitializedParameterSize = "ADP_UninitializedParameterSize";
- public const string ADP_UnknownDataType = "ADP_UnknownDataType";
- public const string ADP_UnknownDataTypeCode = "ADP_UnknownDataTypeCode";
- public const string ADP_UnsupportedNativeDataTypeOleDb = "ADP_UnsupportedNativeDataTypeOleDb";
- public const string ADP_UnwantedStatementType = "ADP_UnwantedStatementType";
- public const string ADP_UpdateConcurrencyViolation_Batch = "ADP_UpdateConcurrencyViolation_Batch";
- public const string ADP_UpdateConcurrencyViolation_Delete = "ADP_UpdateConcurrencyViolation_Delete";
- public const string ADP_UpdateConcurrencyViolation_Update = "ADP_UpdateConcurrencyViolation_Update";
- public const string ADP_UpdateMismatchRowTable = "ADP_UpdateMismatchRowTable";
- public const string ADP_UpdateRequiresCommandClone = "ADP_UpdateRequiresCommandClone";
- public const string ADP_UpdateRequiresCommandDelete = "ADP_UpdateRequiresCommandDelete";
- public const string ADP_UpdateRequiresCommandInsert = "ADP_UpdateRequiresCommandInsert";
- public const string ADP_UpdateRequiresCommandSelect = "ADP_UpdateRequiresCommandSelect";
- public const string ADP_UpdateRequiresCommandUpdate = "ADP_UpdateRequiresCommandUpdate";
- public const string ADP_UpdateRequiresSourceTable = "ADP_UpdateRequiresSourceTable";
- public const string ADP_UpdateRequiresSourceTableName = "ADP_UpdateRequiresSourceTableName";
- public const string ADP_VersionDoesNotSupportDataType = "ADP_VersionDoesNotSupportDataType";
- public const string CodeGen_DuplicateTableName = "CodeGen_DuplicateTableName";
- public const string CodeGen_InvalidIdentifier = "CodeGen_InvalidIdentifier";
- public const string CodeGen_NoCtor0 = "CodeGen_NoCtor0";
- public const string CodeGen_NoCtor1 = "CodeGen_NoCtor1";
- public const string CodeGen_TypeCantBeNull = "CodeGen_TypeCantBeNull";
- public const string ConfigBaseElementsOnly = "ConfigBaseElementsOnly";
- public const string ConfigBaseNoChildNodes = "ConfigBaseNoChildNodes";
- public const string ConfigProviderInvalid = "ConfigProviderInvalid";
- public const string ConfigProviderMissing = "ConfigProviderMissing";
- public const string ConfigProviderNotFound = "ConfigProviderNotFound";
- public const string ConfigProviderNotInstalled = "ConfigProviderNotInstalled";
- public const string ConfigRequiredAttributeEmpty = "ConfigRequiredAttributeEmpty";
- public const string ConfigRequiredAttributeMissing = "ConfigRequiredAttributeMissing";
- public const string ConfigSectionsUnique = "ConfigSectionsUnique";
- public const string ConfigUnrecognizedAttributes = "ConfigUnrecognizedAttributes";
- public const string ConfigUnrecognizedElement = "ConfigUnrecognizedElement";
- public const string Config_base_elements_only = "Config_base_elements_only";
- public const string Config_base_no_child_nodes = "Config_base_no_child_nodes";
- public const string Config_base_required_attribute_empty = "Config_base_required_attribute_empty";
- public const string Config_base_required_attribute_missing = "Config_base_required_attribute_missing";
- public const string Config_base_unrecognized_attribute = "Config_base_unrecognized_attribute";
- public const string Config_base_unrecognized_element = "Config_base_unrecognized_element";
- public const string ConstraintNameDescr = "ConstraintNameDescr";
- public const string ConstraintTableDescr = "ConstraintTableDescr";
- public const string DataAdapter_AcceptChangesDuringFill = "DataAdapter_AcceptChangesDuringFill";
- public const string DataAdapter_AcceptChangesDuringUpdate = "DataAdapter_AcceptChangesDuringUpdate";
- public const string DataAdapter_ContinueUpdateOnError = "DataAdapter_ContinueUpdateOnError";
- public const string DataAdapter_FillError = "DataAdapter_FillError";
- public const string DataAdapter_FillLoadOption = "DataAdapter_FillLoadOption";
- public const string DataAdapter_MissingMappingAction = "DataAdapter_MissingMappingAction";
- public const string DataAdapter_MissingSchemaAction = "DataAdapter_MissingSchemaAction";
- public const string DataAdapter_ReturnProviderSpecificTypes = "DataAdapter_ReturnProviderSpecificTypes";
- public const string DataAdapter_TableMappings = "DataAdapter_TableMappings";
- public const string DataCategory_Action = "DataCategory_Action";
- public const string DataCategory_Advanced = "DataCategory_Advanced";
- public const string DataCategory_Behavior = "DataCategory_Behavior";
- public const string DataCategory_ConnectionResilency = "DataCategory_ConnectionResilency";
- public const string DataCategory_Context = "DataCategory_Context";
- public const string DataCategory_Data = "DataCategory_Data";
- public const string DataCategory_Fill = "DataCategory_Fill";
- public const string DataCategory_InfoMessage = "DataCategory_InfoMessage";
- public const string DataCategory_Initialization = "DataCategory_Initialization";
- public const string DataCategory_Mapping = "DataCategory_Mapping";
- public const string DataCategory_NamedConnectionString = "DataCategory_NamedConnectionString";
- public const string DataCategory_Notification = "DataCategory_Notification";
- public const string DataCategory_Pooling = "DataCategory_Pooling";
- public const string DataCategory_Replication = "DataCategory_Replication";
- public const string DataCategory_Schema = "DataCategory_Schema";
- public const string DataCategory_Security = "DataCategory_Security";
- public const string DataCategory_Source = "DataCategory_Source";
- public const string DataCategory_StateChange = "DataCategory_StateChange";
- public const string DataCategory_StatementCompleted = "DataCategory_StatementCompleted";
- public const string DataCategory_Update = "DataCategory_Update";
- public const string DataCategory_Xml = "DataCategory_Xml";
- public const string DataColumnAllowNullDescr = "DataColumnAllowNullDescr";
- public const string DataColumnAutoIncrementDescr = "DataColumnAutoIncrementDescr";
- public const string DataColumnAutoIncrementSeedDescr = "DataColumnAutoIncrementSeedDescr";
- public const string DataColumnAutoIncrementStepDescr = "DataColumnAutoIncrementStepDescr";
- public const string DataColumnCaptionDescr = "DataColumnCaptionDescr";
- public const string DataColumnColumnNameDescr = "DataColumnColumnNameDescr";
- public const string DataColumnDataTableDescr = "DataColumnDataTableDescr";
- public const string DataColumnDataTypeDescr = "DataColumnDataTypeDescr";
- public const string DataColumnDateTimeModeDescr = "DataColumnDateTimeModeDescr";
- public const string DataColumnDefaultValueDescr = "DataColumnDefaultValueDescr";
- public const string DataColumnExpressionDescr = "DataColumnExpressionDescr";
- public const string DataColumnMappingDescr = "DataColumnMappingDescr";
- public const string DataColumnMapping_DataSetColumn = "DataColumnMapping_DataSetColumn";
- public const string DataColumnMapping_SourceColumn = "DataColumnMapping_SourceColumn";
- public const string DataColumnMappings_Count = "DataColumnMappings_Count";
- public const string DataColumnMappings_Item = "DataColumnMappings_Item";
- public const string DataColumnMaxLengthDescr = "DataColumnMaxLengthDescr";
- public const string DataColumnNamespaceDescr = "DataColumnNamespaceDescr";
- public const string DataColumnOrdinalDescr = "DataColumnOrdinalDescr";
- public const string DataColumnPrefixDescr = "DataColumnPrefixDescr";
- public const string DataColumnReadOnlyDescr = "DataColumnReadOnlyDescr";
- public const string DataColumnUniqueDescr = "DataColumnUniqueDescr";
- public const string DataColumn_AutoIncrementAndDefaultValue = "DataColumn_AutoIncrementAndDefaultValue";
- public const string DataColumn_AutoIncrementAndExpression = "DataColumn_AutoIncrementAndExpression";
- public const string DataColumn_AutoIncrementCannotSetIfHasData = "DataColumn_AutoIncrementCannotSetIfHasData";
- public const string DataColumn_AutoIncrementSeed = "DataColumn_AutoIncrementSeed";
- public const string DataColumn_CannotChangeNamespace = "DataColumn_CannotChangeNamespace";
- public const string DataColumn_CannotSetDateTimeModeForNonDateTimeColumns = "DataColumn_CannotSetDateTimeModeForNonDateTimeColumns";
- public const string DataColumn_CannotSetMaxLength = "DataColumn_CannotSetMaxLength";
- public const string DataColumn_CannotSetMaxLength2 = "DataColumn_CannotSetMaxLength2";
- public const string DataColumn_CannotSetToNull = "DataColumn_CannotSetToNull";
- public const string DataColumn_CannotSimpleContent = "DataColumn_CannotSimpleContent";
- public const string DataColumn_CannotSimpleContentType = "DataColumn_CannotSimpleContentType";
- public const string DataColumn_ChangeDataType = "DataColumn_ChangeDataType";
- public const string DataColumn_DateTimeMode = "DataColumn_DateTimeMode";
- public const string DataColumn_DefaultValueAndAutoIncrement = "DataColumn_DefaultValueAndAutoIncrement";
- public const string DataColumn_DefaultValueColumnDataType = "DataColumn_DefaultValueColumnDataType";
- public const string DataColumn_DefaultValueDataType = "DataColumn_DefaultValueDataType";
- public const string DataColumn_DefaultValueDataType1 = "DataColumn_DefaultValueDataType1";
- public const string DataColumn_ExceedMaxLength = "DataColumn_ExceedMaxLength";
- public const string DataColumn_ExpressionAndConstraint = "DataColumn_ExpressionAndConstraint";
- public const string DataColumn_ExpressionAndReadOnly = "DataColumn_ExpressionAndReadOnly";
- public const string DataColumn_ExpressionAndUnique = "DataColumn_ExpressionAndUnique";
- public const string DataColumn_ExpressionCircular = "DataColumn_ExpressionCircular";
- public const string DataColumn_ExpressionInConstraint = "DataColumn_ExpressionInConstraint";
- public const string DataColumn_HasToBeStringType = "DataColumn_HasToBeStringType";
- public const string DataColumn_INullableUDTwithoutStaticNull = "DataColumn_INullableUDTwithoutStaticNull";
- public const string DataColumn_InvalidDataColumnMapping = "DataColumn_InvalidDataColumnMapping";
- public const string DataColumn_LongerThanMaxLength = "DataColumn_LongerThanMaxLength";
- public const string DataColumn_NameRequired = "DataColumn_NameRequired";
- public const string DataColumn_NonUniqueValues = "DataColumn_NonUniqueValues";
- public const string DataColumn_NotAllowDBNull = "DataColumn_NotAllowDBNull";
- public const string DataColumn_NotInAnyTable = "DataColumn_NotInAnyTable";
- public const string DataColumn_NotInTheTable = "DataColumn_NotInTheTable";
- public const string DataColumn_NotInTheUnderlyingTable = "DataColumn_NotInTheUnderlyingTable";
- public const string DataColumn_NullDataType = "DataColumn_NullDataType";
- public const string DataColumn_NullKeyValues = "DataColumn_NullKeyValues";
- public const string DataColumn_NullValues = "DataColumn_NullValues";
- public const string DataColumn_NullableTypesNotSupported = "DataColumn_NullableTypesNotSupported";
- public const string DataColumn_OrdinalExceedMaximun = "DataColumn_OrdinalExceedMaximun";
- public const string DataColumn_ReadOnly = "DataColumn_ReadOnly";
- public const string DataColumn_ReadOnlyAndExpression = "DataColumn_ReadOnlyAndExpression";
- public const string DataColumn_SetAddedAndModifiedCalledOnNonUnchanged = "DataColumn_SetAddedAndModifiedCalledOnNonUnchanged";
- public const string DataColumn_SetFailed = "DataColumn_SetFailed";
- public const string DataColumn_UDTImplementsIChangeTrackingButnotIRevertible = "DataColumn_UDTImplementsIChangeTrackingButnotIRevertible";
- public const string DataColumn_UniqueAndExpression = "DataColumn_UniqueAndExpression";
- public const string DataColumns_Add1 = "DataColumns_Add1";
- public const string DataColumns_Add2 = "DataColumns_Add2";
- public const string DataColumns_Add3 = "DataColumns_Add3";
- public const string DataColumns_Add4 = "DataColumns_Add4";
- public const string DataColumns_AddDuplicate = "DataColumns_AddDuplicate";
- public const string DataColumns_AddDuplicate2 = "DataColumns_AddDuplicate2";
- public const string DataColumns_AddDuplicate3 = "DataColumns_AddDuplicate3";
- public const string DataColumns_OutOfRange = "DataColumns_OutOfRange";
- public const string DataColumns_Remove = "DataColumns_Remove";
- public const string DataColumns_RemoveChildKey = "DataColumns_RemoveChildKey";
- public const string DataColumns_RemoveConstraint = "DataColumns_RemoveConstraint";
- public const string DataColumns_RemoveExpression = "DataColumns_RemoveExpression";
- public const string DataColumns_RemovePrimaryKey = "DataColumns_RemovePrimaryKey";
- public const string DataConstraint_AddFailed = "DataConstraint_AddFailed";
- public const string DataConstraint_AddPrimaryKeyConstraint = "DataConstraint_AddPrimaryKeyConstraint";
- public const string DataConstraint_BadObjectPropertyAccess = "DataConstraint_BadObjectPropertyAccess";
- public const string DataConstraint_CantAddConstraintToMultipleNestedTable = "DataConstraint_CantAddConstraintToMultipleNestedTable";
- public const string DataConstraint_CascadeDelete = "DataConstraint_CascadeDelete";
- public const string DataConstraint_CascadeUpdate = "DataConstraint_CascadeUpdate";
- public const string DataConstraint_ClearParentTable = "DataConstraint_ClearParentTable";
- public const string DataConstraint_Duplicate = "DataConstraint_Duplicate";
- public const string DataConstraint_DuplicateName = "DataConstraint_DuplicateName";
- public const string DataConstraint_ForeignKeyViolation = "DataConstraint_ForeignKeyViolation";
- public const string DataConstraint_ForeignTable = "DataConstraint_ForeignTable";
- public const string DataConstraint_NeededForForeignKeyConstraint = "DataConstraint_NeededForForeignKeyConstraint";
- public const string DataConstraint_NoName = "DataConstraint_NoName";
- public const string DataConstraint_NotInTheTable = "DataConstraint_NotInTheTable";
- public const string DataConstraint_OutOfRange = "DataConstraint_OutOfRange";
- public const string DataConstraint_ParentValues = "DataConstraint_ParentValues";
- public const string DataConstraint_RemoveFailed = "DataConstraint_RemoveFailed";
- public const string DataConstraint_RemoveParentRow = "DataConstraint_RemoveParentRow";
- public const string DataConstraint_UniqueViolation = "DataConstraint_UniqueViolation";
- public const string DataConstraint_Violation = "DataConstraint_Violation";
- public const string DataConstraint_ViolationValue = "DataConstraint_ViolationValue";
- public const string DataDom_CloneNode = "DataDom_CloneNode";
- public const string DataDom_ColumnMappingChange = "DataDom_ColumnMappingChange ";
- public const string DataDom_ColumnNameChange = "DataDom_ColumnNameChange ";
- public const string DataDom_ColumnNamespaceChange = "DataDom_ColumnNamespaceChange ";
- public const string DataDom_DataSetNameChange = "DataDom_DataSetNameChange ";
- public const string DataDom_DataSetNestedRelationsChange = "DataDom_DataSetNestedRelationsChange ";
- public const string DataDom_DataSetNull = "DataDom_DataSetNull";
- public const string DataDom_DataSetTablesChange = "DataDom_DataSetTablesChange ";
- public const string DataDom_EnforceConstraintsShouldBeOff = "DataDom_EnforceConstraintsShouldBeOff ";
- public const string DataDom_Foliation = "DataDom_Foliation";
- public const string DataDom_MultipleDataSet = "DataDom_MultipleDataSet";
- public const string DataDom_MultipleLoad = "DataDom_MultipleLoad ";
- public const string DataDom_NotSupport_Clear = "DataDom_NotSupport_Clear ";
- public const string DataDom_NotSupport_EntRef = "DataDom_NotSupport_EntRef ";
- public const string DataDom_NotSupport_GetElementById = "DataDom_NotSupport_GetElementById ";
- public const string DataDom_TableColumnsChange = "DataDom_TableColumnsChange ";
- public const string DataDom_TableNameChange = "DataDom_TableNameChange ";
- public const string DataDom_TableNamespaceChange = "DataDom_TableNamespaceChange ";
- public const string DataIndex_FindWithoutSortOrder = "DataIndex_FindWithoutSortOrder";
- public const string DataIndex_KeyLength = "DataIndex_KeyLength";
- public const string DataIndex_RecordStateRange = "DataIndex_RecordStateRange";
- public const string DataKey_DuplicateColumns = "DataKey_DuplicateColumns";
- public const string DataKey_NoColumns = "DataKey_NoColumns";
- public const string DataKey_RemovePrimaryKey = "DataKey_RemovePrimaryKey";
- public const string DataKey_RemovePrimaryKey1 = "DataKey_RemovePrimaryKey1";
- public const string DataKey_TableMismatch = "DataKey_TableMismatch";
- public const string DataKey_TooManyColumns = "DataKey_TooManyColumns";
- public const string DataMerge_DataTypeMismatch = "DataMerge_DataTypeMismatch";
- public const string DataMerge_MissingColumnDefinition = "DataMerge_MissingColumnDefinition";
- public const string DataMerge_MissingConstraint = "DataMerge_MissingConstraint";
- public const string DataMerge_MissingDefinition = "DataMerge_MissingDefinition";
- public const string DataMerge_PrimaryKeyColumnsMismatch = "DataMerge_PrimaryKeyColumnsMismatch";
- public const string DataMerge_PrimaryKeyMismatch = "DataMerge_PrimaryKeyMismatch";
- public const string DataMerge_ReltionKeyColumnsMismatch = "DataMerge_ReltionKeyColumnsMismatch";
- public const string DataROWView_PropertyNotFound = "DataROWView_PropertyNotFound";
- public const string DataRelationChildColumnsDescr = "DataRelationChildColumnsDescr";
- public const string DataRelationNested = "DataRelationNested";
- public const string DataRelationParentColumnsDescr = "DataRelationParentColumnsDescr";
- public const string DataRelationRelationNameDescr = "DataRelationRelationNameDescr";
- public const string DataRelation_AlreadyExists = "DataRelation_AlreadyExists";
- public const string DataRelation_AlreadyInOtherDataSet = "DataRelation_AlreadyInOtherDataSet";
- public const string DataRelation_AlreadyInTheDataSet = "DataRelation_AlreadyInTheDataSet";
- public const string DataRelation_CaseLocaleMismatch = "DataRelation_CaseLocaleMismatch";
- public const string DataRelation_ChildTableMismatch = "DataRelation_ChildTableMismatch";
- public const string DataRelation_ColumnsTypeMismatch = "DataRelation_ColumnsTypeMismatch";
- public const string DataRelation_DataSetMismatch = "DataRelation_DataSetMismatch";
- public const string DataRelation_DoesNotExist = "DataRelation_DoesNotExist";
- public const string DataRelation_DuplicateName = "DataRelation_DuplicateName";
- public const string DataRelation_ForeignDataSet = "DataRelation_ForeignDataSet";
- public const string DataRelation_ForeignRow = "DataRelation_ForeignRow";
- public const string DataRelation_ForeignTable = "DataRelation_ForeignTable";
- public const string DataRelation_GetParentRowTableMismatch = "DataRelation_GetParentRowTableMismatch";
- public const string DataRelation_InValidNamespaceInNestedRelation = "DataRelation_InValidNamespaceInNestedRelation";
- public const string DataRelation_InValidNestedRelation = "DataRelation_InValidNestedRelation";
- public const string DataRelation_KeyColumnsIdentical = "DataRelation_KeyColumnsIdentical";
- public const string DataRelation_KeyLengthMismatch = "DataRelation_KeyLengthMismatch";
- public const string DataRelation_KeyZeroLength = "DataRelation_KeyZeroLength";
- public const string DataRelation_LoopInNestedRelations = "DataRelation_LoopInNestedRelations";
- public const string DataRelation_NoName = "DataRelation_NoName";
- public const string DataRelation_NotInTheDataSet = "DataRelation_NotInTheDataSet";
- public const string DataRelation_OutOfRange = "DataRelation_OutOfRange";
- public const string DataRelation_ParentOrChildColumnsDoNotHaveDataSet = "DataRelation_ParentOrChildColumnsDoNotHaveDataSet";
- public const string DataRelation_ParentTableMismatch = "DataRelation_ParentTableMismatch";
- public const string DataRelation_RelationNestedReadOnly = "DataRelation_RelationNestedReadOnly";
- public const string DataRelation_SetParentRowTableMismatch = "DataRelation_SetParentRowTableMismatch";
- public const string DataRelation_TableCantBeNestedInTwoTables = "DataRelation_TableCantBeNestedInTwoTables";
- public const string DataRelation_TableNull = "DataRelation_TableNull";
- public const string DataRelation_TableWasRemoved = "DataRelation_TableWasRemoved";
- public const string DataRelation_TablesInDifferentSets = "DataRelation_TablesInDifferentSets";
- public const string DataRow_AlreadyDeleted = "DataRow_AlreadyDeleted";
- public const string DataRow_AlreadyInOtherCollection = "DataRow_AlreadyInOtherCollection";
- public const string DataRow_AlreadyInTheCollection = "DataRow_AlreadyInTheCollection";
- public const string DataRow_AlreadyRemoved = "DataRow_AlreadyRemoved";
- public const string DataRow_BeginEditInRowChanging = "DataRow_BeginEditInRowChanging";
- public const string DataRow_CancelEditInRowChanging = "DataRow_CancelEditInRowChanging";
- public const string DataRow_DeleteInRowDeleting = "DataRow_DeleteInRowDeleting";
- public const string DataRow_DeletedRowInaccessible = "DataRow_DeletedRowInaccessible";
- public const string DataRow_EditInRowChanging = "DataRow_EditInRowChanging";
- public const string DataRow_Empty = "DataRow_Empty";
- public const string DataRow_EndEditInRowChanging = "DataRow_EndEditInRowChanging";
- public const string DataRow_InvalidRowBitPattern = "DataRow_InvalidRowBitPattern";
- public const string DataRow_InvalidVersion = "DataRow_InvalidVersion";
- public const string DataRow_MultipleParents = "DataRow_MultipleParents";
- public const string DataRow_NoCurrentData = "DataRow_NoCurrentData";
- public const string DataRow_NoOriginalData = "DataRow_NoOriginalData";
- public const string DataRow_NoProposedData = "DataRow_NoProposedData";
- public const string DataRow_NotInTheDataSet = "DataRow_NotInTheDataSet";
- public const string DataRow_NotInTheTable = "DataRow_NotInTheTable";
- public const string DataRow_OutOfRange = "DataRow_OutOfRange";
- public const string DataRow_ParentRowNotInTheDataSet = "DataRow_ParentRowNotInTheDataSet";
- public const string DataRow_RemovedFromTheTable = "DataRow_RemovedFromTheTable";
- public const string DataRow_RowInsertMissing = "DataRow_RowInsertMissing";
- public const string DataRow_RowInsertOutOfRange = "DataRow_RowInsertOutOfRange";
- public const string DataRow_RowInsertTwice = "DataRow_RowInsertTwice";
- public const string DataRow_RowOutOfRange = "DataRow_RowOutOfRange";
- public const string DataRow_ValuesArrayLength = "DataRow_ValuesArrayLength";
- public const string DataSetCaseSensitiveDescr = "DataSetCaseSensitiveDescr";
- public const string DataSetDataSetNameDescr = "DataSetDataSetNameDescr";
- public const string DataSetDefaultViewDescr = "DataSetDefaultViewDescr";
- public const string DataSetDescr = "DataSetDescr";
- public const string DataSetEnforceConstraintsDescr = "DataSetEnforceConstraintsDescr";
- public const string DataSetHasErrorsDescr = "DataSetHasErrorsDescr";
- public const string DataSetInitializedDescr = "DataSetInitializedDescr";
- public const string DataSetLocaleDescr = "DataSetLocaleDescr";
- public const string DataSetMergeFailedDescr = "DataSetMergeFailedDescr";
- public const string DataSetNamespaceDescr = "DataSetNamespaceDescr";
- public const string DataSetPrefixDescr = "DataSetPrefixDescr";
- public const string DataSetRelationsDescr = "DataSetRelationsDescr";
- public const string DataSetTablesDescr = "DataSetTablesDescr";
- public const string DataSet_CannotChangeCaseLocale = "DataSet_CannotChangeCaseLocale";
- public const string DataSet_CannotChangeSchemaSerializationMode = "DataSet_CannotChangeSchemaSerializationMode";
- public const string DataSet_DefaultConstraintException = "DataSet_DefaultConstraintException";
- public const string DataSet_DefaultDataException = "DataSet_DefaultDataException";
- public const string DataSet_DefaultDeletedRowInaccessibleException = "DataSet_DefaultDeletedRowInaccessibleException";
- public const string DataSet_DefaultDuplicateNameException = "DataSet_DefaultDuplicateNameException";
- public const string DataSet_DefaultInRowChangingEventException = "DataSet_DefaultInRowChangingEventException";
- public const string DataSet_DefaultInvalidConstraintException = "DataSet_DefaultInvalidConstraintException";
- public const string DataSet_DefaultMissingPrimaryKeyException = "DataSet_DefaultMissingPrimaryKeyException";
- public const string DataSet_DefaultNoNullAllowedException = "DataSet_DefaultNoNullAllowedException";
- public const string DataSet_DefaultReadOnlyException = "DataSet_DefaultReadOnlyException";
- public const string DataSet_DefaultRowNotInTableException = "DataSet_DefaultRowNotInTableException";
- public const string DataSet_DefaultVersionNotFoundException = "DataSet_DefaultVersionNotFoundException";
- public const string DataSet_SetDataSetNameConflicting = "DataSet_SetDataSetNameConflicting";
- public const string DataSet_SetNameToEmpty = "DataSet_SetNameToEmpty";
- public const string DataSet_UnsupportedSchema = "DataSet_UnsupportedSchema";
- public const string DataStorage_AggregateException = "DataStorage_AggregateException";
- public const string DataStorage_IComparableNotDefined = "DataStorage_IComparableNotDefined";
- public const string DataStorage_InvalidStorageType = "DataStorage_InvalidStorageType";
- public const string DataStorage_ProblematicChars = "DataStorage_ProblematicChars";
- public const string DataStorage_SetInvalidDataType = "DataStorage_SetInvalidDataType";
- public const string DataTableCaseSensitiveDescr = "DataTableCaseSensitiveDescr";
- public const string DataTableChildRelationsDescr = "DataTableChildRelationsDescr";
- public const string DataTableColumnChangedDescr = "DataTableColumnChangedDescr";
- public const string DataTableColumnChangingDescr = "DataTableColumnChangingDescr";
- public const string DataTableColumnsDescr = "DataTableColumnsDescr";
- public const string DataTableConstraintsDescr = "DataTableConstraintsDescr";
- public const string DataTableDataSetDescr = "DataTableDataSetDescr";
- public const string DataTableDefaultViewDescr = "DataTableDefaultViewDescr";
- public const string DataTableDisplayExpressionDescr = "DataTableDisplayExpressionDescr";
- public const string DataTableHasErrorsDescr = "DataTableHasErrorsDescr";
- public const string DataTableLocaleDescr = "DataTableLocaleDescr";
- public const string DataTableMapping_ColumnMappings = "DataTableMapping_ColumnMappings";
- public const string DataTableMapping_DataSetTable = "DataTableMapping_DataSetTable";
- public const string DataTableMapping_SourceTable = "DataTableMapping_SourceTable";
- public const string DataTableMappings_Count = "DataTableMappings_Count";
- public const string DataTableMappings_Item = "DataTableMappings_Item";
- public const string DataTableMinimumCapacityDescr = "DataTableMinimumCapacityDescr";
- public const string DataTableNamespaceDescr = "DataTableNamespaceDescr";
- public const string DataTableParentRelationsDescr = "DataTableParentRelationsDescr";
- public const string DataTablePrefixDescr = "DataTablePrefixDescr";
- public const string DataTablePrimaryKeyDescr = "DataTablePrimaryKeyDescr";
- public const string DataTableReader_ArgumentContainsNullValue = "DataTableReader_ArgumentContainsNullValue";
- public const string DataTableReader_CannotCreateDataReaderOnEmptyDataSet = "DataTableReader_CannotCreateDataReaderOnEmptyDataSet";
- public const string DataTableReader_DataTableCleared = "DataTableReader_DataTableCleared";
- public const string DataTableReader_DataTableReaderArgumentIsEmpty = "DataTableReader_DataTableReaderArgumentIsEmpty";
- public const string DataTableReader_InvalidDataTableReader = "DataTableReader_InvalidDataTableReader";
- public const string DataTableReader_InvalidRowInDataTableReader = "DataTableReader_InvalidRowInDataTableReader";
- public const string DataTableReader_SchemaInvalidDataTableReader = "DataTableReader_SchemaInvalidDataTableReader";
- public const string DataTableRowChangedDescr = "DataTableRowChangedDescr";
- public const string DataTableRowChangingDescr = "DataTableRowChangingDescr";
- public const string DataTableRowDeletedDescr = "DataTableRowDeletedDescr";
- public const string DataTableRowDeletingDescr = "DataTableRowDeletingDescr";
- public const string DataTableRowsClearedDescr = "DataTableRowsClearedDescr";
- public const string DataTableRowsClearingDescr = "DataTableRowsClearingDescr";
- public const string DataTableRowsDescr = "DataTableRowsDescr";
- public const string DataTableRowsNewRowDescr = "DataTableRowsNewRowDescr";
- public const string DataTableSerializeHierarchy = "DataTableSerializeHierarchy";
- public const string DataTableTableNameDescr = "DataTableTableNameDescr";
- public const string DataTable_AlreadyInOtherDataSet = "DataTable_AlreadyInOtherDataSet";
- public const string DataTable_AlreadyInTheDataSet = "DataTable_AlreadyInTheDataSet";
- public const string DataTable_CanNotRemoteDataTable = "DataTable_CanNotRemoteDataTable";
- public const string DataTable_CanNotSerializeDataTableHierarchy = "DataTable_CanNotSerializeDataTableHierarchy";
- public const string DataTable_CanNotSerializeDataTableWithEmptyName = "DataTable_CanNotSerializeDataTableWithEmptyName";
- public const string DataTable_CanNotSetRemotingFormat = "DataTable_CanNotSetRemotingFormat";
- public const string DataTable_CannotAddToSimpleContent = "DataTable_CannotAddToSimpleContent";
- public const string DataTable_DatasetConflictingName = "DataTable_DatasetConflictingName";
- public const string DataTable_DuplicateName = "DataTable_DuplicateName";
- public const string DataTable_DuplicateName2 = "DataTable_DuplicateName2";
- public const string DataTable_ForeignPrimaryKey = "DataTable_ForeignPrimaryKey";
- public const string DataTable_InConstraint = "DataTable_InConstraint";
- public const string DataTable_InRelation = "DataTable_InRelation";
- public const string DataTable_InvalidSortString = "DataTable_InvalidSortString";
- public const string DataTable_MissingPrimaryKey = "DataTable_MissingPrimaryKey";
- public const string DataTable_MultipleSimpleContentColumns = "DataTable_MultipleSimpleContentColumns";
- public const string DataTable_NoName = "DataTable_NoName";
- public const string DataTable_NotInTheDataSet = "DataTable_NotInTheDataSet";
- public const string DataTable_OutOfRange = "DataTable_OutOfRange";
- public const string DataTable_SelfnestedDatasetConflictingName = "DataTable_SelfnestedDatasetConflictingName";
- public const string DataTable_TableNotFound = "DataTable_TableNotFound";
- public const string DataViewAllowDeleteDescr = "DataViewAllowDeleteDescr";
- public const string DataViewAllowEditDescr = "DataViewAllowEditDescr";
- public const string DataViewAllowNewDescr = "DataViewAllowNewDescr";
- public const string DataViewApplyDefaultSortDescr = "DataViewApplyDefaultSortDescr";
- public const string DataViewCountDescr = "DataViewCountDescr";
- public const string DataViewDataViewManagerDescr = "DataViewDataViewManagerDescr";
- public const string DataViewIsOpenDescr = "DataViewIsOpenDescr";
- public const string DataViewListChangedDescr = "DataViewListChangedDescr";
- public const string DataViewManagerDataSetDescr = "DataViewManagerDataSetDescr";
- public const string DataViewManagerTableSettingsDescr = "DataViewManagerTableSettingsDescr";
- public const string DataViewRowFilterDescr = "DataViewRowFilterDescr";
- public const string DataViewRowStateFilterDescr = "DataViewRowStateFilterDescr";
- public const string DataViewSortDescr = "DataViewSortDescr";
- public const string DataViewTableDescr = "DataViewTableDescr";
- public const string DataView_AddExternalObject = "DataView_AddExternalObject";
- public const string DataView_AddNewNotAllowNull = "DataView_AddNewNotAllowNull";
- public const string DataView_CanNotBindTable = "DataView_CanNotBindTable";
- public const string DataView_CanNotClear = "DataView_CanNotClear";
- public const string DataView_CanNotDelete = "DataView_CanNotDelete";
- public const string DataView_CanNotEdit = "DataView_CanNotEdit";
- public const string DataView_CanNotSetDataSet = "DataView_CanNotSetDataSet";
- public const string DataView_CanNotSetTable = "DataView_CanNotSetTable";
- public const string DataView_CanNotUse = "DataView_CanNotUse";
- public const string DataView_CanNotUseDataViewManager = "DataView_CanNotUseDataViewManager";
- public const string DataView_CreateChildView = "DataView_CreateChildView";
- public const string DataView_GetElementIndex = "DataView_GetElementIndex";
- public const string DataView_InsertExternalObject = "DataView_InsertExternalObject";
- public const string DataView_NotOpen = "DataView_NotOpen";
- public const string DataView_RemoveExternalObject = "DataView_RemoveExternalObject";
- public const string DataView_SetDataSetFailed = "DataView_SetDataSetFailed";
- public const string DataView_SetFailed = "DataView_SetFailed";
- public const string DataView_SetIListObject = "DataView_SetIListObject";
- public const string DataView_SetRowStateFilter = "DataView_SetRowStateFilter";
- public const string DataView_SetTable = "DataView_SetTable";
- public const string Data_ArgumentContainsNull = "Data_ArgumentContainsNull";
- public const string Data_ArgumentNull = "Data_ArgumentNull";
- public const string Data_ArgumentOutOfRange = "Data_ArgumentOutOfRange";
- public const string Data_CannotModifyCollection = "Data_CannotModifyCollection";
- public const string Data_CaseInsensitiveNameConflict = "Data_CaseInsensitiveNameConflict";
- public const string Data_EnforceConstraints = "Data_EnforceConstraints";
- public const string Data_InvalidOffsetLength = "Data_InvalidOffsetLength";
- public const string Data_NamespaceNameConflict = "Data_NamespaceNameConflict";
- public const string DbCommandBuilder_CatalogLocation = "DbCommandBuilder_CatalogLocation";
- public const string DbCommandBuilder_CatalogSeparator = "DbCommandBuilder_CatalogSeparator";
- public const string DbCommandBuilder_ConflictOption = "DbCommandBuilder_ConflictOption";
- public const string DbCommandBuilder_DataAdapter = "DbCommandBuilder_DataAdapter";
- public const string DbCommandBuilder_QuotePrefix = "DbCommandBuilder_QuotePrefix";
- public const string DbCommandBuilder_QuoteSuffix = "DbCommandBuilder_QuoteSuffix";
- public const string DbCommandBuilder_SchemaSeparator = "DbCommandBuilder_SchemaSeparator";
- public const string DbCommandBuilder_SetAllValues = "DbCommandBuilder_SetAllValues";
- public const string DbCommand_CommandText = "DbCommand_CommandText";
- public const string DbCommand_CommandTimeout = "DbCommand_CommandTimeout";
- public const string DbCommand_CommandType = "DbCommand_CommandType";
- public const string DbCommand_Connection = "DbCommand_Connection";
- public const string DbCommand_Parameters = "DbCommand_Parameters";
- public const string DbCommand_StatementCompleted = "DbCommand_StatementCompleted";
- public const string DbCommand_Transaction = "DbCommand_Transaction";
- public const string DbCommand_UpdatedRowSource = "DbCommand_UpdatedRowSource";
- public const string DbConnectionString_ApplicationIntent = "DbConnectionString_ApplicationIntent";
- public const string DbConnectionString_ApplicationName = "DbConnectionString_ApplicationName";
- public const string DbConnectionString_AsynchronousProcessing = "DbConnectionString_AsynchronousProcessing";
- public const string DbConnectionString_AttachDBFilename = "DbConnectionString_AttachDBFilename";
- public const string DbConnectionString_ConnectRetryCount = "DbConnectionString_ConnectRetryCount";
- public const string DbConnectionString_ConnectRetryInterval = "DbConnectionString_ConnectRetryInterval";
- public const string DbConnectionString_ConnectTimeout = "DbConnectionString_ConnectTimeout";
- public const string DbConnectionString_ConnectionReset = "DbConnectionString_ConnectionReset";
- public const string DbConnectionString_ConnectionString = "DbConnectionString_ConnectionString";
- public const string DbConnectionString_ContextConnection = "DbConnectionString_ContextConnection";
- public const string DbConnectionString_CurrentLanguage = "DbConnectionString_CurrentLanguage";
- public const string DbConnectionString_DSN = "DbConnectionString_DSN";
- public const string DbConnectionString_DataSource = "DbConnectionString_DataSource";
- public const string DbConnectionString_Driver = "DbConnectionString_Driver";
- public const string DbConnectionString_Encrypt = "DbConnectionString_Encrypt";
- public const string DbConnectionString_Enlist = "DbConnectionString_Enlist";
- public const string DbConnectionString_FailoverPartner = "DbConnectionString_FailoverPartner";
- public const string DbConnectionString_FileName = "DbConnectionString_FileName";
- public const string DbConnectionString_InitialCatalog = "DbConnectionString_InitialCatalog";
- public const string DbConnectionString_IntegratedSecurity = "DbConnectionString_IntegratedSecurity";
- public const string DbConnectionString_LoadBalanceTimeout = "DbConnectionString_LoadBalanceTimeout";
- public const string DbConnectionString_MaxPoolSize = "DbConnectionString_MaxPoolSize";
- public const string DbConnectionString_MinPoolSize = "DbConnectionString_MinPoolSize";
- public const string DbConnectionString_MultiSubnetFailover = "DbConnectionString_MultiSubnetFailover";
- public const string DbConnectionString_MultipleActiveResultSets = "DbConnectionString_MultipleActiveResultSets";
- public const string DbConnectionString_NamedConnection = "DbConnectionString_NamedConnection";
- public const string DbConnectionString_NetworkLibrary = "DbConnectionString_NetworkLibrary";
- public const string DbConnectionString_OleDbServices = "DbConnectionString_OleDbServices";
- public const string DbConnectionString_PacketSize = "DbConnectionString_PacketSize";
- public const string DbConnectionString_Password = "DbConnectionString_Password";
- public const string DbConnectionString_PersistSecurityInfo = "DbConnectionString_PersistSecurityInfo";
- public const string DbConnectionString_Pooling = "DbConnectionString_Pooling";
- public const string DbConnectionString_Provider = "DbConnectionString_Provider";
- public const string DbConnectionString_Replication = "DbConnectionString_Replication ";
- public const string DbConnectionString_TransactionBinding = "DbConnectionString_TransactionBinding";
- public const string DbConnectionString_TrustServerCertificate = "DbConnectionString_TrustServerCertificate";
- public const string DbConnectionString_TypeSystemVersion = "DbConnectionString_TypeSystemVersion";
- public const string DbConnectionString_UserID = "DbConnectionString_UserID";
- public const string DbConnectionString_UserInstance = "DbConnectionString_UserInstance";
- public const string DbConnectionString_WorkstationID = "DbConnectionString_WorkstationID";
- public const string DbConnection_InfoMessage = "DbConnection_InfoMessage";
- public const string DbConnection_State = "DbConnection_State";
- public const string DbConnection_StateChange = "DbConnection_StateChange";
- public const string DbDataAdapter_DeleteCommand = "DbDataAdapter_DeleteCommand";
- public const string DbDataAdapter_InsertCommand = "DbDataAdapter_InsertCommand";
- public const string DbDataAdapter_RowUpdated = "DbDataAdapter_RowUpdated";
- public const string DbDataAdapter_RowUpdating = "DbDataAdapter_RowUpdating";
- public const string DbDataAdapter_SelectCommand = "DbDataAdapter_SelectCommand";
- public const string DbDataAdapter_UpdateBatchSize = "DbDataAdapter_UpdateBatchSize";
- public const string DbDataAdapter_UpdateCommand = "DbDataAdapter_UpdateCommand";
- public const string DbDataParameter_Precision = "DbDataParameter_Precision";
- public const string DbDataParameter_Scale = "DbDataParameter_Scale";
- public const string DbParameter_DbType = "DbParameter_DbType";
- public const string DbParameter_Direction = "DbParameter_Direction";
- public const string DbParameter_Offset = "DbParameter_Offset";
- public const string DbParameter_ParameterName = "DbParameter_ParameterName";
- public const string DbParameter_Size = "DbParameter_Size";
- public const string DbParameter_SourceColumn = "DbParameter_SourceColumn";
- public const string DbParameter_SourceColumnNullMapping = "DbParameter_SourceColumnNullMapping";
- public const string DbParameter_SourceVersion = "DbParameter_SourceVersion";
- public const string DbParameter_Value = "DbParameter_Value";
- public const string Expr_AggregateArgument = "Expr_AggregateArgument";
- public const string Expr_AggregateUnbound = "Expr_AggregateUnbound";
- public const string Expr_AmbiguousBinop = "Expr_AmbiguousBinop";
- public const string Expr_ArgumentOutofRange = "Expr_ArgumentOutofRange";
- public const string Expr_ArgumentType = "Expr_ArgumentType";
- public const string Expr_ArgumentTypeInteger = "Expr_ArgumentTypeInteger";
- public const string Expr_BindFailure = "Expr_BindFailure";
- public const string Expr_ComputeNotAggregate = "Expr_ComputeNotAggregate";
- public const string Expr_DatatypeConvertion = "Expr_DatatypeConvertion";
- public const string Expr_DatavalueConvertion = "Expr_DatavalueConvertion";
- public const string Expr_EvalNoContext = "Expr_EvalNoContext";
- public const string Expr_ExpressionTooComplex = "Expr_ExpressionTooComplex";
- public const string Expr_ExpressionUnbound = "Expr_ExpressionUnbound";
- public const string Expr_FilterConvertion = "Expr_FilterConvertion";
- public const string Expr_FunctionArgumentCount = "Expr_FunctionArgumentCount";
- public const string Expr_InWithoutList = "Expr_InWithoutList";
- public const string Expr_InWithoutParentheses = "Expr_InWithoutParentheses";
- public const string Expr_InvalidDate = "Expr_InvalidDate";
- public const string Expr_InvalidHoursArgument = "Expr_InvalidHoursArgument";
- public const string Expr_InvalidMinutesArgument = "Expr_InvalidMinutesArgument";
- public const string Expr_InvalidName = "Expr_InvalidName";
- public const string Expr_InvalidNameBracketing = "Expr_InvalidNameBracketing";
- public const string Expr_InvalidPattern = "Expr_InvalidPattern";
- public const string Expr_InvalidString = "Expr_InvalidString";
- public const string Expr_InvalidTimeZoneRange = "Expr_InvalidTimeZoneRange";
- public const string Expr_InvalidType = "Expr_InvalidType";
- public const string Expr_InvokeArgument = "Expr_InvokeArgument";
- public const string Expr_IsSyntax = "Expr_IsSyntax";
- public const string Expr_LookupArgument = "Expr_LookupArgument";
- public const string Expr_MismatchKindandTimeSpan = "Expr_MismatchKindandTimeSpan";
- public const string Expr_MissingOperand = "Expr_MissingOperand";
- public const string Expr_MissingOperandBefore = "Expr_MissingOperandBefore";
- public const string Expr_MissingRightParen = "Expr_MissingRightParen";
- public const string Expr_NYI = "Expr_NYI";
- public const string Expr_NonConstantArgument = "Expr_NonConstantArgument";
- public const string Expr_Overflow = "Expr_Overflow";
- public const string Expr_Syntax = "Expr_Syntax";
- public const string Expr_TooManyRightParentheses = "Expr_TooManyRightParentheses";
- public const string Expr_TypeMismatch = "Expr_TypeMismatch";
- public const string Expr_TypeMismatchInBinop = "Expr_TypeMismatchInBinop";
- public const string Expr_UnboundName = "Expr_UnboundName";
- public const string Expr_UndefinedFunction = "Expr_UndefinedFunction";
- public const string Expr_UnknownToken = "Expr_UnknownToken";
- public const string Expr_UnknownToken1 = "Expr_UnknownToken1";
- public const string Expr_UnresolvedRelation = "Expr_UnresolvedRelation";
- public const string Expr_UnsupportedOperator = "Expr_UnsupportedOperator";
- public const string Expr_UnsupportedType = "Expr_UnsupportedType";
- public const string ExtendedPropertiesDescr = "ExtendedPropertiesDescr";
- public const string ForeignKeyConstraintAcceptRejectRuleDescr = "ForeignKeyConstraintAcceptRejectRuleDescr";
- public const string ForeignKeyConstraintChildColumnsDescr = "ForeignKeyConstraintChildColumnsDescr";
- public const string ForeignKeyConstraintDeleteRuleDescr = "ForeignKeyConstraintDeleteRuleDescr";
- public const string ForeignKeyConstraintParentColumnsDescr = "ForeignKeyConstraintParentColumnsDescr";
- public const string ForeignKeyConstraintUpdateRuleDescr = "ForeignKeyConstraintUpdateRuleDescr";
- public const string ForeignKeyRelatedTableDescr = "ForeignKeyRelatedTableDescr";
- public const string IEnumerableOfSqlDataRecordHasNoRows = "IEnumerableOfSqlDataRecordHasNoRows";
- public const string InvalidSchemaTableOrdinals = "InvalidSchemaTableOrdinals";
- public const string KeyConstraintColumnsDescr = "KeyConstraintColumnsDescr";
- public const string KeyConstraintIsPrimaryKeyDescr = "KeyConstraintIsPrimaryKeyDescr";
- public const string Load_ReadOnlyDataModified = "Load_ReadOnlyDataModified";
- public const string MDF_AmbigousCollectionName = "MDF_AmbigousCollectionName";
- public const string MDF_CollectionNameISNotUnique = "MDF_CollectionNameISNotUnique";
- public const string MDF_DataTableDoesNotExist = "MDF_DataTableDoesNotExist";
- public const string MDF_IncorrectNumberOfDataSourceInformationRows = "MDF_IncorrectNumberOfDataSourceInformationRows";
- public const string MDF_InvalidRestrictionValue = "MDF_InvalidRestrictionValue";
- public const string MDF_InvalidXml = "MDF_InvalidXml";
- public const string MDF_InvalidXmlInvalidValue = "MDF_InvalidXmlInvalidValue";
- public const string MDF_InvalidXmlMissingColumn = "MDF_InvalidXmlMissingColumn";
- public const string MDF_MissingDataSourceInformationColumn = "MDF_MissingDataSourceInformationColumn";
- public const string MDF_MissingRestrictionColumn = "MDF_MissingRestrictionColumn";
- public const string MDF_MissingRestrictionRow = "MDF_MissingRestrictionRow";
- public const string MDF_NoColumns = "MDF_NoColumns";
- public const string MDF_QueryFailed = "MDF_QueryFailed";
- public const string MDF_TooManyRestrictions = "MDF_TooManyRestrictions";
- public const string MDF_UnableToBuildCollection = "MDF_UnableToBuildCollection";
- public const string MDF_UndefinedCollection = "MDF_UndefinedCollection";
- public const string MDF_UndefinedPopulationMechanism = "MDF_UndefinedPopulationMechanism";
- public const string MDF_UnsupportedVersion = "MDF_UnsupportedVersion";
- public const string MetaType_SingleValuedStructNotSupported = "MetaType_SingleValuedStructNotSupported";
- public const string NamedSimpleType_InvalidDuplicateNamedSimpleTypeDelaration = "NamedSimpleType_InvalidDuplicateNamedSimpleTypeDelaration";
- public const string NullSchemaTableDataTypeNotSupported = "NullSchemaTableDataTypeNotSupported";
- public const string ODBC_GetSchemaRestrictionRequired = "ODBC_GetSchemaRestrictionRequired";
- public const string ODBC_NotSupportedEnumerationValue = "ODBC_NotSupportedEnumerationValue";
- public const string ODBC_ODBCCommandText = "ODBC_ODBCCommandText";
- public const string OLEDB_OLEDBCommandText = "OLEDB_OLEDBCommandText";
- public const string OdbcCommandBuilder_DataAdapter = "OdbcCommandBuilder_DataAdapter";
- public const string OdbcConnection_ConnectionString = "OdbcConnection_ConnectionString";
- public const string OdbcConnection_ConnectionStringTooLong = "OdbcConnection_ConnectionStringTooLong";
- public const string OdbcConnection_ConnectionTimeout = "OdbcConnection_ConnectionTimeout";
- public const string OdbcConnection_DataSource = "OdbcConnection_DataSource";
- public const string OdbcConnection_Database = "OdbcConnection_Database";
- public const string OdbcConnection_Driver = "OdbcConnection_Driver";
- public const string OdbcConnection_ServerVersion = "OdbcConnection_ServerVersion";
- public const string OdbcParameter_OdbcType = "OdbcParameter_OdbcType";
- public const string Odbc_CantAllocateEnvironmentHandle = "Odbc_CantAllocateEnvironmentHandle";
- public const string Odbc_CantEnableConnectionpooling = "Odbc_CantEnableConnectionpooling";
- public const string Odbc_CantSetPropertyOnOpenConnection = "Odbc_CantSetPropertyOnOpenConnection";
- public const string Odbc_ConnectionClosed = "Odbc_ConnectionClosed";
- public const string Odbc_ExceptionMessage = "Odbc_ExceptionMessage";
- public const string Odbc_FailedToGetDescriptorHandle = "Odbc_FailedToGetDescriptorHandle";
- public const string Odbc_MDACWrongVersion = "Odbc_MDACWrongVersion";
- public const string Odbc_NegativeArgument = "Odbc_NegativeArgument";
- public const string Odbc_NoMappingForSqlTransactionLevel = "Odbc_NoMappingForSqlTransactionLevel";
- public const string Odbc_NotInTransaction = "Odbc_NotInTransaction";
- public const string Odbc_OpenConnectionNoOwner = "Odbc_OpenConnectionNoOwner";
- public const string Odbc_UnknownSQLType = "Odbc_UnknownSQLType";
- public const string OleDbCommandBuilder_DataAdapter = "OleDbCommandBuilder_DataAdapter";
- public const string OleDbConnection_ConnectionString = "OleDbConnection_ConnectionString";
- public const string OleDbConnection_ConnectionTimeout = "OleDbConnection_ConnectionTimeout";
- public const string OleDbConnection_DataSource = "OleDbConnection_DataSource";
- public const string OleDbConnection_Database = "OleDbConnection_Database";
- public const string OleDbConnection_Provider = "OleDbConnection_Provider";
- public const string OleDbConnection_ServerVersion = "OleDbConnection_ServerVersion";
- public const string OleDbParameter_OleDbType = "OleDbParameter_OleDbType";
- public const string OleDb_AsynchronousNotSupported = "OleDb_AsynchronousNotSupported";
- public const string OleDb_BadAccessor = "OleDb_BadAccessor";
- public const string OleDb_BadStatusRowAccessor = "OleDb_BadStatusRowAccessor";
- public const string OleDb_BadStatus_ParamAcc = "OleDb_BadStatus_ParamAcc";
- public const string OleDb_CantConvertValue = "OleDb_CantConvertValue";
- public const string OleDb_CantCreate = "OleDb_CantCreate";
- public const string OleDb_CommandParameterBadAccessor = "OleDb_CommandParameterBadAccessor";
- public const string OleDb_CommandParameterCantConvertValue = "OleDb_CommandParameterCantConvertValue";
- public const string OleDb_CommandParameterDataOverflow = "OleDb_CommandParameterDataOverflow";
- public const string OleDb_CommandParameterDefault = "OleDb_CommandParameterDefault";
- public const string OleDb_CommandParameterError = "OleDb_CommandParameterError";
- public const string OleDb_CommandParameterSignMismatch = "OleDb_CommandParameterSignMismatch";
- public const string OleDb_CommandParameterUnavailable = "OleDb_CommandParameterUnavailable";
- public const string OleDb_CommandTextNotSupported = "OleDb_CommandTextNotSupported";
- public const string OleDb_ConfigUnableToLoadXmlMetaDataFile = "OleDb_ConfigUnableToLoadXmlMetaDataFile";
- public const string OleDb_ConfigWrongNumberOfValues = "OleDb_ConfigWrongNumberOfValues";
- public const string OleDb_DBBindingGetVector = "OleDb_DBBindingGetVector";
- public const string OleDb_DataOverflow = "OleDb_DataOverflow";
- public const string OleDb_FailedGetDescription = "OleDb_FailedGetDescription";
- public const string OleDb_FailedGetSource = "OleDb_FailedGetSource";
- public const string OleDb_Fill_EmptyRecord = "OleDb_Fill_EmptyRecord";
- public const string OleDb_Fill_EmptyRecordSet = "OleDb_Fill_EmptyRecordSet";
- public const string OleDb_Fill_NotADODB = "OleDb_Fill_NotADODB";
- public const string OleDb_GVtUnknown = "OleDb_GVtUnknown";
- public const string OleDb_IDBInfoNotSupported = "OleDb_IDBInfoNotSupported";
- public const string OleDb_ISourcesRowsetNotSupported = "OleDb_ISourcesRowsetNotSupported";
- public const string OleDb_InvalidProviderSpecified = "OleDb_InvalidProviderSpecified";
- public const string OleDb_InvalidRestrictionsDbInfoKeywords = "OleDb_InvalidRestrictionsDbInfoKeywords";
- public const string OleDb_InvalidRestrictionsDbInfoLiteral = "OleDb_InvalidRestrictionsDbInfoLiteral";
- public const string OleDb_InvalidRestrictionsSchemaGuids = "OleDb_InvalidRestrictionsSchemaGuids";
- public const string OleDb_MDACNotAvailable = "OleDb_MDACNotAvailable";
- public const string OleDb_MDACWrongVersion = "OleDb_MDACWrongVersion";
- public const string OleDb_MSDASQLNotSupported = "OleDb_MSDASQLNotSupported";
- public const string OleDb_NoErrorInformation = "OleDb_NoErrorInformation";
- public const string OleDb_NoErrorInformation2 = "OleDb_NoErrorInformation2";
- public const string OleDb_NoErrorMessage = "OleDb_NoErrorMessage";
- public const string OleDb_NoProviderSpecified = "OleDb_NoProviderSpecified";
- public const string OleDb_NoProviderSupportForParameters = "OleDb_NoProviderSupportForParameters";
- public const string OleDb_NoProviderSupportForSProcResetParameters = "OleDb_NoProviderSupportForSProcResetParameters";
- public const string OleDb_NotSupportedSchemaTable = "OleDb_NotSupportedSchemaTable";
- public const string OleDb_PossiblePromptNotUserInteractive = "OleDb_PossiblePromptNotUserInteractive";
- public const string OleDb_PropertyBadColumn = "OleDb_PropertyBadColumn";
- public const string OleDb_PropertyBadOption = "OleDb_PropertyBadOption";
- public const string OleDb_PropertyBadValue = "OleDb_PropertyBadValue";
- public const string OleDb_PropertyConflicting = "OleDb_PropertyConflicting";
- public const string OleDb_PropertyNotAllSettable = "OleDb_PropertyNotAllSettable";
- public const string OleDb_PropertyNotAvailable = "OleDb_PropertyNotAvailable";
- public const string OleDb_PropertyNotSet = "OleDb_PropertyNotSet";
- public const string OleDb_PropertyNotSettable = "OleDb_PropertyNotSettable";
- public const string OleDb_PropertyNotSupported = "OleDb_PropertyNotSupported";
- public const string OleDb_PropertyStatusUnknown = "OleDb_PropertyStatusUnknown";
- public const string OleDb_ProviderUnavailable = "OleDb_ProviderUnavailable";
- public const string OleDb_SVtUnknown = "OleDb_SVtUnknown";
- public const string OleDb_SchemaRowsetsNotSupported = "OleDb_SchemaRowsetsNotSupported";
- public const string OleDb_SignMismatch = "OleDb_SignMismatch";
- public const string OleDb_ThreadApartmentState = "OleDb_ThreadApartmentState";
- public const string OleDb_TransactionsNotSupported = "OleDb_TransactionsNotSupported";
- public const string OleDb_Unavailable = "OleDb_Unavailable";
- public const string OleDb_UnexpectedStatusValue = "OleDb_UnexpectedStatusValue";
- public const string OleDb_UninitializedParameters = "OleDb_UninitializedParameters";
- public const string Range_Argument = "Range_Argument";
- public const string Range_NullRange = "Range_NullRange";
- public const string RbTree_EnumerationBroken = "RbTree_EnumerationBroken";
- public const string RbTree_InvalidState = "RbTree_InvalidState";
- public const string RecordManager_MinimumCapacity = "RecordManager_MinimumCapacity";
- public const string SQLCR_AllAttemptsFailed = "SQLCR_AllAttemptsFailed";
- public const string SQLCR_EncryptionChanged = "SQLCR_EncryptionChanged";
- public const string SQLCR_InvalidConnectRetryCountValue = "SQLCR_InvalidConnectRetryCountValue";
- public const string SQLCR_InvalidConnectRetryIntervalValue = "SQLCR_InvalidConnectRetryIntervalValue";
- public const string SQLCR_NextAttemptWillExceedQueryTimeout = "SQLCR_NextAttemptWillExceedQueryTimeout";
- public const string SQLCR_NoCRAckAtReconnection = "SQLCR_NoCRAckAtReconnection";
- public const string SQLCR_TDSVestionNotPreserved = "SQLCR_TDSVestionNotPreserved";
- public const string SQLCR_UnrecoverableClient = "SQLCR_UnrecoverableClient";
- public const string SQLCR_UnrecoverableServer = "SQLCR_UnrecoverableServer";
- public const string SQLMSF_FailoverPartnerNotSupported = "SQLMSF_FailoverPartnerNotSupported";
- public const string SQLNotify_AlreadyHasCommand = "SQLNotify_AlreadyHasCommand";
- public const string SQLNotify_ErrorFormat = "SQLNotify_ErrorFormat";
- public const string SQLROR_FailoverNotSupported = "SQLROR_FailoverNotSupported";
- public const string SQLROR_InvalidRoutingInfo = "SQLROR_InvalidRoutingInfo";
- public const string SQLROR_RecursiveRoutingNotSupported = "SQLROR_RecursiveRoutingNotSupported";
- public const string SQLROR_TimeoutAfterRoutingInfo = "SQLROR_TimeoutAfterRoutingInfo";
- public const string SQLROR_UnexpectedRoutingInfo = "SQLROR_UnexpectedRoutingInfo";
- public const string SQLTVP_TableTypeCanOnlyBeParameter = "SQLTVP_TableTypeCanOnlyBeParameter";
- public const string SQLUDT_InvalidSqlType = "SQLUDT_InvalidSqlType";
- public const string SQLUDT_InvalidUdtTypeName = "SQLUDT_InvalidUdtTypeName";
- public const string SQLUDT_MaxByteSizeValue = "SQLUDT_MaxByteSizeValue";
- public const string SQLUDT_Unexpected = "SQLUDT_Unexpected";
- public const string SQLUDT_UnexpectedUdtTypeName = "SQLUDT_UnexpectedUdtTypeName";
- public const string SQL_ArgumentLengthMismatch = "SQL_ArgumentLengthMismatch";
- public const string SQL_AsyncConnectionRequired = "SQL_AsyncConnectionRequired";
- public const string SQL_AsyncOperationCompleted = "SQL_AsyncOperationCompleted";
- public const string SQL_BatchedUpdatesNotAvailableOnContextConnection = "SQL_BatchedUpdatesNotAvailableOnContextConnection";
- public const string SQL_BulkCopyDestinationTableName = "SQL_BulkCopyDestinationTableName";
- public const string SQL_BulkLoadCannotConvertValue = "SQL_BulkLoadCannotConvertValue";
- public const string SQL_BulkLoadConflictingTransactionOption = "SQL_BulkLoadConflictingTransactionOption";
- public const string SQL_BulkLoadExistingTransaction = "SQL_BulkLoadExistingTransaction";
- public const string SQL_BulkLoadInvalidDestinationTable = "SQL_BulkLoadInvalidDestinationTable";
- public const string SQL_BulkLoadInvalidOperationInsideEvent = "SQL_BulkLoadInvalidOperationInsideEvent";
- public const string SQL_BulkLoadInvalidTimeout = "SQL_BulkLoadInvalidTimeout";
- public const string SQL_BulkLoadInvalidVariantValue = "SQL_BulkLoadInvalidVariantValue";
- public const string SQL_BulkLoadMappingInaccessible = "SQL_BulkLoadMappingInaccessible";
- public const string SQL_BulkLoadMappingsNamesOrOrdinalsOnly = "SQL_BulkLoadMappingsNamesOrOrdinalsOnly";
- public const string SQL_BulkLoadMissingDestinationTable = "SQL_BulkLoadMissingDestinationTable";
- public const string SQL_BulkLoadNoCollation = "SQL_BulkLoadNoCollation";
- public const string SQL_BulkLoadNonMatchingColumnMapping = "SQL_BulkLoadNonMatchingColumnMapping";
- public const string SQL_BulkLoadNonMatchingColumnName = "SQL_BulkLoadNonMatchingColumnName";
- public const string SQL_BulkLoadNotAllowDBNull = "SQL_BulkLoadNotAllowDBNull";
- public const string SQL_BulkLoadPendingOperation = "SQL_BulkLoadPendingOperation";
- public const string SQL_BulkLoadStringTooLong = "SQL_BulkLoadStringTooLong";
- public const string SQL_CannotGetDTCAddress = "SQL_CannotGetDTCAddress";
- public const string SQL_CannotModifyPropertyAsyncOperationInProgress = "SQL_CannotModifyPropertyAsyncOperationInProgress";
- public const string SQL_ChangePasswordArgumentMissing = "SQL_ChangePasswordArgumentMissing";
- public const string SQL_ChangePasswordConflictsWithSSPI = "SQL_ChangePasswordConflictsWithSSPI";
- public const string SQL_ChangePasswordRequiresYukon = "SQL_ChangePasswordRequiresYukon";
- public const string SQL_ChangePasswordUseOfUnallowedKey = "SQL_ChangePasswordUseOfUnallowedKey";
- public const string SQL_ConnectionDoomed = "SQL_ConnectionDoomed";
- public const string SQL_ConnectionLockedForBcpEvent = "SQL_ConnectionLockedForBcpEvent";
- public const string SQL_ContextAllowsLimitedKeywords = "SQL_ContextAllowsLimitedKeywords";
- public const string SQL_ContextAllowsOnlyTypeSystem2005 = "SQL_ContextAllowsOnlyTypeSystem2005";
- public const string SQL_ContextConnectionIsInUse = "SQL_ContextConnectionIsInUse";
- public const string SQL_ContextUnavailableOutOfProc = "SQL_ContextUnavailableOutOfProc";
- public const string SQL_ContextUnavailableWhileInProc = "SQL_ContextUnavailableWhileInProc";
- public const string SQL_CultureIdError = "SQL_CultureIdError";
- public const string SQL_Duration_Login_Begin = "SQL_Duration_Login_Begin";
- public const string SQL_Duration_Login_ProcessConnectionAuth = "SQL_Duration_Login_ProcessConnectionAuth";
- public const string SQL_Duration_PostLogin = "SQL_Duration_PostLogin";
- public const string SQL_Duration_PreLoginHandshake = "SQL_Duration_PreLoginHandshake";
- public const string SQL_Duration_PreLogin_Begin = "SQL_Duration_PreLogin_Begin";
- public const string SQL_EncryptionNotSupportedByClient = "SQL_EncryptionNotSupportedByClient";
- public const string SQL_EncryptionNotSupportedByServer = "SQL_EncryptionNotSupportedByServer";
- public const string SQL_EnumeratedRecordFieldCountChanged = "SQL_EnumeratedRecordFieldCountChanged";
- public const string SQL_EnumeratedRecordMetaDataChanged = "SQL_EnumeratedRecordMetaDataChanged";
- public const string SQL_ExClientConnectionId = "SQL_ExClientConnectionId";
- public const string SQL_ExErrorNumberStateClass = "SQL_ExErrorNumberStateClass";
- public const string SQL_ExOriginalClientConnectionId = "SQL_ExOriginalClientConnectionId";
- public const string SQL_ExRoutingDestination = "SQL_ExRoutingDestination";
- public const string SQL_ExceedsMaxDataLength = "SQL_ExceedsMaxDataLength";
- public const string SQL_FatalTimeout = "SQL_FatalTimeout";
- public const string SQL_InstanceFailure = "SQL_InstanceFailure";
- public const string SQL_InvalidBufferSizeOrIndex = "SQL_InvalidBufferSizeOrIndex";
- public const string SQL_InvalidDataLength = "SQL_InvalidDataLength";
- public const string SQL_InvalidInternalPacketSize = "SQL_InvalidInternalPacketSize";
- public const string SQL_InvalidOptionLength = "SQL_InvalidOptionLength";
- public const string SQL_InvalidPacketSizeValue = "SQL_InvalidPacketSizeValue";
- public const string SQL_InvalidParameterNameLength = "SQL_InvalidParameterNameLength";
- public const string SQL_InvalidParameterTypeNameFormat = "SQL_InvalidParameterTypeNameFormat";
- public const string SQL_InvalidPartnerConfiguration = "SQL_InvalidPartnerConfiguration";
- public const string SQL_InvalidRead = "SQL_InvalidRead";
- public const string SQL_InvalidSQLServerVersionUnknown = "SQL_InvalidSQLServerVersionUnknown";
- public const string SQL_InvalidSSPIPacketSize = "SQL_InvalidSSPIPacketSize";
- public const string SQL_InvalidSqlDbTypeWithOneAllowedType = "SQL_InvalidSqlDbTypeWithOneAllowedType";
- public const string SQL_InvalidTDSPacketSize = "SQL_InvalidTDSPacketSize";
- public const string SQL_InvalidTDSVersion = "SQL_InvalidTDSVersion";
- public const string SQL_InvalidUdt3PartNameFormat = "SQL_InvalidUdt3PartNameFormat";
- public const string SQL_MarsUnsupportedOnConnection = "SQL_MarsUnsupportedOnConnection";
- public const string SQL_MoneyOverflow = "SQL_MoneyOverflow";
- public const string SQL_NestedTransactionScopesNotSupported = "SQL_NestedTransactionScopesNotSupported";
- public const string SQL_NonBlobColumn = "SQL_NonBlobColumn";
- public const string SQL_NonCharColumn = "SQL_NonCharColumn";
- public const string SQL_NonLocalSSEInstance = "SQL_NonLocalSSEInstance";
- public const string SQL_NonXmlResult = "SQL_NonXmlResult";
- public const string SQL_NotAvailableOnContextConnection = "SQL_NotAvailableOnContextConnection";
- public const string SQL_NotSupportedEnumerationValue = "SQL_NotSupportedEnumerationValue";
- public const string SQL_NotificationsNotAvailableOnContextConnection = "SQL_NotificationsNotAvailableOnContextConnection";
- public const string SQL_NotificationsRequireYukon = "SQL_NotificationsRequireYukon";
- public const string SQL_NullEmptyTransactionName = "SQL_NullEmptyTransactionName";
- public const string SQL_OpenResultCountExceeded = "SQL_OpenResultCountExceeded";
- public const string SQL_OperationCancelled = "SQL_OperationCancelled";
- public const string SQL_ParameterInvalidVariant = "SQL_ParameterInvalidVariant";
- public const string SQL_ParameterTypeNameRequired = "SQL_ParameterTypeNameRequired";
- public const string SQL_ParsingError = "SQL_ParsingError";
- public const string SQL_PendingBeginXXXExists = "SQL_PendingBeginXXXExists";
- public const string SQL_PipeErrorRequiresSendEnd = "SQL_PipeErrorRequiresSendEnd";
- public const string SQL_PrecisionValueOutOfRange = "SQL_PrecisionValueOutOfRange";
- public const string SQL_SNIPacketAllocationFailure = "SQL_SNIPacketAllocationFailure";
- public const string SQL_SSPIGenerateError = "SQL_SSPIGenerateError";
- public const string SQL_SSPIInitializeError = "SQL_SSPIInitializeError";
- public const string SQL_ScaleValueOutOfRange = "SQL_ScaleValueOutOfRange";
- public const string SQL_SevereError = "SQL_SevereError";
- public const string SQL_SmallDateTimeOverflow = "SQL_SmallDateTimeOverflow";
- public const string SQL_SnapshotNotSupported = "SQL_SnapshotNotSupported";
- public const string SQL_SqlCommandCommandText = "SQL_SqlCommandCommandText";
- public const string SQL_SqlRecordReadOnly = "SQL_SqlRecordReadOnly";
- public const string SQL_SqlRecordReadOnly2 = "SQL_SqlRecordReadOnly2";
- public const string SQL_SqlResultSetClosed = "SQL_SqlResultSetClosed";
- public const string SQL_SqlResultSetClosed2 = "SQL_SqlResultSetClosed2";
- public const string SQL_SqlResultSetCommandNotInSameConnection = "SQL_SqlResultSetCommandNotInSameConnection";
- public const string SQL_SqlResultSetNoAcceptableCursor = "SQL_SqlResultSetNoAcceptableCursor";
- public const string SQL_SqlResultSetRowDeleted = "SQL_SqlResultSetRowDeleted";
- public const string SQL_SqlResultSetRowDeleted2 = "SQL_SqlResultSetRowDeleted2";
- public const string SQL_StreamNotSupportOnColumnType = "SQL_StreamNotSupportOnColumnType";
- public const string SQL_StreamReadNotSupported = "SQL_StreamReadNotSupported";
- public const string SQL_StreamSeekNotSupported = "SQL_StreamSeekNotSupported";
- public const string SQL_StreamWriteNotSupported = "SQL_StreamWriteNotSupported";
- public const string SQL_TDSParserTableName = "SQL_TDSParserTableName";
- public const string SQL_TextReaderNotSupportOnColumnType = "SQL_TextReaderNotSupportOnColumnType";
- public const string SQL_TimeOverflow = "SQL_TimeOverflow";
- public const string SQL_TimeScaleValueOutOfRange = "SQL_TimeScaleValueOutOfRange";
- public const string SQL_Timeout = "SQL_Timeout";
- public const string SQL_Timeout_FailoverInfo = "SQL_Timeout_FailoverInfo";
- public const string SQL_Timeout_Login_Begin = "SQL_Timeout_Login_Begin";
- public const string SQL_Timeout_Login_ProcessConnectionAuth = "SQL_Timeout_Login_ProcessConnectionAuth";
- public const string SQL_Timeout_PostLogin = "SQL_Timeout_PostLogin";
- public const string SQL_Timeout_PreLogin_Begin = "SQL_Timeout_PreLogin_Begin";
- public const string SQL_Timeout_PreLogin_ConsumeHandshake = "SQL_Timeout_PreLogin_ConsumeHandshake";
- public const string SQL_Timeout_PreLogin_InitializeConnection = "SQL_Timeout_PreLogin_InitializeConnection";
- public const string SQL_Timeout_PreLogin_SendHandshake = "SQL_Timeout_PreLogin_SendHandshake";
- public const string SQL_Timeout_RoutingDestinationInfo = "SQL_Timeout_RoutingDestinationInfo";
- public const string SQL_TooManyValues = "SQL_TooManyValues";
- public const string SQL_TypeName = "SQL_TypeName";
- public const string SQL_UDTTypeName = "SQL_UDTTypeName";
- public const string SQL_UnexpectedSmiEvent = "SQL_UnexpectedSmiEvent";
- public const string SQL_UnknownSysTxIsolationLevel = "SQL_UnknownSysTxIsolationLevel";
- public const string SQL_UserInstanceFailoverNotCompatible = "SQL_UserInstanceFailoverNotCompatible";
- public const string SQL_UserInstanceFailure = "SQL_UserInstanceFailure";
- public const string SQL_UserInstanceNotAvailableInProc = "SQL_UserInstanceNotAvailableInProc";
- public const string SQL_WrongType = "SQL_WrongType";
- public const string SQL_XmlReaderNotSupportOnColumnType = "SQL_XmlReaderNotSupportOnColumnType";
- public const string Snix_PreLogin = "Snix_PreLogin";
- public const string SqlCommandBuilder_DataAdapter = "SqlCommandBuilder_DataAdapter";
- public const string SqlCommand_Notification = "SqlCommand_Notification";
- public const string SqlCommand_NotificationAutoEnlist = "SqlCommand_NotificationAutoEnlist";
- public const string SqlConnection_ClientConnectionId = "SqlConnection_ClientConnectionId";
- public const string SqlConnection_ConnectionString = "SqlConnection_ConnectionString";
- public const string SqlConnection_ConnectionTimeout = "SqlConnection_ConnectionTimeout";
- public const string SqlConnection_Credential = "SqlConnection_Credential";
- public const string SqlConnection_DataSource = "SqlConnection_DataSource";
- public const string SqlConnection_Database = "SqlConnection_Database";
- public const string SqlConnection_PacketSize = "SqlConnection_PacketSize";
- public const string SqlConnection_ServerVersion = "SqlConnection_ServerVersion";
- public const string SqlConnection_StatisticsEnabled = "SqlConnection_StatisticsEnabled";
- public const string SqlConnection_WorkstationId = "SqlConnection_WorkstationId";
- public const string SqlConvert_ConvertFailed = "SqlConvert_ConvertFailed";
- public const string SqlDelegatedTransaction_PromotionFailed = "SqlDelegatedTransaction_PromotionFailed";
- public const string SqlDependency_AddCommandDependency = "SqlDependency_AddCommandDependency";
- public const string SqlDependency_DatabaseBrokerDisabled = "SqlDependency_DatabaseBrokerDisabled";
- public const string SqlDependency_DefaultOptionsButNoStart = "SqlDependency_DefaultOptionsButNoStart";
- public const string SqlDependency_DuplicateStart = "SqlDependency_DuplicateStart";
- public const string SqlDependency_EventNoDuplicate = "SqlDependency_EventNoDuplicate";
- public const string SqlDependency_HasChanges = "SqlDependency_HasChanges";
- public const string SqlDependency_Id = "SqlDependency_Id";
- public const string SqlDependency_IdMismatch = "SqlDependency_IdMismatch";
- public const string SqlDependency_InvalidTimeout = "SqlDependency_InvalidTimeout";
- public const string SqlDependency_NoMatchingServerDatabaseStart = "SqlDependency_NoMatchingServerDatabaseStart";
- public const string SqlDependency_NoMatchingServerStart = "SqlDependency_NoMatchingServerStart";
- public const string SqlDependency_OnChange = "SqlDependency_OnChange";
- public const string SqlFileStream_FileAlreadyInTransaction = "SqlFileStream_FileAlreadyInTransaction ";
- public const string SqlFileStream_InvalidParameter = "SqlFileStream_InvalidParameter ";
- public const string SqlFileStream_InvalidPath = "SqlFileStream_InvalidPath";
- public const string SqlFileStream_PathNotValidDiskResource = "SqlFileStream_PathNotValidDiskResource";
- public const string SqlMetaData_InvalidSqlDbTypeForConstructorFormat = "SqlMetaData_InvalidSqlDbTypeForConstructorFormat";
- public const string SqlMetaData_NameTooLong = "SqlMetaData_NameTooLong";
- public const string SqlMetaData_NoMetadata = "SqlMetaData_NoMetadata";
- public const string SqlMetaData_SpecifyBothSortOrderAndOrdinal = "SqlMetaData_SpecifyBothSortOrderAndOrdinal";
- public const string SqlMisc_AlreadyFilledMessage = "SqlMisc_AlreadyFilledMessage";
- public const string SqlMisc_ArithOverflowMessage = "SqlMisc_ArithOverflowMessage";
- public const string SqlMisc_BufferInsufficientMessage = "SqlMisc_BufferInsufficientMessage";
- public const string SqlMisc_ClosedXmlReaderMessage = "SqlMisc_ClosedXmlReaderMessage";
- public const string SqlMisc_CompareDiffCollationMessage = "SqlMisc_CompareDiffCollationMessage";
- public const string SqlMisc_ConcatDiffCollationMessage = "SqlMisc_ConcatDiffCollationMessage";
- public const string SqlMisc_ConversionOverflowMessage = "SqlMisc_ConversionOverflowMessage";
- public const string SqlMisc_DateTimeOverflowMessage = "SqlMisc_DateTimeOverflowMessage";
- public const string SqlMisc_DivideByZeroMessage = "SqlMisc_DivideByZeroMessage";
- public const string SqlMisc_FormatMessage = "SqlMisc_FormatMessage";
- public const string SqlMisc_InvalidArraySizeMessage = "SqlMisc_InvalidArraySizeMessage";
- public const string SqlMisc_InvalidDateTimeMessage = "SqlMisc_InvalidDateTimeMessage";
- public const string SqlMisc_InvalidFlagMessage = "SqlMisc_InvalidFlagMessage";
- public const string SqlMisc_InvalidOpStreamClosed = "SqlMisc_InvalidOpStreamClosed";
- public const string SqlMisc_InvalidOpStreamNonReadable = "SqlMisc_InvalidOpStreamNonReadable";
- public const string SqlMisc_InvalidOpStreamNonSeekable = "SqlMisc_InvalidOpStreamNonSeekable";
- public const string SqlMisc_InvalidOpStreamNonWritable = "SqlMisc_InvalidOpStreamNonWritable";
- public const string SqlMisc_InvalidPrecScaleMessage = "SqlMisc_InvalidPrecScaleMessage";
- public const string SqlMisc_MessageString = "SqlMisc_MessageString";
- public const string SqlMisc_NoBufferMessage = "SqlMisc_NoBufferMessage";
- public const string SqlMisc_NotFilledMessage = "SqlMisc_NotFilledMessage";
- public const string SqlMisc_NullString = "Null";
- public const string SqlMisc_NullValueMessage = "Data is Null. This method or property cannot be called on Null values.";
- public const string SqlMisc_NumeToDecOverflowMessage = "SqlMisc_NumeToDecOverflowMessage";
- public const string SqlMisc_SqlTypeMessage = "SqlMisc_SqlTypeMessage";
- public const string SqlMisc_StreamErrorMessage = "SqlMisc_StreamErrorMessage";
- public const string SqlMisc_SubclassMustOverride = "SqlMisc_SubclassMustOverride";
- public const string SqlMisc_TimeZoneSpecifiedMessage = "SqlMisc_TimeZoneSpecifiedMessage";
- public const string SqlMisc_TruncationMaxDataMessage = "SqlMisc_TruncationMaxDataMessage";
- public const string SqlMisc_TruncationMessage = "SqlMisc_TruncationMessage";
- public const string SqlMisc_WriteNonZeroOffsetOnNullMessage = "SqlMisc_WriteNonZeroOffsetOnNullMessage";
- public const string SqlMisc_WriteOffsetLargerThanLenMessage = "SqlMisc_WriteOffsetLargerThanLenMessage";
- public const string SqlNotify_SqlDepCannotBeCreatedInProc = "SqlNotify_SqlDepCannotBeCreatedInProc";
- public const string SqlParameter_DBNullNotSupportedForTVP = "SqlParameter_DBNullNotSupportedForTVP";
- public const string SqlParameter_InvalidTableDerivedPrecisionForTvp = "SqlParameter_InvalidTableDerivedPrecisionForTvp";
- public const string SqlParameter_ParameterName = "SqlParameter_ParameterName";
- public const string SqlParameter_SqlDbType = "SqlParameter_SqlDbType";
- public const string SqlParameter_UnexpectedTypeNameForNonStruct = "SqlParameter_UnexpectedTypeNameForNonStruct";
- public const string SqlParameter_UnsupportedTVPOutputParameter = "SqlParameter_UnsupportedTVPOutputParameter";
- public const string SqlParameter_XmlSchemaCollectionDatabase = "SqlParameter_XmlSchemaCollectionDatabase";
- public const string SqlParameter_XmlSchemaCollectionName = "SqlParameter_XmlSchemaCollectionName";
- public const string SqlParameter_XmlSchemaCollectionOwningSchema = "SqlParameter_XmlSchemaCollectionOwningSchema";
- public const string SqlPipe_AlreadyHasAnOpenResultSet = "SqlPipe_AlreadyHasAnOpenResultSet";
- public const string SqlPipe_CommandHookedUpToNonContextConnection = "SqlPipe_CommandHookedUpToNonContextConnection";
- public const string SqlPipe_DoesNotHaveAnOpenResultSet = "SqlPipe_DoesNotHaveAnOpenResultSet";
- public const string SqlPipe_IsBusy = "SqlPipe_IsBusy";
- public const string SqlPipe_MessageTooLong = "SqlPipe_MessageTooLong";
- public const string SqlProvider_DuplicateSortOrdinal = "SqlProvider_DuplicateSortOrdinal";
- public const string SqlProvider_InvalidDataColumnMaxLength = "SqlProvider_InvalidDataColumnMaxLength";
- public const string SqlProvider_InvalidDataColumnType = "SqlProvider_InvalidDataColumnType";
- public const string SqlProvider_MissingSortOrdinal = "SqlProvider_MissingSortOrdinal";
- public const string SqlProvider_NotEnoughColumnsInStructuredType = "SqlProvider_NotEnoughColumnsInStructuredType";
- public const string SqlProvider_SortOrdinalGreaterThanFieldCount = "SqlProvider_SortOrdinalGreaterThanFieldCount";
- public const string SqlUdtReason_NoUdtAttribute = "SqlUdtReason_NoUdtAttribute";
- public const string SqlUdt_InvalidUdtMessage = "SqlUdt_InvalidUdtMessage";
- public const string Sql_BulkLoadLcidMismatch = "Sql_BulkLoadLcidMismatch";
- public const string Sql_CanotCreateNormalizer = "Sql_CanotCreateNormalizer";
- public const string Sql_InternalError = "Sql_InternalError";
- public const string Sql_MismatchedMetaDataDirectionArrayLengths = "Sql_MismatchedMetaDataDirectionArrayLengths";
- public const string Sql_NullCommandText = "Sql_NullCommandText";
- public const string Xml_AttributeValues = "Xml_AttributeValues";
- public const string Xml_CanNotDeserializeObjectType = "Xml_CanNotDeserializeObjectType";
- public const string Xml_CannotConvert = "Xml_CannotConvert";
- public const string Xml_CannotInstantiateAbstract = "Xml_CannotInstantiateAbstract";
- public const string Xml_CircularComplexType = "Xml_CircularComplexType";
- public const string Xml_ColumnConflict = "Xml_ColumnConflict";
- public const string Xml_DataTableInferenceNotSupported = "Xml_DataTableInferenceNotSupported";
- public const string Xml_DatatypeNotDefined = "Xml_DatatypeNotDefined";
- public const string Xml_DuplicateConstraint = "Xml_DuplicateConstraint";
- public const string Xml_DynamicWithoutXmlSerializable = "Xml_DynamicWithoutXmlSerializable";
- public const string Xml_ElementTypeNotFound = "Xml_ElementTypeNotFound";
- public const string Xml_FoundEntity = "Xml_FoundEntity";
- public const string Xml_InvalidField = "Xml_InvalidField";
- public const string Xml_InvalidKey = "Xml_InvalidKey";
- public const string Xml_InvalidPrefix = "Xml_InvalidPrefix";
- public const string Xml_InvalidSelector = "Xml_InvalidSelector";
- public const string Xml_IsDataSetAttributeMissingInSchema = "Xml_IsDataSetAttributeMissingInSchema";
- public const string Xml_MergeDuplicateDeclaration = "Xml_MergeDuplicateDeclaration";
- public const string Xml_MismatchKeyLength = "Xml_MismatchKeyLength";
- public const string Xml_MissingAttribute = "Xml_MissingAttribute";
- public const string Xml_MissingRefer = "Xml_MissingRefer";
- public const string Xml_MissingSQL = "Xml_MissingSQL";
- public const string Xml_MissingTable = "Xml_MissingTable";
- public const string Xml_MultipleParentRows = "Xml_MultipleParentRows";
- public const string Xml_MultipleTargetConverterEmpty = "Xml_MultipleTargetConverterEmpty";
- public const string Xml_NestedCircular = "Xml_NestedCircular";
- public const string Xml_PolymorphismNotSupported = "Xml_PolymorphismNotSupported";
- public const string Xml_RelationChildKeyMissing = "Xml_RelationChildKeyMissing";
- public const string Xml_RelationChildNameMissing = "Xml_RelationChildNameMissing";
- public const string Xml_RelationParentNameMissing = "Xml_RelationParentNameMissing";
- public const string Xml_RelationTableKeyMissing = "Xml_RelationTableKeyMissing";
- public const string Xml_SimpleTypeNotSupported = "Xml_SimpleTypeNotSupported";
- public const string Xml_TooManyIsDataSetAtributeInSchema = "Xml_TooManyIsDataSetAtributeInSchema";
- public const string Xml_UndefinedDatatype = "Xml_UndefinedDatatype";
- public const string Xml_ValueOutOfRange = "Xml_ValueOutOfRange";
- public const string collectionChangedEventDescr = "collectionChangedEventDescr";
-
- public static string GetString (string name)
- {
- return SR.GetString (name);
- }
-
- public static string GetString (string name, params object[] args)
- {
- return SR.GetString (name, args);
- }
+namespace System.Data {
+ static partial class Res {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+public const string ADP_Ascending = @"Ascending";
+public const string ADP_CollectionIndexInt32 = @"Invalid index {0} for this {1} with Count={2}.";
+public const string ADP_CollectionIndexString = @"An {0} with {1} '{2}' is not contained by this {3}.";
+public const string ADP_CollectionInvalidType = @"The {0} only accepts non-null {1} type objects, not {2} objects.";
+public const string ADP_CollectionIsNotParent = @"The {0} is already contained by another {1}.";
+public const string ADP_CollectionIsParent = @"The {0} with is already contained by this {1}.";
+public const string ADP_CollectionNullValue = @"The {0} only accepts non-null {1} type objects.";
+public const string ADP_CollectionRemoveInvalidObject = @"Attempted to remove an {0} that is not contained by this {1}.";
+public const string ADP_CollectionUniqueValue = @"The {0}.{1} is required to be unique, '{2}' already exists in the collection.";
+public const string ADP_ConnectionAlreadyOpen = @"The connection was not closed. {0}";
+public const string ADP_ConnectionStateMsg_Closed = @"The connection's current state is closed.";
+public const string ADP_ConnectionStateMsg_Connecting = @"The connection's current state is connecting.";
+public const string ADP_ConnectionStateMsg_Open = @"The connection's current state is open.";
+public const string ADP_ConnectionStateMsg_OpenExecuting = @"The connection's current state is executing.";
+public const string ADP_ConnectionStateMsg_OpenFetching = @"The connection's current state is fetching.";
+public const string ADP_ConnectionStateMsg = @"The connection's current state: {0}.";
+public const string ADP_ConnectionStringSyntax = @"Format of the initialization string does not conform to specification starting at index {0}.";
+public const string ADP_DataReaderClosed = @"Invalid attempt to call {0} when reader is closed.";
+public const string ADP_DelegatedTransactionPresent = @"Cannot enlist in the transaction because the connection is the primary connection for a delegated or promoted transaction.";
+public const string ADP_Descending = @"Descending";
+public const string ADP_EmptyString = @"Expecting non-empty string for '{0}' parameter.";
+public const string ADP_InternalConnectionError = @"Internal DbConnection Error: {0}";
+public const string ADP_InvalidDataDirectory = @"The DataDirectory substitute is not a string.";
+public const string ADP_InvalidEnumerationValue = @"The {0} enumeration value, {1}, is invalid.";
+public const string ADP_InvalidKey = @"Invalid keyword, contain one or more of 'no characters', 'control characters', 'leading or trailing whitespace' or 'leading semicolons'.";
+public const string ADP_InvalidOffsetValue = @"Invalid parameter Offset value '{0}'. The value must be greater than or equal to 0.";
+public const string ADP_InvalidValue = @"The value contains embedded nulls (\\u0000).";
+public const string ADP_InvalidXMLBadVersion = @"Invalid Xml; can only parse elements of version one.";
+public const string ADP_NoConnectionString = @"The ConnectionString property has not been initialized.";
+public const string ADP_NonCLSException = @"A Non CLS Exception was caught.";
+public const string ADP_NotAPermissionElement = @"Given security element is not a permission element.";
+public const string ADP_OpenConnectionPropertySet = @"Not allowed to change the '{0}' property. {1}";
+public const string ADP_PendingAsyncOperation = @"Can not start another operation while there is an asynchronous operation pending.";
+public const string ADP_PermissionTypeMismatch = @"Type mismatch.";
+public const string ADP_PooledOpenTimeout = @"Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.";
+public const string ADP_NonPooledOpenTimeout = @"Timeout attempting to open the connection. The time period elapsed prior to attempting to open the connection has been exceeded. This may have occurred because of too many simultaneous non-pooled connection attempts.";
+public const string ADP_InvalidMixedUsageOfSecureAndClearCredential = @"Cannot use Credential with UserID, UID, Password, or PWD connection string keywords.";
+public const string ADP_InvalidMixedUsageOfSecureCredentialAndIntegratedSecurity = @"Cannot use Credential with Integrated Security connection string keyword.";
+public const string ADP_InvalidMixedUsageOfSecureCredentialAndContextConnection = @"Cannot use Credential with Context Connection keyword.";
+public const string ADP_MustBeReadOnly = @"{0} must be marked as read only.";
+public const string DataCategory_Data = @"Data";
+public const string DataCategory_StateChange = @"StateChange";
+public const string DataCategory_Update = @"Update";
+public const string DbCommand_CommandTimeout = @"Time to wait for command to execute.";
+public const string DbConnection_State = @"The ConnectionState indicating whether the connection is open or closed.";
+public const string DbConnection_StateChange = @"Event triggered when the connection changes state.";
+public const string DbParameter_DbType = @"The parameter generic type.";
+public const string DbParameter_Direction = @"Input, output, or bidirectional parameter.";
+public const string DbParameter_IsNullable = @"a design-time property used for strongly typed code-generation.";
+public const string DbParameter_Offset = @"Offset in variable length data types.";
+public const string DbParameter_ParameterName = @"Name of the parameter.";
+public const string DbParameter_Size = @"Size of variable length data types (string & arrays).";
+public const string DbParameter_SourceColumn = @"When used by a DataAdapter.Update, the source column name that is used to find the DataSetColumn name in the ColumnMappings. This is to copy a value between the parameter and a data row.";
+public const string DbParameter_SourceVersion = @"When used by a DataAdapter.Update (UpdateCommand only), the version of the DataRow value that is used to update the data source.";
+public const string DbParameter_SourceColumnNullMapping = @"When used by DataAdapter.Update, the parameter value is changed from DBNull.Value into (Int32)1 or (Int32)0 if non-null.";
+public const string DbParameter_Value = @"Value of the parameter.";
+public const string MDF_QueryFailed = @"Unable to build the '{0}' collection because execution of the SQL query failed. See the inner exception for details.";
+public const string MDF_TooManyRestrictions = @"More restrictions were provided than the requested schema ('{0}') supports.";
+public const string MDF_InvalidRestrictionValue = @" '{2}' is not a valid value for the '{1}' restriction of the '{0}' schema collection.";
+public const string MDF_UndefinedCollection = @"The requested collection ({0}) is not defined.";
+public const string MDF_UndefinedPopulationMechanism = @"The population mechanism '{0}' is not defined.";
+public const string MDF_UnsupportedVersion = @"The requested collection ({0}) is not supported by this version of the provider.";
+public const string MDF_MissingDataSourceInformationColumn = @"One of the required DataSourceInformation tables columns is missing.";
+public const string MDF_IncorrectNumberOfDataSourceInformationRows = @"The DataSourceInformation table must contain exactly one row.";
+public const string MDF_MissingRestrictionColumn = @" One or more of the required columns of the restrictions collection is missing.";
+public const string MDF_MissingRestrictionRow = @" A restriction exists for which there is no matching row in the restrictions collection.";
+public const string MDF_NoColumns = @"The schema table contains no columns.";
+public const string MDF_UnableToBuildCollection = @"Unable to build schema collection '{0}';";
+public const string MDF_AmbigousCollectionName = @"The collection name '{0}' matches at least two collections with the same name but with different case, but does not match any of them exactly.";
+public const string MDF_CollectionNameISNotUnique = @"There are multiple collections named '{0}'.";
+public const string MDF_DataTableDoesNotExist = @"The collection '{0}' is missing from the metadata XML.";
+public const string MDF_InvalidXml = @"The metadata XML is invalid.";
+public const string MDF_InvalidXmlMissingColumn = @"The metadata XML is invalid. The {0} collection must contain a {1} column and it must be a string column.";
+public const string MDF_InvalidXmlInvalidValue = @"The metadata XML is invalid. The {1} column of the {0} collection must contain a non-empty string.";
+
+
+
+
+
+
+public const string DataCategory_Action = @"Action";
+public const string DataCategory_Behavior = @"Behavior";
+
+public const string DataCategory_Fill = @"Fill";
+public const string DataCategory_InfoMessage = @"InfoMessage";
+public const string DataCategory_Mapping = @"Mapping";
+public const string DataCategory_StatementCompleted = @"StatementCompleted";
+
+
+public const string DataCategory_Udt = @"UDT";
+public const string DataCategory_Notification = @"Notification";
+public const string DataCategory_Schema = @"Schema";
+public const string DataCategory_Xml = @"XML";
+
+public const string DataCategory_Advanced = @"Advanced";
+public const string DataCategory_Context = @"Context";
+public const string DataCategory_Initialization = @"Initialization";
+public const string DataCategory_Pooling = @"Pooling";
+public const string DataCategory_NamedConnectionString = @"Named ConnectionString";
+public const string DataCategory_Security = @"Security";
+public const string DataCategory_Source = @"Source";
+public const string DataCategory_Replication = @"Replication";
+public const string DataCategory_ConnectionResilency = @"Connection Resiliency";
+
+
+
+public const string ExtendedPropertiesDescr = @"The collection that holds custom user information.";
+
+
+public const string DataSetCaseSensitiveDescr = @"Indicates whether comparing strings within the DataSet is case sensitive.";
+public const string DataSetDataSetNameDescr = @"The name of this DataSet.";
+public const string DataSetDefaultViewDescr = @"Indicates a custom ""view"" of the data contained by the DataSet. This view allows filtering, searching, and navigating through the custom data view.";
+public const string DataSetEnforceConstraintsDescr = @"Indicates whether constraint rules are to be followed.";
+public const string DataSetHasErrorsDescr = @"Indicates that the DataSet has errors.";
+public const string DataSetLocaleDescr = @"Indicates a locale under which to compare strings within the DataSet.";
+public const string DataSetNamespaceDescr = @"Indicates the XML uri namespace for the root element pointed at by this DataSet.";
+public const string DataSetPrefixDescr = @"Indicates the prefix of the namespace used for this DataSet.";
+public const string DataSetRelationsDescr = @"The collection that holds the relations for this DataSet.";
+public const string DataSetTablesDescr = @"The collection that holds the tables for this DataSet.";
+public const string DataSetMergeFailedDescr = @"Occurs when it is not possible to merge schemas for two tables with the same name.";
+public const string DataSetInitializedDescr = @"Occurs after Initialization is finished.";
+public const string DataSetDescr = @"Represents an in-memory cache of data.";
+
+
+public const string DataTableCaseSensitiveDescr = @"Indicates whether comparing strings within the table is case sensitive.";
+public const string DataTableChildRelationsDescr = @"Returns the child relations for this table.";
+public const string DataTableColumnsDescr = @"The collection that holds the columns for this table.";
+public const string DataTableConstraintsDescr = @"The collection that holds the constraints for this table.";
+public const string DataTableDataSetDescr = @"Indicates the DataSet to which this table belongs.";
+public const string DataTableDefaultViewDescr = @"This is the default DataView for the table.";
+public const string DataTableDisplayExpressionDescr = @"The expression used to compute the data-bound value of this row.";
+public const string DataTableHasErrorsDescr = @"Returns whether the table has errors.";
+public const string DataTableLocaleDescr = @"Indicates a locale under which to compare strings within the table.";
+public const string DataTableMinimumCapacityDescr = @"Indicates an initial starting size for this table.";
+public const string DataTableNamespaceDescr = @"Indicates the XML uri namespace for the elements contained in this table.";
+public const string DataTablePrefixDescr = @"Indicates the Prefix of the namespace used for this table in XML representation.";
+public const string DataTableParentRelationsDescr = @"Returns the parent relations for this table.";
+public const string DataTablePrimaryKeyDescr = @"Indicates the column(s) that represent the primary key for this table.";
+public const string DataTableRowsDescr = @"Indicates the collection that holds the rows of data for this table.";
+public const string DataTableTableNameDescr = @"Indicates the name used to look up this table in the Tables collection of a DataSet.";
+
+
+public const string DataTableRowChangedDescr = @"Occurs after a row in the table has been successfully edited.";
+public const string DataTableRowChangingDescr = @"Occurs when the row is being changed so that the event handler can modify or cancel the change. The user can modify values in the row and should throw an exception to cancel the edit.";
+public const string DataTableRowDeletedDescr = @"Occurs after a row in the table has been successfully deleted.";
+public const string DataTableRowDeletingDescr = @"Occurs when a row in the table marked for deletion. Throw an exception to cancel the deletion.";
+public const string DataTableColumnChangingDescr = @"Occurs when a value has been submitted for this column. The user can modify the proposed value and should throw an exception to cancel the edit.";
+public const string DataTableColumnChangedDescr = @"Occurs when a value has been changed for this column.";
+public const string DataTableRowsClearingDescr = @"Occurs prior to clearing all rows from the table.";
+public const string DataTableRowsClearedDescr = @"Occurs after all rows in the table has been successfully cleared.";
+public const string DataTableRowsNewRowDescr = @"Occurs after a new DataRow has been instantiated.";
+
+
+public const string DataRelationRelationNameDescr = @"The name used to look up this relation in the Relations collection of a DataSet.";
+public const string DataRelationChildColumnsDescr = @"Indicates the child columns of this relation.";
+public const string DataRelationParentColumnsDescr = @"Indicates the parent columns of this relation.";
+public const string DataRelationNested = @"Indicates whether relations are nested.";
+
+
+public const string ForeignKeyConstraintDeleteRuleDescr = @"For deletions, indicates what kind of cascading should take place across this relation.";
+public const string ForeignKeyConstraintUpdateRuleDescr = @"For updates, indicates what kind of cascading should take place across this relation.";
+public const string ForeignKeyConstraintAcceptRejectRuleDescr = @"For accept and reject changes, indicates what kind of cascading should take place across this relation.";
+public const string ForeignKeyConstraintChildColumnsDescr = @"Indicates the child columns of this constraint.";
+public const string ForeignKeyConstraintParentColumnsDescr = @"Indicates the parent columns of this constraint.";
+public const string ForeignKeyRelatedTableDescr = @"Indicates the child table of this constraint.";
+public const string KeyConstraintColumnsDescr = @"Indicates the columns of this constraint.";
+public const string KeyConstraintIsPrimaryKeyDescr = @"Indicates if this constraint is a primary key.";
+public const string ConstraintNameDescr = @"Indicates the name of this constraint.";
+public const string ConstraintTableDescr = @"Indicates the table of this constraint.";
+
+
+public const string DataColumnAllowNullDescr = @"Indicates whether null values are allowed in this column.";
+public const string DataColumnAutoIncrementDescr = @"Indicates whether the column automatically increments itself for new rows added to the table. The type of this column must be Int16, Int32, or Int64.";
+public const string DataColumnAutoIncrementSeedDescr = @"Indicates the starting value for an AutoIncrement column.";
+public const string DataColumnAutoIncrementStepDescr = @"Indicates the increment used by an AutoIncrement column.";
+public const string DataColumnCaptionDescr = @"Indicates the default user-interface caption for this column.";
+public const string DataColumnColumnNameDescr = @"Indicates the name used to look up this column in the Columns collection of a DataTable.";
+public const string DataColumnDataTableDescr = @"Returns the DataTable to which this column belongs.";
+public const string DataColumnDataTypeDescr = @"Indicates the type of data stored in this column.";
+public const string DataColumnDefaultValueDescr = @"Indicates the default column value used when adding new rows to the table.";
+public const string DataColumnExpressionDescr = @"Indicates the value that this column computes for each row based on other columns instead of taking user input.";
+public const string DataColumnMappingDescr = @"Indicates how this column persists in XML: as an attribute, element, simple content node, or nothing.";
+public const string DataColumnNamespaceDescr = @"Indicates the XML uri for elements or attributes stored in this column.";
+public const string DataColumnPrefixDescr = @"Indicates the Prefix used for this DataColumn in xml representation.";
+public const string DataColumnOrdinalDescr = @"Indicates the index of this column in the Columns collection.";
+public const string DataColumnReadOnlyDescr = @"Indicates whether this column allows changes once a row has been added to the table.";
+public const string DataColumnUniqueDescr = @"Indicates whether this column should restrict its values in the rows of the table to be unique.";
+public const string DataColumnMaxLengthDescr = @"Indicates the maximum length of the value this column allows.";
+public const string DataColumnDateTimeModeDescr = @"Indicates DateTimeMode of this DataColumn.";
+
+
+
+public const string DataViewAllowDeleteDescr = @"Indicates whether this DataView and the user interface associated with it allows deletes.";
+public const string DataViewAllowEditDescr = @"Indicates whether this DataView and the user interface associated with it allows edits.";
+public const string DataViewAllowNewDescr = @"Indicates whether this DataView and the user interface associated with it allows new rows to be added.";
+public const string DataViewCountDescr = @"Returns the number of items currently in this view.";
+public const string DataViewDataViewManagerDescr = @"This returns a pointer to back to the DataViewManager that owns this DataSet (if any).";
+public const string DataViewIsOpenDescr = @"Indicates whether the view is open.";
+public const string DataViewRowFilterDescr = @"Indicates an expression used to filter the data returned by this DataView.";
+public const string DataViewRowStateFilterDescr = @"Indicates the versions of data returned by this DataView.";
+public const string DataViewSortDescr = @"Indicates the names of the column and the order in which data is returned by this DataView.";
+public const string DataViewApplyDefaultSortDescr = @"Indicates whether to use the default sort if the Sort property is not set.";
+public const string DataViewTableDescr = @"Indicates the table this DataView uses to get data.";
+public const string DataViewListChangedDescr = @"Indicates that the data returned by this DataView has somehow changed.";
+
+
+public const string DataViewManagerDataSetDescr = @"Indicates the source of data for this DataViewManager.";
+public const string DataViewManagerTableSettingsDescr = @"Indicates the sorting/filtering/state settings for any table in the corresponding DataSet.";
+
+
+
+
+public const string Xml_SimpleTypeNotSupported = @"DataSet doesn't support 'union' or 'list' as simpleType.";
+public const string Xml_MissingAttribute = @"Invalid {0} syntax: missing required '{1}' attribute.";
+public const string Xml_ValueOutOfRange = @"Value '{1}' is invalid for attribute '{0}'.";
+public const string Xml_AttributeValues = @"The value of attribute '{0}' should be '{1}' or '{2}'.";
+public const string Xml_ElementTypeNotFound = @"Cannot find ElementType name='{0}'.";
+public const string Xml_RelationParentNameMissing = @"Parent table name is missing in relation '{0}'.";
+public const string Xml_RelationChildNameMissing = @"Child table name is missing in relation '{0}'.";
+public const string Xml_RelationTableKeyMissing = @"Parent table key is missing in relation '{0}'.";
+public const string Xml_RelationChildKeyMissing = @"Child table key is missing in relation '{0}'.";
+public const string Xml_UndefinedDatatype = @"Undefined data type: '{0}'.";
+public const string Xml_DatatypeNotDefined = @"Data type not defined.";
+public const string Xml_InvalidField = @"Invalid XPath selection inside field node. Cannot find: {0}.";
+public const string Xml_InvalidSelector = @"Invalid XPath selection inside selector node: {0}.";
+public const string Xml_InvalidKey = @"Invalid 'Key' node inside constraint named: {0}.";
+public const string Xml_DuplicateConstraint = @"The constraint name {0} is already used in the schema.";
+public const string Xml_CannotConvert = @" Cannot convert '{0}' to type '{1}'.";
+public const string Xml_MissingRefer = @"Missing '{0}' part in '{1}' constraint named '{2}'.";
+public const string Xml_MismatchKeyLength = @"Invalid Relation definition: different length keys.";
+public const string Xml_CircularComplexType = @"DataSet doesn't allow the circular reference in the ComplexType named '{0}'.";
+public const string Xml_CannotInstantiateAbstract = @"DataSet cannot instantiate an abstract ComplexType for the node {0}.";
+public const string Xml_MultipleTargetConverterError = @"An error occurred with the multiple target converter while writing an Xml Schema. See the inner exception for details.";
+public const string Xml_MultipleTargetConverterEmpty = @"An error occurred with the multiple target converter while writing an Xml Schema. A null or empty string was returned.";
+
+public const string Xml_MergeDuplicateDeclaration = @"Duplicated declaration '{0}'.";
+public const string Xml_MissingTable = @"Cannot load diffGram. Table '{0}' is missing in the destination dataset.";
+public const string Xml_MissingSQL = @"Cannot load diffGram. The 'sql' node is missing.";
+public const string Xml_ColumnConflict = @"Column name '{0}' is defined for different mapping types.";
+public const string Xml_InvalidPrefix = @"Prefix '{0}' is not valid, because it contains special characters.";
+public const string Xml_NestedCircular = @"Circular reference in self-nested table '{0}'.";
+public const string Xml_FoundEntity = @"DataSet cannot expand entities. Use XmlValidatingReader and set the EntityHandling property accordingly.";
+public const string Xml_PolymorphismNotSupported = @"Type '{0}' does not implement IXmlSerializable interface therefore can not proceed with serialization.";
+public const string Xml_CanNotDeserializeObjectType = @"Unable to proceed with deserialization. Data does not implement IXMLSerializable, therefore polymorphism is not supported.";
+public const string Xml_DataTableInferenceNotSupported = @"DataTable does not support schema inference from Xml.";
+public const string Xml_MultipleParentRows = @"Cannot proceed with serializing DataTable '{0}'. It contains a DataRow which has multiple parent rows on the same Foreign Key.";
+public const string Xml_IsDataSetAttributeMissingInSchema = @"IsDataSet attribute is missing in input Schema.";
+public const string Xml_TooManyIsDataSetAtributeInSchema = @"Cannot determine the DataSet Element. IsDataSet attribute exist more than once.";
+public const string Xml_DynamicWithoutXmlSerializable = @"DataSet will not serialize types that implement IDynamicMetaObjectProvider but do not also implement IXmlSerializable.";
+
+
+
+public const string Expr_NYI = @"The feature not implemented. {0}.";
+public const string Expr_MissingOperand = @"Syntax error: Missing operand after '{0}' operator.";
+public const string Expr_TypeMismatch = @"Type mismatch in expression '{0}'.";
+public const string Expr_ExpressionTooComplex = @"Expression is too complex.";
+public const string Expr_UnboundName = @"Cannot find column [{0}].";
+public const string Expr_InvalidString = @"The expression contains an invalid string constant: {0}.";
+public const string Expr_UndefinedFunction = @"The expression contains undefined function call {0}().";
+public const string Expr_Syntax = @"Syntax error in the expression.";
+public const string Expr_FunctionArgumentCount = @"Invalid number of arguments: function {0}().";
+public const string Expr_MissingRightParen = @"The expression is missing the closing parenthesis.";
+public const string Expr_UnknownToken = @"Cannot interpret token '{0}' at position {1}.";
+public const string Expr_UnknownToken1 = @"Expected {0}, but actual token at the position {2} is {1}.";
+public const string Expr_DatatypeConvertion = @"Cannot convert from {0} to {1}.";
+public const string Expr_DatavalueConvertion = @"Cannot convert value '{0}' to Type: {1}.";
+public const string Expr_InvalidName = @"Invalid column name [{0}].";
+public const string Expr_InvalidDate = @"The expression contains invalid date constant '{0}'.";
+public const string Expr_NonConstantArgument = @"Only constant expressions are allowed in the expression list for the IN operator.";
+public const string Expr_InvalidPattern = @"Error in Like operator: the string pattern '{0}' is invalid.";
+public const string Expr_InWithoutParentheses = @"Syntax error: The items following the IN keyword must be separated by commas and be enclosed in parentheses.";
+public const string Expr_ArgumentType = @"Type mismatch in function argument: {0}(), argument {1}, expected {2}.";
+public const string Expr_ArgumentTypeInteger = @"Type mismatch in function argument: {0}(), argument {1}, expected one of the Integer types.";
+public const string Expr_TypeMismatchInBinop = @"Cannot perform '{0}' operation on {1} and {2}.";
+public const string Expr_AmbiguousBinop = @"Operator '{0}' is ambiguous on operands of type '{1}' and '{2}'. Cannot mix signed and unsigned types. Please use explicit Convert() function.";
+public const string Expr_InWithoutList = @"Syntax error: The IN keyword must be followed by a non-empty list of expressions separated by commas, and also must be enclosed in parentheses.";
+public const string Expr_UnsupportedOperator = @"The expression contains unsupported operator '{0}'.";
+public const string Expr_InvalidNameBracketing = @"The expression contains invalid name: '{0}'.";
+public const string Expr_MissingOperandBefore = @"Syntax error: Missing operand before '{0}' operator.";
+public const string Expr_TooManyRightParentheses = @"The expression has too many closing parentheses.";
+public const string Expr_UnresolvedRelation = @"The table [{0}] involved in more than one relation. You must explicitly mention a relation name in the expression '{1}'.";
+public const string Expr_AggregateArgument = @"Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier.";
+public const string Expr_AggregateUnbound = @"Unbound reference in the aggregate expression '{0}'.";
+public const string Expr_EvalNoContext = @"Cannot evaluate non-constant expression without current row.";
+public const string Expr_ExpressionUnbound = @"Unbound reference in the expression '{0}'.";
+public const string Expr_ComputeNotAggregate = @"Cannot evaluate. Expression '{0}' is not an aggregate.";
+public const string Expr_FilterConvertion = @"Filter expression '{0}' does not evaluate to a Boolean term.";
+public const string Expr_InvalidType = @"Invalid type name '{0}'.";
+public const string Expr_LookupArgument = @"Syntax error in Lookup expression: Expecting keyword 'Parent' followed by a single column argument with possible relation qualifier: Parent[(<relation_name>)].<column_name>.";
+public const string Expr_InvokeArgument = @"Need a row or a table to Invoke DataFilter.";
+public const string Expr_ArgumentOutofRange = @"{0}() argument is out of range.";
+public const string Expr_IsSyntax = @"Syntax error: Invalid usage of 'Is' operator. Correct syntax: <expression> Is [Not] Null.";
+public const string Expr_Overflow = @"Value is either too large or too small for Type '{0}'.";
+public const string Expr_DivideByZero = @"Divide by zero error encountered.";
+public const string Expr_BindFailure = @"Cannot find the parent relation '{0}'.";
+public const string Expr_InvalidHoursArgument = @"'hours' argument is out of range. Value must be between -14 and +14.";
+public const string Expr_InvalidMinutesArgument = @"'minutes' argument is out of range. Value must be between -59 and +59.";
+public const string Expr_InvalidTimeZoneRange = @"Provided range for time one exceeds total of 14 hours.";
+public const string Expr_MismatchKindandTimeSpan = @"Kind property of provided DateTime argument, does not match 'hours' and 'minutes' arguments.";
+public const string Expr_UnsupportedType = @"A DataColumn of type '{0}' does not support expression.";
+
+
+
+
+public const string Data_EnforceConstraints = @"Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.";
+public const string Data_CannotModifyCollection = @"Collection itself is not modifiable.";
+public const string Data_CaseInsensitiveNameConflict = @"The given name '{0}' matches at least two names in the collection object with different cases, but does not match either of them with the same case.";
+public const string Data_NamespaceNameConflict = @"The given name '{0}' matches at least two names in the collection object with different namespaces.";
+public const string Data_InvalidOffsetLength = @"Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.";
+
+public const string Data_ArgumentOutOfRange = @"'{0}' argument is out of range.";
+public const string Data_ArgumentNull = @"'{0}' argument cannot be null.";
+public const string Data_ArgumentContainsNull = @"'{0}' argument contains null value.";
+
+public const string DataColumns_OutOfRange = @"Cannot find column {0}.";
+public const string DataColumns_Add1 = @"Column '{0}' already belongs to this DataTable.";
+public const string DataColumns_Add2 = @"Column '{0}' already belongs to another DataTable.";
+public const string DataColumns_Add3 = @"Cannot have more than one SimpleContent columns in a DataTable.";
+public const string DataColumns_Add4 = @"Cannot add a SimpleContent column to a table containing element columns or nested relations.";
+public const string DataColumns_AddDuplicate = @"A column named '{0}' already belongs to this DataTable.";
+public const string DataColumns_AddDuplicate2 = @"Cannot add a column named '{0}': a nested table with the same name already belongs to this DataTable.";
+public const string DataColumns_AddDuplicate3 = @"A column named '{0}' already belongs to this DataTable: cannot set a nested table name to the same name.";
+public const string DataColumns_Remove = @"Cannot remove a column that doesn't belong to this table.";
+public const string DataColumns_RemovePrimaryKey = @"Cannot remove this column, because it's part of the primary key.";
+public const string DataColumns_RemoveChildKey = @"Cannot remove this column, because it is part of the parent key for relationship {0}.";
+public const string DataColumns_RemoveConstraint = @"Cannot remove this column, because it is a part of the constraint {0} on the table {1}.";
+public const string DataColumns_RemoveExpression = @"Cannot remove this column, because it is part of an expression: {0} = {1}.";
+
+public const string DataColumn_AutoIncrementAndExpression = @"Cannot set AutoIncrement property for a computed column.";
+public const string DataColumn_AutoIncrementAndDefaultValue = @"Cannot set AutoIncrement property for a column with DefaultValue set.";
+public const string DataColumn_DefaultValueAndAutoIncrement = @"Cannot set a DefaultValue on an AutoIncrement column.";
+public const string DataColumn_AutoIncrementSeed = @"AutoIncrementStep must be a non-zero value.";
+public const string DataColumn_NameRequired = @"ColumnName is required when it is part of a DataTable.";
+public const string DataColumn_ChangeDataType = @"Cannot change DataType of a column once it has data.";
+public const string DataColumn_NullDataType = @"Column requires a valid DataType.";
+public const string DataColumn_DefaultValueDataType = @"The DefaultValue for column {0} is of type {1} and cannot be converted to {2}.";
+public const string DataColumn_DefaultValueDataType1 = @"The DefaultValue for the column is of type {0} and cannot be converted to {1}.";
+public const string DataColumn_DefaultValueColumnDataType = @"The DefaultValue for column {0} is of type {1}, but the column is of type {2}.";
+public const string DataColumn_ReadOnlyAndExpression = @"Cannot change ReadOnly property for the expression column.";
+public const string DataColumn_UniqueAndExpression = @"Cannot change Unique property for the expression column.";
+public const string DataColumn_ExpressionAndUnique = @"Cannot create an expression on a column that has AutoIncrement or Unique.";
+public const string DataColumn_ExpressionAndReadOnly = @"Cannot set expression because column cannot be made ReadOnly.";
+public const string DataColumn_ExpressionAndConstraint = @"Cannot set Expression property on column {0}, because it is a part of a constraint.";
+public const string DataColumn_ExpressionInConstraint = @"Cannot create a constraint based on Expression column {0}.";
+public const string DataColumn_ExpressionCircular = @"Cannot set Expression property due to circular reference in the expression.";
+public const string DataColumn_NullKeyValues = @"Column '{0}' has null values in it.";
+public const string DataColumn_NullValues = @"Column '{0}' does not allow nulls.";
+public const string DataColumn_ReadOnly = @"Column '{0}' is read only.";
+public const string DataColumn_NonUniqueValues = @"Column '{0}' contains non-unique values.";
+public const string DataColumn_NotInTheTable = @"Column '{0}' does not belong to table {1}.";
+public const string DataColumn_NotInAnyTable = @"Column must belong to a table.";
+public const string DataColumn_SetFailed = @"Couldn't store <{0}> in {1} Column. Expected type is {2}.";
+public const string DataColumn_CannotSetToNull = @"Cannot set Column '{0}' to be null. Please use DBNull instead.";
+public const string DataColumn_LongerThanMaxLength = @"Cannot set column '{0}'. The value violates the MaxLength limit of this column.";
+public const string DataColumn_HasToBeStringType = @"MaxLength applies to string data type only. You cannot set Column '{0}' property MaxLength to be non-negative number.";
+public const string DataColumn_CannotSetMaxLength = @"Cannot set Column '{0}' property MaxLength to '{1}'. There is at least one string in the table longer than the new limit.";
+public const string DataColumn_CannotSetMaxLength2 = @"Cannot set Column '{0}' property MaxLength. The Column is SimpleContent.";
+public const string DataColumn_CannotSimpleContentType = @"Cannot set Column '{0}' property DataType to {1}. The Column is SimpleContent.";
+public const string DataColumn_CannotSimpleContent = @"Cannot set Column '{0}' property MappingType to SimpleContent. The Column DataType is {1}.";
+public const string DataColumn_ExceedMaxLength = @"Column '{0}' exceeds the MaxLength limit.";
+public const string DataColumn_NotAllowDBNull = @"Column '{0}' does not allow DBNull.Value.";
+public const string DataColumn_CannotChangeNamespace = @"Cannot change the Column '{0}' property Namespace. The Column is SimpleContent.";
+public const string DataColumn_AutoIncrementCannotSetIfHasData = @"Cannot change AutoIncrement of a DataColumn with type '{0}' once it has data.";
+public const string DataColumn_NotInTheUnderlyingTable = @"Column '{0}' does not belong to underlying table '{1}'.";
+public const string DataColumn_InvalidDataColumnMapping = @"DataColumn with type '{0}' is a complexType. Can not serialize value of a complex type as Attribute";
+public const string DataColumn_CannotSetDateTimeModeForNonDateTimeColumns = @"The DateTimeMode can be set only on DataColumns of type DateTime.";
+public const string DataColumn_InvalidDateTimeMode = @"'{0}' is Invalid DataSetDateTime value.";
+public const string DataColumn_DateTimeMode = @"Cannot change DateTimeMode from '{0}' to '{1}' once the table has data.";
+public const string DataColumn_INullableUDTwithoutStaticNull = @"Type '{0}' does not contain static Null property or field.";
+public const string DataColumn_UDTImplementsIChangeTrackingButnotIRevertible = @"Type '{0}' does not implement IRevertibleChangeTracking; therefore can not proceed with RejectChanges().";
+public const string DataColumn_SetAddedAndModifiedCalledOnNonUnchanged = @"SetAdded and SetModified can only be called on DataRows with Unchanged DataRowState.";
+public const string DataColumn_OrdinalExceedMaximun = @"Ordinal '{0}' exceeds the maximum number.";
+public const string DataColumn_NullableTypesNotSupported = @"DataSet does not support System.Nullable<>.";
+
+public const string DataConstraint_NoName = @"Cannot change the name of a constraint to empty string when it is in the ConstraintCollection.";
+public const string DataConstraint_Violation = @"Cannot enforce constraints on constraint {0}.";
+public const string DataConstraint_ViolationValue = @"Column '{0}' is constrained to be unique. Value '{1}' is already present.";
+public const string DataConstraint_NotInTheTable = @"Constraint '{0}' does not belong to this DataTable.";
+public const string DataConstraint_OutOfRange = @"Cannot find constraint {0}.";
+public const string DataConstraint_Duplicate = @"Constraint matches constraint named {0} already in collection.";
+public const string DataConstraint_DuplicateName = @"A Constraint named '{0}' already belongs to this DataTable.";
+public const string DataConstraint_UniqueViolation = @"These columns don't currently have unique values.";
+public const string DataConstraint_ForeignTable = @"These columns don't point to this table.";
+public const string DataConstraint_ParentValues = @"This constraint cannot be enabled as not all values have corresponding parent values.";
+public const string DataConstraint_AddFailed = @"This constraint cannot be added since ForeignKey doesn't belong to table {0}.";
+public const string DataConstraint_RemoveFailed = @"Cannot remove a constraint that doesn't belong to this table.";
+public const string DataConstraint_NeededForForeignKeyConstraint = @"Cannot remove unique constraint '{0}'. Remove foreign key constraint '{1}' first.";
+public const string DataConstraint_CascadeDelete = @"Cannot delete this row because constraints are enforced on relation {0}, and deleting this row will strand child rows.";
+public const string DataConstraint_CascadeUpdate = @"Cannot make this change because constraints are enforced on relation {0}, and changing this value will strand child rows.";
+public const string DataConstraint_ClearParentTable = @"Cannot clear table {0} because ForeignKeyConstraint {1} enforces constraints and there are child rows in {2}.";
+public const string DataConstraint_ForeignKeyViolation = @"ForeignKeyConstraint {0} requires the child key values ({1}) to exist in the parent table.";
+public const string DataConstraint_BadObjectPropertyAccess = @"Property not accessible because '{0}'.";
+public const string DataConstraint_RemoveParentRow = @"Cannot remove this row because it has child rows, and constraints on relation {0} are enforced.";
+public const string DataConstraint_AddPrimaryKeyConstraint = @"Cannot add primary key constraint since primary key is already set for the table.";
+public const string DataConstraint_CantAddConstraintToMultipleNestedTable = @"Cannot add constraint to DataTable '{0}' which is a child table in two nested relations.";
+
+public const string DataKey_TableMismatch = @"Cannot create a Key from Columns that belong to different tables.";
+public const string DataKey_NoColumns = @"Cannot have 0 columns.";
+public const string DataKey_TooManyColumns = @"Cannot have more than {0} columns.";
+public const string DataKey_DuplicateColumns = @"Cannot create a Key when the same column is listed more than once: '{0}'";
+public const string DataKey_RemovePrimaryKey = @"Cannot remove unique constraint since it's the primary key of a table.";
+public const string DataKey_RemovePrimaryKey1 = @"Cannot remove unique constraint since it's the primary key of table {0}.";
+
+public const string DataRelation_ColumnsTypeMismatch = @"Parent Columns and Child Columns don't have type-matching columns.";
+public const string DataRelation_KeyColumnsIdentical = @"ParentKey and ChildKey are identical.";
+public const string DataRelation_KeyLengthMismatch = @"ParentColumns and ChildColumns should be the same length.";
+public const string DataRelation_KeyZeroLength = @"ParentColumns and ChildColumns must not be zero length.";
+public const string DataRelation_ForeignRow = @"The row doesn't belong to the same DataSet as this relation.";
+public const string DataRelation_NoName = @"RelationName is required when it is part of a DataSet.";
+public const string DataRelation_ForeignTable = @"GetChildRows requires a row whose Table is {0}, but the specified row's Table is {1}.";
+public const string DataRelation_ForeignDataSet = @"This relation should connect two tables in this DataSet to be added to this DataSet.";
+public const string DataRelation_GetParentRowTableMismatch = @"GetParentRow requires a row whose Table is {0}, but the specified row's Table is {1}.";
+public const string DataRelation_SetParentRowTableMismatch = @"SetParentRow requires a child row whose Table is {0}, but the specified row's Table is {1}.";
+public const string DataRelation_DataSetMismatch = @"Cannot have a relationship between tables in different DataSets.";
+public const string DataRelation_TablesInDifferentSets = @"Cannot create a relation between tables in different DataSets.";
+public const string DataRelation_AlreadyExists = @"A relation already exists for these child columns.";
+public const string DataRelation_DoesNotExist = @"This relation doesn't belong to this relation collection.";
+public const string DataRelation_AlreadyInOtherDataSet = @"This relation already belongs to another DataSet.";
+public const string DataRelation_AlreadyInTheDataSet = @"This relation already belongs to this DataSet.";
+public const string DataRelation_DuplicateName = @"A Relation named '{0}' already belongs to this DataSet.";
+public const string DataRelation_NotInTheDataSet = @"Relation {0} does not belong to this DataSet.";
+public const string DataRelation_OutOfRange = @"Cannot find relation {0}.";
+public const string DataRelation_TableNull = @"Cannot create a collection on a null table.";
+public const string DataRelation_TableWasRemoved = @"The table this collection displays relations for has been removed from its DataSet.";
+public const string DataRelation_ChildTableMismatch = @"Cannot add a relation to this table's ParentRelation collection where this table isn't the child table.";
+public const string DataRelation_ParentTableMismatch = @"Cannot add a relation to this table's ChildRelation collection where this table isn't the parent table.";
+public const string DataRelation_RelationNestedReadOnly = @"Cannot set the 'Nested' property to false for this relation.";
+public const string DataRelation_TableCantBeNestedInTwoTables = @"The same table '{0}' cannot be the child table in two nested relations.";
+public const string DataRelation_LoopInNestedRelations = @"The table ({0}) cannot be the child table to itself in nested relations.";
+public const string DataRelation_CaseLocaleMismatch = @"Cannot add a DataRelation or Constraint that has different Locale or CaseSensitive settings between its parent and child tables.";
+public const string DataRelation_ParentOrChildColumnsDoNotHaveDataSet = @"Cannot create a DataRelation if Parent or Child Columns are not in a DataSet.";
+public const string DataRelation_InValidNestedRelation = @"Nested table '{0}' which inherits its namespace cannot have multiple parent tables in different namespaces.";
+public const string DataRelation_InValidNamespaceInNestedRelation = @"Nested table '{0}' with empty namespace cannot have multiple parent tables in different namespaces.";
+
+public const string DataRow_NotInTheDataSet = @"The row doesn't belong to the same DataSet as this relation.";
+public const string DataRow_NotInTheTable = @"Cannot perform this operation on a row not in the table.";
+public const string DataRow_ParentRowNotInTheDataSet = @"This relation and child row don't belong to same DataSet.";
+public const string DataRow_EditInRowChanging = @"Cannot change a proposed value in the RowChanging event.";
+public const string DataRow_EndEditInRowChanging = @"Cannot call EndEdit() inside an OnRowChanging event.";
+public const string DataRow_BeginEditInRowChanging = @"Cannot call BeginEdit() inside the RowChanging event.";
+public const string DataRow_CancelEditInRowChanging = @"Cannot call CancelEdit() inside an OnRowChanging event. Throw an exception to cancel this update.";
+public const string DataRow_DeleteInRowDeleting = @"Cannot call Delete inside an OnRowDeleting event. Throw an exception to cancel this delete.";
+public const string DataRow_ValuesArrayLength = @"Input array is longer than the number of columns in this table.";
+public const string DataRow_NoCurrentData = @"There is no Current data to access.";
+public const string DataRow_NoOriginalData = @"There is no Original data to access.";
+public const string DataRow_NoProposedData = @"There is no Proposed data to access.";
+public const string DataRow_RemovedFromTheTable = @"This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row.";
+public const string DataRow_DeletedRowInaccessible = @"Deleted row information cannot be accessed through the row.";
+public const string DataRow_InvalidVersion = @"Version must be Original, Current, or Proposed.";
+public const string DataRow_OutOfRange = @"There is no row at position {0}.";
+public const string DataRow_RowInsertOutOfRange = @"The row insert position {0} is invalid.";
+public const string DataRow_RowInsertTwice = @"The rowOrder value={0} has been found twice for table named '{1}'.";
+public const string DataRow_RowInsertMissing = @"Values are missing in the rowOrder sequence for table '{0}'.";
+public const string DataRow_RowOutOfRange = @"The given DataRow is not in the current DataRowCollection.";
+public const string DataRow_AlreadyInOtherCollection = @"This row already belongs to another table.";
+public const string DataRow_AlreadyInTheCollection = @"This row already belongs to this table.";
+public const string DataRow_AlreadyDeleted = @"Cannot delete this row since it's already deleted.";
+public const string DataRow_Empty = @"This row is empty.";
+public const string DataRow_AlreadyRemoved = @"Cannot remove a row that's already been removed.";
+public const string DataRow_MultipleParents = @"A child row has multiple parents.";
+public const string DataRow_InvalidRowBitPattern = @"Unrecognized row state bit pattern.";
+
+public const string DataSet_SetNameToEmpty = @"Cannot change the name of the DataSet to an empty string.";
+public const string DataSet_SetDataSetNameConflicting = @"The name '{0}' is invalid. A DataSet cannot have the same name of the DataTable.";
+public const string DataSet_UnsupportedSchema = @"The schema namespace is invalid. Please use this one instead: {0}.";
+public const string DataSet_CannotChangeCaseLocale = @"Cannot change CaseSensitive or Locale property. This change would lead to at least one DataRelation or Constraint to have different Locale or CaseSensitive settings between its related tables.";
+public const string DataSet_CannotChangeSchemaSerializationMode = @"SchemaSerializationMode property can be set only if it is overridden by derived DataSet.";
+
+public const string DataTable_ForeignPrimaryKey = @"PrimaryKey columns do not belong to this table.";
+public const string DataTable_CannotAddToSimpleContent = @"Cannot add a nested relation or an element column to a table containing a SimpleContent column.";
+public const string DataTable_NoName = @"TableName is required when it is part of a DataSet.";
+public const string DataTable_MultipleSimpleContentColumns = @"DataTable already has a simple content column.";
+public const string DataTable_MissingPrimaryKey = @"Table doesn't have a primary key.";
+public const string DataTable_InvalidSortString = @" {0} isn't a valid Sort string entry.";
+public const string DataTable_CanNotSerializeDataTableHierarchy = @"Cannot serialize the DataTable. A DataTable being used in one or more DataColumn expressions is not a descendant of current DataTable.";
+public const string DataTable_CanNotRemoteDataTable = @"This DataTable can only be remoted as part of DataSet. One or more Expression Columns has reference to other DataTable(s).";
+public const string DataTable_CanNotSetRemotingFormat = @"Cannot have different remoting format property value for DataSet and DataTable.";
+public const string DataTable_CanNotSerializeDataTableWithEmptyName = @"Cannot serialize the DataTable. DataTable name is not set.";
+
+public const string DataTable_DuplicateName = @"A DataTable named '{0}' already belongs to this DataSet.";
+public const string DataTable_DuplicateName2 = @"A DataTable named '{0}' with the same Namespace '{1}' already belongs to this DataSet.";
+public const string DataTable_SelfnestedDatasetConflictingName = @"The table ({0}) cannot be the child table to itself in a nested relation: the DataSet name conflicts with the table name.";
+public const string DataTable_DatasetConflictingName = @"The name '{0}' is invalid. A DataTable cannot have the same name of the DataSet.";
+public const string DataTable_AlreadyInOtherDataSet = @"DataTable already belongs to another DataSet.";
+public const string DataTable_AlreadyInTheDataSet = @"DataTable already belongs to this DataSet.";
+public const string DataTable_NotInTheDataSet = @"Table {0} does not belong to this DataSet.";
+public const string DataTable_OutOfRange = @"Cannot find table {0}.";
+public const string DataTable_InRelation = @"Cannot remove a table that has existing relations. Remove relations first.";
+public const string DataTable_InConstraint = @"Cannot remove table {0}, because it referenced in ForeignKeyConstraint {1}. Remove the constraint first.";
+public const string DataTable_TableNotFound = @"DataTable '{0}' does not match to any DataTable in source.";
+
+public const string DataMerge_MissingDefinition = @"Target DataSet missing definition for {0}.";
+public const string DataMerge_MissingConstraint = @"Target DataSet missing {0} {1}.";
+public const string DataMerge_DataTypeMismatch = @"<target>.{0} and <source>.{0} have conflicting properties: DataType property mismatch.";
+public const string DataMerge_PrimaryKeyMismatch = @"<target>.PrimaryKey and <source>.PrimaryKey have different Length.";
+public const string DataMerge_PrimaryKeyColumnsMismatch = @"Mismatch columns in the PrimaryKey : <target>.{0} versus <source>.{1}.";
+public const string DataMerge_ReltionKeyColumnsMismatch = @"Relation {0} cannot be merged, because keys have mismatch columns.";
+public const string DataMerge_MissingColumnDefinition = @"Target table {0} missing definition for column {1}.";
+public const string DataMerge_MissingPrimaryKeyColumnInSource = @"PrimaryKey column {0} does not exist in source Table.";
+
+public const string DataIndex_RecordStateRange = @"The RowStates parameter must be set to a valid combination of values from the DataViewRowState enumeration.";
+public const string DataIndex_FindWithoutSortOrder = @"Find finds a row based on a Sort order, and no Sort order is specified.";
+public const string DataIndex_KeyLength = @"Expecting {0} value(s) for the key being indexed, but received {1} value(s).";
+
+public const string DataStorage_AggregateException = @"Invalid usage of aggregate function {0}() and Type: {1}.";
+public const string DataStorage_InvalidStorageType = @"Invalid storage type: {0}.";
+public const string DataStorage_ProblematicChars = @"The DataSet Xml persistency does not support the value '{0}' as Char value, please use Byte storage instead.";
+public const string DataStorage_SetInvalidDataType = @"Type of value has a mismatch with column type";
+public const string DataStorage_IComparableNotDefined = @" Type '{0}' does not implement IComparable interface. Comparison cannot be done.";
+
+public const string DataView_SetFailed = @"Cannot set {0}.";
+public const string DataView_SetDataSetFailed = @"Cannot change DataSet on a DataViewManager that's already the default view for a DataSet.";
+public const string DataView_SetRowStateFilter = @"RowStateFilter cannot show ModifiedOriginals and ModifiedCurrents at the same time.";
+public const string DataView_SetTable = @"Cannot change Table property on a DefaultView or a DataView coming from a DataViewManager.";
+public const string DataView_CanNotSetDataSet = @"Cannot change DataSet property once it is set.";
+public const string DataView_CanNotUseDataViewManager = @"DataSet must be set prior to using DataViewManager.";
+public const string DataView_CanNotSetTable = @"Cannot change Table property once it is set.";
+public const string DataView_CanNotUse = @"DataTable must be set prior to using DataView.";
+public const string DataView_CanNotBindTable = @"Cannot bind to DataTable with no name.";
+public const string DataView_SetIListObject = @"Cannot set an object into this list.";
+public const string DataView_AddNewNotAllowNull = @"Cannot call AddNew on a DataView where AllowNew is false.";
+public const string DataView_NotOpen = @"DataView is not open.";
+public const string DataView_CreateChildView = @"The relation is not parented to the table to which this DataView points.";
+public const string DataView_CanNotDelete = @"Cannot delete on a DataSource where AllowDelete is false.";
+public const string DataView_CanNotEdit = @"Cannot edit on a DataSource where AllowEdit is false.";
+public const string DataView_GetElementIndex = @"Index {0} is either negative or above rows count.";
+public const string DataView_AddExternalObject = @"Cannot add external objects to this list.";
+public const string DataView_CanNotClear = @"Cannot clear this list.";
+public const string DataView_InsertExternalObject = @"Cannot insert external objects to this list.";
+public const string DataView_RemoveExternalObject = @"Cannot remove objects not in the list.";
+
+public const string DataROWView_PropertyNotFound = @"{0} is neither a DataColumn nor a DataRelation for table {1}.";
+
+public const string Range_Argument = @"Min ({0}) must be less than or equal to max ({1}) in a Range object.";
+public const string Range_NullRange = @"This is a null range.";
+public const string RecordManager_MinimumCapacity = @"MinimumCapacity must be non-negative.";
+
+
+public const string CodeGen_InvalidIdentifier = @"Cannot generate identifier for name '{0}'.";
+public const string CodeGen_DuplicateTableName = @"There is more than one table with the same name '{0}' (even if namespace is different).";
+public const string CodeGen_TypeCantBeNull = @"Column '{0}': Type '{1}' cannot be null.";
+public const string CodeGen_NoCtor0 = @"Column '{0}': Type '{1}' does not have parameterless constructor.";
+public const string CodeGen_NoCtor1 = @"Column '{0}': Type '{1}' does not have constructor with string argument.";
+
+
+
+public const string SqlConvert_ConvertFailed = @" Cannot convert object of type '{0}' to object of type '{1}'.";
+
+
+public const string DataSet_DefaultDataException = @"Data Exception.";
+public const string DataSet_DefaultConstraintException = @"Constraint Exception.";
+public const string DataSet_DefaultDeletedRowInaccessibleException = @"Deleted rows inaccessible.";
+public const string DataSet_DefaultDuplicateNameException = @"Duplicate name not allowed.";
+public const string DataSet_DefaultInRowChangingEventException = @"Operation not supported in the RowChanging event.";
+public const string DataSet_DefaultInvalidConstraintException = @"Invalid constraint.";
+public const string DataSet_DefaultMissingPrimaryKeyException = @"Missing primary key.";
+public const string DataSet_DefaultNoNullAllowedException = @"Null not allowed.";
+public const string DataSet_DefaultReadOnlyException = @"Column is marked read only.";
+public const string DataSet_DefaultRowNotInTableException = @"Row not found in table.";
+public const string DataSet_DefaultVersionNotFoundException = @"Version not found.";
+
+
+public const string Load_ReadOnlyDataModified = @"ReadOnly Data is Modified.";
+
+
+
+public const string DataTableReader_InvalidDataTableReader = @"DataTableReader is invalid for current DataTable '{0}'.";
+public const string DataTableReader_SchemaInvalidDataTableReader = @"Schema of current DataTable '{0}' in DataTableReader has changed, DataTableReader is invalid.";
+public const string DataTableReader_CannotCreateDataReaderOnEmptyDataSet = @"DataTableReader Cannot be created. There is no DataTable in DataSet.";
+public const string DataTableReader_DataTableReaderArgumentIsEmpty = @"Cannot create DataTableReader. Argument is Empty.";
+public const string DataTableReader_ArgumentContainsNullValue = @"Cannot create DataTableReader. Arguments contain null value.";
+public const string DataTableReader_InvalidRowInDataTableReader = @"Current DataRow is either in Deleted or Detached state.";
+
+public const string DataTableReader_DataTableCleared = @"Current DataTable '{0}' is empty. There is no DataRow in DataTable.";
+
+
+
+
+public const string RbTree_InvalidState = @"DataTable internal index is corrupted: '{0}'.";
+public const string RbTree_EnumerationBroken = @"Collection was modified; enumeration operation might not execute.";
+
+
+public const string NamedSimpleType_InvalidDuplicateNamedSimpleTypeDelaration = @"Simple type '{0}' has already be declared with different '{1}'.";
+
+
+
+public const string DataDom_Foliation = @"Invalid foliation.";
+public const string DataDom_TableNameChange = @"Cannot change the table name once the associated DataSet is mapped to a loaded XML document.";
+public const string DataDom_TableNamespaceChange = @"Cannot change the table namespace once the associated DataSet is mapped to a loaded XML document.";
+public const string DataDom_ColumnNameChange = @"Cannot change the column name once the associated DataSet is mapped to a loaded XML document.";
+public const string DataDom_ColumnNamespaceChange = @"Cannot change the column namespace once the associated DataSet is mapped to a loaded XML document.";
+public const string DataDom_ColumnMappingChange = @"Cannot change the ColumnMapping property once the associated DataSet is mapped to a loaded XML document.";
+public const string DataDom_TableColumnsChange = @"Cannot add or remove columns from the table once the DataSet is mapped to a loaded XML document.";
+public const string DataDom_DataSetTablesChange = @"Cannot add or remove tables from the DataSet once the DataSet is mapped to a loaded XML document.";
+public const string DataDom_DataSetNestedRelationsChange = @"Cannot add, remove, or change Nested relations from the DataSet once the DataSet is mapped to a loaded XML document.";
+public const string DataDom_DataSetNull = @"The DataSet parameter is invalid. It cannot be null.";
+public const string DataDom_DataSetNameChange = @"Cannot change the DataSet name once the DataSet is mapped to a loaded XML document.";
+public const string DataDom_CloneNode = @"This type of node cannot be cloned: {0}.";
+public const string DataDom_MultipleLoad = @"Cannot load XmlDataDocument if it already contains data. Please use a new XmlDataDocument.";
+public const string DataDom_MultipleDataSet = @"DataSet can be associated with at most one XmlDataDocument. Cannot associate the DataSet with the current XmlDataDocument because the DataSet is already associated with another XmlDataDocument.";
+public const string DataDom_EnforceConstraintsShouldBeOff = @"Please set DataSet.EnforceConstraints == false before trying to edit XmlDataDocument using XML operations.";
+public const string DataDom_NotSupport_GetElementById = @"GetElementById() is not supported on DataDocument.";
+public const string DataDom_NotSupport_EntRef = @"Cannot create entity references on DataDocument.";
+public const string DataDom_NotSupport_Clear = @"Clear function on DateSet and DataTable is not supported on XmlDataDocument.";
+
+
+
+
+public const string StrongTyping_CannotRemoveColumn = @"Cannot remove column since it is built in to this dataSet.";
+public const string StrongTyping_CananotRemoveRelation = @"Cannot remove relation since it is built in to this dataSet.";
+public const string propertyChangedEventDescr = @"Occurs whenever a property for this control changes.";
+public const string collectionChangedEventDescr = @"Occurs whenever this collection's membership changes.";
+public const string StrongTyping_CananotAccessDBNull = @"Cannot get value because it is DBNull.";
+
+
+
+
+
+
+public const string ADP_PropertyNotSupported = @"The '{0}' property requires Microsoft WindowsNT or a WindowsNT based operating system.";
+
+
+public const string ConfigProviderNotFound = @"Unable to find the requested .Net Framework Data Provider. It may not be installed.";
+public const string ConfigProviderInvalid = @"The requested .Net Framework Data Provider's implementation does not have an Instance field of a System.Data.Common.DbProviderFactory derived type.";
+public const string ConfigProviderNotInstalled = @"Failed to find or load the registered .Net Framework Data Provider.";
+public const string ConfigProviderMissing = @"The missing .Net Framework Data Provider's assembly qualified name is required.";
+
+
+public const string ConfigBaseElementsOnly = @"Only elements allowed.";
+public const string ConfigBaseNoChildNodes = @"Child nodes not allowed.";
+public const string ConfigUnrecognizedAttributes = @"Unrecognized attribute '{0}'.";
+public const string ConfigUnrecognizedElement = @"Unrecognized element.";
+public const string ConfigSectionsUnique = @"The '{0}' section can only appear once per config file.";
+public const string ConfigRequiredAttributeMissing = @"Required attribute '{0}' not found.";
+public const string ConfigRequiredAttributeEmpty = @"Required attribute '{0}' cannot be empty.";
+
+public const string ADP_EmptyArray = @"Expecting non-empty array for '{0}' parameter.";
+
+
+public const string ADP_SingleValuedProperty = @"The only acceptable value for the property '{0}' is '{1}'.";
+public const string ADP_DoubleValuedProperty = @"The acceptable values for the property '{0}' are '{1}' or '{2}'.";
+public const string ADP_InvalidPrefixSuffix = @"Specified QuotePrefix and QuoteSuffix values do not match.";
+
+public const string ADP_InvalidArgumentLength = @"The length of argument '{0}' exceeds it's limit of '{1}'.";
+
+
+
+
+
+public const string SQL_WrongType = @"Expecting argument of type {1}, but received type {0}.";
+
+
+
+public const string ADP_InvalidConnectionOptionValue = @"Invalid value for key '{0}'.";
+public const string ADP_MissingConnectionOptionValue = @"Use of key '{0}' requires the key '{1}' to be present.";
+public const string ADP_InvalidConnectionOptionValueLength = @"The value's length for key '{0}' exceeds it's limit of '{1}'.";
+
+
+public const string ADP_KeywordNotSupported = @"Keyword not supported: '{0}'.";
+
+
+public const string ADP_UdlFileError = @"Unable to load the UDL file.";
+public const string ADP_InvalidUDL = @"Invalid UDL file.";
+
+
+
+
+
+public const string ADP_InternalProviderError = @"Internal .Net Framework Data Provider error {0}.";
+
+
+
+
+
+
+
+
+
+
+public const string ADP_NoQuoteChange = @"The QuotePrefix and QuoteSuffix properties cannot be changed once an Insert, Update, or Delete command has been generated.";
+public const string ADP_MissingSourceCommand = @"The DataAdapter.SelectCommand property needs to be initialized.";
+public const string ADP_MissingSourceCommandConnection = @"The DataAdapter.SelectCommand.Connection property needs to be initialized;";
+
+
+public const string ADP_InvalidMultipartName = @"{0} ""{1}"".";
+public const string ADP_InvalidMultipartNameQuoteUsage = @"{0} ""{1}"", incorrect usage of quotes.";
+public const string ADP_InvalidMultipartNameToManyParts = @"{0} ""{1}"", the current limit of ""{2}"" is insufficient.";
+
+
+public const string SQL_BulkCopyDestinationTableName = @"SqlBulkCopy.WriteToServer failed because the SqlBulkCopy.DestinationTableName is an invalid multipart name";
+public const string SQL_TDSParserTableName = @"Processing of results from SQL Server failed because of an invalid multipart name";
+public const string SQL_UDTTypeName = @"SqlParameter.UdtTypeName is an invalid multipart name";
+public const string SQL_TypeName = @"SqlParameter.TypeName is an invalid multipart name";
+public const string SQL_SqlCommandCommandText = @"SqlCommand.DeriveParameters failed because the SqlCommand.CommandText property value is an invalid multipart name";
+public const string ODBC_ODBCCommandText = @"OdbcCommandBuilder.DeriveParameters failed because the OdbcCommand.CommandText property value is an invalid multipart name";
+public const string OLEDB_OLEDBCommandText = @"OleDbCommandBuilder.DeriveParameters failed because the OleDbCommandBuilder.CommandText property value is an invalid multipart name";
+
+
+public const string SQLMSF_FailoverPartnerNotSupported = @"Connecting to a mirrored SQL Server instance using the MultiSubnetFailover connection option is not supported.";
+
+
+
+
+
+
+
+
+
+
+
+
+
+public const string ADP_ColumnSchemaExpression = @"The column mapping from SourceColumn '{0}' failed because the DataColumn '{1}' is a computed column.";
+public const string ADP_ColumnSchemaMismatch = @"Inconvertible type mismatch between SourceColumn '{0}' of {1} and the DataColumn '{2}' of {3}.";
+public const string ADP_ColumnSchemaMissing1 = @"Missing the DataColumn '{0}' for the SourceColumn '{2}'.";
+public const string ADP_ColumnSchemaMissing2 = @"Missing the DataColumn '{0}' in the DataTable '{1}' for the SourceColumn '{2}'.";
+
+
+
+public const string ADP_InvalidSourceColumn = @"SourceColumn is required to be a non-empty string.";
+
+public const string ADP_MissingColumnMapping = @"Missing SourceColumn mapping for '{0}'.";
+
+
+
+
+public const string ADP_NotSupportedEnumerationValue = @"The {0} enumeration value, {1}, is not supported by the {2} method.";
+public const string ODBC_NotSupportedEnumerationValue = @"The {0} enumeration value, {1}, is not supported by the .Net Framework Odbc Data Provider.";
+public const string OLEDB_NotSupportedEnumerationValue = @"The {0} enumeration value, {1}, is not supported by the .Net Framework OleDb Data Provider.";
+public const string SQL_NotSupportedEnumerationValue = @"The {0} enumeration value, {1}, is not supported by the .Net Framework SqlClient Data Provider.";
+
+
+
+public const string ADP_ComputerNameEx = @"Unable to retrieve the ComputerNameDnsFullyQualified, {0}.";
+
+
+
+public const string ADP_MissingTableSchema = @"Missing the '{0}' DataTable for the '{1}' SourceTable.";
+
+
+
+public const string ADP_InvalidSourceTable = @"SourceTable is required to be a non-empty string";
+
+public const string ADP_MissingTableMapping = @"Missing SourceTable mapping: '{0}'";
+
+
+
+public const string ADP_CommandTextRequired = @"{0}: CommandText property has not been initialized";
+public const string ADP_ConnectionRequired = @"{0}: Connection property has not been initialized.";
+public const string ADP_OpenConnectionRequired = @"{0} requires an open and available Connection. {1}";
+
+public const string ADP_ConnectionRequired_Fill = @"Fill: SelectCommand.Connection property has not been initialized.";
+public const string ADP_ConnectionRequired_FillPage = @"FillPage: SelectCommand.Connection property has not been initialized.";
+public const string ADP_ConnectionRequired_FillSchema = @"FillSchema: SelectCommand.Connection property has not been initialized.";
+public const string ADP_ConnectionRequired_Insert = @"Update requires the InsertCommand to have a connection object. The Connection property of the InsertCommand has not been initialized.";
+public const string ADP_ConnectionRequired_Update = @"Update requires the UpdateCommand to have a connection object. The Connection property of the UpdateCommand has not been initialized.";
+public const string ADP_ConnectionRequired_Delete = @"Update requires the DeleteCommand to have a connection object. The Connection property of the DeleteCommand has not been initialized.";
+public const string ADP_ConnectionRequired_Batch = @"Update requires a connection object. The Connection property has not been initialized.";
+public const string ADP_ConnectionRequired_Clone = @"Update requires the command clone to have a connection object. The Connection property of the command clone has not been initialized.";
+public const string ADP_ConnecitonRequired_UpdateRows = @"Update requires a connection.";
+
+public const string ADP_OpenConnectionRequired_Insert = @"Update requires the {0}Command to have an open connection object. {1}";
+public const string ADP_OpenConnectionRequired_Update = @"Update requires the {0}Command to have an open connection object. {1}";
+public const string ADP_OpenConnectionRequired_Delete = @"Update requires the {0}Command to have an open connection object. {1}";
+public const string ADP_OpenConnectionRequired_Clone = @"Update requires the updating command to have an open connection object. {1}";
+
+public const string ADP_NoStoredProcedureExists = @"The stored procedure '{0}' doesn't exist.";
+public const string ADP_TransactionCompleted = @"The transaction assigned to this command must be the most nested pending local transaction.";
+public const string ADP_TransactionConnectionMismatch = @"The transaction is either not associated with the current connection or has been completed.";
+public const string ADP_TransactionCompletedButNotDisposed = @"The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.";
+public const string ADP_TransactionRequired = @"{0} requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized.";
+public const string ADP_OpenResultSetExists = @"There is already an open SqlResultSet associated with this command which must be closed first.";
+public const string ADP_OpenReaderExists = @"There is already an open DataReader associated with this Command which must be closed first.";
+public const string ADP_DeriveParametersNotSupported = @"{0} DeriveParameters only supports CommandType.StoredProcedure, not CommandType.{1}.";
+public const string ADP_CalledTwice = @"The method '{0}' cannot be called more than once for the same execution.";
+public const string ADP_IncorrectAsyncResult = @"Incorrect async result.";
+
+
+
+public const string ADP_MissingSelectCommand = @"The SelectCommand property has not been initialized before calling '{0}'.";
+public const string ADP_UnwantedStatementType = @"The StatementType {0} is not expected here.";
+
+
+
+public const string ADP_FillSchemaRequiresSourceTableName = @"FillSchema: expected a non-empty string for the SourceTable name.";
+
+
+
+public const string ADP_InvalidMaxRecords = @"The MaxRecords value of {0} is invalid; the value must be >= 0.";
+public const string ADP_InvalidStartRecord = @"The StartRecord value of {0} is invalid; the value must be >= 0.";
+
+public const string ADP_FillRequiresSourceTableName = @"Fill: expected a non-empty string for the SourceTable name.";
+public const string ADP_FillChapterAutoIncrement = @"Hierarchical chapter columns must map to an AutoIncrement DataColumn.";
+public const string ADP_MissingDataReaderFieldType = @"DataReader.GetFieldType({0}) returned null.";
+public const string ADP_OnlyOneTableForStartRecordOrMaxRecords = @"Only specify one item in the dataTables array when using non-zero values for startRecords or maxRecords.";
+
+
+public const string ADP_UpdateRequiresSourceTable = @"Update unable to find TableMapping['{0}'] or DataTable '{0}'.";
+public const string ADP_UpdateRequiresSourceTableName = @"Update: expected a non-empty SourceTable name.";
+public const string ADP_MissingTableMappingDestination = @"Missing TableMapping when TableMapping.DataSetTable='{0}'.";
+
+public const string ADP_UpdateRequiresCommandClone = @"Update requires the command clone to be valid.";
+public const string ADP_UpdateRequiresCommandSelect = @"Auto SQL generation during Update requires a valid SelectCommand.";
+public const string ADP_UpdateRequiresCommandInsert = @"Update requires a valid InsertCommand when passed DataRow collection with new rows.";
+public const string ADP_UpdateRequiresCommandUpdate = @"Update requires a valid UpdateCommand when passed DataRow collection with modified rows.";
+public const string ADP_UpdateRequiresCommandDelete = @"Update requires a valid DeleteCommand when passed DataRow collection with deleted rows.";
+
+
+public const string ADP_UpdateMismatchRowTable = @"DataRow[{0}] is from a different DataTable than DataRow[0].";
+public const string ADP_RowUpdatedErrors = @"RowUpdatedEvent: Errors occurred; no additional is information available.";
+public const string ADP_RowUpdatingErrors = @"RowUpdatingEvent: Errors occurred; no additional is information available.";
+
+public const string ADP_ResultsNotAllowedDuringBatch = @"When batching, the command's UpdatedRowSource property value of UpdateRowSource.FirstReturnedRecord or UpdateRowSource.Both is invalid.";
+
+public const string ADP_UpdateConcurrencyViolation_Update = @"Concurrency violation: the UpdateCommand affected {0} of the expected {1} records.";
+public const string ADP_UpdateConcurrencyViolation_Delete = @"Concurrency violation: the DeleteCommand affected {0} of the expected {1} records.";
+public const string ADP_UpdateConcurrencyViolation_Batch = @"Concurrency violation: the batched command affected {0} of the expected {1} records.";
+
+
+public const string ADP_InvalidCommandTimeout = @"Invalid CommandTimeout value {0}; the value must be >= 0.";
+
+public const string ADP_UninitializedParameterSize = @"{1}[{0}]: the Size property has an invalid size of 0.";
+public const string ADP_PrepareParameterType = @"{0}.Prepare method requires all parameters to have an explicitly set type.";
+public const string ADP_PrepareParameterSize = @"{0}.Prepare method requires all variable length parameters to have an explicitly set non-zero Size.";
+public const string ADP_PrepareParameterScale = @"{0}.Prepare method requires parameters of type '{1}' have an explicitly set Precision and Scale.";
+public const string ADP_MismatchedAsyncResult = @"Mismatched end method call for asyncResult. Expected call to {0} but {1} was called instead.";
+
+
+
+public const string ADP_ClosedConnectionError = @"Invalid operation. The connection is closed.";
+
+public const string ADP_ConnectionIsDisabled = @"The connection has been disabled.";
+
+public const string ADP_LocalTransactionPresent = @"Cannot enlist in the transaction because a local transaction is in progress on the connection. Finish local transaction and retry.";
+public const string ADP_TransactionPresent = @"Connection currently has transaction enlisted. Finish current transaction and retry.";
+
+public const string ADP_EmptyDatabaseName = @"Database cannot be null, the empty string, or string of only whitespace.";
+public const string ADP_DatabaseNameTooLong = @"The argument is too long.";
+public const string ADP_InvalidConnectTimeoutValue = @"Invalid 'Connect Timeout' value which must be an integer >= 0.";
+
+
+
+
+public const string ADP_InvalidSourceBufferIndex = @"Invalid source buffer (size of {0}) offset: {1}";
+public const string ADP_InvalidDestinationBufferIndex = @"Invalid destination buffer (size of {0}) offset: {1}";
+
+public const string ADP_DataReaderNoData = @"No data exists for the row/column.";
+
+
+public const string ADP_NumericToDecimalOverflow = @"The numerical value is too large to fit into a 96 bit decimal.";
+
+
+public const string ADP_StreamClosed = @"Invalid attempt to {0} when stream is closed.";
+public const string ADP_InvalidSeekOrigin = @"Specified SeekOrigin value is invalid.";
+
+
+public const string ADP_DynamicSQLJoinUnsupported = @"Dynamic SQL generation is not supported against multiple base tables.";
+public const string ADP_DynamicSQLNoTableInfo = @"Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information.";
+public const string ADP_DynamicSQLNoKeyInfoDelete = @"Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information.";
+public const string ADP_DynamicSQLNoKeyInfoUpdate = @"Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.";
+public const string ADP_DynamicSQLNoKeyInfoRowVersionDelete = @"Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not contain a row version column.";
+public const string ADP_DynamicSQLNoKeyInfoRowVersionUpdate = @"Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not contain a row version column.";
+public const string ADP_DynamicSQLNestedQuote = @"Dynamic SQL generation not supported against table names '{0}' that contain the QuotePrefix or QuoteSuffix character '{1}'.";
+public const string ADP_NonSequentialColumnAccess = @"Invalid attempt to read from column ordinal '{0}'. With CommandBehavior.SequentialAccess, you may only read from column ordinal '{1}' or greater.";
+
+public const string ADP_InvalidDateTimeDigits = @"Data type '{0}' can not be formatted as a literal because it has an invalid date time digits.";
+public const string ADP_InvalidFormatValue = @"The value can not be formatted as a literal of the requested type.";
+public const string ADP_InvalidMaximumScale = @"Data type '{0}' can not be formatted as a literal because it has an invalid maximum scale.";
+public const string ADP_LiteralValueIsInvalid = @"The literal value provided is not a valid literal for the data type '{0}'.";
+public const string ADP_EvenLengthLiteralValue = @"'{0}':The length of the literal value must be even.";
+public const string ADP_HexDigitLiteralValue = @"'{0}':The literal value must be a string with hexadecimal digits";
+public const string ADP_QuotePrefixNotSet = @"{0} requires open connection when the quote prefix has not been set.";
+public const string ADP_UnableToCreateBooleanLiteral = @"Can not determine the correct boolean literal values. Boolean literals can not be created.";
+public const string ADP_UnsupportedNativeDataTypeOleDb = @"Literals of the native data type associated with data type '{0}' are not supported.";
+
+
+
+public const string ADP_InvalidDataType = @"The parameter data type of {0} is invalid.";
+public const string ADP_UnknownDataType = @"No mapping exists from object type {0} to a known managed provider native type.";
+public const string ADP_UnknownDataTypeCode = @"Unable to handle an unknown TypeCode {0} returned by Type {1}.";
+public const string ADP_DbTypeNotSupported = @"No mapping exists from DbType {0} to a known {1}.";
+public const string ADP_VersionDoesNotSupportDataType = @"The version of SQL Server in use does not support datatype '{0}'.";
+public const string ADP_ParameterValueOutOfRange = @"Parameter value '{0}' is out of range.";
+public const string ADP_BadParameterName = @"Specified parameter name '{0}' is not valid.";
+public const string ADP_MultipleReturnValue = @"Multiple return value parameters are not supported.";
+
+
+public const string ADP_InvalidSizeValue = @"Invalid parameter Size value '{0}'. The value must be greater than or equal to 0.";
+public const string ADP_NegativeParameter = @"Invalid value for argument '{0}'. The value must be greater than or equal to 0.";
+
+public const string ADP_InvalidMetaDataValue = @"Invalid value for this metadata.";
+public const string ADP_NotRowType = @"Metadata must be SqlDbType.Row";
+public const string ADP_ParameterConversionFailed = @"Failed to convert parameter value from a {0} to a {1}.";
+
+
+
+public const string ADP_ParallelTransactionsNotSupported = @"{0} does not support parallel transactions.";
+public const string ADP_TransactionZombied = @"This {0} has completed; it is no longer usable.";
+
+public const string ADP_DbRecordReadOnly = @"'{0}' cannot be called when the record is read only.";
+
+
+public const string ADP_DbDataUpdatableRecordReadOnly = @"'{0}' cannot be called when the DbDataRecord is read only.";
+public const string ADP_InvalidImplicitConversion = @"Implicit conversion of object type '{0}' to data type '{1}' is not supported.";
+
+public const string ADP_InvalidBufferSizeOrIndex = @"Buffer offset '{1}' plus the bytes available '{0}' is greater than the length of the passed in buffer.";
+public const string ADP_InvalidDataLength = @"Data length '{0}' is less than 0.";
+public const string ADP_InvalidDataLength2 = @"Specified length '{0}' is out of range.";
+public const string ADP_NonSeqByteAccess = @"Invalid {2} attempt at dataIndex '{0}'. With CommandBehavior.SequentialAccess, you may only read from dataIndex '{1}' or greater.";
+
+public const string ADP_OffsetOutOfRangeException = @"Offset must refer to a location within the value.";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+public const string ODBC_GetSchemaRestrictionRequired = @"""The ODBC managed provider requires that the TABLE_NAME restriction be specified and non-null for the GetSchema indexes collection.";
+
+
+public const string ADP_InvalidArgumentValue = @"Invalid argument value for method '{0}'.";
+
+
+
+
+public const string ADP_OdbcNoTypesFromProvider = @"The ODBC provider did not return results from SQLGETTYPEINFO.";
+
+
+
+public const string ADP_NullDataTable = @"Unexpected null DataTable argument";
+public const string ADP_NullDataSet = @"Unexpected null DataSet argument.";
+
+
+
+public const string OdbcConnection_ConnectionStringTooLong = @"Connection string exceeds maximum allowed length of {0}.";
+
+public const string Odbc_GetTypeMapping_UnknownType = @"{0} - unable to map type.";
+public const string Odbc_UnknownSQLType = @"Unknown SQL type - {0}.";
+public const string Odbc_UnknownURTType = @"Unknown URT type - {0}.";
+public const string Odbc_NegativeArgument = @"Invalid negative argument!";
+public const string Odbc_CantSetPropertyOnOpenConnection = @"Can't set property on an open connection.";
+public const string Odbc_NoMappingForSqlTransactionLevel = @"No valid mapping for a SQL_TRANSACTION '{0}' to a System.Data.IsolationLevel enumeration value.";
+public const string Odbc_CantEnableConnectionpooling = @"{0} - unable to enable connection pooling...";
+public const string Odbc_CantAllocateEnvironmentHandle = @"{0} - unable to allocate an environment handle.";
+public const string Odbc_FailedToGetDescriptorHandle = @"{0} - unable to get descriptor handle.";
+public const string Odbc_NotInTransaction = @"Not in a transaction";
+public const string Odbc_UnknownOdbcType = @"Invalid OdbcType enumeration value={0}.";
+public const string Odbc_NullData = @"Use IsDBNull when DBNull.Value data is expected.";
+public const string Odbc_ExceptionMessage = @"{0} [{1}] {2}";
+public const string Odbc_ExceptionNoInfoMsg = @"{0} - no error information available";
+
+public const string Odbc_ConnectionClosed = @"The connection is closed.";
+public const string Odbc_OpenConnectionNoOwner = @"An internal connection does not have an owner.";
+
+
+
+
+public const string Odbc_MDACWrongVersion = @"The .Net Framework Odbc Data Provider requires Microsoft Data Access Components(MDAC) version 2.6 or later. Version {0} was found currently installed.";
+public const string OleDb_MDACWrongVersion = @"The .Net Framework OleDb Data Provider requires Microsoft Data Access Components(MDAC) version 2.6 or later. Version {0} was found currently installed.";
+
+
+
+public const string OleDb_SchemaRowsetsNotSupported = @"'{0}' interface is not supported by the '{1}' provider. GetOleDbSchemaTable is unavailable with the current provider.";
+public const string OleDb_NoErrorInformation2 = @"'{0}' failed with no error message available, result code: {1}.";
+public const string OleDb_NoErrorInformation = @"No error message available, result code: {0}.";
+public const string OleDb_MDACNotAvailable = @"The .Net Framework Data Providers require Microsoft Data Access Components(MDAC). Please install Microsoft Data Access Components(MDAC) version 2.6 or later.";
+public const string OleDb_MSDASQLNotSupported = @"The .Net Framework Data Provider for OLEDB (System.Data.OleDb) does not support the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL). Use the .Net Framework Data Provider for ODBC (System.Data.Odbc).";
+public const string OleDb_PossiblePromptNotUserInteractive = @"The .Net Framework Data Provider for OLEDB will not allow the OLE DB Provider to prompt the user in a non-interactive environment.";
+public const string OleDb_ProviderUnavailable = @"The '{0}' provider is not registered on the local machine.";
+public const string OleDb_CommandTextNotSupported = @"The ICommandText interface is not supported by the '{0}' provider. Use CommandType.TableDirect instead.";
+public const string OleDb_TransactionsNotSupported = @"The ITransactionLocal interface is not supported by the '{0}' provider. Local transactions are unavailable with the current provider.";
+public const string OleDb_ConnectionStringSyntax = @"Format of the initialization string does not conform to the OLE DB specification. Starting around char[{0}] in the connection string.";
+public const string OleDb_AsynchronousNotSupported = @"'Asynchronous Processing' is not a supported feature of the .Net Framework Data OLE DB Provider(System.Data.OleDb).";
+public const string OleDb_NoProviderSpecified = @"An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.";
+public const string OleDb_InvalidProviderSpecified = @"The OLE DB Provider specified in the ConnectionString is too long.";
+public const string OleDb_InvalidRestrictionsDbInfoKeywords = @"No restrictions are expected for the DbInfoKeywords OleDbSchemaGuid.";
+public const string OleDb_InvalidRestrictionsDbInfoLiteral = @"No restrictions are expected for the DbInfoLiterals OleDbSchemaGuid.";
+public const string OleDb_InvalidRestrictionsSchemaGuids = @"No restrictions are expected for the schema guid OleDbSchemaGuid.";
+public const string OleDb_NotSupportedSchemaTable = @"The {0} OleDbSchemaGuid is not a supported schema by the '{1}' provider.";
+public const string OleDb_ConfigWrongNumberOfValues = @"The '{0}' configuration setting has the wrong number of values.";
+public const string OleDb_ConfigUnableToLoadXmlMetaDataFile = @"Unable to load the XML file specified in configuration setting '{0}'.";
+
+
+public const string OleDb_CommandParameterBadAccessor = @"Command parameter[{0}] '{1}' is invalid.";
+public const string OleDb_CommandParameterCantConvertValue = @"Command parameter[{0}] '{1}' data value could not be converted for reasons other than sign mismatch or data overflow.";
+public const string OleDb_CommandParameterSignMismatch = @"Conversion failed for command parameter[{0}] '{1}' because the data value was signed and the type used by the provider was unsigned.";
+public const string OleDb_CommandParameterDataOverflow = @"Conversion failed for command parameter[{0}] '{1}' because the data value overflowed the type used by the provider.";
+public const string OleDb_CommandParameterUnavailable = @"Provider encountered an error while sending command parameter[{0}] '{1}' value and stopped processing.";
+public const string OleDb_CommandParameterDefault = @"Parameter[{0}] '{1}' has no default value.";
+public const string OleDb_CommandParameterError = @"Error occurred with parameter[{0}]: {1}.";
+
+public const string OleDb_BadStatus_ParamAcc = @"System.Data.OleDb.OleDbDataAdapter internal error: invalid parameter accessor: {0} {1}.";
+public const string OleDb_UninitializedParameters = @"Parameter[{0}]: the OleDbType property is uninitialized: OleDbType.{1}.";
+public const string OleDb_NoProviderSupportForParameters = @"The ICommandWithParameters interface is not supported by the '{0}' provider. Command parameters are unsupported with the current provider.";
+public const string OleDb_NoProviderSupportForSProcResetParameters = @"Retrieving procedure parameter information is not supported by the '{0}' provider.";
+
+
+public const string OleDb_CanNotDetermineDecimalSeparator = @"Can not determine the server's decimal separator. Non-integer numeric literals can not be created.";
+
+
+public const string OleDb_Fill_NotADODB = @"Object is not an ADODB.RecordSet or an ADODB.Record.";
+public const string OleDb_Fill_EmptyRecordSet = @"Unable to retrieve the '{0}' interface from the ADODB.RecordSet object.";
+public const string OleDb_Fill_EmptyRecord = @"Unable to retrieve the IRow interface from the ADODB.Record object.";
+
+
+public const string OleDb_ISourcesRowsetNotSupported = @"Type does not support the OLE DB interface ISourcesRowset";
+
+
+public const string OleDb_IDBInfoNotSupported = @"Cannot construct the ReservedWords schema collection because the provider does not support IDBInfo.";
+
+
+
+public const string OleDb_PropertyNotSupported = @"The property's value was not set because the provider did not support the '{0}' property, or the consumer attempted to get or set values of properties not in the Initialization property group and the data source object is uninitialized.";
+public const string OleDb_PropertyBadValue = @"Failed to initialize the '{0}' property for one of the following reasons:\r\n\tThe value data type was not the data type of the property or was not null. For example, the property was DBPROP_MEMORYUSAGE, which has a data type of Int32, and the data type was Int64.\r\n\tThe value was not a valid value. For example, the property was DBPROP_MEMORYUSAGE and the value was negative.\r\n\tThe value was a valid value for the property and the provider supports the property as a settable property, but the provider does not support the value specified. This includes the case where the value was added to the property in OLE DB after the provider was written.";
+public const string OleDb_PropertyBadOption = @"The value of Options was invalid.";
+public const string OleDb_PropertyBadColumn = @"The ColumnID element was invalid.";
+public const string OleDb_PropertyNotAllSettable = @"A '{0}' property was specified to be applied to all columns but could not be applied to one or more of them.";
+public const string OleDb_PropertyNotSettable = @"The '{0}' property was read-only, or the consumer attempted to set values of properties in the Initialization property group after the data source object was initialized. Consumers can set the value of a read-only property to its current value. This status is also returned if a settable column property could not be set for the particular column.";
+public const string OleDb_PropertyNotSet = @"The optional '{0}' property's value was not set to the specified value and setting the property to the specified value was not possible.";
+public const string OleDb_PropertyConflicting = @"The '{0}'property's value was not set because doing so would have conflicted with an existing property.";
+public const string OleDb_PropertyNotAvailable = @"(Reserved).";
+public const string OleDb_PropertyStatusUnknown = @"The provider returned an unknown DBPROPSTATUS_ value '{0}'.";
+
+
+
+public const string OleDb_BadAccessor = @"Accessor validation was deferred and was performed while the method returned data. The binding was invalid for this column or parameter.";
+public const string OleDb_BadStatusRowAccessor = @"OleDbDataAdapter internal error: invalid row set accessor: Ordinal={0} Status={1}.";
+public const string OleDb_CantConvertValue = @"The data value could not be converted for reasons other than sign mismatch or data overflow. For example, the data was corrupted in the data store but the row was still retrievable.";
+public const string OleDb_CantCreate = @"The provider could not allocate memory in which to return {0} data.";
+public const string OleDb_DataOverflow = @"Conversion failed because the {0} data value overflowed the type specified for the {0} value part in the consumer's buffer.";
+public const string OleDb_GVtUnknown = @"OleDbDataAdapter internal error: [get] Unknown OLE DB data type: 0x{0} ({1}).";
+public const string OleDb_SignMismatch = @"Conversion failed because the {0} data value was signed and the type specified for the {0} value part in the consumer's buffer was unsigned.";
+public const string OleDb_SVtUnknown = @"OleDbDataAdapter internal error: [set] Unknown OLE DB data type: 0x{0} ({1}).";
+public const string OleDb_Unavailable = @"The provider could not determine the {0} value. For example, the row was just created, the default for the {0} column was not available, and the consumer had not yet set a new {0} value.";
+public const string OleDb_UnexpectedStatusValue = @"OLE DB Provider returned an unexpected status value of {0}.";
+public const string OleDb_ThreadApartmentState = @"The OleDbDataReader.Read must be used from the same thread on which is was created if that thread's ApartmentState was not ApartmentState.MTA.";
+
+public const string OleDb_NoErrorMessage = @"Unspecified error: {0}";
+public const string OleDb_FailedGetDescription = @"IErrorInfo.GetDescription failed with {0}.";
+public const string OleDb_FailedGetSource = @"IErrorInfo.GetSource failed with {0}.";
+public const string OleDb_DBBindingGetVector = @"DBTYPE_VECTOR data is not supported by the .Net Framework Data OLE DB Provider(System.Data.OleDb).";
+
+
+
+
+
+
+public const string ADP_InvalidMinMaxPoolSizeValues = @"Invalid min or max pool size values, min pool size cannot be greater than the max pool size.";
+public const string ADP_ObsoleteKeyword = @"The '{0}' keyword is obsolete. Use '{1}' instead.";
+public const string SQL_CannotGetDTCAddress = @"Unable to get the address of the distributed transaction coordinator for the server, from the server. Is DTC enabled on the server?";
+public const string SQL_InvalidOptionLength = @"The length of the value for the connection parameter <{0}> exceeds the maximum allowed 65535 characters.";
+public const string SQL_InvalidPacketSizeValue = @"Invalid 'Packet Size'. The value must be an integer >= 512 and <= 32768.";
+public const string SQL_NullEmptyTransactionName = @"Invalid transaction or invalid name for a point at which to save within the transaction.";
+public const string SQL_SnapshotNotSupported = @"The {0} enumeration value, {1}, is not supported by SQL Server 7.0 or SQL Server 2000.";
+public const string SQL_UserInstanceFailoverNotCompatible = @"User Instance and Failover are not compatible options. Please choose only one of the two in the connection string.";
+
+public const string SQL_EncryptionNotSupportedByClient = @"The instance of SQL Server you attempted to connect to requires encryption but this machine does not support it.";
+public const string SQL_EncryptionNotSupportedByServer = @"The instance of SQL Server you attempted to connect to does not support encryption.";
+public const string SQL_InvalidSQLServerVersionUnknown = @"Unsupported SQL Server version. The .Net Framework SqlClient Data Provider can only be used with SQL Server versions 7.0 and later.";
+
+public const string SQL_CannotModifyPropertyAsyncOperationInProgress = @"{0} cannot be changed while async operation is in progress.";
+public const string SQL_AsyncConnectionRequired = @"This command requires an asynchronous connection. Set \""Asynchronous Processing=true\"" in the connection string.";
+public const string SQL_FatalTimeout = @"Timeout expired. The connection has been broken as a result.";
+public const string SQL_InstanceFailure = @"Instance failure.";
+
+public const string SQL_ChangePasswordArgumentMissing = @"The '{0}' argument must not be null or empty.";
+public const string SQL_ChangePasswordConflictsWithSSPI = @"ChangePassword can only be used with SQL authentication, not with integrated security.";
+public const string SQL_ChangePasswordUseOfUnallowedKey = @"The keyword '{0}' must not be specified in the connectionString argument to ChangePassword.";
+public const string SQL_UnknownSysTxIsolationLevel = @"Unrecognized System.Transactions.IsolationLevel enumeration value: {0}.";
+public const string SQL_InvalidPartnerConfiguration = @"Server {0}, database {1} is not configured for database mirroring.";
+public const string SQL_MarsUnsupportedOnConnection = @"The connection does not support MultipleActiveResultSets.";
+
+
+public const string SQL_ChangePasswordRequiresYukon = @"ChangePassword requires SQL Server 9.0 or later.";
+public const string SQL_NonLocalSSEInstance = @"SSE Instance re-direction is not supported for non-local user instances.";
+
+
+
+public const string SQL_AsyncOperationCompleted = @"The asynchronous operation has already completed.";
+public const string SQL_PendingBeginXXXExists = @"The command execution cannot proceed due to a pending asynchronous operation already in progress.";
+public const string SQL_NonXmlResult = @"Invalid command sent to ExecuteXmlReader. The command must return an Xml result.";
+
+public const string SQL_NotificationsRequireYukon = @"Notifications require SQL Server 9.0 or later.";
+
+
+
+public const string SQL_InvalidUdt3PartNameFormat = @"Invalid 3 part name format for UdtTypeName.";
+public const string SQL_InvalidParameterTypeNameFormat = @"Invalid 3 part name format for TypeName.";
+public const string SQL_InvalidParameterNameLength = @"The length of the parameter '{0}' exceeds the limit of 128 characters.";
+public const string SQL_PrecisionValueOutOfRange = @"Precision value '{0}' is either less than 0 or greater than the maximum allowed precision of 38.";
+public const string SQL_ScaleValueOutOfRange = @"Scale value '{0}' is either less than 0 or greater than the maximum allowed scale of 38.";
+public const string SQL_TimeScaleValueOutOfRange = @"Scale value '{0}' is either less than 0 or greater than the maximum allowed scale of 7.";
+
+public const string SQL_ParameterInvalidVariant = @"Parameter '{0}' exceeds the size limit for the sql_variant datatype.";
+public const string SQL_ParameterTypeNameRequired = @"The {0} type parameter '{1}' must have a valid type name.";
+
+
+
+
+
+public const string SQL_InvalidInternalPacketSize = @"Invalid internal packet size:";
+public const string SQL_InvalidTDSVersion = @"The SQL Server instance returned an invalid or unsupported protocol version during login negotiation.";
+public const string SQL_InvalidTDSPacketSize = @"Invalid Packet Size.";
+public const string SQL_ParsingError = @"Internal connection fatal error.";
+public const string SQL_ConnectionLockedForBcpEvent = @"The connection cannot be used because there is an ongoing operation that must be finished.";
+public const string SQL_SNIPacketAllocationFailure = @"Memory allocation for internal connection failed.";
+
+public const string SQL_SmallDateTimeOverflow = @"SqlDbType.SmallDateTime overflow. Value '{0}' is out of range. Must be between 1/1/1900 12:00:00 AM and 6/6/2079 11:59:59 PM.";
+public const string SQL_TimeOverflow = @"SqlDbType.Time overflow. Value '{0}' is out of range. Must be between 00:00:00.0000000 and 23:59:59.9999999.";
+public const string SQL_MoneyOverflow = @"SqlDbType.SmallMoney overflow. Value '{0}' is out of range. Must be between -214,748.3648 and 214,748.3647.";
+
+public const string SQL_CultureIdError = @"The Collation specified by SQL Server is not supported.";
+public const string SQL_OperationCancelled = @"Operation cancelled by user.";
+public const string SQL_SevereError = @"A severe error occurred on the current command. The results, if any, should be discarded.";
+public const string SQL_SSPIGenerateError = @"The target principal name is incorrect. Cannot generate SSPI context.";
+public const string SQL_InvalidSSPIPacketSize = @"Invalid SSPI packet size.";
+public const string SQL_SSPIInitializeError = @"Cannot initialize SSPI package.";
+public const string SQL_Timeout = @"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.";
+public const string SQL_Timeout_PreLogin_Begin = @"Connection Timeout Expired. The timeout period elapsed at the start of the pre-login phase. This could be because of insufficient time provided for connection timeout.";
+public const string SQL_Timeout_PreLogin_InitializeConnection = @"Connection Timeout Expired. The timeout period elapsed while attempting to create and initialize a socket to the server. This could be either because the server was unreachable or unable to respond back in time.";
+public const string SQL_Timeout_PreLogin_SendHandshake = @"Connection Timeout Expired. The timeout period elapsed while making a pre-login handshake request. This could be because the server was unable to respond back in time.";
+public const string SQL_Timeout_PreLogin_ConsumeHandshake = @"Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time.";
+public const string SQL_Timeout_Login_Begin = @"Connection Timeout Expired. The timeout period elapsed at the start of the login phase. This could be because of insufficient time provided for connection timeout.";
+public const string SQL_Timeout_Login_ProcessConnectionAuth = @"Connection Timeout Expired. The timeout period elapsed while attempting to authenticate the login. This could be because the server failed to authenticate the user or the server was unable to respond back in time.";
+public const string SQL_Timeout_PostLogin = @"Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections.";
+public const string SQL_Timeout_FailoverInfo = @"This failure occured while attempting to connect to the {0} server.";
+public const string SQL_Timeout_RoutingDestinationInfo = @"This failure occurred while attempting to connect to the routing destination. The duration spent while attempting to connect to the original server was - [Pre-Login] initialization={0}; handshake={1}; [Login] initialization={2}; authentication={3}; [Post-Login] complete={4}; ";
+public const string SQL_Duration_PreLogin_Begin = @"The duration spent while attempting to connect to this server was - [Pre-Login] initialization={0};";
+public const string SQL_Duration_PreLoginHandshake = @"The duration spent while attempting to connect to this server was - [Pre-Login] initialization={0}; handshake={1}; ";
+public const string SQL_Duration_Login_Begin = @"The duration spent while attempting to connect to this server was - [Pre-Login] initialization={0}; handshake={1}; [Login] initialization={2}; ";
+public const string SQL_Duration_Login_ProcessConnectionAuth = @"The duration spent while attempting to connect to this server was - [Pre-Login] initialization={0}; handshake={1}; [Login] initialization={2}; authentication={3}; ";
+public const string SQL_Duration_PostLogin = @"The duration spent while attempting to connect to this server was - [Pre-Login] initialization={0}; handshake={1}; [Login] initialization={2}; authentication={3}; [Post-Login] complete={4}; ";
+public const string SQL_UserInstanceFailure = @"A user instance was requested in the connection string but the server specified does not support this option.";
+
+
+
+public const string SQL_ExceedsMaxDataLength = @"Specified data length {0} exceeds the allowed maximum length of {1}.";
+
+public const string SQL_InvalidRead = @"Invalid attempt to read when no data is present.";
+public const string SQL_NonBlobColumn = @"Invalid attempt to GetBytes on column '{0}'. The GetBytes function can only be used on columns of type Text, NText, or Image.";
+public const string SQL_NonCharColumn = @"Invalid attempt to GetChars on column '{0}'. The GetChars function can only be used on columns of type Text, NText, Xml, VarChar or NVarChar.";
+public const string SQL_StreamNotSupportOnColumnType = @"Invalid attempt to GetStream on column '{0}'. The GetStream function can only be used on columns of type Binary, Image, Udt or VarBinary.";
+public const string SQL_TextReaderNotSupportOnColumnType = @"Invalid attempt to GetTextReader on column '{0}'. The GetTextReader function can only be used on columns of type Char, NChar, NText, NVarChar, Text or VarChar.";
+public const string SQL_XmlReaderNotSupportOnColumnType = @"Invalid attempt to GetXmlReader on column '{0}'. The GetXmlReader function can only be used on columns of type Xml.";
+
+public const string SQL_InvalidBufferSizeOrIndex = @"Buffer offset '{1}' plus the bytes available '{0}' is greater than the length of the passed in buffer.";
+public const string SQL_InvalidDataLength = @"Data length '{0}' is less than 0.";
+
+
+
+public const string SQL_SqlResultSetClosed = @"Invalid attempt to call method {0} when SqlResultSet is closed.";
+public const string SQL_SqlResultSetClosed2 = @"Operation cannot be completed because the SqlResultSet is closed.";
+public const string SQL_SqlRecordReadOnly = @"'{0}' cannot be called when the record is read only.";
+public const string SQL_SqlRecordReadOnly2 = @"Operation cannot be completed because the record is read only.";
+public const string SQL_SqlResultSetRowDeleted = @"Invalid attempt to call method {0} when the current row is deleted";
+public const string SQL_SqlResultSetRowDeleted2 = @"Operation cannot be completed because the current row is deleted";
+public const string SQL_SqlResultSetCommandNotInSameConnection = @"Operation cannot be completed because the command that created the SqlResultSet has been dissociated from the original connection. SqlResultSet is closed.";
+public const string SQL_SqlResultSetNoAcceptableCursor = @"SqlResultSet could not be created for the given query with the desired options.";
+
+public const string SQL_SqlUpdatableRecordReadOnly = @"'{0}' cannot be called when the SqlDataRecord is read only.";
+
+
+
+public const string SQL_BulkLoadMappingInaccessible = @"The mapped collection is in use and cannot be accessed at this time;";
+public const string SQL_BulkLoadMappingsNamesOrOrdinalsOnly = @"Mappings must be either all name or all ordinal based.";
+public const string SQL_BulkLoadCannotConvertValue = @"The given value of type {0} from the data source cannot be converted to type {1} of the specified target column.";
+public const string SQL_BulkLoadNonMatchingColumnMapping = @"The given ColumnMapping does not match up with any column in the source or destination.";
+public const string SQL_BulkLoadNonMatchingColumnName = @"The given ColumnName '{0}' does not match up with any column in data source.";
+public const string SQL_BulkLoadStringTooLong = @"String or binary data would be truncated.";
+public const string SQL_BulkLoadInvalidTimeout = @"Timeout Value '{0}' is less than 0.";
+public const string SQL_BulkLoadInvalidVariantValue = @"Value cannot be converted to SqlVariant.";
+public const string SQL_BulkLoadExistingTransaction = @"Unexpected existing transaction.";
+public const string SQL_BulkLoadNoCollation = @"Failed to obtain column collation information for the destination table. If the table is not in the current database the name must be qualified using the database name (e.g. [mydb]..[mytable](e.g. [mydb]..[mytable]); this also applies to temporary-tables (e.g. #mytable would be specified as tempdb..#mytable).";
+public const string SQL_BulkLoadConflictingTransactionOption = @"Must not specify SqlBulkCopyOption.UseInternalTransaction and pass an external Transaction at the same time.";
+public const string SQL_BulkLoadInvalidOperationInsideEvent = @"Function must not be called during event.";
+public const string SQL_BulkLoadMissingDestinationTable = @"The DestinationTableName property must be set before calling this method.";
+public const string SQL_BulkLoadInvalidDestinationTable = @"Cannot access destination table '{0}'.";
+public const string SQL_BulkLoadNotAllowDBNull = @"Column '{0}' does not allow DBNull.Value.";
+public const string Sql_BulkLoadLcidMismatch = @"The locale id '{0}' of the source column '{1}' and the locale id '{2}' of the destination column '{3}' do not match.";
+public const string SQL_BulkLoadPendingOperation = @"Attempt to invoke bulk copy on an object that has a pending operation.";
+
+
+
+public const string SQL_ConnectionDoomed = @"The requested operation cannot be completed because the connection has been broken.";
+public const string SQL_OpenResultCountExceeded = @"Open result count exceeded.";
+
+
+
+public const string SQL_BatchedUpdatesNotAvailableOnContextConnection = @"Batching updates is not supported on the context connection.";
+public const string SQL_ContextAllowsLimitedKeywords = @"The only additional connection string keyword that may be used when requesting the context connection is the Type System Version keyword.";
+public const string SQL_ContextAllowsOnlyTypeSystem2005 = @"The context connection does not support Type System Version=SQL Server 2000.";
+public const string SQL_ContextConnectionIsInUse = @"The context connection is already in use.";
+public const string SQL_ContextUnavailableOutOfProc = @"The requested operation requires a SqlClr context, which is only available when running in the Sql Server process.";
+public const string SQL_ContextUnavailableWhileInProc = @"The requested operation requires a Sql Server execution thread. The current thread was started by user code or other non-Sql Server engine code.";
+public const string SQL_NestedTransactionScopesNotSupported = @"Nested TransactionScopes are not supported.";
+public const string SQL_NotAvailableOnContextConnection = @"The requested operation is not available on the context connection.";
+public const string SQL_NotificationsNotAvailableOnContextConnection = @"Notifications are not available on the context connection.";
+public const string SQL_UnexpectedSmiEvent = @"Unexpected server event: {0}.";
+public const string SQL_UserInstanceNotAvailableInProc = @"User instances are not allowed when running in the Sql Server process.";
+public const string SQL_ArgumentLengthMismatch = @"The length of '{0}' must match the length of '{1}'.";
+public const string SQL_InvalidSqlDbTypeWithOneAllowedType = @"The SqlDbType '{0}' is invalid for {1}. Only {2} is supported.";
+public const string SQL_PipeErrorRequiresSendEnd = @"An error occurred with a prior row sent to the SqlPipe. SendResultsEnd must be called before anything else con be sent.";
+public const string SQL_TooManyValues = @"Too many values.";
+public const string SQL_StreamWriteNotSupported = @"The Stream does not support writing.";
+public const string SQL_StreamReadNotSupported = @"The Stream does not support reading.";
+public const string SQL_StreamSeekNotSupported = @"The Stream does not support seeking.";
+
+
+
+public const string SQL_ExClientConnectionId = @"ClientConnectionId:{0}";
+public const string SQL_ExErrorNumberStateClass = @"Error Number:{0},State:{1},Class:{2}";
+public const string SQL_ExOriginalClientConnectionId = @"ClientConnectionId before routing:{0}";
+public const string SQL_ExRoutingDestination = @"Routing Destination:{0}";
+
+
+
+public const string SqlMisc_NullString = @"Null";
+public const string SqlMisc_MessageString = @"Message";
+public const string SqlMisc_ArithOverflowMessage = @"Arithmetic Overflow.";
+public const string SqlMisc_DivideByZeroMessage = @"Divide by zero error encountered.";
+public const string SqlMisc_NullValueMessage = @"Data is Null. This method or property cannot be called on Null values.";
+public const string SqlMisc_TruncationMessage = @"Numeric arithmetic causes truncation.";
+public const string SqlMisc_DateTimeOverflowMessage = @"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.";
+public const string SqlMisc_ConcatDiffCollationMessage = @"Two strings to be concatenated have different collation.";
+public const string SqlMisc_CompareDiffCollationMessage = @"Two strings to be compared have different collation.";
+public const string SqlMisc_InvalidFlagMessage = @"Invalid flag value.";
+public const string SqlMisc_NumeToDecOverflowMessage = @"Conversion from SqlDecimal to Decimal overflows.";
+public const string SqlMisc_ConversionOverflowMessage = @"Conversion overflows.";
+public const string SqlMisc_InvalidDateTimeMessage = @"Invalid SqlDateTime.";
+public const string SqlMisc_TimeZoneSpecifiedMessage = @"A time zone was specified. SqlDateTime does not support time zones.";
+public const string SqlMisc_InvalidArraySizeMessage = @"Invalid array size.";
+public const string SqlMisc_InvalidPrecScaleMessage = @"Invalid numeric precision/scale.";
+public const string SqlMisc_FormatMessage = @"The input wasn't in a correct format.";
+public const string SqlMisc_SqlTypeMessage = @"SqlType error.";
+public const string SqlMisc_LenTooLargeMessage = @"The SqlBytes and SqlChars don't support length of more than 2GB in this version.";
+public const string SqlMisc_StreamErrorMessage = @"An error occurred while reading.";
+public const string SqlMisc_StreamClosedMessage = @"Stream has been closed or disposed.";
+public const string SqlMisc_NoBufferMessage = @"There is no buffer. Read or write operation failed.";
+public const string SqlMisc_SetNonZeroLenOnNullMessage = @"Cannot set to non-zero length, because current value is Null.";
+public const string SqlMisc_BufferInsufficientMessage = @"The buffer is insufficient. Read or write operation failed.";
+public const string SqlMisc_WriteNonZeroOffsetOnNullMessage = @"Cannot write to non-zero offset, because current value is Null.";
+public const string SqlMisc_WriteOffsetLargerThanLenMessage = @"Cannot write from an offset that is larger than current length. It would leave uninitialized data in the buffer.";
+public const string SqlMisc_TruncationMaxDataMessage = @"Data returned is larger than 2Gb in size. Use SequentialAccess command behavior in order to get all of the data.";
+public const string SqlMisc_InvalidFirstDayMessage = @"Argument to GetDayOfWeek must be integer between 1 and 7.";
+public const string SqlMisc_NotFilledMessage = @"SQL Type has not been loaded with data.";
+public const string SqlMisc_AlreadyFilledMessage = @"SQL Type has already been loaded with data.";
+public const string SqlMisc_ClosedXmlReaderMessage = @"Invalid attempt to access a closed XmlReader.";
+public const string SqlMisc_InvalidOpStreamClosed = @"Invalid attempt to call {0} when the stream is closed.";
+public const string SqlMisc_InvalidOpStreamNonWritable = @"Invalid attempt to call {0} when the stream non-writable.";
+public const string SqlMisc_InvalidOpStreamNonReadable = @"Invalid attempt to call {0} when the stream non-readable.";
+public const string SqlMisc_InvalidOpStreamNonSeekable = @"Invalid attempt to call {0} when the stream is non-seekable.";
+public const string SqlMisc_SubclassMustOverride = @"Subclass did not override a required method.";
+
+
+
+
+public const string Sql_CanotCreateNormalizer = @"Cannot create normalizer for '{0}'.";
+public const string Sql_InternalError = @"Internal Error";
+public const string Sql_NullCommandText = @"Command parameter must have a non null and non empty command text.";
+public const string Sql_MismatchedMetaDataDirectionArrayLengths = @"MetaData parameter array must have length equivalent to ParameterDirection array argument.";
+
+
+public const string ADP_AdapterMappingExceptionMessage = @"Data adapter mapping error.";
+public const string ADP_DataAdapterExceptionMessage = @"Data adapter error.";
+public const string ADP_DBConcurrencyExceptionMessage = @"DB concurrency violation.";
+public const string ADP_OperationAborted = @"Operation aborted.";
+public const string ADP_OperationAbortedExceptionMessage = @"Operation aborted due to an exception (see InnerException for details).";
+
+
+
+
+
+public const string DataAdapter_AcceptChangesDuringFill = @"Whether or not Fill will call DataRow.AcceptChanges.";
+public const string DataAdapter_AcceptChangesDuringUpdate = @"Whether or not Update will call DataRow.AcceptChanges.";
+public const string DataAdapter_ContinueUpdateOnError = @"Whether or not to continue to the next DataRow when the Update events, RowUpdating and RowUpdated, Status is UpdateStatus.ErrorsOccurred.";
+public const string DataAdapter_FillLoadOption = @"How the adapter fills the DataTable from the DataReader.";
+public const string DataAdapter_MissingMappingAction = @"The action taken when a table or column in the TableMappings is missing.";
+public const string DataAdapter_MissingSchemaAction = @"The action taken when a table or column in the DataSet is missing.";
+public const string DataAdapter_TableMappings = @"How to map source table to DataSet table.";
+public const string DataAdapter_FillError = @"Event triggered when a recoverable error occurs during Fill.";
+public const string DataAdapter_ReturnProviderSpecificTypes = @"Should Fill return provider specific values or common CLSCompliant values.";
+
+
+public const string DataColumnMapping_DataSetColumn = @"DataColumn.ColumnName";
+public const string DataColumnMapping_SourceColumn = @"Source column name - case sensitive.";
+
+
+public const string DataColumnMappings_Count = @"The number of items in the collection";
+public const string DataColumnMappings_Item = @"The specified DataColumnMapping object.";
+
+
+public const string DataTableMapping_ColumnMappings = @"Individual columns mappings when this table mapping is matched.";
+public const string DataTableMapping_DataSetTable = @"DataTable.TableName";
+public const string DataTableMapping_SourceTable = @"The DataTableMapping source table name. This name is case sensitive.";
+
+
+public const string DataTableMappings_Count = @"The number of items in the collection";
+public const string DataTableMappings_Item = @"The specified DataTableMapping object";
+
+
+public const string DbDataAdapter_DeleteCommand = @"Used during Update for deleted rows in DataSet.";
+public const string DbDataAdapter_InsertCommand = @"Used during Update for new rows in DataSet.";
+public const string DbDataAdapter_SelectCommand = @"Used during Fill/FillSchema.";
+public const string DbDataAdapter_UpdateCommand = @"Used during Update for modified rows in DataSet.";
+public const string DbDataAdapter_RowUpdated = @"Event triggered before every DataRow during Update.";
+public const string DbDataAdapter_RowUpdating = @"Event triggered after every DataRow during Update.";
+public const string DbDataAdapter_UpdateBatchSize = @"Number of rows to batch together before executing against the data source.";
+
+
+public const string DbTable_Connection = @"Connection used if the the Select/Insert/Update/DeleteCommands do not already have a connection.";
+public const string DbTable_DeleteCommand = @"Used during Update for deleted rows in the DataTable.";
+public const string DbTable_InsertCommand = @"Used during Update for new rows in the DataTable.";
+public const string DbTable_SelectCommand = @"Used during Fill.";
+public const string DbTable_UpdateCommand = @"Used during Update for modified rows in the DataTable.";
+public const string DbTable_ReturnProviderSpecificTypes = @"Should Fill return provider specific values or common CLSCompliant values.";
+public const string DbTable_TableMapping = @"How to map source table to DataTable.";
+public const string DbTable_ConflictDetection = @"How are the Insert/Update/DeleteCommands generated when not set by the user.";
+public const string DbTable_UpdateBatchSize = @"Number of rows to batch together before executing against the data source.";
+
+
+
+public const string DbConnectionString_ConnectionString = @"The connection string used to connect to the Data Source.";
+public const string DbConnectionString_Driver = @"The name of the ODBC Driver to use when connecting to the Data Source.";
+public const string DbConnectionString_DSN = @"The DSN to use when connecting to the Data Source.";
+public const string DbConnectionString_AdoNetPooler = @"When true, indicates that managed connection pooling should be used.";
+public const string DbConnectionString_FileName = @"The UDL file to use when connecting to the Data Source.";
+public const string DbConnectionString_OleDbServices = @"Specifies which OLE DB Services to enable or disable with the OleDb Provider.";
+public const string DbConnectionString_Provider = @"The name of the OLE DB Provider to use when connecting to the Data Source.";
+public const string DbConnectionString_ApplicationName = @"The name of the application.";
+public const string DbConnectionString_AsynchronousProcessing = @"When true, enables usage of the Asynchronous functionality in the .Net Framework Data Provider.";
+public const string DbConnectionString_AttachDBFilename = @"The name of the primary file, including the full path name, of an attachable database.";
+public const string DbConnectionString_ConnectTimeout = @"The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error.";
+public const string DbConnectionString_ConnectionReset = @"When true, indicates the connection state is reset when removed from the pool.";
+public const string DbConnectionString_ContextConnection = @"When true, indicates the connection should be from the Sql Server context. Available only when running in the Sql Server process.";
+public const string DbConnectionString_CurrentLanguage = @"The SQL Server Language record name.";
+public const string DbConnectionString_DataSource = @"Indicates the name of the data source to connect to.";
+public const string DbConnectionString_Encrypt = @"When true, SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed.";
+public const string DbConnectionString_Enlist = @"Sessions in a Component Services (or MTS, if you are using Microsoft Windows NT) environment should automatically be enlisted in a global transaction where required.";
+public const string DbConnectionString_InitialCatalog = @"The name of the initial catalog or database in the data source.";
+public const string DbConnectionString_FailoverPartner = @"The name or network address of the instance of SQL Server that acts as a failover partner.";
+public const string DbConnectionString_IntegratedSecurity = @"Whether the connection is to be a secure connection or not.";
+public const string DbConnectionString_LoadBalanceTimeout = @"The minimum amount of time (in seconds) for this connection to live in the pool before being destroyed.";
+public const string DbConnectionString_MaxPoolSize = @"The maximum number of connections allowed in the pool.";
+public const string DbConnectionString_MinPoolSize = @"The minimum number of connections allowed in the pool.";
+public const string DbConnectionString_MultipleActiveResultSets = @"When true, multiple result sets can be returned and read from one connection.";
+public const string DbConnectionString_MultiSubnetFailover = @"If your application is connecting to a high-availability, disaster recovery (AlwaysOn) availability group (AG) on different subnets, MultiSubnetFailover=Yes configures SqlConnection to provide faster detection of and connection to the (currently) active server.";
+public const string DbConnectionString_NetworkLibrary = @"The network library used to establish a connection to an instance of SQL Server.";
+public const string DbConnectionString_PacketSize = @"Size in bytes of the network packets used to communicate with an instance of SQL Server.";
+public const string DbConnectionString_Password = @"Indicates the password to be used when connecting to the data source.";
+public const string DbConnectionString_PersistSecurityInfo = @"When false, security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state.";
+public const string DbConnectionString_Pooling = @"When true, the connection object is drawn from the appropriate pool, or if necessary, is created and added to the appropriate pool.";
+public const string DbConnectionString_Replication = @"Used by SQL Server in Replication.";
+public const string DbConnectionString_TransactionBinding = @"Indicates binding behavior of connection to a System.Transactions Transaction when enlisted.";
+public const string DbConnectionString_TrustServerCertificate = @"When true (and encrypt=true), SQL Server uses SSL encryption for all data sent between the client and server without validating the server certificate.";
+public const string DbConnectionString_TypeSystemVersion = @"Indicates which server type system the provider will expose through the DataReader.";
+public const string DbConnectionString_UserID = @"Indicates the user ID to be used when connecting to the data source.";
+public const string DbConnectionString_UserInstance = @"Indicates whether the connection will be re-directed to connect to an instance of SQL Server running under the user's account.";
+public const string DbConnectionString_WorkstationID = @"The name of the workstation connecting to SQL Server.";
+public const string DbConnectionString_ApplicationIntent = @"Declares the application workload type when connecting to a server.";
+
+public const string DbConnectionString_ConnectRetryCount = @"Number of attempts to restore connection.";
+public const string DbConnectionString_ConnectRetryInterval = @"Delay between attempts to restore connection.";
+
+
+
+
+public const string OdbcConnection_ConnectionString = @"Information used to connect to a Data Source.";
+public const string OdbcConnection_ConnectionTimeout = @"Current connection timeout value, not settable in the ConnectionString.";
+public const string OdbcConnection_Database = @"Current data source catalog value, 'Database=X' in the connection string.";
+public const string OdbcConnection_DataSource = @"Current data source, 'Server=X' in the connection string.";
+public const string OdbcConnection_Driver = @"Current ODBC driver.";
+public const string OdbcConnection_ServerVersion = @"Version of the product accessed by the ODBC Driver.";
+
+public const string OleDbConnection_ConnectionString = @"Information used to connect to a Data Source.";
+public const string OleDbConnection_ConnectionTimeout = @"Current connection timeout value, 'Connect Timeout=X' in the ConnectionString.";
+public const string OleDbConnection_Database = @"Current data source catalog value, 'Initial Catalog=X' in the connection string.";
+public const string OleDbConnection_DataSource = @"Current data source, 'Data Source=X' in the connection string.";
+public const string OleDbConnection_Provider = @"Current OLE DB provider ProgID, 'Provider=X' in the connection string.";
+public const string OleDbConnection_ServerVersion = @"Version of the product accessed by the OLE DB Provider.";
+
+public const string SqlConnection_Asynchronous = @"State of connection, synchronous or asynchronous. 'Asynchronous Processing=x' in the connection string.";
+public const string SqlConnection_Replication = @"Information used to connect for replication.";
+public const string SqlConnection_ConnectionString = @"Information used to connect to a DataSource, such as 'Data Source=x;Initial Catalog=x;Integrated Security=SSPI'.";
+public const string SqlConnection_ConnectionTimeout = @"Current connection timeout value, 'Connect Timeout=X' in the ConnectionString.";
+public const string SqlConnection_Database = @"Current SQL Server database, 'Initial Catalog=X' in the connection string.";
+public const string SqlConnection_DataSource = @"Current SqlServer that the connection is opened to, 'Data Source=X' in the connection string.";
+public const string SqlConnection_PacketSize = @"Network packet size, 'Packet Size=x' in the connection string.";
+public const string SqlConnection_ServerVersion = @"Version of the SQL Server accessed by the SqlConnection.";
+public const string SqlConnection_WorkstationId = @"Workstation Id, 'Workstation ID=x' in the connection string.";
+public const string SqlConnection_StatisticsEnabled = @"Collect statistics for this connection.";
+public const string SqlConnection_ClientConnectionId = @"A guid to represent the physical connection.";
+public const string SqlConnection_Credential = @"User Id and secure password to use for authentication.";
+
+
+public const string DbConnection_InfoMessage = @"Event triggered when messages arrive from the DataSource.";
+
+
+
+
+
+public const string DbCommand_CommandText = @"Command text to execute.";
+
+public const string DbCommand_CommandType = @"How to interpret the CommandText.";
+public const string DbCommand_Connection = @"Connection used by the command.";
+public const string DbCommand_Parameters = @"The parameters collection.";
+public const string DbCommand_Transaction = @"The transaction used by the command.";
+public const string DbCommand_UpdatedRowSource = @"When used by a DataAdapter.Update, how command results are applied to the current DataRow.";
+public const string DbCommand_StatementCompleted = @"When records are affected by a given statement by the execution of the command.";
+
+public const string SqlCommand_Notification = @"Notification values used by Microsoft SQL Server.";
+public const string SqlCommand_NotificationAutoEnlist = @"Automatic enlistment in notifications used by Microsoft SQL Server.";
+
+
+public const string DbCommandBuilder_ConflictOption = @"How the where clause is auto-generated for the Update and Delete commands when not specified by the user.";
+public const string DbCommandBuilder_CatalogLocation = @"Indicates the position of the catalog name in a qualified table name in a text command.";
+public const string DbCommandBuilder_CatalogSeparator = @"The character that separates the catalog name from the rest of the identifier in a text command.";
+public const string DbCommandBuilder_SchemaSeparator = @"The character that separates the schema name from the rest of the identifier in a text command.";
+public const string DbCommandBuilder_QuotePrefix = @"The prefix string wrapped around sql objects.";
+public const string DbCommandBuilder_QuoteSuffix = @"The suffix string wrapped around sql objects.";
+public const string DbCommandBuilder_DataAdapter = @"The DataAdapter for which to automatically generate Commands.";
+public const string DbCommandBuilder_SchemaLocation = @"Use schema from DataTable or the SelectCommand.";
+public const string DbCommandBuilder_SetAllValues = @"How the set clause is auto-generated for the Update command when not specified by the user.";
+
+public const string OdbcCommandBuilder_DataAdapter = @"The DataAdapter for which to automatically generate OdbcCommands";
+public const string OdbcCommandBuilder_QuotePrefix = @"The character used in a text command as the opening quote for quoting identifiers that contain special characters.";
+public const string OdbcCommandBuilder_QuoteSuffix = @"The character used in a text command as the closing quote for quoting identifiers that contain special characters.";
+
+public const string OleDbCommandBuilder_DataAdapter = @"The DataAdapter for which to automatically generate OleDbCommands";
+public const string OleDbCommandBuilder_DecimalSeparator = @"The decimal separator used in numeric literals.";
+public const string OleDbCommandBuilder_QuotePrefix = @"The prefix string wrapped around sql objects";
+public const string OleDbCommandBuilder_QuoteSuffix = @"The suffix string wrapped around sql objects";
+
+public const string SqlCommandBuilder_DataAdapter = @"The DataAdapter for which to automatically generate SqlCommands";
+public const string SqlCommandBuilder_DecimalSeparator = @"The decimal separator used in numeric literals.";
+public const string SqlCommandBuilder_QuotePrefix = @"The character used in a text command as the opening quote for quoting identifiers that contain special characters.";
+public const string SqlCommandBuilder_QuoteSuffix = @"The character used in a text command as the closing quote for quoting identifiers that contain special characters.";
+
+
+
+
+
+
+
+
+
+
+
+
+public const string DbDataParameter_Precision = @"Only necessary to set for decimal and numeric parameters when using with Prepare, FillSchema and CommandBuilder scenarios.";
+public const string DbDataParameter_Scale = @"Only necessary to set for decimal and numeric parameters when using with Prepare, FillSchema and CommandBuilder scenarios.";
+
+
+
+public const string OdbcParameter_OdbcType = @"The parameter native type.";
+
+public const string OleDbParameter_OleDbType = @"The parameter native type.";
+
+public const string SqlParameter_ParameterName = @"Name of the parameter, like '@p1'";
+public const string SqlParameter_SqlDbType = @"The parameter native type.";
+public const string SqlParameter_TypeName = @"The server's name for the type.";
+public const string SqlParameter_Offset = @"Offset in variable length data types.";
+public const string SqlParameter_XmlSchemaCollectionDatabase = @"XmlSchemaCollectionDatabase";
+public const string SqlParameter_XmlSchemaCollectionOwningSchema = @"XmlSchemaCollectionOwningSchema";
+public const string SqlParameter_XmlSchemaCollectionName = @"XmlSchemaCollectionName";
+public const string SqlParameter_UnsupportedTVPOutputParameter = @"ParameterDirection '{0}' specified for parameter '{1}' is not supported. Table-valued parameters only support ParameterDirection.Input.";
+public const string SqlParameter_DBNullNotSupportedForTVP = @"DBNull value for parameter '{0}' is not supported. Table-valued parameters cannot be DBNull.";
+public const string SqlParameter_InvalidTableDerivedPrecisionForTvp = @"Precision '{0}' required to send all values in column '{1}' exceeds the maximum supported precision '{2}'. The values must all fit in a single precision.";
+public const string SqlParameter_UnexpectedTypeNameForNonStruct = @"TypeName specified for parameter '{0}'. TypeName must only be set for Structured parameters.";
+public const string MetaType_SingleValuedStructNotSupported = @"SqlDbType.Structured type is only supported for multiple valued types.";
+public const string NullSchemaTableDataTypeNotSupported = @"DateType column for field '{0}' in schema table is null. DataType must be non-null.";
+public const string InvalidSchemaTableOrdinals = @"Invalid column ordinals in schema table. ColumnOrdinals, if present, must not have duplicates or gaps.";
+public const string SQL_EnumeratedRecordMetaDataChanged = @"Metadata for field '{0}' of record '{1}' did not match the original record's metadata.";
+public const string SQL_EnumeratedRecordFieldCountChanged = @"Number of fields in record '{0}' does not match the number in the original record.";
+
+
+
+
+public const string SQLUDT_MaxByteSizeValue = @"range: 0-8000";
+
+public const string SQLUDT_Unexpected = @"unexpected error encountered in SqlClient data provider. {0}";
+public const string SQLUDT_InvalidDbId = @"Unable to get Type Info for {0},{1}";
+public const string SQLUDT_CantLoadAssembly = @"The provider has failed to load the following assembly: {0}";
+public const string SQLUDT_InvalidUdtTypeName = @"UdtTypeName property must be set for UDT parameters.";
+
+
+public const string SQLUDT_UnexpectedUdtTypeName = @"UdtTypeName property must be set only for UDT parameters.";
+public const string SQLUDT_InvalidSqlType = @"Specified type is not registered on the target server.{0}.";
+public const string SQLUDT_InWhereClause = @"UDT parameters not permitted in the where clause unless part of the primary key.";
+
+public const string SqlUdt_InvalidUdtMessage = @"'{0}' is an invalid user defined type, reason: {1}.";
+public const string SqlUdtReason_MultipleSerFormats = @"supports both in-memory and user-defined formats";
+public const string SqlUdtReason_CannotSupportNative = @"Native format can't be supported.";
+public const string SqlUdtReason_CannotSupportUserDefined = @"does not implement IBinarySerialize";
+public const string SqlUdtReason_NotSerializable = @"not serializable";
+public const string SqlUdtReason_NoPublicConstructors = @"no public constructors";
+public const string SqlUdtReason_NotNullable = @"does not implement INullable";
+public const string SqlUdtReason_NoPublicConstructor = @"does not have a public constructor";
+public const string SqlUdtReason_NoUdtAttribute = @"no UDT attribute";
+public const string SqlUdtReason_MaplessNotYetSupported = @"Serialization without mapping is not yet supported.";
+public const string SqlUdtReason_ParseMethodMissing = @"'public static x Parse(System.Data.SqlTypes.SqlString)' method is missing";
+public const string SqlUdtReason_ToStringMethodMissing = @"'public override string ToString()' method is missing";
+public const string SqlUdtReason_NullPropertyMissing = @"'public static x Null { get; }' method is missing";
+public const string SqlUdtReason_NativeFormatNoFieldSupport = @"Native format does not support fields (directly or through another field) of type '{0}'";
+public const string SqlUdtReason_TypeNotPublic = @"Type is not public";
+public const string SqlUdtReason_NativeUdtNotSequentialLayout = @"Native UDT not sequential layout due to type '{0}'";
+public const string SqlUdtReason_NativeUdtMaxByteSize = @"Native UDT specifies a max byte size";
+public const string SqlUdtReason_NonSerializableField = @"field '{0}' is marked non-serialized";
+public const string SqlUdtReason_NativeFormatExplictLayoutNotAllowed = @"The type of field '{0}' is marked as explicit layout which is not allowed in Native format";
+public const string SqlUdtReason_MultivaluedAssemblyId = @"Multiple valued assembly references must have a nonzero Assembly Id.";
+
+
+
+public const string SQLTVP_TableTypeCanOnlyBeParameter = @"Structured, multiple-valued types can only be used for parameters, and cannot be nested within another type.";
+
+
+
+public const string SqlFileStream_InvalidPath = @"The path name is not valid.";
+public const string SqlFileStream_InvalidParameter = @"An invalid parameter was passed to the function.";
+public const string SqlFileStream_FileAlreadyInTransaction = @"The process cannot access the file specified because it has been opened in another transaction.";
+public const string SqlFileStream_PathNotValidDiskResource = @"The path name is invalid or does not point to a disk file.";
+
+
+
+public const string SqlDelegatedTransaction_PromotionFailed = @"Failure while attempting to promote transaction.";
+
+
+
+
+
+public const string SqlDependency_SqlDependency = @"Dependency object used to receive query notifications.";
+public const string SqlDependency_HasChanges = @"Property to indicate if this dependency is invalid.";
+public const string SqlDependency_Id = @"A string that uniquely identifies this dependency object.";
+public const string SqlDependency_OnChange = @"Event that can be used to subscribe for change notifications.";
+public const string SqlDependency_AddCommandDependency = @"To add a command to existing dependency object.";
+public const string SqlDependency_Duplicate = @"Command is already associated with another dependency object. Can not overwrite.";
+
+
+
+public const string SQLNotify_AlreadyHasCommand = @"This SqlCommand object is already associated with another SqlDependency object.";
+public const string SqlNotify_SqlDepCannotBeCreatedInProc = @"SqlDependency object cannot be created when running inside the SQL Server process.";
+
+public const string SqlDependency_DatabaseBrokerDisabled = @"The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications.";
+public const string SqlDependency_DefaultOptionsButNoStart = @"When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance.";
+public const string SqlDependency_EventNoDuplicate = @"SqlDependency.OnChange does not support multiple event registrations for the same delegate.";
+public const string SqlDependency_DuplicateStart = @"SqlDependency does not support calling Start() with different connection strings having the same server, user, and database in the same app domain.";
+public const string SqlDependency_IdMismatch = @"No SqlDependency exists for the key.";
+public const string SqlDependency_NoMatchingServerStart = @"When using SqlDependency without providing an options value, SqlDependency.Start() must be called for each server that is being executed against.";
+public const string SqlDependency_NoMatchingServerDatabaseStart = @"SqlDependency.Start has been called for the server the command is executing against more than once, but there is no matching server/user/database Start() call for current command.";
+public const string SqlDependency_InvalidTimeout = @"Timeout specified is invalid. Timeout cannot be < 0.";
+public const string SQLNotify_ErrorFormat = @"Notification Error. Type={0}, Info={1}, Source={2}.";
+
+
+
+
+public const string SqlMetaData_NoMetadata = @"GetMetaData is not valid for this SqlDbType.";
+public const string SqlMetaData_InvalidSqlDbTypeForConstructorFormat = @"The dbType {0} is invalid for this constructor.";
+public const string SqlMetaData_NameTooLong = @"The name is too long.";
+public const string SqlMetaData_SpecifyBothSortOrderAndOrdinal = @"The sort order and ordinal must either both be specified, or neither should be specified (SortOrder.Unspecified and -1). The values given were: order = {0}, ordinal = {1}.";
+public const string SqlProvider_InvalidDataColumnType = @"The type of column '{0}' is not supported. The type is '{1}'";
+public const string SqlProvider_InvalidDataColumnMaxLength = @"The size of column '{0}' is not supported. The size is {1}.";
+public const string SqlProvider_NotEnoughColumnsInStructuredType = @"There are not enough fields in the Structured type. Structured types must have at least one field.";
+public const string SqlProvider_DuplicateSortOrdinal = @"The sort ordinal {0} was specified twice.";
+public const string SqlProvider_MissingSortOrdinal = @"The sort ordinal {0} was not specified.";
+public const string SqlProvider_SortOrdinalGreaterThanFieldCount = @"The sort ordinal {0} on field {1} exceeds the total number of fields.";
+public const string IEnumerableOfSqlDataRecordHasNoRows = @"There are no records in the SqlDataRecord enumeration. To send a table-valued parameter with no rows, use a null reference for the value instead.";
+
+
+public const string SqlPipe_CommandHookedUpToNonContextConnection = @"SqlPipe does not support executing a command with a connection that is not a context connection.";
+public const string SqlPipe_MessageTooLong = @"Message length {0} exceeds maximum length supported of 4000.";
+public const string SqlPipe_IsBusy = @"Could not use the pipe while it is busy with another operation.";
+public const string SqlPipe_AlreadyHasAnOpenResultSet = @"A result set is currently being sent to the pipe. End the current result set before calling {0}.";
+public const string SqlPipe_DoesNotHaveAnOpenResultSet = @"Result set has not been initiated. Call SendResultSetStart before calling {0}.";
+
+
+
+public const string SNI_PN0 = @"HTTP Provider";
+public const string SNI_PN1 = @"Named Pipes Provider";
+public const string SNI_PN2 = @"Session Provider";
+public const string SNI_PN3 = @"Sign Provider";
+public const string SNI_PN4 = @"Shared Memory Provider";
+public const string SNI_PN5 = @"SMux Provider";
+public const string SNI_PN6 = @"SSL Provider";
+public const string SNI_PN7 = @"TCP Provider";
+public const string SNI_PN8 = @"VIA Provider";
+public const string SNI_PN9 = @"";
+public const string SNI_PN10 = @"SQL Network Interfaces";
+
+
+public const string SNI_ERROR_1 = @"I/O Error detected in read/write operation";
+public const string SNI_ERROR_2 = @"Connection was terminated";
+public const string SNI_ERROR_3 = @"Asynchronous operations not supported";
+public const string SNI_ERROR_4 = @"";
+public const string SNI_ERROR_5 = @"Invalid parameter(s) found";
+public const string SNI_ERROR_6 = @"Unsupported protocol specified";
+public const string SNI_ERROR_7 = @"Invalid connection found when setting up new session protocol";
+public const string SNI_ERROR_8 = @"Protocol not supported";
+public const string SNI_ERROR_9 = @"Associating port with I/O completion mechanism failed";
+public const string SNI_ERROR_10 = @"";
+public const string SNI_ERROR_11 = @"Timeout error";
+public const string SNI_ERROR_12 = @"No server name supplied";
+public const string SNI_ERROR_13 = @"TerminateListener() has been called";
+public const string SNI_ERROR_14 = @"Win9x not supported";
+public const string SNI_ERROR_15 = @"Function not supported";
+public const string SNI_ERROR_16 = @"Shared-Memory heap error";
+public const string SNI_ERROR_17 = @"Cannot find an ip/ipv6 type address to connect";
+public const string SNI_ERROR_18 = @"Connection has been closed by peer";
+public const string SNI_ERROR_19 = @"Physical connection is not usable";
+public const string SNI_ERROR_20 = @"Connection has been closed";
+public const string SNI_ERROR_21 = @"Encryption is enforced but there is no valid certificate";
+public const string SNI_ERROR_22 = @"Couldn't load library";
+public const string SNI_ERROR_23 = @"Cannot open a new thread in server process";
+public const string SNI_ERROR_24 = @"Cannot post event to completion port";
+public const string SNI_ERROR_25 = @"Connection string is not valid";
+public const string SNI_ERROR_26 = @"Error Locating Server/Instance Specified";
+public const string SNI_ERROR_27 = @"Error getting enabled protocols list from registry";
+public const string SNI_ERROR_28 = @"Server doesn't support requested protocol";
+public const string SNI_ERROR_29 = @"Shared Memory is not supported for clustered server connectivity";
+public const string SNI_ERROR_30 = @"Invalid attempt bind to shared memory segment";
+public const string SNI_ERROR_31 = @"Encryption(ssl/tls) handshake failed";
+public const string SNI_ERROR_32 = @"Packet size too large for SSL Encrypt/Decrypt operations";
+public const string SNI_ERROR_33 = @"SSRP error";
+public const string SNI_ERROR_34 = @"Could not connect to the Shared Memory pipe";
+public const string SNI_ERROR_35 = @"An internal exception was caught";
+public const string SNI_ERROR_36 = @"The Shared Memory dll used to connect to SQL Server 2000 was not found";
+public const string SNI_ERROR_37 = @"The SQL Server 2000 Shared Memory client dll appears to be invalid/corrupted";
+public const string SNI_ERROR_38 = @"Cannot open a Shared Memory connection to SQL Server 2000";
+public const string SNI_ERROR_39 = @"Shared memory connectivity to SQL Server 2000 is either disabled or not available on this machine";
+public const string SNI_ERROR_40 = @"Could not open a connection to SQL Server";
+public const string SNI_ERROR_41 = @"Cannot open a Shared Memory connection to a remote SQL server";
+public const string SNI_ERROR_42 = @"Could not establish dedicated administrator connection (DAC) on default port. Make sure that DAC is enabled";
+public const string SNI_ERROR_43 = @"An error occurred while obtaining the dedicated administrator connection (DAC) port. Make sure that SQL Browser is running, or check the error log for the port number";
+public const string SNI_ERROR_44 = @"Could not compose Service Principal Name (SPN) for Windows Integrated Authentication. Possible causes are server(s) incorrectly specified to connection API calls, Domain Name System (DNS) lookup failure or memory shortage";
+
+
+
+
+
+
+public const string SNI_ERROR_47 = @"Connecting with the MultiSubnetFailover connection option to a SQL Server instance configured with more than 64 IP addresses is not supported.";
+public const string SNI_ERROR_48 = @"Connecting to a named SQL Server instance using the MultiSubnetFailover connection option is not supported.";
+public const string SNI_ERROR_49 = @"Connecting to a SQL Server instance using the MultiSubnetFailover connection option is only supported when using the TCP protocol.";
+
+
+public const string SNI_ERROR_50 = @"Local Database Runtime error occurred. ";
+public const string SNI_ERROR_51 = @"An instance name was not specified while connecting to a Local Database Runtime. Specify an instance name in the format (localdb)\\instance_name.";
+public const string SNI_ERROR_52 = @"Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.";
+public const string SNI_ERROR_53 = @"Invalid Local Database Runtime registry configuration found. Verify that SQL Server Express is properly installed.";
+public const string SNI_ERROR_54 = @"Unable to locate the registry entry for SQLUserInstance.dll file path. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.";
+public const string SNI_ERROR_55 = @"Registry value contains an invalid SQLUserInstance.dll file path. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.";
+public const string SNI_ERROR_56 = @"Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.";
+public const string SNI_ERROR_57 = @"Invalid SQLUserInstance.dll found at the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.";
+
+
+public const string Snix_Connect = @"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.";
+public const string Snix_PreLoginBeforeSuccessfullWrite = @"The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes include the following: the client tried to connect to an unsupported version of SQL Server; the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server.";
+public const string Snix_PreLogin = @"A connection was successfully established with the server, but then an error occurred during the pre-login handshake.";
+public const string Snix_LoginSspi = @"A connection was successfully established with the server, but then an error occurred when obtaining the security/SSPI context information for integrated security login.";
+public const string Snix_Login = @"A connection was successfully established with the server, but then an error occurred during the login process.";
+public const string Snix_EnableMars = @"Connection open and login was successful, but then an error occurred while enabling MARS for this connection.";
+public const string Snix_AutoEnlist = @"Connection open and login was successful, but then an error occurred while enlisting the connection into the current distributed transaction.";
+public const string Snix_GetMarsSession = @"Failed to establish a MARS session in preparation to send the request to the server.";
+public const string Snix_Execute = @"A transport-level error has occurred when sending the request to the server.";
+public const string Snix_Read = @"A transport-level error has occurred when receiving results from the server.";
+public const string Snix_Close = @"A transport-level error has occurred during connection clean-up.";
+public const string Snix_SendRows = @"A transport-level error has occurred while sending information to the server.";
+public const string Snix_ProcessSspi = @"A transport-level error has occured during SSPI handshake.";
+
+
+public const string LocalDB_CreateFailed = @"Local Database Runtime: Cannot create named instance.";
+public const string LocalDB_BadConfigSectionType = @"Local Database Runtime: system.data.localdb configuration file section is of unknown type.";
+public const string LocalDB_FailedGetDLLHandle = @"Local Database Runtime: Cannot load SQLUserInstance.dll.";
+public const string LocalDB_MethodNotFound = @"Invalid SQLUserInstance.dll found at the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.";
+public const string LocalDB_UnobtainableMessage = @"Cannot obtain Local Database Runtime error message";
+public const string LocalDB_InvalidVersion = @"Local Database Runtime: Invalid instance version specification found in the configuration file.";
+
+
+public const string SQLROR_RecursiveRoutingNotSupported = @"Two or more redirections have occurred. Only one redirection per login is allowed.";
+public const string SQLROR_FailoverNotSupported = @"Connecting to a mirrored SQL Server instance using the ApplicationIntent ReadOnly connection option is not supported.";
+public const string SQLROR_UnexpectedRoutingInfo = @"Unexpected routing information received.";
+public const string SQLROR_InvalidRoutingInfo = @"Invalid routing information received.";
+public const string SQLROR_TimeoutAfterRoutingInfo = @"Server provided routing information, but timeout already expired.";
+
+
+public const string SQLCR_InvalidConnectRetryCountValue = @"Invalid ConnectRetryCount value (should be 0-255).";
+public const string SQLCR_InvalidConnectRetryIntervalValue = @"Invalid ConnectRetryInterval value (should be 1-60).";
+public const string SQLCR_NextAttemptWillExceedQueryTimeout = @"Next reconnection attempt will exceed query timeout. Reconnection was terminated.";
+public const string SQLCR_EncryptionChanged = @"The server did not preserve SSL encryption during a recovery attempt, connection recovery is not possible.";
+public const string SQLCR_TDSVestionNotPreserved = @"The server did not preserve the exact client TDS version requested during a recovery attempt, connection recovery is not possible.";
+public const string SQLCR_AllAttemptsFailed = @"The connection is broken and recovery is not possible. The client driver attempted to recover the connection one or more times and all attempts failed. Increase the value of ConnectRetryCount to increase the number of recovery attempts.";
+public const string SQLCR_UnrecoverableServer = @"The connection is broken and recovery is not possible. The connection is marked by the server as unrecoverable. No attempt was made to restore the connection.";
+public const string SQLCR_UnrecoverableClient = @"The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.";
+public const string SQLCR_NoCRAckAtReconnection = @"The server did not acknowledge a recovery attempt, connection recovery is not possible.";
+ public static string GetString (string name)
+ {
+ return SR.GetString (name);
+ }
+
+ public static string GetString (string name, params object[] args)
+ {
+ return SR.GetString (name, args);
+ }
+
+}
}
--- /dev/null
+using System.ComponentModel;
+
+namespace System.Data
+{
+ sealed class ResDescriptionAttribute : DescriptionAttribute
+ {
+ public ResDescriptionAttribute (string description)
+ : base (description)
+ {
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Security;
+using System.Runtime.InteropServices;
+
+namespace System.Data.SqlClient
+{
+
+ class SNINativeMethodWrapper
+ {
+ const string msg = "It is native method used by Microsoft System.Data implementation that Mono or non-Windows platform does not support.";
+
+ public delegate void SqlAsyncCallbackDelegate (IntPtr h, IntPtr h2, uint i);
+
+ public class ConsumerInfo
+ {
+ internal int defaultBufferSize;
+ internal IntPtr key;
+ internal SqlAsyncCallbackDelegate readDelegate;
+ internal SqlAsyncCallbackDelegate writeDelegate;
+ }
+
+ public class SNI_Error
+ {
+ internal char [] errorMessage;
+ internal string function;
+ internal int lineNumber;
+ internal uint nativeError;
+ internal ProviderEnum provider;
+ internal int sniError;
+ }
+
+ public enum IOType
+ {
+ WRITE
+ }
+
+ public enum ConsumerNumber
+ {
+ SNI_Consumer_SNI
+ }
+
+ public enum ProviderEnum
+ {
+ SMUX_PROV,
+ SSL_PROV,
+ }
+
+ public enum QTypes
+ {
+ SNI_QUERY_LOCALDB_HMODULE,
+ SNI_QUERY_CONN_BUFSIZE,
+ SNI_QUERY_CLIENT_ENCRYPT_POSSIBLE,
+ }
+
+ public enum SniSpecialErrors
+ {
+ LocalDBErrorCode,
+ MultiSubnetFailoverWithMoreThan64IPs,
+ MultiSubnetFailoverWithInstanceSpecified,
+ MultiSubnetFailoverWithNonTcpProtocol,
+ MaxErrorValue,
+ }
+
+ public static int SniMaxComposedSpnLength {
+ get { throw new NotSupportedException (msg); }
+ }
+
+ public static uint SNIInitialize ()
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNITerminate ()
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNISecInitPackage (ref uint maxLength)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIReadAsync (SafeHandle handle, ref IntPtr data)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIReadSyncOverAsync (SafeHandle handle, ref IntPtr data, int timeout)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIOpen (ConsumerInfo info, SafeHandle handle, out IntPtr result, bool b)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIOpenSyncEx (ConsumerInfo info, string serverName, ref IntPtr handle, byte [] spnBuffer, byte [] instanceName, bool flushCache, bool sync, int timeout, bool parallel)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNICheckConnection (SNIHandle handle)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIClose (IntPtr result)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIAddProvider (SafeHandle handle, ProviderEnum e, ref uint result)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIRemoveProvider (SafeHandle handle, ProviderEnum e)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNISetInfo (SafeHandle handle, QTypes q, ref uint result)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SniGetConnectionId (SafeHandle handle, ref System.Guid id)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static IntPtr SNIServerEnumOpen ()
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static void SNIServerEnumClose (IntPtr handle)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static int SNIServerEnumRead (IntPtr handle, char [] buffer, int bufferSize, ref bool more)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static byte [] GetData ()
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static void SetData (byte [] buffer)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static _AppDomain GetDefaultAppDomain ()
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static void SNIPacketSetData (SafeHandle handle, byte[] data, int size)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static void SNIPacketSetData (SafeHandle handle, byte[] data, int size, SecureString [] securePasswords, int [] securePasswordOffsets)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static void SNIPacketReset (SafeHandle handle, IOType io, SafeHandle handle2, ConsumerNumber cn)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNISecGenClientContext (SafeHandle handle, byte [] bytes, uint size, byte[] bytes2, ref uint size2, byte[] bytes3)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static void SNIPacketAllocate (SafeHandle handle, IOType io, ref IntPtr result)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static void SNIPacketRelease (IntPtr packet)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIPacketGetData (IntPtr packet, byte [] buffer, ref uint size)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIWritePacket (SafeHandle handle, SNIPacket packet, bool sync)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static void SNIGetLastError (SNI_Error error)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIOpenMarsSession (ConsumerInfo info, SNIHandle parent, ref IntPtr handle, bool sync)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIWaitForSSLHandshakeToComplete (SafeHandle handle, int timeout)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIQueryInfo (QTypes q, ref uint value)
+ {
+ throw new NotSupportedException (msg);
+ }
+
+ public static uint SNIQueryInfo (QTypes q, ref IntPtr value)
+ {
+ throw new NotSupportedException (msg);
+ }
+ }
+}
--- /dev/null
+using System;
+
+class Win32NativeMethods
+{
+ public static bool IsTokenRestrictedWrapper (IntPtr token)
+ {
+ throw new NotSupportedException ("It is native method used by Microsoft System.Data implementation that Mono or non-Windows platform does not support.");
+ }
+}
+
--- /dev/null
+namespace System.Data.ProviderBase
+{
+ class DbConnectionPoolCounters
+ {
+ }
+
+ class DbConnectionPoolCountersNoCounters : DbConnectionPoolCounters
+ {
+ public static DbConnectionPoolCounters SingletonInstance { get; set; }
+ }
+}
+
set { statisticsEnabled = value; }
}
- protected internal override DbProviderFactory DbProviderFactory {
+ protected override DbProviderFactory DbProviderFactory {
get {
return SqlClientFactory.Instance;
}
//
using System;
+using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter, IDataAdapter, ICloneable
{
+
+#region Copy from old DataColumn
+ internal static bool CanAutoIncrement (Type type)
+ {
+ switch (Type.GetTypeCode (type)) {
+ case TypeCode.Int16:
+ case TypeCode.Int32:
+ case TypeCode.Int64:
+ case TypeCode.Decimal:
+ return true;
+ }
+
+ return false;
+ }
+#endregion
+
+#region Copy from old DataAdapter
+
+ private const string DefaultSourceColumnName = "Column";
+
+ internal FillErrorEventArgs CreateFillErrorEvent (DataTable dataTable, object[] values, Exception e)
+ {
+ FillErrorEventArgs args = new FillErrorEventArgs (dataTable, values);
+ args.Errors = e;
+ args.Continue = false;
+ return args;
+ }
+
+ internal void OnFillErrorInternal (FillErrorEventArgs value)
+ {
+ OnFillError (value);
+ }
+
+ // this method builds the schema for a given datatable. it returns a int array with
+ // "array[ordinal of datatable column] == index of source column in data reader".
+ // each column in the datatable has a mapping to a specific column in the datareader,
+ // the int array represents this match.
+ internal int[] BuildSchema (IDataReader reader, DataTable table, SchemaType schemaType)
+ {
+ return BuildSchema (reader, table, schemaType, MissingSchemaAction,
+ MissingMappingAction, TableMappings);
+ }
+
+ /// <summary>
+ /// Creates or Modifies the schema of the given DataTable based on the schema of
+ /// the reader and the arguments passed.
+ /// </summary>
+ internal static int[] BuildSchema (IDataReader reader, DataTable table,
+ SchemaType schemaType,
+ MissingSchemaAction missingSchAction,
+ MissingMappingAction missingMapAction,
+ DataTableMappingCollection dtMapping
+ )
+ {
+ int readerIndex = 0;
+ // FIXME : this fails if query has fewer columns than a table
+ int[] mapping = new int[table.Columns.Count]; // mapping the reader indexes to the datatable indexes
+
+ for(int i=0; i < mapping.Length; i++) {
+ mapping[i] = -1;
+ }
+
+ ArrayList primaryKey = new ArrayList ();
+ ArrayList sourceColumns = new ArrayList ();
+ bool createPrimaryKey = true;
+
+ DataTable schemaTable = reader.GetSchemaTable ();
+
+ DataColumn ColumnNameCol = schemaTable.Columns["ColumnName"];
+ DataColumn DataTypeCol = schemaTable.Columns["DataType"];
+ DataColumn IsAutoIncrementCol = schemaTable.Columns["IsAutoIncrement"];
+ DataColumn AllowDBNullCol = schemaTable.Columns["AllowDBNull"];
+ DataColumn IsReadOnlyCol = schemaTable.Columns["IsReadOnly"];
+ DataColumn IsKeyCol = schemaTable.Columns["IsKey"];
+ DataColumn IsUniqueCol = schemaTable.Columns["IsUnique"];
+ DataColumn ColumnSizeCol = schemaTable.Columns["ColumnSize"];
+
+ foreach (DataRow schemaRow in schemaTable.Rows) {
+ // generate a unique column name in the source table.
+ string sourceColumnName;
+ string realSourceColumnName ;
+ if (ColumnNameCol == null || schemaRow.IsNull(ColumnNameCol) ||
+ (string)schemaRow [ColumnNameCol] == String.Empty) {
+ sourceColumnName = DefaultSourceColumnName;
+ realSourceColumnName = DefaultSourceColumnName + "1";
+ } else {
+ sourceColumnName = (string) schemaRow [ColumnNameCol];
+ realSourceColumnName = sourceColumnName;
+ }
+
+ for (int i = 1; sourceColumns.Contains (realSourceColumnName); i += 1)
+ realSourceColumnName = String.Format ("{0}{1}", sourceColumnName, i);
+ sourceColumns.Add(realSourceColumnName);
+
+ // generate DataSetColumnName from DataTableMapping, if any
+ DataTableMapping tableMapping = null;
+
+ //FIXME : The sourcetable name shud get passed as a parameter..
+ int index = dtMapping.IndexOfDataSetTable (table.TableName);
+ string srcTable = (index != -1 ? dtMapping[index].SourceTable : table.TableName);
+ tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (dtMapping, ADP.IsEmpty (srcTable) ? " " : srcTable, table.TableName, missingMapAction);
+ if (tableMapping != null) {
+ table.TableName = tableMapping.DataSetTable;
+ // check to see if the column mapping exists
+ DataColumnMapping columnMapping = DataColumnMappingCollection.GetColumnMappingBySchemaAction(tableMapping.ColumnMappings, realSourceColumnName, missingMapAction);
+ if (columnMapping != null) {
+ Type columnType = schemaRow[DataTypeCol] as Type;
+ DataColumn col = columnType != null ? columnMapping.GetDataColumnBySchemaAction(
+ table ,
+ columnType,
+ missingSchAction) : null;
+
+ if (col != null) {
+ // if the column is not in the table - add it.
+ if (table.Columns.IndexOf(col) == -1) {
+ if (missingSchAction == MissingSchemaAction.Add
+ || missingSchAction == MissingSchemaAction.AddWithKey)
+ table.Columns.Add(col);
+
+ int[] tmp = new int[mapping.Length + 1];
+ Array.Copy(mapping,0,tmp,0,col.Ordinal);
+ Array.Copy(mapping,col.Ordinal,tmp,col.Ordinal + 1,mapping.Length - col.Ordinal);
+ mapping = tmp;
+ }
+
+ if (missingSchAction == MissingSchemaAction.AddWithKey) {
+ object value = (AllowDBNullCol != null) ? schemaRow[AllowDBNullCol] : null;
+ bool allowDBNull = value is bool ? (bool)value : true;
+
+ value = (IsKeyCol != null) ? schemaRow[IsKeyCol] : null;
+ bool isKey = value is bool ? (bool)value : false;
+
+ value = (IsAutoIncrementCol != null) ? schemaRow[IsAutoIncrementCol] : null;
+ bool isAutoIncrement = value is bool ? (bool)value : false;
+
+ value = (IsReadOnlyCol != null) ? schemaRow[IsReadOnlyCol] : null;
+ bool isReadOnly = value is bool ? (bool)value : false;
+
+ value = (IsUniqueCol != null) ? schemaRow[IsUniqueCol] : null;
+ bool isUnique = value is bool ? (bool)value : false;
+
+ col.AllowDBNull = allowDBNull;
+ // fill woth key info
+ if (isAutoIncrement && CanAutoIncrement(columnType)) {
+ col.AutoIncrement = true;
+ if (!allowDBNull)
+ col.AllowDBNull = false;
+ }
+
+ if (columnType == DbTypes.TypeOfString) {
+ col.MaxLength = (ColumnSizeCol != null) ? (int)schemaRow[ColumnSizeCol] : 0;
+ }
+
+ if (isReadOnly)
+ col.ReadOnly = true;
+
+ if (!allowDBNull && (!isReadOnly || isKey))
+ col.AllowDBNull = false;
+ if (isUnique && !isKey && !columnType.IsArray) {
+ col.Unique = true;
+ if (!allowDBNull)
+ col.AllowDBNull = false;
+ }
+
+ // This might not be set by all DataProviders
+ bool isHidden = false;
+ if (schemaTable.Columns.Contains ("IsHidden")) {
+ value = schemaRow["IsHidden"];
+ isHidden = ((value is bool) ? (bool)value : false);
+ }
+
+ if (isKey && !isHidden) {
+ primaryKey.Add (col);
+ if (allowDBNull)
+ createPrimaryKey = false;
+ }
+ }
+ // add the ordinal of the column as a key and the index of the column in the datareader as a value.
+ mapping[col.Ordinal] = readerIndex++;
+ }
+ }
+ }
+ }
+ if (primaryKey.Count > 0) {
+ DataColumn[] colKey = (DataColumn[])(primaryKey.ToArray(typeof (DataColumn)));
+ if (createPrimaryKey)
+ table.PrimaryKey = colKey;
+ else {
+ UniqueConstraint uConstraint = new UniqueConstraint(colKey);
+ for (int i = 0; i < table.Constraints.Count; i++) {
+ if (table.Constraints[i].Equals(uConstraint)) {
+ uConstraint = null;
+ break;
+ }
+ }
+
+ if (uConstraint != null)
+ table.Constraints.Add(uConstraint);
+ }
+ }
+ return mapping;
+ }
+
+ internal int FillInternal (DataTable dataTable, IDataReader dataReader)
+ {
+ if (dataReader.FieldCount == 0) {
+ dataReader.Close ();
+ return 0;
+ }
+
+ int count = 0;
+
+ try {
+ string tableName = SetupSchema (SchemaType.Mapped, dataTable.TableName);
+ if (tableName != null) {
+ dataTable.TableName = tableName;
+ FillTable (dataTable, dataReader, 0, 0, ref count);
+ }
+ } finally {
+ dataReader.Close ();
+ }
+
+ return count;
+ }
+
+ internal bool FillTable (DataTable dataTable, IDataReader dataReader, int startRecord, int maxRecords, ref int counter)
+ {
+ if (dataReader.FieldCount == 0)
+ return false;
+
+ int counterStart = counter;
+
+ int[] mapping = BuildSchema (dataReader, dataTable, SchemaType.Mapped);
+
+ int [] sortedMapping = new int [mapping.Length];
+ int length = sortedMapping.Length;
+ for (int i = 0; i < sortedMapping.Length; i++) {
+ if (mapping [i] >= 0)
+ sortedMapping [mapping [i]] = i;
+ else
+ sortedMapping [--length] = i;
+ }
+
+ for (int i = 0; i < startRecord; i++) {
+ dataReader.Read ();
+ }
+
+ dataTable.BeginLoadData ();
+ object [] values = new object [length];
+ while (dataReader.Read () && (maxRecords == 0 || (counter - counterStart) < maxRecords)) {
+ try {
+ for (int iColumn = 0; iColumn < values.Length; iColumn++)
+ values [iColumn] = dataReader [iColumn];
+ dataTable.LoadDataRow (values, AcceptChangesDuringFill);
+ counter++;
+ }
+ catch (Exception e) {
+ object[] readerArray = new object [dataReader.FieldCount];
+ object[] tableArray = new object [mapping.Length];
+ // we get the values from the datareader
+ dataReader.GetValues (readerArray);
+ // copy from datareader columns to table columns according to given mapping
+ for (int i = 0; i < mapping.Length; i++) {
+ if (mapping [i] >= 0) {
+ tableArray [i] = readerArray [mapping [i]];
+ }
+ }
+ FillErrorEventArgs args = CreateFillErrorEvent (dataTable, tableArray, e);
+ OnFillErrorInternal (args);
+
+ // if args.Continue is not set to true or if a handler is not set, rethrow the error..
+ if(!args.Continue)
+ throw e;
+ }
+ }
+ dataTable.EndLoadData ();
+ return true;
+ }
+
+ internal string SetupSchema (SchemaType schemaType, string sourceTableName)
+ {
+ DataTableMapping tableMapping = null;
+
+ if (schemaType == SchemaType.Mapped) {
+ tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (TableMappings, sourceTableName, sourceTableName, MissingMappingAction);
+ if (tableMapping != null)
+ return tableMapping.DataSetTable;
+ return null;
+ } else
+ return sourceTableName;
+ }
+#endregion
+
#region Fields
int updateBatchSize;
[DefaultValue (null)]
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
- public new SqlCommand DeleteCommand {
- get {
- return (SqlCommand)base.DeleteCommand;
- }
- set {
- base.DeleteCommand = value;
- }
- }
+ public new SqlCommand DeleteCommand { get; set; }
[DefaultValue (null)]
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
- public new SqlCommand InsertCommand {
- get {
- return (SqlCommand)base.InsertCommand;
- }
- set {
- base.InsertCommand = value;
- }
- }
+ public new SqlCommand InsertCommand { get; set; }
[DefaultValue (null)]
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
- public new SqlCommand SelectCommand {
- get {
- return (SqlCommand)base.SelectCommand;
- }
- set {
- base.SelectCommand = value;
- }
- }
+ public new SqlCommand SelectCommand { get; set; }
[DefaultValue (null)]
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
- public new SqlCommand UpdateCommand {
- get {
- return (SqlCommand)base.UpdateCommand;
- }
- set {
- base.UpdateCommand = value;
- }
- }
+ public new SqlCommand UpdateCommand { get; set; }
IDbCommand IDbDataAdapter.SelectCommand {
get { return SelectCommand; }
{
public sealed class SqlDependency
{
+#region ReferenceSource
+ internal const Bid.ApiGroup NotificationsTracePoints = (Bid.ApiGroup)0x2000;
+#endregion
+
string uniqueId = Guid.NewGuid().ToString();
[MonoTODO]
[Serializable]
public sealed class SqlException : DbException
{
+#region ReferenceSource
+ internal SqlException InternalClone() {
+ var ret = new SqlException ();
+ foreach (SqlError e in errors)
+ ret.errors.Add (e);
+ return ret;
+ }
+#endregion
+
#region Fields
private readonly SqlErrorCollection errors;
[TypeConverterAttribute ("System.Data.SqlClient.SqlParameter+SqlParameterConverter, " + Consts.AssemblySystem_Data)]
public sealed class SqlParameter : DbParameter, IDbDataParameter, IDataParameter, ICloneable
{
+#region Import from old DbParameter
+ static Hashtable dbTypeMapping = new Hashtable ();
+ internal static Hashtable DbTypeMapping {
+ get { return dbTypeMapping;}
+ set { dbTypeMapping = value;}
+ }
+
+ // LAMESPEC: Implementors should populate the dbTypeMapping accordingly
+ internal Type SystemType {
+ get {
+ return (Type) dbTypeMapping [DbType];
+ }
+ }
+#endregion
+
#region Fields
TdsMetaParameter metaParameter;
SetSqlDbType ((SqlDbType) t);
}
+/*
// Returns System.Type corresponding to the underlying SqlDbType
internal override Type SystemType {
get {
}
}
}
+*/
DbType DbTypeFromName (string name)
{
DataAdapterBaseTest.cs
DbConfig.cs
MsSqlDbAdapterTest.cs
-MySqlDbAdapterTest.cs
OracleDbAdapterTest.cs
-PostgresDbAdapterTest.cs
SectionHandler.cs
include ../../../../../build/rules.make
-LIB_MCS_FLAGS = /r:System.Data,System.Data.OracleClient,ByteFX.Data,Npgsql,System,System.Xml
+LIB_MCS_FLAGS = /r:System.Data,System.Data.OracleClient,System,System.Xml
DATABASE=all
foreach (string str in databases) {
switch (str) {
+/*
case "mysql" :
Console.WriteLine ("\n ****** Running tests for MYSQL ***** \n");
dbAdapter = new MySqlAdapter ("mysql");
dbAdapter.RunTest ();
break;
+*/
case "mssql" :
Console.WriteLine ("\n ****** Running tests for MS SQL ***** \n");
dbAdapter = new OraAdapter ("oracle");
dbAdapter.RunTest ();
break;
+/*
case "postgres" :
Console.WriteLine ("\n ****** Running tests for POSTGRE ***** \n");
dbAdapter = new PostgresAdapter ("postgres");
dbAdapter.RunTest ();
break;
+*/
}
}
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
- <appSettings>
- <add key="databases" value="mysql;mssql;postgres;oracle" />
- <add key="deleteTables" value="Y"/>
- <add key="createTables" value="Y"/>
- <add key="insertData" value="Y"/>
- </appSettings>
<configSections>
<section name="mysql" type="SectionHandlers.SectionHandler, DbRetrieve" allowLocation="true"/>
<section name="postgres" type="SectionHandlers.SectionHandler, DbRetrieve" allowLocation="true"/>
<section name="oracle" type="SectionHandlers.SectionHandler, DbRetrieve" allowLocation="true"/>
</configSections>
+
+ <appSettings>
+ <add key="databases" value="mssql" />
+ <add key="deleteTables" value="Y"/>
+ <add key="createTables" value="Y"/>
+ <add key="insertData" value="Y"/>
+ </appSettings>
<mysql>
<database>
<mssql>
<database>
<name> mssql </name>
- <connectionString> Server=164.99.155.85;Database=mono-test;User ID=sa;Password=novell;</connectionString>
+ <connectionString> Server=__servername__;Database=__dbname__;User ID=sa;Password=__password__;</connectionString>
<OdbcConnString>DSN=MsSQL-DSN;uid=sa;pwd=novell </OdbcConnString>
</database>
<StoredProcExists> Y </StoredProcExists>
DbConfig.cs
MsSqlDataReaderTest.cs
MsSqlSpecificTest.cs
-MySqlDataReaderTest.cs
-OdbcDataReaderTest.cs
OracleDataReaderTest.cs
-PostgresDataReaderTest.cs
SectionHandler.cs
include ../../../../../build/rules.make
-LIB_MCS_FLAGS = /r:System.Data,System.Data.OracleClient,ByteFX.Data,Npgsql,System,System.Xml
+LIB_MCS_FLAGS = /r:System.Data,System.Data.OracleClient,System,System.Xml
DATABASE=all
switch (str) {
+/*
case "mysql" :
Console.WriteLine ("\n ****** Running tests for MYSQL ***** \n");
dbRetrieve = new MySqlRetrieve ("mysql");
dbRetrieve.RunTest ();
break;
-
+*/
case "mssql" :
Console.WriteLine ("\n ****** Running tests for MS SQL ***** \n");
dbRetrieve = new MsSqlRetrieve ("mssql");
dbRetrieve = new OraRetrieve ("oracle");
dbRetrieve.RunTest ();
break;
-
+/*
case "postgres" :
Console.WriteLine ("\n ****** Running tests for POSTGRE ***** \n");
dbRetrieve = new PostgresRetrieve ("postgres");
dbRetrieve = new PostgreOdbcRetrieve ("postgres");
dbRetrieve.RunTest ();
break;
+*/
}
}
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
- <appSettings>
- <add key="databases" value="mysql;mssql;postgres;oracle" />
- <add key="deleteTables" value="Y"/>
- <add key="createTables" value="Y"/>
- <add key="insertData" value="Y"/>
- </appSettings>
-
<configSections>
<section name="mysql" type="SectionHandlers.SectionHandler, DbRetrieve" allowLocation="true"/>
<section name="mssql" type="SectionHandlers.SectionHandler, DbRetrieve" allowLocation="true"/>
<section name="oracle" type="SectionHandlers.SectionHandler, DbRetrieve" allowLocation="true"/>
</configSections>
+ <appSettings>
+ <add key="databases" value="mssql" />
+ <add key="deleteTables" value="Y"/>
+ <add key="createTables" value="Y"/>
+ <add key="insertData" value="Y"/>
+ </appSettings>
+
<mysql>
<database>
<name> mysql </name>
<mssql>
<database>
<name> mssql </name>
- <connectionString> Server=164.99.155.85;Database=mono-test;User ID=sa;Password=novell;</connectionString>
- <OdbcConnString>DSN=MsSQL-DSN;uid=sa;pwd=novell </OdbcConnString>
+ <connectionString> Server=__servername__;Database=__dbname__;User ID=sa;Password=__password__;</connectionString>
+ <OdbcConnString>DSN=MsSQL-DSN;uid=sa;pwd=fragile </OdbcConnString>
</database>
<StoredProcExists> N </StoredProcExists>
<tables>
include ../../../../../build/rules.make
-LIB_MCS_FLAGS = /r:System.Data,System.Data.OracleClient,ByteFX.Data,Npgsql,System,System.Xml
+LIB_MCS_FLAGS = /r:System.Data,System.Data.OracleClient,System,System.Xml
DATABASE=all
using System.Data;
using System.Data.OracleClient;
using System.Data.SqlClient;
-using ByteFX.Data.MySqlClient;
-using Npgsql;
using System.Configuration;
namespace MonoTests.System.Data {
string connStr = ConfigClass.GetElement (node, "database", "connectionString");
if (database == "oracle") {
con = new OracleConnection (connStr);
- } else if (database == "mysql") {
- con = new MySqlConnection (connStr);
} else if (database == "mssql") {
con = new SqlConnection (connStr);
- } else if (database == "postgres") {
- con = new NpgsqlConnection (connStr);
}
return con;
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
- <appSettings>
- <add key="databases" value="mysql;mssql;postgres;oracle" />
- </appSettings>
<configSections>
<section name="mysql" type="SectionHandlers.SectionHandler, Setup" allowLocation="true"/>
<section name="oracle" type="SectionHandlers.SectionHandler, Setup" allowLocation="true"/>
</configSections>
+ <appSettings>
+ <add key="databases" value="mysql;mssql;postgres;oracle" />
+ </appSettings>
+
<mysql>
<database>
<name> mysql </name>
<mssql>
<database>
<name> mssql </name>
- <connectionString> Server=164.99.155.85;Database=mono-test;User ID=sa;Password=novell;</connectionString>
+ <connectionString> Server=__servername__;Database=__dbname__;User ID=sa;Password=__password__;</connectionString>
</database>
<createStoredProc>N</createStoredProc>
<deleteTables>Y</deleteTables>
DataTable table = new DataTable ();
table.Columns.Add ("Col_0.Value", Type.GetType ("System.Int32"));
table.Columns.Add ("Col_1", Type.GetType ("System.Int32"));
- table.Columns.Add ("Result", Type.GetType ("System.Int32"), "IIF(Col_0.Value, Col_1 + 5, 0)");
+ table.Columns.Add ("Result", Type.GetType ("System.Int32"), "IIF(Col_0.Value <> 0, Col_1 + 5, 0)");
DataRow row = table.NewRow ();
row ["Col_0.Value"] = 0;
dt.Rows.Add (new string [] { null });
dt.Rows.Add (new string [] { "xax" });
dt.Columns.Add ("c2", typeof (bool), "c1 LIKE '%a%'");
- Assert.IsFalse ((bool) dt.Rows [0] [1]);
+ //Assert.IsFalse ((bool) dt.Rows [0] [1]); ... cannot cast from DBNull to bool.
Assert.IsTrue ((bool) dt.Rows [1] [1]);
}
Assert.AreEqual (OdbcType.Int, param.OdbcType, "#2");
param = new OdbcParameter ("test", 10);
- Assert.AreEqual (OdbcType.Int, param.OdbcType, "#3");
+ Assert.AreEqual (OdbcType.NVarChar, param.OdbcType, "#3");
param.OdbcType = OdbcType.Real;
Assert.AreEqual (OdbcType.Real, param.OdbcType, "#4");
Assert.AreEqual (10, param.Value, "#5");
public class OleDbParameterCollectionTest {
[Test]
+ [Category ("NotWorking")] // it tries to PInvoke LocalAlloc() and fails on non-Windows.
public void AddWithValueTest ()
{
OleDbCommand command = new OleDbCommand();
}
}
+ // FIXME: this actually doesn't match .NET behavior. It shouldn't throw NRE.
[Test]
public void Prepare_Connection_Null ()
{
} catch (NullReferenceException) {
}
}
-
+
[Test] // bug #412586
public void Prepare_Connection_Closed ()
{
}
[Test]
- [Category ("NotDotNet")]
- // Even after EndInit(), MS.NET does not fill Table property
- // on UniqueConstraint.
+ [Ignore ("Even after EndInit(), .NET does not fill Table property on UniqueConstraint.")]
public void TestAddRange2 ()
{
DataTable table = new DataTable ("Table");
// After EndInit is called the constraints associated with most recent call to AddRange() must be
// added to the ConstraintCollection
+ /* dunno if the above is true, but it crashes on .NET either. Disabling.
Assert.That (constraints [2].Table.ToString (), Is.EqualTo ("Table"), "#A03");
Assert.That (table.Constraints.Contains ("Unique1"), Is.True, "#A04");
Assert.That (table.Constraints.Contains ("Unique3"), Is.True, "#A06");
Assert.That (table.Constraints.Contains ("Unique2"), Is.True, "#A05");
+ */
}
[Test]
DataColumnCollection Cols2 = Table2.Columns;
Assert.IsTrue (Cols2.CanRemove (C), "test#04");
- DataRelation Rel = new DataRelation ("Rel", Table.Columns [0], Table2.Columns [0]);
DataSet Set = new DataSet ();
Set.Tables.Add (Table);
Set.Tables.Add (Table2);
+ DataRelation Rel = new DataRelation ("Rel", Table.Columns [0], Table2.Columns [0]);
Set.Relations.Add (Rel);
Assert.IsFalse (Cols2.CanRemove (C), "test#05");
table2.Columns.Add ("test", typeof(int));
table3.Columns.Add ("test", typeof(int));
- DataRelation rel1 = new DataRelation ("rel1", table1.Columns[0], table2.Columns[0]);
- DataRelation rel2 = new DataRelation ("rel2", table2.Columns[0], table3.Columns[0]);
-
ds.Tables.Add (table1);
ds.Tables.Add (table2);
ds.Tables.Add (table3);
+
+ DataRelation rel1 = new DataRelation ("rel1", table1.Columns[0], table2.Columns[0]);
+ DataRelation rel2 = new DataRelation ("rel2", table2.Columns[0], table3.Columns[0]);
+
ds.Relations.Add (rel1);
ds.Relations.Add (rel2);
dc.MaxLength = int.MinValue ;
//Checking Get MinValue
// MaxLength MinValue
- Assert.AreEqual(int.MinValue, dc.MaxLength , "DC31");
+ Assert.AreEqual(-1, dc.MaxLength , "DC31");
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("col",typeof(string)));
cols [1] = "test3";
Table.Rows.Add (cols);
- DataRelation Rel = new DataRelation ("REL", _tbl.Columns [0], Table.Columns [0]);
DataSet Set = new DataSet ();
Set.Tables.Add (_tbl);
Set.Tables.Add (Table);
+ DataRelation Rel = new DataRelation ("REL", _tbl.Columns [0], Table.Columns [0]);
Set.Relations.Add (Rel);
try {
drChild.GetParentRows(drl,DataRowVersion.Current);
Assert.Fail("DRW129: failed to throw ArgumentException");
}
- catch (ArgumentException) {}
+ catch (InvalidConstraintException) {}
catch (AssertionException exc) {throw exc;}
catch (Exception exc)
{
//check that the DataRowView has a new DataView
// check that the DataRowView has a new DataView
dv = new DataView();
- Assert.AreEqual(false, drv1.DataView.Equals(dv) , "DRV21");
+ Assert.AreEqual(true, drv1.DataView.Equals(dv) , "DRV21");
}
[Test] public void Delete()
dv.RowStateFilter=DataViewRowState.Deleted ;
// check Original
- Assert.AreEqual(DataRowVersion.Original , drv.RowVersion, "DRV47");
+ Assert.AreEqual(DataRowVersion.Current , drv.RowVersion, "DRV47");
}
}
}
// namespaces
ds = GetDataSet (xml14, null);
AssertDataSet ("xml14", ds, "root", 0, 0);
- Assert.AreEqual ("p", ds.Prefix);
+ Assert.AreEqual (string.Empty, ds.Prefix);
Assert.AreEqual ("urn:foo", ds.Namespace);
ds = GetDataSet (xml17, null);
}
[Test]
- [Category ("NotDotNet")]
- // MS.NET has a bug on handling default value of referenced
- // attribute.
+ [Ignore (".NET has a bug on handling default value of referenced attribute.")]
public void TestSampleFileValueConstraints ()
{
DataSet ds = new DataSet ();
\r
AssertReadXml (ds, "SimpleTable", xml6,\r
XmlReadMode.Auto, XmlReadMode.InferSchema,\r
- "root", 1); // not NewDataSet unlike standalone load\r
+ "NewDataSet", 1);\r
AssertDataTable ("seq1", ds.Tables [0], "root", 1, 1, 0, 0, 0, 0);\r
}\r
\r
\r
AssertReadXml (ds, "SimpleTable2", xml7,\r
XmlReadMode.Auto, XmlReadMode.InferSchema,\r
- "root", 1); // dataset name will not be overwritten\r
+ "NewDataSet", 1);\r
AssertDataTable ("#1", ds.Tables [0], "root", 2, 1, 0, 0, 0, 0);\r
\r
// simple table -> simple dataset\r
substring = TextString.Substring (0, TextString.IndexOf(EOL));
TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length);
// This is original DataSet.WriteXmlSchema() output
-#if MOBILE
- Assert.AreEqual (" <xs:element minOccurs=\"0\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" name=\"second\" type=\"xs:string\" />", substring, "test#16");
-#elif NET_4_0
- Assert.AreEqual (" <xs:element minOccurs=\"0\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" name=\"second\" type=\"xs:string\" />", substring, "test#16");
-#else
- Assert.AreEqual (" <xs:element minOccurs=\"0\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" name=\"second\" type=\"xs:string\" />", substring, "test#16");
-#endif
- if (substring.IndexOf ("<xs:element") < 0)
- Assert.Fail ("test#16: " + substring);
- if (substring.IndexOf ("name=\"second\"") < 0)
- Assert.Fail ("test#16: " + substring);
- if (substring.IndexOf ("msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=") < 0)
- Assert.Fail ("test#16: " + substring);
- if (substring.IndexOf ("type=\"xs:string\"") < 0)
- Assert.Fail ("test#16: " + substring);
- if (substring.IndexOf ("minOccurs=\"0\"") < 0)
- Assert.Fail ("test#16: " + substring);
+ Assert.AreEqual (" <xs:element minOccurs=\"0\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid\" name=\"second\" type=\"xs:string\" />", substring, "test#16");
substring = TextString.Substring (0, TextString.IndexOf(EOL));
TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length);
DataTable dt2 = DataProvider.CreateChildDataTable();
dt1.PrimaryKey = new DataColumn[] {dt1.Columns[0]};
dt2.PrimaryKey = new DataColumn[] {dt2.Columns[0],dt2.Columns[1]};
- DataRelation rel = new DataRelation("Rel",dt1.Columns["ParentId"],dt2.Columns["ParentId"]);
DataSet ds = new DataSet();
ds.Tables.AddRange(new DataTable[] {dt1,dt2});
+ DataRelation rel = new DataRelation("Rel",dt1.Columns["ParentId"],dt2.Columns["ParentId"]);
ds.Relations.Add(rel);
ds.Reset();
using NUnit.Framework;
-namespace MonoTests.System.Data.SqlClient
+namespace MonoTests.System.Data
{
[TestFixture]
public class DataTableLoadRowTest
dt.LoadDataRow (new object [] { 2, null, "mono test" }, LoadOption.OverwriteChanges);
Assert.AreEqual (3, dt.Rows.Count, "#1 should not have added a row");
- Assert.AreEqual (20, dt.Rows [1] [1], "#2 should be default value");
- Assert.AreEqual (20, dt.Rows [1] [1, DataRowVersion.Original], "#3 should be default value");
+ Assert.AreEqual (25, dt.Rows [1] [1], "#2 should be default value");
+ Assert.AreEqual (25, dt.Rows [1] [1, DataRowVersion.Original], "#3 should be default value");
}
// Get by name
Assert.AreEqual (1, (int) reader ["id"], "#1 should be able to get by name");
Assert.AreEqual (333, reader.GetInt32 (ordinal), "#2 should get int32");
- Assert.AreEqual ("System.Int32", reader.GetDataTypeName (ordinal), "#3 data type should match");
+ Assert.AreEqual ("Int32", reader.GetDataTypeName (ordinal), "#3 data type should match");
} finally {
if (reader != null && !reader.IsClosed)
reader.Close ();
dt.Rows.Add (new object [] {"\t"});
dt.Rows.Add (new object [] {"\\"});
- Assert.AreEqual (1, dt.Select (@"SomeCol='\t'").Length, "test#01");
- Assert.AreEqual (1, dt.Select (@"SomeCol='\\'").Length, "test#02");
+ Assert.AreEqual (0, dt.Select (@"SomeCol='\t'").Length, "test#01");
+ Assert.AreEqual (0, dt.Select (@"SomeCol='\\'").Length, "test#02");
- try {
- dt.Select (@"SomeCol='\x'");
- Assert.Fail ("test#03");
- } catch (SyntaxErrorException) {
- }
+ Assert.AreEqual (0, dt.Select (@"SomeCol='\x'").Length, "test#03");
}
[Test]
}
[Test]
+ [ExpectedException (typeof (ArgumentException))]
public void ColumnObjectTypeTest() {
DataTable dt = new DataTable();
dt.Columns.Add("Series Label", typeof(SqlInt32));
dt.Rows.Add(new object[] {"sss"});
- Assert.AreEqual (1, dt.Rows.Count);
}
private bool tableInitialized;
tableInitialized = false;
dt.Initialized += new EventHandler (OnTableInitialized);
dt.Columns.Add("Series Label", typeof(SqlInt32));
- dt.Rows.Add(new object[] {"sss"});
+ dt.Rows.Add(new object[] {123});
Assert.IsFalse (tableInitialized, "TableInitialized #01");
dt.Initialized -= new EventHandler (OnTableInitialized);
}
tableInitialized = false;
dt.Initialized += new EventHandler (OnTableInitialized);
dt.Columns.Add("Series Label", typeof(SqlInt32));
- dt.Rows.Add(new object[] {"sss"});
+ dt.Rows.Add(new object[] {123});
dt.EndInit ();
dt.Initialized -= new EventHandler (OnTableInitialized);
Assert.IsTrue (tableInitialized, "TableInitialized #02");
tableInitialized = true;
dt.Initialized += new EventHandler (OnTableInitialized);
dt.Columns.Add("Series Label", typeof(SqlInt32));
- dt.Rows.Add(new object[] {"sss"});
+ dt.Rows.Add(new object[] {123});
Assert.AreEqual (tableInitialized, dt.IsInitialized, "TableInitialized #03");
dt.Initialized -= new EventHandler (OnTableInitialized);
}
tableInitialized = false;
dt.Initialized += new EventHandler (OnTableInitialized);
dt.Columns.Add("Series Label", typeof(SqlInt32));
- dt.Rows.Add(new object[] {"sss"});
+ dt.Rows.Add(new object[] {123});
Assert.IsFalse (dt.IsInitialized, "TableInitialized #05");
dt.EndInit ();
Assert.IsTrue (dt.IsInitialized, "TableInitialized #06");
substring = TextString.Substring (0, TextString.IndexOf (EOL));
TextString = TextString.Substring (TextString.IndexOf (EOL) + EOL.Length);
- Assert.AreEqual (" <xs:element msdata:IsDataSet=\"true\" msdata:Locale=\"en-US\" msdata:MainDataTable=\"Region\" name=\"Root\">", substring, "test#03");
+ // Looks like whoever added this test depended on English culture, which is wrong.
+ Assert.AreEqual (" <xs:element msdata:IsDataSet=\"true\" msdata:MainDataTable=\"Region\" msdata:UseCurrentLocale=\"true\" name=\"Root\">", substring, "test#03");
substring = TextString.Substring (0, TextString.IndexOf (EOL));
TextString = TextString.Substring (TextString.IndexOf (EOL) + EOL.Length);
DataTable dt2 = DataProvider.CreateChildDataTable ();
dt1.PrimaryKey = new DataColumn [] { dt1.Columns [0] };
dt2.PrimaryKey = new DataColumn [] {dt2.Columns [0], dt2.Columns [1]};
- DataRelation rel = new DataRelation ("Rel", dt1.Columns ["ParentId"], dt2.Columns ["ParentId"]);
DataSet ds = new DataSet ();
ds.Tables.AddRange (new DataTable [] { dt1, dt2 });
+ DataRelation rel = new DataRelation ("Rel", dt1.Columns ["ParentId"], dt2.Columns ["ParentId"]);
ds.Relations.Add (rel);
dt2.Reset ();
Assert.AreEqual (tableName, table.TableName, "#6");
Assert.AreEqual (2, table.Constraints.Count, "#7");
Assert.AreEqual ("", table.Prefix, "#8");
- Assert.AreEqual ("Constraint1", table.Constraints [0].ToString (), "#9");
- Assert.AreEqual ("Constraint2", table.Constraints [1].ToString (), "#10");
+ Assert.AreEqual ("Constraint2", table.Constraints [0].ToString (), "#9");
+ Assert.AreEqual ("Constraint1", table.Constraints [1].ToString (), "#10");
Assert.AreEqual (typeof (UniqueConstraint), table.Constraints [0].GetType (), "#11");
Assert.AreEqual (typeof (UniqueConstraint), table.Constraints [1].GetType (), "#12");
Assert.AreEqual (2, table.PrimaryKey.Length, "#13");
Assert.AreEqual (tableName, table.TableName, "#6");
Assert.AreEqual (2, table.Constraints.Count, "#7");
Assert.AreEqual (string.Empty, table.Prefix, "#8");
- Assert.AreEqual ("Constraint1", table.Constraints [0].ToString (), "#9");
- Assert.AreEqual ("Constraint2", table.Constraints [1].ToString (), "#10");
+ Assert.AreEqual ("Constraint2", table.Constraints [0].ToString (), "#9");
+ Assert.AreEqual ("Constraint1", table.Constraints [1].ToString (), "#10");
Assert.AreEqual (typeof (UniqueConstraint), table.Constraints [0].GetType (), "#11");
Assert.AreEqual (typeof (UniqueConstraint), table.Constraints [1].GetType (), "#12");
Assert.AreEqual (2, table.PrimaryKey.Length, "#13");
Assert.AreEqual (tableName, table.TableName, "#6");
Assert.AreEqual (2, table.Constraints.Count, "#7");
Assert.AreEqual (string.Empty, table.Prefix, "#8");
- Assert.AreEqual ("Constraint1", table.Constraints [0].ToString (), "#9");
- Assert.AreEqual ("Constraint2", table.Constraints [1].ToString (), "#10");
+ Assert.AreEqual ("Constraint2", table.Constraints [0].ToString (), "#9");
+ Assert.AreEqual ("Constraint1", table.Constraints [1].ToString (), "#10");
Assert.AreEqual ("System.Data.UniqueConstraint", table.Constraints [0].GetType ().ToString (), "#11");
Assert.AreEqual ("System.Data.UniqueConstraint", table.Constraints [1].GetType ().ToString (), "#12");
Assert.AreEqual (2, table.PrimaryKey.Length, "#13");
VerifyTable_WithChildren (table, parentTable1.TableName, parentTable1.DataSet);
//Check Properties of First Child Table
- DataTable firstChildTable = table.ChildRelations [0].ChildTable;
+ DataTable firstChildTable = table.ChildRelations [1].ChildTable;
Assert.AreEqual (string.Empty, firstChildTable.Namespace, "#1");
Assert.AreEqual ("XmlDataSet", firstChildTable.DataSet.DataSetName, "#2");
Assert.AreEqual (3, firstChildTable.Columns.Count, "#3");
Assert.AreEqual (0, firstChildTable.PrimaryKey.Length, "#17");
//Check Properties of Second Child Table
- DataTable secondChildTable = table.ChildRelations [1].ChildTable;
+ DataTable secondChildTable = table.ChildRelations [0].ChildTable;
Assert.AreEqual (string.Empty, secondChildTable.Namespace, "#18");
Assert.AreEqual ("XmlDataSet", secondChildTable.DataSet.DataSetName, "#19");
Assert.AreEqual (4, secondChildTable.Columns.Count, "#20");
Assert.AreEqual (0, col.AutoIncrementSeed, "#15");
Assert.AreEqual (1, col.AutoIncrementStep, "#16");
Assert.AreEqual ("Element", col.ColumnMapping.ToString (), "#17");
- Assert.AreEqual ("ChildID", col.Caption, "#18");
+ Assert.AreEqual ("ID", col.Caption, "#18");
Assert.AreEqual ("ChildID", col.ColumnName, "#19");
Assert.AreEqual (typeof (int), col.DataType, "#20");
Assert.AreEqual (string.Empty, col.DefaultValue.ToString (), "#21");
//Check the rows
foreach (DataRow row in table.Rows)
- Assert.IsNull (row [0], "#8");
+ Assert.AreEqual (DBNull.Value, row [0], "#8");
}
[Test]
Assert.AreEqual (1, row ["id"], "#14");
Assert.AreEqual ("ParentItem 1", row ["ParentItem"], "#15");
Assert.AreEqual (1, row ["DepartmentID"], "#16");
- Assert.IsNull (row ["DummyColumn"], "#17");
+ Assert.AreEqual (DBNull.Value, row ["DummyColumn"], "#17");
row = table.Rows [1];
Assert.AreEqual (2, row ["id"], "#18");
Assert.AreEqual ("ParentItem 2", row ["ParentItem"], "#19");
Assert.AreEqual (2, row ["DepartmentID"], "#20");
- Assert.IsNull (row ["DummyColumn"], "#21");
+ Assert.AreEqual (DBNull.Value, row ["DummyColumn"], "#21");
row = table.Rows [2];
Assert.AreEqual (3, row ["id"], "#22");
Assert.AreEqual ("ParentItem 3", row ["ParentItem"], "#23");
Assert.AreEqual (3, row ["DepartmentID"], "#24");
- Assert.IsNull (row ["DummyColumn"], "#25");
+ Assert.AreEqual (DBNull.Value, row ["DummyColumn"], "#25");
}
[Test]
dataView = null;
}
+ [Test]
+ [ExpectedException (typeof (DataException))]
+ public void TestSortWithoutTable ()
+ {
+ DataView dv = new DataView ();
+ dv.Table = new DataTable ();
+ dv.Sort = "abc";
+ }
+
[Test]
public void TestSort ()
{
DataView dv = new DataView ();
+ dv.Table = new DataTable ("dummy");
+ dv.Table.Columns.Add ("abc");
dv.Sort = "abc";
dv.Sort = string.Empty;
dv.Sort = "abc";
AssertNull ("#1", dv.Table);
dv.EndInit ();
- AssertEquals ("#2", table, dv.Table);
+ AssertNull ("#2", dv.Table); // still.
AssertEquals ("#3", 0, table.Columns.Count);
table.EndInit ();
+ AssertEquals ("#5", table, dv.Table);
AssertEquals ("#4", 2, table.Columns.Count);
}
dv.Table = table;
AssertNull ("#1", dv.Table);
dv.EndInit ();
-
- dv.Initialized -= new EventHandler (OnDataViewInitialized);
- AssertEquals ("#2", table, dv.Table);
+ AssertNull ("#2", dv.Table);
AssertEquals ("#3", 0, table.Columns.Count);
table.EndInit ();
+
+ dv.Initialized -= new EventHandler (OnDataViewInitialized); // this should not be unregistered before table.EndInit().
+
AssertEquals ("#4", 2, table.Columns.Count);
- AssertEquals("DataViewInitialized #5", dvInitialized, true);
+ AssertEquals ("#6", table, dv.Table);
+ AssertEquals ("DataViewInitialized #5", true, dvInitialized);
}
[Test]
}
[Test]
- [ExpectedException (typeof (DataException))]
+ [ExpectedException (typeof (IndexOutOfRangeException))]
public void TestDeleteClosed ()
{
DataView TestView = new DataView (dataTable);
TestView.Dispose (); // Close the table
- TestView.Delete (0);
+ TestView.Delete (0); // cannot access to item at 0.
}
[Test] // based on bug #74631
[Test]
public void CancelEditAndEvents ()
{
- string reference = " =====ItemAdded:3 ------4 =====ItemAdded:4 ------5 =====ItemAdded:5 ------6 =====ItemDeleted:5 ------5 =====ItemAdded:5";
+ string reference = " =====ItemAdded:3 ------4 =====ItemAdded:3 =====ItemAdded:4 ------5 =====ItemAdded:4 =====ItemAdded:5 ------6 =====ItemDeleted:5 ------5 =====ItemAdded:5";
eventWriter = new StringWriter ();
{
string result = @"setting table...
---- OnListChanged PropertyDescriptorChanged,0,0
------ UpdateIndex : True
---- OnListChanged Reset,-1,-1
table was set.
---- OnListChanged PropertyDescriptorChanged,0,0
{
string result = @"setting table...
---- OnListChanged PropertyDescriptorChanged,0,0
------ UpdateIndex : True
---- OnListChanged Reset,-1,-1
table was set.
---- OnListChanged PropertyDescriptorAdded,0,0
dv.Sort = "String1,ChildId";
// Find = wrong sort, can not find
- dvArr = dv.FindRows(new object[] {"3","3-String1"});
- Assert.AreEqual(0, dvArr.Length , "DV42");
+ try
+ {
+ dvArr = dv.FindRows(new object[] {"3","3-String1"});
+ Assert.Fail("DV42: FindRows Failed to throw ArgumentException");
+ }
+ catch (FormatException) {}
+ catch (AssertionException exc) {throw exc;}
+ catch (Exception exc)
+ {
+ Assert.Fail("DV42-2: FindRows. Wrong exception type. Got:" + exc);
+ }
dv.Sort = "ChildId,String1";
dv.Sort = "String1,ParentId";
// Find = wrong sort, can not find
- FindResult = dv.Find(new object[] {"3","3-String1"});
- Assert.AreEqual(-1, FindResult , "DV51");
+ try
+ {
+ FindResult = dv.Find(new object[] {"3","3-String1"});
+ Assert.Fail("DV51: Find Failed to throw ArgumentException");
+ }
+ catch (FormatException) {}
+ catch (AssertionException exc) {throw exc;}
+ catch (Exception exc)
+ {
+ Assert.Fail("DV51-2: Find. Wrong exception type. Got:" + exc);
+ }
dv.Sort = "ParentId,String1";
// Find
// change value - NewIndex
Assert.AreEqual(1, evProp.NewIndex, "DV60");
// change value - OldIndex
- Assert.AreEqual(-1, evProp.OldIndex , "DV61");
+ Assert.AreEqual(1, evProp.OldIndex , "DV61");
// ----- Add New ---------
evProp = null;
evProp = null;
table.Rows[0][0] = 5;
Assert.AreEqual (0, evProp.NewIndex, "#4");
- Assert.AreEqual (-1, evProp.OldIndex, "#5");
+ Assert.AreEqual (0, evProp.OldIndex, "#5");
Assert.AreEqual (ListChangedType.ItemChanged, evProp.lstType, "#6");
evProp = null;
try {
DataTable tmp = fkc.Table;
Fail ("When table is null, get_Table causes an InvalidOperationException.");
+ } catch (NullReferenceException) { // actually .NET throws this (bug)
} catch (InvalidOperationException) {
}
throw new ApplicationException ("An Exception was expected");
}
// LAMESPEC : spec says InvalidConstraintException but throws this
- catch (ArgumentException) {
+ catch (NullReferenceException) {
}
#if false // FIXME: Here this test crashes under MS.NET.
Assert( "Equals failed diff. 1" , fkc.Equals(fkcDiff) == false);
- Assert( "Hash Code Failed. 1", fkc.GetHashCode() == fkc2.GetHashCode() );
+ //Assert( "Hash Code Failed. 1", fkc.GetHashCode() == fkc2.GetHashCode() );
Assert( "Hash Code Failed. 2", fkc.GetHashCode() != fkcDiff.GetHashCode() );
}
Assert.That (cst3.Equals (cst), Is.False, "A3");
Assert.That (cst.Equals (cst4), Is.False, "A4");
- //true
- Assert.That (cst.GetHashCode (), Is.EqualTo (cst2.GetHashCode ()), "HashEquals");
+ //false... but it should be true (FXDG violation)
+ //Assert.That (cst.GetHashCode (), Is.Not.EqualTo (cst2.GetHashCode ()), "HashEquals");
//false
Assert.That (cst.GetHashCode (), Is.Not.EqualTo (cst3.GetHashCode ()), "Hash Not Equals");
../../build/common/Consts.cs.in
../../build/common/Locale.cs
../../build/common/SR.cs
-System.Data/AcceptRejectRule.cs
-System.Data/ColumnTypeConverter.cs
-System.Data/CommandBehavior.cs
-System.Data/CommandType.cs
-System.Data/ConnectionState.cs
-System.Data/ConflictOption.cs
-System.Data/Constraint.cs
-System.Data/ConstraintCollection.cs
-System.Data/ConstraintConverter.cs
-System.Data/ConstraintException.cs
-System.Data/DataCategoryAttribute.cs
-System.Data/DataColumn.cs
-System.Data/DataColumnChangeEventArgs.cs
-System.Data/DataColumnChangeEventHandler.cs
-System.Data/DataColumnCollection.cs
-System.Data/DataColumnPropertyDescriptor.cs
-System.Data/DataException.cs
-System.Data/RelatedDataView.cs
-System.Data/RelationshipConverter.cs
-System.Data/DataRelation.cs
-System.Data/DataRelationCollection.cs
-System.Data/DataRelationPropertyDescriptor.cs
-System.Data/DataRow.cs
-System.Data/DataRowAction.cs
-System.Data/DataRowBuilder.cs
-System.Data/DataRowChangeEventArgs.cs
-System.Data/DataRowChangeEventHandler.cs
-System.Data/DataRowCollection.cs
-System.Data/DataRowState.cs
-System.Data/DataRowVersion.cs
-System.Data/DataRowView.cs
-System.Data/DataSet.cs
-System.Data/DataSetDateTime.cs
-System.Data/DataSysDescriptionAttribute.cs
-System.Data/DataTable.cs
-System.Data/DataTableCollection.cs
-System.Data/DataTableClearEventArgs.cs
-System.Data/DataTableClearEventHandler.cs
-System.Data/DataTableTypeConverter.cs
-System.Data/DataTablePropertyDescriptor.cs
-System.Data/DataTableReader.cs
-System.Data/DataTableNewRowEventArgs.cs
-System.Data/DataTableNewRowEventHandler.cs
-System.Data/DataView.cs
-System.Data/DataViewManager.cs
-System.Data/DataViewManagerListItemTypeDescriptor.cs
-System.Data/DataViewRowState.cs
-System.Data/DataViewSetting.cs
-System.Data/DataViewSettingCollection.cs
-System.Data/DBConcurrencyException.cs
-System.Data/DbType.cs
-System.Data/DefaultValueTypeConverter.cs
-System.Data/DeletedRowInaccessibleException.cs
-System.Data/DuplicateNameException.cs
-System.Data/EvaluateException.cs
-System.Data/FillErrorEventArgs.cs
-System.Data/FillErrorEventHandler.cs
-System.Data/ForeignKeyConstraint.cs
-System.Data/IColumnMapping.cs
-System.Data/IColumnMappingCollection.cs
-System.Data/IDataAdapter.cs
-System.Data/IDataParameter.cs
-System.Data/IDataParameterCollection.cs
-System.Data/IDataReader.cs
-System.Data/IDataRecord.cs
-System.Data/IDbCommand.cs
-System.Data/IDbConnection.cs
-System.Data/IDbDataAdapter.cs
-System.Data/IDbDataParameter.cs
-System.Data/IDbTransaction.cs
-System.Data/InRowChangingEventException.cs
-System.Data/InternalDataCollectionBase.cs
-System.Data/InvalidConstraintException.cs
-System.Data/InvalidExpressionException.cs
-System.Data/ISafeDataRecord.cs
-System.Data/IsolationLevel.cs
-System.Data/ITableMapping.cs
-System.Data/ITableMappingCollection.cs
-System.Data/LoadOption.cs
-System.Data/MappingType.cs
-System.Data/MergeFailedEventArgs.cs
-System.Data/MergeFailedEventHandler.cs
-System.Data/MergeManager.cs
-System.Data/MissingMappingAction.cs
-System.Data/MissingPrimaryKeyException.cs
-System.Data/MissingSchemaAction.cs
-System.Data/Node.cs
-System.Data/NoNullAllowedException.cs
-System.Data/OperationAbortedException.cs
-System.Data/ParameterDirection.cs
-System.Data/PropertyAttributes.cs
-System.Data/PropertyCollection.cs
-System.Data/ReadOnlyException.cs
-System.Data/ResDescriptionAttribute.cs
-System.Data/RowNotInTableException.cs
-System.Data/Rule.cs
-System.Data/SchemaType.cs
-System.Data/SerializationFormat.cs
-System.Data/SchemaSerializationMode.cs
-System.Data/SqlDbType.cs
-System.Data/StateChangeEventArgs.cs
-System.Data/StateChangeEventHandler.cs
-System.Data/StatementCompletedEventArgs.cs
-System.Data/StatementCompletedEventHandler.cs
-System.Data/StatementType.cs
-System.Data/StrongTypingException.cs
-System.Data/SyntaxErrorException.cs
../../build/common/MonoTODOAttribute.cs
-System.Data/TableAdapterSchemaInfo.cs
-System.Data/TypeDataSetGeneratorException.cs
-System.Data/UniqueConstraint.cs
-System.Data/UpdateRowSource.cs
-System.Data/UpdateStatus.cs
-System.Data/VersionNotFoundException.cs
-System.Data/XmlDataInferenceLoader.cs
-System.Data/XmlHelper.cs
-System.Data/XmlDataReader.cs
-System.Data/XmlReadMode.cs
-System.Data/XmlWriteMode.cs
-System.Data/XmlConstants.cs
-System.Data/XmlDiffLoader.cs
-System.Data.Common/CatalogLocation.cs
-System.Data.Common/ComparerFactory.cs
-System.Data.Common/DataAdapter.cs
-System.Data.Common/DataContainer.cs
-System.Data.Common/DbCommandBuilder.cs
-System.Data.Common/DbConnectionStringBuilderHelper.cs
-System.Data.Common/DbCommand.cs
-System.Data.Common/DbConnection.cs
-System.Data.Common/DbDataAdapter.cs
-System.Data.Common/DbDataReader.cs
-System.Data.Common/DbDataSourceEnumerator.cs
-System.Data.Common/DbException.cs
-System.Data.Common/DbMetaDataCollectionNames.cs
-System.Data.Common/DbMetaDataColumnNames.cs
-System.Data.Common/DbParameterCollection.cs
-System.Data.Common/DbParameter.cs
-System.Data.Common/DbProviderFactory.cs
-System.Data.Common/DbProviderSpecificTypePropertyAttribute.cs
-System.Data.Common/DbTable.cs
-System.Data.Common/DbTransaction.cs
-System.Data.Common/DbTypes.cs
-System.Data.Common/ExceptionHelper.cs
-System.Data.Common/GroupByBehavior.cs
-System.Data.Common/IdentifierCase.cs
-System.Data.Common/Index.cs
-System.Data.Common/Key.cs
-System.Data.Common/PermissionHelper.cs
-System.Data.Common/RecordCache.cs
-System.Data.Common/RowUpdatedEventArgs.cs
-System.Data.Common/RowUpdatingEventArgs.cs
-System.Data.Common/SchemaTableColumn.cs
-System.Data.Common/SchemaTableOptionalColumn.cs
-System.Data.Common/SupportedJoinOperators.cs
-System.Data.Common/TaskHelper.cs
-System.Data.SqlTypes/SqlXml.cs
+
+ReferenceSources/NativeOledbWrapper.cs
+ReferenceSources/Res.cs
+ReferenceSources/ResCategoryAttribute.cs
+ReferenceSources/ResDescriptionAttribute.cs
+ReferenceSources/ThisAssembly.cs
+ReferenceSources/Win32NativeMethods.cs
+
+ReferenceSources/mobile_DbConnectionPoolCounters.cs
+
System.Data.Sql/SqlDataSourceEnumerator.cs
System.Data.Sql/SqlNotificationRequest.cs
Microsoft.SqlServer.Server/Format.cs
System.Data.SqlClient/SqlNotificationEventArgs.cs
System.Data.SqlClient/OnChangeEventHandler.cs
System.Data.SqlClient/SqlDecimalExtensions.cs
-System.Data/XmlDataLoader.cs
-System.Data/XmlSchemaDataImporter.cs
-System.Data/XmlSchemaWriter.cs
-System.Data/XmlTableWriter.cs
-System.Xml/XmlDataDocument.cs
-Mono.Data.SqlExpressions/Tokenizer.cs
-Mono.Data.SqlExpressions/Numeric.cs
-Mono.Data.SqlExpressions/Expressions.cs
-Mono.Data.SqlExpressions/Literal.cs
-Mono.Data.SqlExpressions/ColumnReference.cs
-Mono.Data.SqlExpressions/ArithmeticExpressions.cs
-Mono.Data.SqlExpressions/BooleanExpressions.cs
-Mono.Data.SqlExpressions/Comparison.cs
-Mono.Data.SqlExpressions/StringFunctions.cs
-Mono.Data.SqlExpressions/Functions.cs
-Mono.Data.SqlExpressions/Like.cs
-Mono.Data.SqlExpressions/In.cs
-Mono.Data.SqlExpressions/Aggregation.cs
+System.Data.SqlTypes/SqlXml.cs
+
+System.Data.Common/DbTypes.cs
+System.Data.Common/ExceptionHelper.cs
+System.Data.Common/DbConnectionStringBuilderHelper.cs
+
+#include mobile_referencesource.sources
-ReferenceSources/Bid.cs
-ReferenceSources/BidArgumentTypeAttribute.cs
-ReferenceSources/BidMethodAttribute.cs
-ReferenceSources/DataStorage.cs
-ReferenceSources/InOutOfProcHelper.cs
-ReferenceSources/ODB.cs
-ReferenceSources/Res.cs
-ReferenceSources/ResCategoryAttribute.cs
-ReferenceSources/SafeNativeMethods.cs
-ReferenceSources/ThisAssembly.cs
-../../../external/referencesource/System.Data/Misc/HResults.cs
-../../../external/referencesource/System.Data/System/Data/Common/AdapterUtil.cs
-../../../external/referencesource/System.Data/System/Data/Common/DataColumnMapping.cs
-../../../external/referencesource/System.Data/System/Data/Common/DataColumnMappingCollection.cs
-../../../external/referencesource/System.Data/System/Data/Common/DataTableMapping.cs
-../../../external/referencesource/System.Data/System/Data/Common/DataTableMappingCollection.cs
-../../../external/referencesource/System.Data/System/Data/Common/DataRecordInternal.cs
-../../../external/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs
-../../../external/referencesource/System.Data/System/Data/Common/DBConnectionString.cs
-../../../external/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs
-../../../external/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs
-../../../external/referencesource/System.Data/System/Data/Common/DBDataPermission.cs
-../../../external/referencesource/System.Data/System/Data/Common/DBDataPermissionAttribute.cs
-../../../external/referencesource/System.Data/System/Data/Common/dbdatarecord.cs
-../../../external/referencesource/System.Data/System/Data/Common/dbenumerator.cs
-../../../external/referencesource/System.Data/System/Data/Common/FieldNameLookup.cs
-../../../external/referencesource/System.Data/System/Data/Common/NameValuePair.cs
-../../../external/referencesource/System.Data/System/Data/Common/NameValuePermission.cs
-../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs
-../../../external/referencesource/System.Data/System/Data/SqlClient/ApplicationIntent.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/INullable.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLByte.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBytes.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLChars.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SqlCharStream.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDateTime.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDecimal.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDouble.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLGuid.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt16.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt32.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt64.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLMoney.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLResource.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLSingle.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLString.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLUtility.cs
--- /dev/null
+../../../external/referencesource/System.Data/bid/inc/cs/bidPrivateBase.cs
+../../../external/referencesource/System.Data/FxCopSuppressions/Baseline.cs
+../../../external/referencesource/System.Data/FxCopSuppressions/EverettBreaking.cs
+../../../external/referencesource/System.Data/FxCopSuppressions/FxCop40Suppressions.cs
+../../../external/referencesource/System.Data/FxCopSuppressions/Triaged.cs
+../../../external/referencesource/System.Data/Misc/ExternDll.cs
+../../../external/referencesource/System.Data/Misc/HResults.cs
+../../../external/referencesource/System.Data/System/Data/AcceptRejectRule.cs
+../../../external/referencesource/System.Data/System/Data/AggregateType.cs
+../../../external/referencesource/System.Data/System/Data/BaseCollection.cs
+../../../external/referencesource/System.Data/System/Data/CatalogLocation.cs
+../../../external/referencesource/System.Data/System/Data/ColumnTypeConverter.cs
+../../../external/referencesource/System.Data/System/Data/CommandBehavior.cs
+../../../external/referencesource/System.Data/System/Data/CommandType.cs
+../../../external/referencesource/System.Data/System/Data/Common/ActivityCorrelator.cs
+../../../external/referencesource/System.Data/System/Data/Common/AdapterSwitches.cs
+../../../external/referencesource/System.Data/System/Data/Common/AdapterUtil.cs
+../../../external/referencesource/System.Data/System/Data/Common/BigIntegerStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/BooleanStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/ByteStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/CharStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataAdapter.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataColumnMappingCollection.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataColumnMapping.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataRecordInternal.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataTableMappingCollection.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataTableMapping.cs
+../../../external/referencesource/System.Data/System/Data/Common/DateTimeOffsetStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/DateTimeStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBCommandBuilder.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBCommand.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBConnection.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbConnectionPoolKey.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBConnectionString.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbDataAdapter.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBDataPermissionAttribute.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBDataPermission.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbDataReader.cs
+../../../external/referencesource/System.Data/System/Data/Common/dbdatarecord.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbDataSourceEnumerator.cs
+../../../external/referencesource/System.Data/System/Data/Common/dbenumerator.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbException.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbParameterCollection.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBParameter.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbProviderFactory.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbProviderSpecificTypePropertyAttribute.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBSchemaRow.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBSchemaTable.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbTransaction.cs
+../../../external/referencesource/System.Data/System/Data/Common/DecimalStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/DoubleStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/FieldNameLookup.cs
+../../../external/referencesource/System.Data/System/Data/Common/GreenMethods.cs
+../../../external/referencesource/System.Data/System/Data/Common/Groupbybehavior.cs
+../../../external/referencesource/System.Data/System/Data/Common/identifiercase.cs
+../../../external/referencesource/System.Data/System/Data/Common/Int16Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/Int32Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/Int64Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/MultipartIdentifier.cs
+../../../external/referencesource/System.Data/System/Data/Common/NameValuePair.cs
+../../../external/referencesource/System.Data/System/Data/Common/NameValuePermission.cs
+../../../external/referencesource/System.Data/System/Data/Common/ObjectStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/RowUpdatedEventArgs.cs
+../../../external/referencesource/System.Data/System/Data/Common/RowUpdatingEventArgs.cs
+../../../external/referencesource/System.Data/System/Data/Common/SafeNativeMethods.cs
+../../../external/referencesource/System.Data/System/Data/Common/SByteStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SchemaTableColumn.cs
+../../../external/referencesource/System.Data/System/Data/Common/SchemaTableOptionalColumn.cs
+../../../external/referencesource/System.Data/System/Data/Common/SingleStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLConvert.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBinaryStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQlBooleanStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBytesStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLByteStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLCharsStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDecimalStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDoubleStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLGuidStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt16Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt32Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt64Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLMoneyStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLSingleStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLStringStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SqlUDTStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SqlXmlStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/StringStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SupportedJoinOperators.cs
+../../../external/referencesource/System.Data/System/Data/Common/System.Data_BID.cs
+../../../external/referencesource/System.Data/System/Data/Common/TimeSpanStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/UInt16Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/UInt32Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/UInt64Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/UnsafeNativeMethods.cs
+../../../external/referencesource/System.Data/System/Data/ConflictOptions.cs
+../../../external/referencesource/System.Data/System/Data/ConnectionState.cs
+../../../external/referencesource/System.Data/System/Data/ConstraintCollection.cs
+../../../external/referencesource/System.Data/System/Data/ConstraintConverter.cs
+../../../external/referencesource/System.Data/System/Data/Constraint.cs
+../../../external/referencesource/System.Data/System/Data/ConstraintEnumerator.cs
+../../../external/referencesource/System.Data/System/Data/DataColumnChangeEvent.cs
+../../../external/referencesource/System.Data/System/Data/DataColumnChangeEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/DataColumnCollection.cs
+../../../external/referencesource/System.Data/System/Data/DataColumn.cs
+../../../external/referencesource/System.Data/System/Data/DataColumnPropertyDescriptor.cs
+../../../external/referencesource/System.Data/System/Data/DataError.cs
+../../../external/referencesource/System.Data/System/Data/DataException.cs
+../../../external/referencesource/System.Data/System/Data/DataKey.cs
+../../../external/referencesource/System.Data/System/Data/DataRelationCollection.cs
+../../../external/referencesource/System.Data/System/Data/DataRelation.cs
+../../../external/referencesource/System.Data/System/Data/DataRelationPropertyDescriptor.cs
+../../../external/referencesource/System.Data/System/Data/DataRowAction.cs
+../../../external/referencesource/System.Data/System/Data/DataRowChangeEvent.cs
+../../../external/referencesource/System.Data/System/Data/DataRowChangeEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/DataRowCollection.cs
+../../../external/referencesource/System.Data/System/Data/DataRowCreatedEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/DataRow.cs
+../../../external/referencesource/System.Data/System/Data/DataRowState.cs
+../../../external/referencesource/System.Data/System/Data/DataRowVersion.cs
+../../../external/referencesource/System.Data/System/Data/DataRowView.cs
+../../../external/referencesource/System.Data/System/Data/DataSerializationFormat.cs
+../../../external/referencesource/System.Data/System/Data/DataSet.cs
+../../../external/referencesource/System.Data/System/Data/DataSetDateTime.cs
+../../../external/referencesource/System.Data/System/Data/DataSysAttribute.cs
+../../../external/referencesource/System.Data/System/Data/DataTableClearEvent.cs
+../../../external/referencesource/System.Data/System/Data/DataTableClearEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/DataTableCollection.cs
+../../../external/referencesource/System.Data/System/Data/DataTable.cs
+../../../external/referencesource/System.Data/System/Data/DataTableNewRowEvent.cs
+../../../external/referencesource/System.Data/System/Data/DataTableNewRowEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/DataTablePropertyDescriptor.cs
+../../../external/referencesource/System.Data/System/Data/DataTableReader.cs
+../../../external/referencesource/System.Data/System/Data/DataTableReaderListener.cs
+../../../external/referencesource/System.Data/System/Data/DataTableTypeConverter.cs
+../../../external/referencesource/System.Data/System/Data/DataView.cs
+../../../external/referencesource/System.Data/System/Data/DataViewListener.cs
+../../../external/referencesource/System.Data/System/Data/DataViewManager.cs
+../../../external/referencesource/System.Data/System/Data/DataViewManagerListItemTypeDescriptor.cs
+../../../external/referencesource/System.Data/System/Data/DataViewRowState.cs
+../../../external/referencesource/System.Data/System/Data/DataViewSettingCollection.cs
+../../../external/referencesource/System.Data/System/Data/DataViewSetting.cs
+../../../external/referencesource/System.Data/System/Data/DBConcurrencyException.cs
+../../../external/referencesource/System.Data/System/Data/dbtype.cs
+../../../external/referencesource/System.Data/System/Data/DefaultValueTypeConverter.cs
+../../../external/referencesource/System.Data/System/Data/FillErrorEventArgs.cs
+../../../external/referencesource/System.Data/System/Data/FillErrorEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/Filter/AggregateNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/BinaryNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/ConstNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/DataExpression.cs
+../../../external/referencesource/System.Data/System/Data/Filter/ExpressionNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/ExpressionParser.cs
+../../../external/referencesource/System.Data/System/Data/Filter/FilterException.cs
+../../../external/referencesource/System.Data/System/Data/Filter/FunctionNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/IFilter.cs
+../../../external/referencesource/System.Data/System/Data/Filter/LookupNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/NameNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/Operators.cs
+../../../external/referencesource/System.Data/System/Data/Filter/UnaryNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/ZeroOpNode.cs
+../../../external/referencesource/System.Data/System/Data/ForeignKeyConstraint.cs
+../../../external/referencesource/System.Data/System/Data/IColumnMappingCollection.cs
+../../../external/referencesource/System.Data/System/Data/IColumnMapping.cs
+../../../external/referencesource/System.Data/System/Data/IDataAdapter.cs
+../../../external/referencesource/System.Data/System/Data/IDataParameterCollection.cs
+../../../external/referencesource/System.Data/System/Data/IDataParameter.cs
+../../../external/referencesource/System.Data/System/Data/IDataReader.cs
+../../../external/referencesource/System.Data/System/Data/IDataRecord.cs
+../../../external/referencesource/System.Data/System/Data/IDbCommand.cs
+../../../external/referencesource/System.Data/System/Data/IDbConnection.cs
+../../../external/referencesource/System.Data/System/Data/IDbDataAdapter.cs
+../../../external/referencesource/System.Data/System/Data/IDbDataParameter.cs
+../../../external/referencesource/System.Data/System/Data/IDbTransaction.cs
+../../../external/referencesource/System.Data/System/Data/IsolationLevel.cs
+../../../external/referencesource/System.Data/System/Data/ITableMappingCollection.cs
+../../../external/referencesource/System.Data/System/Data/ITableMapping.cs
+../../../external/referencesource/System.Data/System/Data/LoadOption.cs
+../../../external/referencesource/System.Data/System/Data/MappingType.cs
+../../../external/referencesource/System.Data/System/Data/MergeFailedEvent.cs
+../../../external/referencesource/System.Data/System/Data/MergeFailedEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/Merger.cs
+../../../external/referencesource/System.Data/System/Data/MissingMappingAction.cs
+../../../external/referencesource/System.Data/System/Data/MissingSchemaAction.cs
+../../../external/referencesource/System.Data/System/Data/OperationAbortedException.cs
+../../../external/referencesource/System.Data/System/Data/ParameterDirection.cs
+../../../external/referencesource/System.Data/System/Data/PrimaryKeyTypeConverter.cs
+../../../external/referencesource/System.Data/System/Data/PropertyCollection.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DataReaderContainer.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbBuffer.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionClosed.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionFactory.cs
+# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionInternal.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroup.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolIdentity.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolOptions.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataCollectionNames.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataColumnNames.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs
+# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs
+# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbReferenceCollection.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/SchemaMapping.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/TimeoutTimer.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/WrappedIUnknown.cs
+../../../external/referencesource/System.Data/System/Data/Range.cs
+../../../external/referencesource/System.Data/System/Data/RbTree.cs
+../../../external/referencesource/System.Data/System/Data/RecordManager.cs
+../../../external/referencesource/System.Data/System/Data/RecordsAffectedEventArgs.cs
+../../../external/referencesource/System.Data/System/Data/RecordsAffectedEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/RelatedView.cs
+../../../external/referencesource/System.Data/System/Data/RelationshipConverter.cs
+../../../external/referencesource/System.Data/System/Data/Rule.cs
+../../../external/referencesource/System.Data/System/Data/SchemaSerializationMode.cs
+../../../external/referencesource/System.Data/System/Data/SchemaType.cs
+../../../external/referencesource/System.Data/System/Data/Select.cs
+../../../external/referencesource/System.Data/System/Data/Selection.cs
+../../../external/referencesource/System.Data/System/Data/SimpleType.cs
+../../../external/referencesource/System.Data/System/Data/SqlDbType.cs
+../../../external/referencesource/System.Data/System/Data/StateChangeEvent.cs
+../../../external/referencesource/System.Data/System/Data/StateChangeEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/StatementType.cs
+../../../external/referencesource/System.Data/System/Data/UniqueConstraint.cs
+../../../external/referencesource/System.Data/System/Data/UpdateRowSource.cs
+../../../external/referencesource/System.Data/System/Data/updatestatus.cs
+../../../external/referencesource/System.Data/System/Data/XDRSchema.cs
+../../../external/referencesource/System.Data/System/Data/XmlContent.cs
+../../../external/referencesource/System.Data/System/Data/XmlDataLoader.cs
+../../../external/referencesource/System.Data/System/Data/XMLDiffLoader.cs
+../../../external/referencesource/System.Data/System/Data/XmlKeywords.cs
+../../../external/referencesource/System.Data/System/Data/XmlReadMode.cs
+../../../external/referencesource/System.Data/System/Data/xmlsaver.cs
+../../../external/referencesource/System.Data/System/Data/XMLSchema.cs
+../../../external/referencesource/System.Data/System/Data/XmlToDatasetMap.cs
+../../../external/referencesource/System.Data/System/Data/XmlWriteMode.cs
+../../../external/referencesource/System.Data/System/NewXml/BaseTreeIterator.cs
+../../../external/referencesource/System.Data/System/NewXml/DataDocumentXPathNavigator.cs
+../../../external/referencesource/System.Data/System/NewXml/DataPointer.cs
+../../../external/referencesource/System.Data/System/NewXml/DataSetMappper.cs
+../../../external/referencesource/System.Data/System/NewXml/IXmlDataVirtualNode.cs
+../../../external/referencesource/System.Data/System/NewXml/RegionIterator.cs
+../../../external/referencesource/System.Data/System/NewXml/TreeIterator.cs
+../../../external/referencesource/System.Data/System/NewXml/XmlBoundElement.cs
+../../../external/referencesource/System.Data/System/NewXml/XmlDataDocument.cs
+../../../external/referencesource/System.Data/System/NewXml/XmlDataImplementation.cs
+../../../external/referencesource/System.Data/System/NewXml/XPathNodePointer.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbType.cs
+
+../../../external/referencesource/System.Data/System/Data/SqlClient/ApplicationIntent.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/INullable.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLByte.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBytes.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLChars.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SqlCharStream.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDateTime.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDecimal.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDouble.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLGuid.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt16.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt32.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt64.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLMoney.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLResource.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLSingle.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLString.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLUtility.cs
--- /dev/null
+Assembly/AssemblyInfo.cs
+../../build/common/Consts.cs.in
+../../build/common/Locale.cs
+../../build/common/SR.cs
+../../build/common/MonoTODOAttribute.cs
+
+ReferenceSources/NativeOledbWrapper.cs
+ReferenceSources/Res.cs
+ReferenceSources/ResCategoryAttribute.cs
+ReferenceSources/ResDescriptionAttribute.cs
+ReferenceSources/ThisAssembly.cs
+ReferenceSources/Win32NativeMethods.cs
+
+System.Data.Sql/SqlDataSourceEnumerator.cs
+System.Data.Sql/SqlNotificationRequest.cs
+Microsoft.SqlServer.Server/Format.cs
+Microsoft.SqlServer.Server/DataAccessKind.cs
+Microsoft.SqlServer.Server/IBinarySerialize.cs
+Microsoft.SqlServer.Server/InvalidUdtException.cs
+Microsoft.SqlServer.Server/SqlFunctionAttribute.cs
+Microsoft.SqlServer.Server/SqlMetaData.cs
+Microsoft.SqlServer.Server/SqlMethodAttribute.cs
+Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute.cs
+Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute.cs
+Microsoft.SqlServer.Server/SystemDataAccessKind.cs
+Microsoft.SqlServer.Server/SqlFacetAttribute.cs
+Microsoft.SqlServer.Server/TriggerAction.cs
+Microsoft.SqlServer.Server/SqlTriggerContext.cs
+Microsoft.SqlServer.Server/SqlProcedureAttribute.cs
+Microsoft.SqlServer.Server/SqlTriggerAttribute.cs
+System.Data.SqlClient/SortOrder.cs
+System.Data.SqlClient/SqlNotificationType.cs
+System.Data.SqlClient/SqlNotificationInfo.cs
+System.Data.SqlClient/SqlNotificationSource.cs
+System.Data.SqlClient/SqlAsyncState.cs
+System.Data.SqlClient/SqlAsyncResult.cs
+System.Data.SqlClient/SqlClientMetaDataCollectionNames.cs
+System.Data.SqlClient/SqlClientPermission.cs
+System.Data.SqlClient/SqlClientPermissionAttribute.cs
+System.Data.SqlClient/SqlCommand.cs
+System.Data.SqlClient/SqlCommandBuilder.cs
+System.Data.SqlClient/SqlConnection.cs
+System.Data.SqlClient/SqlConnectionStringBuilder.cs
+System.Data.SqlClient/SqlCredential.cs
+System.Data.SqlClient/SqlDataAdapter.cs
+System.Data.SqlClient/SqlDataReader.cs
+System.Data.SqlClient/SqlDataSourceConverter.cs
+System.Data.SqlClient/SqlDependency.cs
+System.Data.SqlClient/SqlError.cs
+System.Data.SqlClient/SqlErrorCollection.cs
+System.Data.SqlClient/SqlException.cs
+System.Data.SqlClient/SqlInfoMessageEventArgs.cs
+System.Data.SqlClient/SqlInfoMessageEventHandler.cs
+System.Data.SqlClient/SqlInitialCatalogConverter.cs
+System.Data.SqlClient/NetworkLibraryConverter.cs
+System.Data.SqlClient/SqlParameter.cs
+System.Data.SqlClient/SqlParameterCollection.cs
+System.Data.SqlClient/SqlParameterConverter.cs
+System.Data.SqlClient/SqlRowUpdatedEventArgs.cs
+System.Data.SqlClient/SqlRowUpdatedEventHandler.cs
+System.Data.SqlClient/SqlRowUpdatingEventArgs.cs
+System.Data.SqlClient/SqlRowUpdatingEventHandler.cs
+System.Data.SqlClient/SqlTransaction.cs
+System.Data.SqlClient/SqlXmlTextReader.cs
+System.Data.SqlClient/SQLDebugging.cs
+System.Data.SqlClient/SqlClientFactory.cs
+System.Data.SqlClient/SqlBulkCopy.cs
+System.Data.SqlClient/SqlBulkCopyOptions.cs
+System.Data.SqlClient/SqlBulkCopyColumnMapping.cs
+System.Data.SqlClient/SqlBulkCopyColumnMappingCollection.cs
+System.Data.SqlClient/SqlRowsCopiedEventHandler.cs
+System.Data.SqlClient/SqlRowsCopiedEventArgs.cs
+System.Data.SqlClient/SqlNotificationEventArgs.cs
+System.Data.SqlClient/OnChangeEventHandler.cs
+System.Data.SqlClient/SqlDecimalExtensions.cs
+System.Data.SqlTypes/SqlXml.cs
+
+System.Data.Common/DbTypes.cs
+System.Data.Common/ExceptionHelper.cs
+System.Data.Common/DbConnectionStringBuilderHelper.cs
+
+#include referencesource.sources
--- /dev/null
+../../../external/referencesource/System.Data/bid/inc/cs/bidPrivateBase.cs
+../../../external/referencesource/System.Data/FxCopSuppressions/Baseline.cs
+../../../external/referencesource/System.Data/FxCopSuppressions/EverettBreaking.cs
+../../../external/referencesource/System.Data/FxCopSuppressions/FxCop40Suppressions.cs
+../../../external/referencesource/System.Data/FxCopSuppressions/Triaged.cs
+../../../external/referencesource/System.Data/Misc/ExternDll.cs
+../../../external/referencesource/System.Data/Misc/HResults.cs
+../../../external/referencesource/System.Data/Misc/PrivilegedConfigurationManager.cs
+../../../external/referencesource/System.Data/System/Data/AcceptRejectRule.cs
+../../../external/referencesource/System.Data/System/Data/AggregateType.cs
+../../../external/referencesource/System.Data/System/Data/BaseCollection.cs
+../../../external/referencesource/System.Data/System/Data/CatalogLocation.cs
+../../../external/referencesource/System.Data/System/Data/CodeGen/datacache.cs
+../../../external/referencesource/System.Data/System/Data/CodeGen/StrongTypingException.cs
+../../../external/referencesource/System.Data/System/Data/ColumnTypeConverter.cs
+../../../external/referencesource/System.Data/System/Data/CommandBehavior.cs
+../../../external/referencesource/System.Data/System/Data/CommandType.cs
+../../../external/referencesource/System.Data/System/Data/Common/ActivityCorrelator.cs
+../../../external/referencesource/System.Data/System/Data/Common/AdapterSwitches.cs
+../../../external/referencesource/System.Data/System/Data/Common/AdapterUtil.cs
+../../../external/referencesource/System.Data/System/Data/Common/BigIntegerStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/BooleanStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/ByteStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/CharStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataAdapter.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataColumnMappingCollection.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataColumnMapping.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataRecordInternal.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataTableMappingCollection.cs
+../../../external/referencesource/System.Data/System/Data/Common/DataTableMapping.cs
+../../../external/referencesource/System.Data/System/Data/Common/DateTimeOffsetStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/DateTimeStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBCommandBuilder.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBCommand.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBConnection.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbConnectionPoolKey.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBConnectionString.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbDataAdapter.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBDataPermissionAttribute.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBDataPermission.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbDataReader.cs
+../../../external/referencesource/System.Data/System/Data/Common/dbdatarecord.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbDataSourceEnumerator.cs
+../../../external/referencesource/System.Data/System/Data/Common/dbenumerator.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbException.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbParameterCollection.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBParameter.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbProviderConfigurationHandler.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbProviderFactoriesConfigurationHandler.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbProviderFactories.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbProviderFactory.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbProviderSpecificTypePropertyAttribute.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBSchemaRow.cs
+../../../external/referencesource/System.Data/System/Data/Common/DBSchemaTable.cs
+../../../external/referencesource/System.Data/System/Data/Common/DbTransaction.cs
+../../../external/referencesource/System.Data/System/Data/Common/DecimalStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/DoubleStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/FieldNameLookup.cs
+../../../external/referencesource/System.Data/System/Data/Common/GreenMethods.cs
+../../../external/referencesource/System.Data/System/Data/Common/Groupbybehavior.cs
+../../../external/referencesource/System.Data/System/Data/Common/HandlerBase.cs
+../../../external/referencesource/System.Data/System/Data/Common/identifiercase.cs
+../../../external/referencesource/System.Data/System/Data/Common/Int16Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/Int32Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/Int64Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/MultipartIdentifier.cs
+../../../external/referencesource/System.Data/System/Data/Common/NameValuePair.cs
+../../../external/referencesource/System.Data/System/Data/Common/NameValuePermission.cs
+../../../external/referencesource/System.Data/System/Data/Common/NativeMethods.cs
+../../../external/referencesource/System.Data/System/Data/Common/ObjectStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/RowUpdatedEventArgs.cs
+../../../external/referencesource/System.Data/System/Data/Common/RowUpdatingEventArgs.cs
+../../../external/referencesource/System.Data/System/Data/Common/SafeNativeMethods.cs
+../../../external/referencesource/System.Data/System/Data/Common/SByteStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SchemaTableColumn.cs
+../../../external/referencesource/System.Data/System/Data/Common/SchemaTableOptionalColumn.cs
+../../../external/referencesource/System.Data/System/Data/Common/SingleStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLConvert.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBinaryStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQlBooleanStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLBytesStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLByteStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLCharsStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDecimalStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLDoubleStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLGuidStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt16Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt32Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLInt64Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLMoneyStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLSingleStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SQLStringStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SqlUDTStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SqlXmlStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/StringStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/SupportedJoinOperators.cs
+../../../external/referencesource/System.Data/System/Data/Common/System.Data_BID.cs
+../../../external/referencesource/System.Data/System/Data/Common/TimeSpanStorage.cs
+../../../external/referencesource/System.Data/System/Data/Common/UInt16Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/UInt32Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/UInt64Storage.cs
+../../../external/referencesource/System.Data/System/Data/Common/UnsafeNativeMethods.cs
+../../../external/referencesource/System.Data/System/Data/ConflictOptions.cs
+../../../external/referencesource/System.Data/System/Data/ConnectionState.cs
+../../../external/referencesource/System.Data/System/Data/ConstraintCollection.cs
+../../../external/referencesource/System.Data/System/Data/ConstraintConverter.cs
+../../../external/referencesource/System.Data/System/Data/Constraint.cs
+../../../external/referencesource/System.Data/System/Data/ConstraintEnumerator.cs
+../../../external/referencesource/System.Data/System/Data/DataColumnChangeEvent.cs
+../../../external/referencesource/System.Data/System/Data/DataColumnChangeEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/DataColumnCollection.cs
+../../../external/referencesource/System.Data/System/Data/DataColumn.cs
+../../../external/referencesource/System.Data/System/Data/DataColumnPropertyDescriptor.cs
+../../../external/referencesource/System.Data/System/Data/DataError.cs
+../../../external/referencesource/System.Data/System/Data/DataException.cs
+../../../external/referencesource/System.Data/System/Data/DataKey.cs
+../../../external/referencesource/System.Data/System/Data/DataRelationCollection.cs
+../../../external/referencesource/System.Data/System/Data/DataRelation.cs
+../../../external/referencesource/System.Data/System/Data/DataRelationPropertyDescriptor.cs
+../../../external/referencesource/System.Data/System/Data/DataRowAction.cs
+../../../external/referencesource/System.Data/System/Data/DataRowChangeEvent.cs
+../../../external/referencesource/System.Data/System/Data/DataRowChangeEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/DataRowCollection.cs
+../../../external/referencesource/System.Data/System/Data/DataRowCreatedEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/DataRow.cs
+../../../external/referencesource/System.Data/System/Data/DataRowState.cs
+../../../external/referencesource/System.Data/System/Data/DataRowVersion.cs
+../../../external/referencesource/System.Data/System/Data/DataRowView.cs
+../../../external/referencesource/System.Data/System/Data/DataSerializationFormat.cs
+../../../external/referencesource/System.Data/System/Data/DataSet.cs
+../../../external/referencesource/System.Data/System/Data/DataSetDateTime.cs
+../../../external/referencesource/System.Data/System/Data/DataSysAttribute.cs
+../../../external/referencesource/System.Data/System/Data/DataTableClearEvent.cs
+../../../external/referencesource/System.Data/System/Data/DataTableClearEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/DataTableCollection.cs
+../../../external/referencesource/System.Data/System/Data/DataTable.cs
+../../../external/referencesource/System.Data/System/Data/DataTableNewRowEvent.cs
+../../../external/referencesource/System.Data/System/Data/DataTableNewRowEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/DataTablePropertyDescriptor.cs
+../../../external/referencesource/System.Data/System/Data/DataTableReader.cs
+../../../external/referencesource/System.Data/System/Data/DataTableReaderListener.cs
+../../../external/referencesource/System.Data/System/Data/DataTableTypeConverter.cs
+../../../external/referencesource/System.Data/System/Data/DataView.cs
+../../../external/referencesource/System.Data/System/Data/DataViewListener.cs
+../../../external/referencesource/System.Data/System/Data/DataViewManager.cs
+../../../external/referencesource/System.Data/System/Data/DataViewManagerListItemTypeDescriptor.cs
+../../../external/referencesource/System.Data/System/Data/DataViewRowState.cs
+../../../external/referencesource/System.Data/System/Data/DataViewSettingCollection.cs
+../../../external/referencesource/System.Data/System/Data/DataViewSetting.cs
+../../../external/referencesource/System.Data/System/Data/DBConcurrencyException.cs
+../../../external/referencesource/System.Data/System/Data/dbtype.cs
+../../../external/referencesource/System.Data/System/Data/DefaultValueTypeConverter.cs
+../../../external/referencesource/System.Data/System/Data/FillErrorEventArgs.cs
+../../../external/referencesource/System.Data/System/Data/FillErrorEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/Filter/AggregateNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/BinaryNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/ConstNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/DataExpression.cs
+../../../external/referencesource/System.Data/System/Data/Filter/ExpressionNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/ExpressionParser.cs
+../../../external/referencesource/System.Data/System/Data/Filter/FilterException.cs
+../../../external/referencesource/System.Data/System/Data/Filter/FunctionNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/IFilter.cs
+../../../external/referencesource/System.Data/System/Data/Filter/LookupNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/NameNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/Operators.cs
+../../../external/referencesource/System.Data/System/Data/Filter/UnaryNode.cs
+../../../external/referencesource/System.Data/System/Data/Filter/ZeroOpNode.cs
+../../../external/referencesource/System.Data/System/Data/ForeignKeyConstraint.cs
+../../../external/referencesource/System.Data/System/Data/IColumnMappingCollection.cs
+../../../external/referencesource/System.Data/System/Data/IColumnMapping.cs
+../../../external/referencesource/System.Data/System/Data/IDataAdapter.cs
+../../../external/referencesource/System.Data/System/Data/IDataParameterCollection.cs
+../../../external/referencesource/System.Data/System/Data/IDataParameter.cs
+../../../external/referencesource/System.Data/System/Data/IDataReader.cs
+../../../external/referencesource/System.Data/System/Data/IDataRecord.cs
+../../../external/referencesource/System.Data/System/Data/IDbCommand.cs
+../../../external/referencesource/System.Data/System/Data/IDbConnection.cs
+../../../external/referencesource/System.Data/System/Data/IDbDataAdapter.cs
+../../../external/referencesource/System.Data/System/Data/IDbDataParameter.cs
+../../../external/referencesource/System.Data/System/Data/IDbTransaction.cs
+../../../external/referencesource/System.Data/System/Data/IsolationLevel.cs
+../../../external/referencesource/System.Data/System/Data/ITableMappingCollection.cs
+../../../external/referencesource/System.Data/System/Data/ITableMapping.cs
+../../../external/referencesource/System.Data/System/Data/LoadOption.cs
+../../../external/referencesource/System.Data/System/Data/MappingType.cs
+../../../external/referencesource/System.Data/System/Data/MergeFailedEvent.cs
+../../../external/referencesource/System.Data/System/Data/MergeFailedEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/Merger.cs
+../../../external/referencesource/System.Data/System/Data/MissingMappingAction.cs
+../../../external/referencesource/System.Data/System/Data/MissingSchemaAction.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/DbDataRecord.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/Odbc32.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcCommandBuilder.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcCommand.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcConnection.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcConnectionFactory.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcConnectionHandle.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcConnectionOpen.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcConnectionPoolProviderInfo.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcConnectionStringbuilder.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcConnectionString.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcDataAdapter.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcDataReader.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcEnvironment.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcEnvironmentHandle.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcErrorCollection.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcError.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcException.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcFactory.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcHandle.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcInfoMessageEvent.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/odbcmetadatacollectionnames.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/odbcmetadatacolumnnames.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/odbcmetadatafactory.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcParameterCollection.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcParameter.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcPermission.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcReferenceCollection.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcRowUpdatingEvent.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcStatementHandle.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcTransaction.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcType.cs
+../../../external/referencesource/System.Data/System/Data/Odbc/OdbcUtils.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/ColumnBinding.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/DBBindings.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/DBPropSet.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbCommandBuilder.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbCommand.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbConnection.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbConnectionFactory.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbConnectionInternal.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbConnectionPoolGroupProviderInfo.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OledbConnectionStringbuilder.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/oledbconnectionstring.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbDataAdapter.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbDataReader.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OLEDB_Enum.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbEnumerator.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbErrorCollection.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbError.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbException.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbFactory.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbHResult.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEvent.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbLiteral.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/oledbmetadatacollectionnames.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/oledbmetadatacolumnnames.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbMetaDataFactory.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbParameterCollection.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbParameter.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbPermission.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbPropertySetGuid.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbPropertyStatus.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbReferenceCollection.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEvent.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEvent.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbSchemaGuid.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbStruct.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbTransaction.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbType.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OLEDB_Util.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbWrapper.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/PropertyAttributes.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/PropertyIDSet.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/PropertyInfoSet.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/RowBinding.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/SafeHandles.cs
+../../../external/referencesource/System.Data/System/Data/OperationAbortedException.cs
+../../../external/referencesource/System.Data/System/Data/ParameterDirection.cs
+../../../external/referencesource/System.Data/System/Data/PrimaryKeyTypeConverter.cs
+../../../external/referencesource/System.Data/System/Data/PropertyCollection.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DataReaderContainer.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbBuffer.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionClosed.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionFactory.cs
+# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionInternal.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolCounters.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroup.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolIdentity.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolOptions.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataCollectionNames.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataColumnNames.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs
+# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs
+# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/DbReferenceCollection.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/SchemaMapping.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/TimeoutTimer.cs
+../../../external/referencesource/System.Data/System/Data/ProviderBase/WrappedIUnknown.cs
+../../../external/referencesource/System.Data/System/Data/Range.cs
+../../../external/referencesource/System.Data/System/Data/RbTree.cs
+../../../external/referencesource/System.Data/System/Data/RecordManager.cs
+../../../external/referencesource/System.Data/System/Data/RecordsAffectedEventArgs.cs
+../../../external/referencesource/System.Data/System/Data/RecordsAffectedEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/RelatedView.cs
+../../../external/referencesource/System.Data/System/Data/RelationshipConverter.cs
+../../../external/referencesource/System.Data/System/Data/Rule.cs
+../../../external/referencesource/System.Data/System/Data/SchemaSerializationMode.cs
+../../../external/referencesource/System.Data/System/Data/SchemaType.cs
+../../../external/referencesource/System.Data/System/Data/Select.cs
+../../../external/referencesource/System.Data/System/Data/Selection.cs
+../../../external/referencesource/System.Data/System/Data/SimpleType.cs
+../../../external/referencesource/System.Data/System/Data/SqlDbType.cs
+../../../external/referencesource/System.Data/System/Data/StateChangeEvent.cs
+../../../external/referencesource/System.Data/System/Data/StateChangeEventHandler.cs
+../../../external/referencesource/System.Data/System/Data/StatementType.cs
+../../../external/referencesource/System.Data/System/Data/UniqueConstraint.cs
+../../../external/referencesource/System.Data/System/Data/UpdateRowSource.cs
+../../../external/referencesource/System.Data/System/Data/updatestatus.cs
+../../../external/referencesource/System.Data/System/Data/XDRSchema.cs
+../../../external/referencesource/System.Data/System/Data/XmlContent.cs
+../../../external/referencesource/System.Data/System/Data/XmlDataLoader.cs
+../../../external/referencesource/System.Data/System/Data/XMLDiffLoader.cs
+../../../external/referencesource/System.Data/System/Data/XmlKeywords.cs
+../../../external/referencesource/System.Data/System/Data/XmlReadMode.cs
+../../../external/referencesource/System.Data/System/Data/xmlsaver.cs
+../../../external/referencesource/System.Data/System/Data/XMLSchema.cs
+../../../external/referencesource/System.Data/System/Data/XmlToDatasetMap.cs
+../../../external/referencesource/System.Data/System/Data/XmlWriteMode.cs
+../../../external/referencesource/System.Data/System/NewXml/BaseTreeIterator.cs
+../../../external/referencesource/System.Data/System/NewXml/DataDocumentXPathNavigator.cs
+../../../external/referencesource/System.Data/System/NewXml/DataPointer.cs
+../../../external/referencesource/System.Data/System/NewXml/DataSetMappper.cs
+../../../external/referencesource/System.Data/System/NewXml/IXmlDataVirtualNode.cs
+../../../external/referencesource/System.Data/System/NewXml/RegionIterator.cs
+../../../external/referencesource/System.Data/System/NewXml/TreeIterator.cs
+../../../external/referencesource/System.Data/System/NewXml/XmlBoundElement.cs
+../../../external/referencesource/System.Data/System/NewXml/XmlDataDocument.cs
+../../../external/referencesource/System.Data/System/NewXml/XmlDataImplementation.cs
+../../../external/referencesource/System.Data/System/NewXml/XPathNodePointer.cs
+
+../../../external/referencesource/System.Data/System/Data/SqlClient/ApplicationIntent.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/INullable.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLByte.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBytes.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLChars.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SqlCharStream.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDateTime.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDecimal.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDouble.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLGuid.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt16.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt32.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt64.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLMoney.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLResource.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLSingle.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLString.cs
+../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLUtility.cs
using System.Reflection;
using System.IO;
+using T = System.Data.TypedDataSetGenerator;
+
namespace System.Data.Design
{
// It is likely replaced by System.Data.TypedDataSetGenerator-based
public static string Generate (DataSet dataSet, CodeNamespace codeNamespace, CodeDomProvider codeProvider)
{
- // See CustomDataclassGenerator.cs
- CustomDataClassGenerator.CreateDataSetClasses (
- dataSet, codeNamespace, codeProvider, null);
-
+ T.Generate (dataSet, codeNamespace, codeProvider.CreateGenerator ());
return null;
}
public static string Generate (string inputFileContent, CodeCompileUnit compileUnit, CodeNamespace mainNamespace, CodeDomProvider codeProvider)
{
- if (inputFileContent == null || inputFileContent.Length < 5)
- return null;
-
- DataSet ds = new DataSet ();
- StringReader sr = new StringReader (inputFileContent);
- ds.ReadXmlSchema (sr as TextReader);
-
- // See CustomDataclassGenerator.cs
- CustomDataClassGenerator.CreateDataSetClasses (
- ds, compileUnit, mainNamespace, codeProvider, null);
-
+ var dataSet = new DataSet ();
+ dataSet.ReadXmlSchema (inputFileContent);
+ T.Generate (dataSet, mainNamespace, codeProvider.CreateGenerator ());
return null;
}
t = lexer.Scan ();
if (!lexer.IsStarStringValue (t)) {
- if (!lexer.TryGetNumericValue (t, out nvalue))
+ long lvalue;
+ if (!lexer.TryGetNumericValue (t, out lvalue))
return false;
- value.Length = nvalue;
+ value.Length = lvalue;
}
t = lexer.Scan ();
sb.Append (entry.Key);
sb.Append (": ");
+ string separator = ",";
+ HeaderInfo headerInfo;
+ if (known_headers.TryGetValue (entry.Key, out headerInfo) && headerInfo.AllowsMany)
+ separator = headerInfo.Separator;
+
bool first = true;
foreach (var v in entry.Value) {
- if (!first)
- sb.Append (", ");
+ if (!first) {
+ sb.Append (separator);
+ sb.Append (" ");
+ }
sb.Append (v);
first = false;
return int.TryParse (GetStringValue (token), NumberStyles.None, CultureInfo.InvariantCulture, out value);
}
+ public bool TryGetNumericValue (Token token, out long value)
+ {
+ return long.TryParse (GetStringValue (token), NumberStyles.None, CultureInfo.InvariantCulture, out value);
+ }
+
public TimeSpan? TryGetTimeSpanValue (Token token)
{
int seconds;
bool token_read;
do {
- int? from = null, to = null;
- int number;
+ long? from = null, to = null;
+ long number;
token_read = false;
t = lexer.Scan (recognizeDash: true);
case Token.Type.Token:
string s = lexer.GetStringValue (t);
var values = s.Split (new [] { '-' }, StringSplitOptions.RemoveEmptyEntries);
- if (!int.TryParse (values[0], out number))
+ if (!Parser.Long.TryParse (values[0], out number))
return false;
switch (values.Length) {
case 2:
from = number;
- if (!int.TryParse (values[1], out number))
+ if (!Parser.Long.TryParse (values[1], out number))
return false;
to = number;
[Test]
public void Parse ()
{
- var res = ContentRangeHeaderValue.Parse ("bytes 0 - 499/ 1234");
+ var res = ContentRangeHeaderValue.Parse ("bytes 0 - 499/ 9223372036854775807");
Assert.AreEqual (0, res.From, "#1");
Assert.AreEqual (499, res.To, "#2");
- Assert.AreEqual (1234, res.Length, "#3");
- Assert.AreEqual ("bytes 0-499/1234", res.ToString (), "#4");
+ Assert.AreEqual (9223372036854775807, res.Length, "#3");
+ Assert.AreEqual ("bytes 0-499/9223372036854775807", res.ToString (), "#4");
res = ContentRangeHeaderValue.Parse ("bytes */ 8");
Assert.IsNull (res.From, "#11");
Assert.AreEqual ("aa: v, v\r\nx: v\r\n", headers.ToString ());
}
+
+ [Test]
+ public void ToString_DifferentSeparator ()
+ {
+ headers.Add ("User-Agent", "MyApp/1.0.0.0 (iOS; 7.1.2; fr_FR) (Apple; iPhone3,1)");
+
+ Assert.AreEqual ("User-Agent: MyApp/1.0.0.0 (iOS; 7.1.2; fr_FR) (Apple; iPhone3,1)\r\n", headers.ToString ());
+ }
}
}
Assert.IsNull (res.Ranges.Skip (1).First ().From, "#53");
Assert.AreEqual (9, res.Ranges.Skip (1).First ().To, "#54");
Assert.AreEqual ("bytes=0-, -9", res.ToString (), "#55");
+
+ res = RangeHeaderValue.Parse ("bytes=3637717541-9223372036854775807");
+ Assert.AreEqual ("bytes", res.Unit, "#60");
+ Assert.AreEqual (3637717541, res.Ranges.First ().From, "#61");
+ Assert.AreEqual (9223372036854775807, res.Ranges.First ().To, "#62");
+ Assert.AreEqual ("bytes=3637717541-9223372036854775807", res.ToString (), "#63");
}
[Test]
--- /dev/null
+//
+// AssemblyInfo.cs
+//
+//
+// 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.Reflection;
+using System.Resources;
+using System.Security;
+using System.Security.Permissions;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+[assembly: AssemblyTitle ("System.ServiceModel.Internals.dll")]
+[assembly: AssemblyDescription ("Contains share code for some System.ServiceModel libraries")]
+[assembly: AssemblyDefaultAlias ("System.ServiceModel.dll")]
+
+[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
+[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
+
+[assembly: NeutralResourcesLanguage ("en-US")]
+[assembly: CLSCompliant (true)]
+[assembly: AssemblyDelaySign (true)]
+#if NET_2_1
+[assembly: AssemblyKeyFile ("../winfx.pub")]
+#else
+[assembly: AssemblyKeyFile ("../ecma.pub")]
+[assembly: AllowPartiallyTrustedCallers]
+[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
+[assembly: SecurityCritical (SecurityCriticalScope.Explicit)]
+#endif
+[assembly: InternalsVisibleTo ("SMDiagnostics, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
+[assembly: InternalsVisibleTo ("System.Runtime.Serialization, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
+[assembly: InternalsVisibleTo ("System.IdentityModel, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
+[assembly: InternalsVisibleTo ("System.IdentityModel.Selectors, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
+[assembly: InternalsVisibleTo ("System.ServiceModel, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
+[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
+
+[assembly: ComVisible (false)]
+
--- /dev/null
+/*
+
+This source is taken from mcs/class/System/System.Diagnostics to make it
+build without adding this public API in System.dll. IF we brought this
+API in mobile world, this will conflict and can be removed.
+
+*/
+
+#if MOBILE
+//
+// System.Diagnostics.EventLogEntryType.cs
+//
+// Authors:
+// Jonathan Pryor (jonpryor@vt.edu)
+//
+// (C) 2002
+//
+
+//
+// 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.Diagnostics;
+
+namespace System.Diagnostics {
+ public enum EventLogEntryType {
+ Error = 0x01,
+ Warning = 0x02,
+ Information = 0x04,
+ SuccessAudit = 0x08,
+ FailureAudit = 0x10
+ }
+}
+
+#endif
--- /dev/null
+namespace System.Runtime {
+
+ internal static class InternalSR {
+ public static string ArgumentNullOrEmpty(string paramName)
+ {
+ return string.Format ("{0} is null or empty");
+ }
+
+ public static string AsyncEventArgsCompletedTwice(Type t)
+ {
+ return string.Format ("AsyncEventArgs completed twice for {0}", t);
+ }
+
+ public static string AsyncEventArgsCompletionPending(Type t)
+ {
+ return string.Format ("AsyncEventArgs completion pending for {0}", t);
+ }
+
+ public static string BufferAllocationFailed(int size)
+ {
+ return string.Format ("Buffer allocation of size {0} failed", size);
+ }
+
+ public static string BufferedOutputStreamQuotaExceeded(int maxSizeQuota)
+ {
+ return string.Format ("Buffered output stream quota exceeded (maxSizeQuota={0})", maxSizeQuota);
+ }
+
+ public static string CannotConvertObject(object source, Type t)
+ {
+ return string.Format ("Cannot convert object {0} to {1}", source, t);
+ }
+
+ public static string EtwAPIMaxStringCountExceeded(object max)
+ {
+ return string.Format ("ETW API max string count exceeded {0}", max);
+ }
+
+ public static string EtwMaxNumberArgumentsExceeded(object max)
+ {
+ return string.Format ("ETW max number arguments exceeded {0}", max);
+ }
+
+ public static string EtwRegistrationFailed(object arg)
+ {
+ return string.Format ("ETW registration failed {0}", arg);
+ }
+
+ public static string FailFastMessage(string description)
+ {
+ return string.Format ("Fail fast: {0}", description);
+ }
+
+ public static string InvalidAsyncResultImplementation(Type t)
+ {
+ return string.Format ("Invalid AsyncResult implementation: {0}", t);
+ }
+
+ public static string LockTimeoutExceptionMessage (object timeout)
+ {
+ return string.Format ("Lock timeout {0}", timeout);
+ }
+
+ public static string ShipAssertExceptionMessage(object description)
+ {
+ return string.Format ("Ship assert exception {0}", description);
+ }
+
+ public static string TaskTimedOutError (object timeout)
+ {
+ return string.Format ("Task timed out error {0}", timeout);
+ }
+
+ public static string TimeoutInputQueueDequeue(object timeout)
+ {
+ return string.Format ("Timeout input queue dequeue {0}", timeout);
+ }
+
+ public static string TimeoutMustBeNonNegative(object argumentName, object timeout)
+ {
+ return string.Format ("Timeout must be non-negative {0} and {1}", argumentName, timeout);
+ }
+
+ public static string TimeoutMustBePositive(string argumentName, object timeout)
+ {
+ return string.Format ("Timeout must be positive {0} {1}", argumentName, timeout);
+ }
+
+ public static string TimeoutOnOperation(object timeout)
+ {
+ return string.Format ("Timeout on operation {0}", timeout);
+ }
+
+ public static string AsyncResultCompletedTwice (Type t)
+ {
+ return string.Format ("AsyncResult Completed Twice for {0}", t);
+ }
+
+ public const string ActionItemIsAlreadyScheduled = "Action Item Is Already Scheduled";
+ public const string AsyncCallbackThrewException = "Async Callback Threw Exception";
+ public const string AsyncResultAlreadyEnded = "Async Result Already Ended";
+ public const string BadCopyToArray = "Bad Copy To Array";
+ public const string BufferIsNotRightSizeForBufferManager = "Buffer Is Not Right Size For Buffer Manager";
+ public const string DictionaryIsReadOnly = "Dictionary Is Read Only";
+ public const string InvalidAsyncResult = "Invalid Async Result";
+ public const string InvalidAsyncResultImplementationGeneric = "Invalid Async Result Implementation Generic";
+ public const string InvalidNullAsyncResult = "Invalid Null Async Result";
+ public const string InvalidSemaphoreExit = "Invalid Semaphore Exit";
+ public const string KeyCollectionUpdatesNotAllowed = "Key Collection Updates Not Allowed";
+ public const string KeyNotFoundInDictionary = "Key Not Found In Dictionary";
+ public const string MustCancelOldTimer = "Must Cancel Old Timer";
+ public const string NullKeyAlreadyPresent = "Null Key Already Present";
+ public const string ReadNotSupported = "Read Not Supported";
+ public const string SFxTaskNotStarted = "SFx Task Not Started";
+ public const string SeekNotSupported = "Seek Not Supported";
+ public const string ThreadNeutralSemaphoreAborted = "Thread Neutral Semaphore Aborted";
+ public const string ValueCollectionUpdatesNotAllowed = "Value Collection Updates Not Allowed";
+ public const string ValueMustBeNonNegative = "Value Must Be Non Negative";
+ }
+}
+
--- /dev/null
+thisdir = class/System.ServiceModel.Internals
+SUBDIRS =
+include ../../build/rules.make
+
+LIBRARY = System.ServiceModel.Internals.dll
+LIB_REFS = System System.Core System.Xml
+ifneq (2.1, $(FRAMEWORK_VERSION))
+ LIB_REFS += System.Configuration
+endif
+LIB_MCS_FLAGS = /unsafe
+
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+
+include ../../build/library.make
--- /dev/null
+../../build/common/Consts.cs
+../../build/common/SR.cs
+EventLogEntryType.cs
+InternalSR.cs
+Assembly/AssemblyInfo.cs
+../../../external/referencesource/System.ServiceModel.Internals/AssemblyInfo.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ActionItem.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AssertHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncCompletionResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncEventArgsCallback.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncEventArgs.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/AsyncWaitHandle.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/BackoffTimeoutHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/BufferedOutputStream.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/CallbackException.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/HopperCache.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/NullableKeyDictionary.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCache.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCacheItem.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ObjectCacheSettings.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/OrderedDictionary.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Collections/ValidatingCollection.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/CompletedAsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ComputerNameFormat.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/ActivityControl.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticEventProvider.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceSource.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DictionaryTraceRecord.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwDiagnosticTrace.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EtwProvider.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventDescriptor.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogCategory.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogEventId.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogger.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventTraceActivity.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/ITraceSourceStringProvider.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/PerformanceCounterNameAttribute.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/StringTraceRecord.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/TraceRecord.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/DiagnosticStrings.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/DuplicateDetector.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ExceptionTrace.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FastAsyncCallback.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FatalException.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/FxCop.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Fx.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/HashHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IAsyncEventArgs.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/InputQueue.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/InternalBufferManager.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Interop/SafeEventLogWriteHandle.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Interop/UnsafeNativeMethods.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadCancellationTokenSource.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadScheduler.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/IOThreadTimer.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/MruCache.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/NameGenerator.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/PartialTrustHelpers.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ReadOnlyDictionaryInternal.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ReadOnlyKeyedCollection.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ScheduleActionItemAsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/SignalGate.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/SynchronizedPool.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TaskExtensions.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/ThreadNeutralSemaphore.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/Ticks.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TimeoutHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceChannel.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceEventLevel.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceEventOpcode.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TraceLevelHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TracePayload.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TypedAsyncResult.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/TypeHelper.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/UrlUtility.cs
+../../../external/referencesource/System.ServiceModel.Internals/System/Runtime/WaitCallbackActionItem.cs
+../../../external/referencesource/System.ServiceModel.Internals/TraceCore.Designer.cs
table = new DataTable ();
view = table.DefaultView;
- table.Columns.Add (new DataColumn ("Amount", typeof (MockNumericFormattable)));
+ table.Columns.Add (new DataColumn ("Amount", typeof (MockNumeric)));
DataRow row = table.NewRow ();
row ["Amount"] = new MockNumericFormattable (1);
Assert.AreEqual (new MockNumericFormattable (1), table.Rows [0] ["Amount"], "#H2");
amountColumnStyle.DoEdit (cm, 0, new Rectangle (new Point (0,0), new Size (100, 100)), false, "INVALID", true);
- Assert.IsTrue (amountColumnStyle.DoCommit (cm, 0), "#I1");
+ Assert.IsFalse (amountColumnStyle.DoCommit (cm, 0), "#I1");
Assert.AreEqual ("INVALID", tb.Text, "#I2");
- Assert.AreEqual ("INVALID", table.Rows [0] ["Amount"], "#I3");
+ //Assert.AreEqual ("INVALID", table.Rows [0] ["Amount"], "#I3");
amountColumnStyle.FormatInfo = new CultureInfo ("en-US");
Assert.AreEqual ("£3.00", tb.Text, "#D1");
Assert.AreEqual (new MockNumericStringConvertable (1), table.Rows [0] ["Amount"], "#D2");
- Assert.IsTrue (amountColumnStyle.DoCommit (cm, cm.Position), "#E1");
+ Assert.IsFalse (amountColumnStyle.DoCommit (cm, cm.Position), "#E1");
Assert.AreEqual ("£3.00", tb.Text, "#E2");
- Assert.AreEqual ("£3.00", table.Rows [0] ["Amount"], "#E3");
+ //Assert.AreEqual ("£3.00", table.Rows [0] ["Amount"], "#E3");
} finally {
Thread.CurrentThread.CurrentCulture = originalCulture;
}
[assembly: InternalsVisibleTo ("System.Runtime.Serialization, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
// System.Xml.Serialization (from Microsoft Silverlight 2.0 SDK) requires access to System.Xml internals
- [assembly: InternalsVisibleTo ("System.Xml.Serialization, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
- [assembly: InternalsVisibleTo ("System.Xml.Linq, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
+ [assembly: InternalsVisibleTo ("System.Xml.Serialization, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
#else
[assembly: AllowPartiallyTrustedCallers]
- [assembly: InternalsVisibleTo ("System.Xml.Linq, PublicKey=00000000000000000400000000000000")]
#endif
+ [assembly: InternalsVisibleTo ("System.Xml.Linq, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull)]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
return ((PropertyInfo) _specifiedMember).CanWrite;
if (_specifiedMember is FieldInfo)
- return ((FieldInfo) _specifiedMember).IsInitOnly;
+ return ! ((FieldInfo) _specifiedMember).IsInitOnly;
return false;
}
XmlSchema.Namespace, XmlSchema.InstanceNamespace, AnotherNamespace,
ANamespace), sw.ToString (), "#3");
}
-
+
+ [Test]
+ public void TestRoundTripSerializeOptionalValueTypeContainer ()
+ {
+ var source = new OptionalValueTypeContainer ();
+ source.IsEmpty = true;
+ source.IsEmptySpecified = true;
+ var ser = new XmlSerializer (typeof (OptionalValueTypeContainer));
+ string xml;
+ using (var t = new StringWriter ()) {
+ ser.Serialize (t, source);
+ xml = t.ToString();
+ }
+ using (var s = new StringReader (xml)) {
+ var obj = (OptionalValueTypeContainer) ser.Deserialize(s);
+ Assert.AreEqual (source.IsEmpty, obj.IsEmpty, "#1");
+ Assert.AreEqual (source.IsEmptySpecified, obj.IsEmptySpecified, "#2");
+ }
+ }
+
[Test]
public void TestSerializePlainContainer ()
{
+++ /dev/null
-//
-// Copyright (C) 2010 Novell Inc. http://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;
-using System.Collections;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Reflection;
-using System.Windows.Markup;
-using System.Xaml.Schema;
-
-namespace System.Windows.Markup
-{
- [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Interface, AllowMultiple = false, Inherited = true)]
- [System.Runtime.CompilerServices.TypeForwardedFrom (Consts.AssemblyWindowsBase)]
- public sealed class ValueSerializerAttribute : Attribute
- {
- public ValueSerializerAttribute (string valueSerializerTypeName)
- {
- ValueSerializerTypeName = valueSerializerTypeName;
- }
-
- public ValueSerializerAttribute (Type valueSerializerType)
- {
- ValueSerializerType = valueSerializerType;
- }
-
- public Type ValueSerializerType { get; private set; }
- public string ValueSerializerTypeName { get; private set; }
- }
-}
-
<Compile Include="System.Windows.Markup\UidPropertyAttribute.cs" />\r
<Compile Include="System.Windows.Markup\UsableDuringInitializationAttribute.cs" />\r
<Compile Include="System.Windows.Markup\ValueSerializer.cs" />\r
- <Compile Include="System.Windows.Markup\ValueSerializerAttribute.cs" />\r
<Compile Include="System.Windows.Markup\WhitespaceSignificantCollectionAttribute.cs" />\r
<Compile Include="System.Windows.Markup\XamlDeferLoadAttribute.cs" />\r
<Compile Include="System.Windows.Markup\XamlSetMarkupExtensionAttribute.cs" />\r
System.Windows.Markup/UidPropertyAttribute.cs
System.Windows.Markup/UsableDuringInitializationAttribute.cs
System.Windows.Markup/ValueSerializer.cs
-System.Windows.Markup/ValueSerializerAttribute.cs
System.Windows.Markup/WhitespaceSignificantCollectionAttribute.cs
System.Windows.Markup/XData.cs
System.Windows.Markup/XamlDeferLoadAttribute.cs
--- /dev/null
+using System;
+using System.Runtime.CompilerServices;
+using System.Threading;
+
+namespace System.Net.Sockets
+{
+ internal sealed class MonoSocketRuntimeWorkItem : IThreadPoolWorkItem
+ {
+ SocketAsyncResult socket_async_result;
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public extern void ExecuteWorkItem();
+
+ public void MarkAborted(ThreadAbortException tae)
+ {
+ }
+ }
+}
\ No newline at end of file
// this version does not throw.
internal void InternalShutdown (SocketShutdown how)
{
- if (!connected || disposed)
+ if (!is_connected || is_disposed)
return;
int error;
- Shutdown_internal (socket, how, out error);
+ Shutdown_internal (safe_handle, how, out error);
}
internal IAsyncResult UnsafeBeginConnect (EndPoint remoteEP, AsyncCallback callback, object state)
internal void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue, bool silent)
{
- if (disposed && closed) {
+ if (is_disposed && is_closed) {
if (silent)
return;
throw new ObjectDisposedException (GetType ().ToString ());
int error;
- SetSocketOption_internal (socket, optionLevel, optionName, null,
+ SetSocketOption_internal (safe_handle, optionLevel, optionName, null,
null, optionValue, out error);
if (!silent && error != 0)
<Compile Include="..\..\..\external\referencesource\System\sys\system\collections\concurrent\BlockingCollection.cs" />\r
<Compile Include="..\..\..\external\referencesource\System\sys\system\collections\concurrent\ConcurrentBag.cs" />\r
<Compile Include="..\..\..\external\referencesource\System\sys\system\threading\Barrier.cs" />\r
+ <Compile Include="..\..\..\external\referencesource\System\sys\system\windows\markup\ValueSerializerAttribute.cs" />\r
<Compile Include="..\..\build\common\SR.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeCompiler.cs" />\r
<Compile Include="..\..\..\external\referencesource\System\sys\system\collections\concurrent\BlockingCollection.cs" />\r
<Compile Include="..\..\..\external\referencesource\System\sys\system\collections\concurrent\ConcurrentBag.cs" />\r
<Compile Include="..\..\..\external\referencesource\System\sys\system\threading\Barrier.cs" />\r
+ <Compile Include="..\..\..\external\referencesource\System\sys\system\windows\markup\ValueSerializerAttribute.cs" />\r
<Compile Include="..\..\build\common\SR.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeCompiler.cs" />\r
<Compile Include="..\..\..\external\referencesource\System\sys\system\collections\concurrent\BlockingCollection.cs" />\r
<Compile Include="..\..\..\external\referencesource\System\sys\system\collections\concurrent\ConcurrentBag.cs" />\r
<Compile Include="..\..\..\external\referencesource\System\sys\system\threading\Barrier.cs" />\r
+ <Compile Include="..\..\..\external\referencesource\System\sys\system\windows\markup\ValueSerializerAttribute.cs" />\r
<Compile Include="..\..\build\common\SR.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeCompiler.cs" />\r
if (!CanWrite)
throw new NotSupportedException ("Stream does not support writing");
+ if (src_offset > src.Length - count)
+ throw new ArgumentException ("Buffer too small. count/offset wrong.");
+
WriteInternal (src, src_offset, count);
}
{
}
- bool closii;
-
- /*protected override void Dispose (bool disposing)
- {
- lock (this) {
- if (!closii) {
-
- closii = true;
- int error = 0;
- Socket.Blocking_internal (handle, false, out error);
- //AbortRegisteredThreads ();
- Socket.Close_internal (handle, out error);
- //Console.Error.WriteLine ("Closed "+ handle);
- }
- }
- base.Dispose (disposing);
- }*/
-
protected override bool ReleaseHandle ()
{
int error = 0;
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
// Sridhar Kulkarni (sridharkulkarni@gmail.com)
// Brian Nickel (brian.nickel@gmail.com)
+// Ludovic Henry (ludovic@xamarin.com)
//
// Copyright (C) 2001, 2002 Phillip Pearson and Ximian, Inc.
// http://www.myelin.co.nz
{
public partial class Socket : IDisposable
{
- private bool islistening;
- private bool useoverlappedIO;
- private const int SOCKET_CLOSED = 10004;
+ const int SOCKET_CLOSED_CODE = 10004;
+ const string TIMEOUT_EXCEPTION_MSG = "A connection attempt failed because the connected party did not properly respond" +
+ "after a period of time, or established connection failed because connected host has failed to respond";
- private static readonly string timeout_exc_msg = "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond";
+ /*
+ * These two fields are looked up by name by the runtime, don't change
+ * their name without also updating the runtime code.
+ */
+ static int ipv4_supported = -1;
+ static int ipv6_supported = -1;
- static void AddSockets (List<Socket> sockets, IList list, string name)
+ /* true if we called Close_internal */
+ bool is_closed;
+
+ bool is_listening;
+ bool use_overlapped_io;
+
+ int linger_timeout;
+
+ /* the field "safe_handle" is looked up by name by the runtime */
+ SafeSocketHandle safe_handle;
+
+ AddressFamily address_family;
+ SocketType socket_type;
+ ProtocolType protocol_type;
+
+ /*
+ * This EndPoint is used when creating new endpoints. Because
+ * there are many types of EndPoints possible,
+ * seed_endpoint.Create(addr) is used for creating new ones.
+ * As such, this value is set on Bind, SentTo, ReceiveFrom,
+ * Connect, etc.
+ */
+ internal EndPoint seed_endpoint = null;
+
+ internal Queue<SocketAsyncWorker> readQ = new Queue<SocketAsyncWorker> (2);
+ internal Queue<SocketAsyncWorker> writeQ = new Queue<SocketAsyncWorker> (2);
+
+ internal bool is_blocking = true;
+ internal bool is_bound;
+
+ /* When true, the socket was connected at the time of the last IO operation */
+ internal bool is_connected;
+
+ internal bool is_disposed;
+ internal bool connect_in_progress;
+
+#region Constructors
+
+ static Socket ()
{
- if (list != null) {
- foreach (Socket sock in list) {
- if (sock == null) // MS throws a NullRef
- throw new ArgumentNullException ("name", "Contains a null element");
- sockets.Add (sock);
+ if (ipv4_supported == -1) {
+ try {
+ Socket tmp = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ tmp.Close();
+
+ ipv4_supported = 1;
+ } catch {
+ ipv4_supported = 0;
}
}
- sockets.Add (null);
+ if (ipv6_supported == -1) {
+ // We need to put a try/catch around ConfigurationManager methods as will always throw an exception
+ // when run in a mono embedded application. This occurs as embedded applications do not have a setup
+ // for application config. The exception is not thrown when called from a normal .NET application.
+ //
+ // We, then, need to guard calls to the ConfigurationManager. If the config is not found or throws an
+ // exception, will fall through to the existing Socket / API directly below in the code.
+ //
+ // Also note that catching ConfigurationErrorsException specifically would require library dependency
+ // System.Configuration, and wanted to avoid that.
+#if !NET_2_1
+#if CONFIGURATION_DEP
+ try {
+ SettingsSection config;
+ config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
+ if (config != null)
+ ipv6_supported = config.Ipv6.Enabled ? -1 : 0;
+ } catch {
+ ipv6_supported = -1;
+ }
+#else
+ try {
+ NetConfig config = System.Configuration.ConfigurationSettings.GetConfig("system.net/settings") as NetConfig;
+ if (config != null)
+ ipv6_supported = config.ipv6Enabled ? -1 : 0;
+ } catch {
+ ipv6_supported = -1;
+ }
+#endif
+#endif
+ if (ipv6_supported != 0) {
+ try {
+ Socket tmp = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
+ tmp.Close();
+
+ ipv6_supported = 1;
+ } catch {
+ ipv6_supported = 0;
+ }
+ }
+ }
}
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Select_internal (ref Socket [] sockets,
- int microSeconds,
- out int error);
- public static void Select (IList checkRead, IList checkWrite, IList checkError, int microSeconds)
- {
- var list = new List<Socket> ();
- AddSockets (list, checkRead, "checkRead");
- AddSockets (list, checkWrite, "checkWrite");
- AddSockets (list, checkError, "checkError");
- if (list.Count == 3) {
- throw new ArgumentNullException ("checkRead, checkWrite, checkError",
- "All the lists are null or empty.");
+ [MonoTODO ("Currently hardcoded to IPv4. Ideally, support v4/v6 dual-stack.")]
+ public Socket (SocketType socketType, ProtocolType protocolType)
+ : this (AddressFamily.InterNetwork, socketType, protocolType)
+ {
+ }
+
+ public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
+ {
+#if NET_2_1 && !MOBILE
+ switch (addressFamily) {
+ case AddressFamily.InterNetwork: // ok
+ case AddressFamily.InterNetworkV6: // ok
+ case AddressFamily.Unknown: // SocketException will be thrown later (with right error #)
+ break;
+ // case AddressFamily.Unspecified:
+ default:
+ throw new ArgumentException ("addressFamily");
+ }
+
+ switch (socketType) {
+ case SocketType.Stream: // ok
+ case SocketType.Unknown: // SocketException will be thrown later (with right error #)
+ break;
+ default:
+ throw new ArgumentException ("socketType");
+ }
+
+ switch (protocolType) {
+ case ProtocolType.Tcp: // ok
+ case ProtocolType.Unspecified: // ok
+ case ProtocolType.Unknown: // SocketException will be thrown later (with right error #)
+ break;
+ default:
+ throw new ArgumentException ("protocolType");
}
-
+#endif
+ this.address_family = addressFamily;
+ this.socket_type = socketType;
+ this.protocol_type = protocolType;
+
int error;
- /*
- * The 'sockets' array contains: READ socket 0-n, null,
- * WRITE socket 0-n, null,
- * ERROR socket 0-n, null
- */
- Socket [] sockets = list.ToArray ();
- Select_internal (ref sockets, microSeconds, out error);
+ var handle = Socket_internal (addressFamily, socketType, protocolType, out error);
+
+ this.safe_handle = new SafeSocketHandle (handle, true);
if (error != 0)
throw new SocketException (error);
- if (sockets == null) {
- if (checkRead != null)
- checkRead.Clear ();
- if (checkWrite != null)
- checkWrite.Clear ();
- if (checkError != null)
- checkError.Clear ();
- return;
- }
+#if !NET_2_1 || MOBILE
+ SocketDefaults ();
+#endif
+ }
- int mode = 0;
- int count = sockets.Length;
- IList currentList = checkRead;
- int currentIdx = 0;
- for (int i = 0; i < count; i++) {
- Socket sock = sockets [i];
- if (sock == null) { // separator
- if (currentList != null) {
- // Remove non-signaled sockets after the current one
- int to_remove = currentList.Count - currentIdx;
- for (int k = 0; k < to_remove; k++)
- currentList.RemoveAt (currentIdx);
- }
- currentList = (mode == 0) ? checkWrite : checkError;
- currentIdx = 0;
- mode++;
- continue;
- }
+#if !MOBILE
+ public Socket (SocketInformation socketInformation)
+ {
+ this.is_listening = (socketInformation.Options & SocketInformationOptions.Listening) != 0;
+ this.is_connected = (socketInformation.Options & SocketInformationOptions.Connected) != 0;
+ this.is_blocking = (socketInformation.Options & SocketInformationOptions.NonBlocking) == 0;
+ this.use_overlapped_io = (socketInformation.Options & SocketInformationOptions.UseOnlyOverlappedIO) != 0;
- if (mode == 1 && currentList == checkWrite && !sock.connected) {
- if ((int) sock.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error) == 0)
- sock.connected = true;
- }
+ var result = Mono.DataConverter.Unpack ("iiiil", socketInformation.ProtocolInformation, 0);
- // Remove non-signaled sockets before the current one
- //int max = currentList.Count;
- while (((Socket) currentList [currentIdx]) != sock) {
- currentList.RemoveAt (currentIdx);
- }
- currentIdx++;
- }
+ this.address_family = (AddressFamily) (int) result [0];
+ this.socket_type = (SocketType) (int) result [1];
+ this.protocol_type = (ProtocolType) (int) result [2];
+ this.is_bound = (ProtocolType) (int) result [3] != 0;
+ this.safe_handle = new SafeSocketHandle ((IntPtr) (long) result [4], true);
+
+ SocketDefaults ();
}
+#endif
- // private constructor used by Accept, which already
- // has a socket handle to use
- internal Socket(AddressFamily family, SocketType type,
- ProtocolType proto, SafeSocketHandle sock)
+ /* private constructor used by Accept, which already has a socket handle to use */
+ internal Socket(AddressFamily family, SocketType type, ProtocolType proto, SafeSocketHandle safe_handle)
{
- address_family=family;
- socket_type=type;
- protocol_type=proto;
+ this.address_family = family;
+ this.socket_type = type;
+ this.protocol_type = proto;
- socket=sock;
- connected=true;
+ this.safe_handle = safe_handle;
+ this.is_connected = true;
+ }
+
+ ~Socket ()
+ {
+ Dispose (false);
}
- private void SocketDefaults ()
+ void SocketDefaults ()
{
try {
- if (address_family == AddressFamily.InterNetwork /* Need to test IPv6 further ||
- address_family == AddressFamily.InterNetworkV6 */) {
- /* This is the default, but it
- * probably has nasty side
- * effects on Linux, as the
- * socket option is kludged by
- * turning on or off PMTU
- * discovery...
- */
+ /* Need to test IPv6 further */
+ if (address_family == AddressFamily.InterNetwork
+ // || address_family == AddressFamily.InterNetworkV6
+ ) {
+ /* This is the default, but it probably has nasty side
+ * effects on Linux, as the socket option is kludged by
+ * turning on or off PMTU discovery... */
this.DontFragment = false;
}
- //
- // Microsoft sets these to 8192, but we are going to keep them
- // both to the OS defaults as these have a big performance impact.
- // on WebClient performance.
- //
- //this.ReceiveBufferSize = 8192;
- //this.SendBufferSize = 8192;
+ /* Microsoft sets these to 8192, but we are going to keep them
+ * both to the OS defaults as these have a big performance impact.
+ * on WebClient performance. */
+ // this.ReceiveBufferSize = 8192;
+ // this.SendBufferSize = 8192;
} catch (SocketException) {
}
}
-#if !MOBILE
- public Socket (SocketInformation socketInformation)
- {
- var options = socketInformation.Options;
- islistening = (options & SocketInformationOptions.Listening) != 0;
- connected = (options & SocketInformationOptions.Connected) != 0;
- blocking = (options & SocketInformationOptions.NonBlocking) == 0;
- useoverlappedIO = (options & SocketInformationOptions.UseOnlyOverlappedIO) != 0;
+ /* Creates a new system socket, returning the handle */
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern IntPtr Socket_internal (AddressFamily family, SocketType type, ProtocolType proto, out int error);
- var result = Mono.DataConverter.Unpack ("iiiil", socketInformation.ProtocolInformation, 0);
-
- address_family = (AddressFamily) (int) result [0];
- socket_type = (SocketType) (int) result [1];
- protocol_type = (ProtocolType) (int) result [2];
- isbound = (ProtocolType) (int) result [3] != 0;
- socket = new SafeSocketHandle ((IntPtr) (long) result [4], true);
- SocketDefaults ();
+#endregion
+
+#region Properties
+
+ public static bool SupportsIPv4 {
+ get { return ipv4_supported == 1; }
+ }
+
+ [ObsoleteAttribute ("Use OSSupportsIPv6 instead")]
+ public static bool SupportsIPv6 {
+ get { return ipv6_supported == 1; }
+ }
+
+#if NET_2_1
+ public static bool OSSupportsIPv4 {
+ get { return ipv4_supported == 1; }
}
#endif
-
- // Returns the amount of data waiting to be read on socket
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Available_internal(IntPtr socket, out int error);
- private static int Available_internal (SafeSocketHandle safeHandle, out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- return Available_internal (safeHandle.DangerousGetHandle (), out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
+#if NET_2_1
+ public static bool OSSupportsIPv6 {
+ get { return ipv6_supported == 1; }
+ }
+#else
+ public static bool OSSupportsIPv6 {
+ get {
+ NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces ();
+
+ foreach (NetworkInterface adapter in nics) {
+ if (adapter.Supports (NetworkInterfaceComponent.IPv6))
+ return true;
+ }
+
+ return false;
}
}
+#endif
public int Available {
get {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
int ret, error;
-
- ret = Available_internal(socket, out error);
+ ret = Available_internal (safe_handle, out error);
if (error != 0)
throw new SocketException (error);
- return(ret);
+ return ret;
+ }
+ }
+
+ static int Available_internal (SafeSocketHandle safeHandle, out int error)
+ {
+ bool release = false;
+ try {
+ safeHandle.DangerousAddRef (ref release);
+ return Available_internal (safeHandle.DangerousGetHandle (), out error);
+ } finally {
+ if (release)
+ safeHandle.DangerousRelease ();
}
}
+ /* Returns the amount of data waiting to be read on socket */
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static int Available_internal (IntPtr socket, out int error);
public bool DontFragment {
get {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
-
- bool dontfragment;
-
- if (address_family == AddressFamily.InterNetwork) {
- dontfragment = (int)(GetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment)) != 0;
- } else if (address_family == AddressFamily.InterNetworkV6) {
- dontfragment = (int)(GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment)) != 0;
- } else {
+ ThrowIfDisposedAndClosed ();
+
+ switch (address_family) {
+ case AddressFamily.InterNetwork:
+ return ((int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment)) != 0;
+ case AddressFamily.InterNetworkV6:
+ return ((int) GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment)) != 0;
+ default:
throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
}
-
- return(dontfragment);
}
set {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
-
- if (address_family == AddressFamily.InterNetwork) {
- SetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment, value?1:0);
- } else if (address_family == AddressFamily.InterNetworkV6) {
- SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment, value?1:0);
- } else {
+ ThrowIfDisposedAndClosed ();
+
+ switch (address_family) {
+ case AddressFamily.InterNetwork:
+ SetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment, value ? 1 : 0);
+ break;
+ case AddressFamily.InterNetworkV6:
+ SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment, value ? 1 : 0);
+ break;
+ default:
throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
}
}
public bool EnableBroadcast {
get {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
+ ThrowIfDisposedAndClosed ();
- if (protocol_type != ProtocolType.Udp) {
- throw new SocketException ((int)SocketError.ProtocolOption);
- }
-
- return((int)(GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast)) != 0);
+ if (protocol_type != ProtocolType.Udp)
+ throw new SocketException ((int) SocketError.ProtocolOption);
+
+ return ((int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast)) != 0;
}
set {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
+ ThrowIfDisposedAndClosed ();
- if (protocol_type != ProtocolType.Udp) {
- throw new SocketException ((int)SocketError.ProtocolOption);
- }
+ if (protocol_type != ProtocolType.Udp)
+ throw new SocketException ((int) SocketError.ProtocolOption);
- SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast, value?1:0);
+ SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast, value ? 1 : 0);
}
}
-
+
public bool ExclusiveAddressUse {
get {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
+ ThrowIfDisposedAndClosed ();
- return((int)(GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse)) != 0);
+ return ((int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse)) != 0;
}
set {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
- if (isbound) {
+ ThrowIfDisposedAndClosed ();
+
+ if (is_bound)
throw new InvalidOperationException ("Bind has already been called for this socket");
- }
-
- SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, value?1:0);
+
+ SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, value ? 1 : 0);
}
}
-
+
public bool IsBound {
get {
- return(isbound);
+ return is_bound;
}
}
-
+
public LingerOption LingerState {
get {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
+ ThrowIfDisposedAndClosed ();
- return((LingerOption)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger));
+ return (LingerOption) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger);
}
set {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
-
- SetSocketOption (SocketOptionLevel.Socket,
- SocketOptionName.Linger,
- value);
+ ThrowIfDisposedAndClosed ();
+ SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger, value);
}
}
-
+
public bool MulticastLoopback {
get {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
-
- /* Even though this option can be set
- * for TCP sockets on Linux, throw
- * this exception anyway to be
- * compatible (the MSDN docs say
- * "Setting this property on a
- * Transmission Control Protocol (TCP)
- * socket will have no effect." but
- * the MS runtime throws the
- * exception...)
- */
- if (protocol_type == ProtocolType.Tcp) {
+ ThrowIfDisposedAndClosed ();
+
+ /* Even though this option can be set for TCP sockets on Linux, throw
+ * this exception anyway to be compatible (the MSDN docs say
+ * "Setting this property on a Transmission Control Protocol (TCP)
+ * socket will have no effect." but the MS runtime throws the
+ * exception...) */
+ if (protocol_type == ProtocolType.Tcp)
throw new SocketException ((int)SocketError.ProtocolOption);
- }
-
- bool multicastloopback;
-
- if (address_family == AddressFamily.InterNetwork) {
- multicastloopback = (int)(GetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback)) != 0;
- } else if (address_family == AddressFamily.InterNetworkV6) {
- multicastloopback = (int)(GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.MulticastLoopback)) != 0;
- } else {
+
+ switch (address_family) {
+ case AddressFamily.InterNetwork:
+ return ((int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback)) != 0;
+ case AddressFamily.InterNetworkV6:
+ return ((int) GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.MulticastLoopback)) != 0;
+ default:
throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
}
-
- return(multicastloopback);
}
set {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
-
- /* Even though this option can be set
- * for TCP sockets on Linux, throw
- * this exception anyway to be
- * compatible (the MSDN docs say
- * "Setting this property on a
- * Transmission Control Protocol (TCP)
- * socket will have no effect." but
- * the MS runtime throws the
- * exception...)
- */
- if (protocol_type == ProtocolType.Tcp) {
+ ThrowIfDisposedAndClosed ();
+
+ /* Even though this option can be set for TCP sockets on Linux, throw
+ * this exception anyway to be compatible (the MSDN docs say
+ * "Setting this property on a Transmission Control Protocol (TCP)
+ * socket will have no effect." but the MS runtime throws the
+ * exception...) */
+ if (protocol_type == ProtocolType.Tcp)
throw new SocketException ((int)SocketError.ProtocolOption);
- }
-
- if (address_family == AddressFamily.InterNetwork) {
- SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback, value?1:0);
- } else if (address_family == AddressFamily.InterNetworkV6) {
- SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.MulticastLoopback, value?1:0);
- } else {
+
+ switch (address_family) {
+ case AddressFamily.InterNetwork:
+ SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback, value ? 1 : 0);
+ break;
+ case AddressFamily.InterNetworkV6:
+ SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.MulticastLoopback, value ? 1 : 0);
+ break;
+ default:
throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
}
}
}
-
-
+
[MonoTODO ("This doesn't do anything on Mono yet")]
public bool UseOnlyOverlappedIO {
- get {
- return(useoverlappedIO);
- }
- set {
- useoverlappedIO = value;
- }
+ get { return use_overlapped_io; }
+ set { use_overlapped_io = value; }
}
public IntPtr Handle {
- get {
- return(socket.DangerousGetHandle ());
- }
- }
-
- // Returns the local endpoint details in addr and port
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static SocketAddress LocalEndPoint_internal(IntPtr socket, int family, out int error);
-
- private static SocketAddress LocalEndPoint_internal(SafeSocketHandle safeHandle, int family, out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- return LocalEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
+ get { return safe_handle.DangerousGetHandle (); }
}
// Wish: support non-IP endpoints.
public EndPoint LocalEndPoint {
get {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- /*
- * If the seed EndPoint is null, Connect, Bind,
- * etc has not yet been called. MS returns null
- * in this case.
- */
+ ThrowIfDisposedAndClosed ();
+
+ /* If the seed EndPoint is null, Connect, Bind, etc has not yet
+ * been called. MS returns null in this case. */
if (seed_endpoint == null)
return null;
-
- SocketAddress sa;
+
int error;
-
- sa=LocalEndPoint_internal(socket, (int) address_family, out error);
+ SocketAddress sa = LocalEndPoint_internal (safe_handle, (int) address_family, out error);
if (error != 0)
throw new SocketException (error);
}
}
- public SocketType SocketType {
- get {
- return(socket_type);
+ static SocketAddress LocalEndPoint_internal (SafeSocketHandle safeHandle, int family, out int error)
+ {
+ bool release = false;
+ try {
+ safeHandle.DangerousAddRef (ref release);
+ return LocalEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
+ } finally {
+ if (release)
+ safeHandle.DangerousRelease ();
}
}
+ /* Returns the local endpoint details in addr and port */
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static SocketAddress LocalEndPoint_internal (IntPtr socket, int family, out int error);
+
+ public SocketType SocketType {
+ get { return socket_type; }
+ }
+
public int SendTimeout {
get {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- return (int)GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.SendTimeout);
+ return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendTimeout);
}
set {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
if (value < -1)
throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than -1");
- /* According to the MSDN docs we
- * should adjust values between 1 and
- * 499 to 500, but the MS runtime
- * doesn't do this.
- */
+ /* According to the MSDN docs we should adjust values between 1 and
+ * 499 to 500, but the MS runtime doesn't do this. */
if (value == -1)
value = 0;
- SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.SendTimeout, value);
+ SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, value);
}
}
public int ReceiveTimeout {
get {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- return (int)GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.ReceiveTimeout);
+ return (int) GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout);
}
set {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
if (value < -1)
throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than -1");
- if (value == -1) {
+ if (value == -1)
value = 0;
- }
-
- SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.ReceiveTimeout, value);
+
+ SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, value);
}
}
- public bool AcceptAsync (SocketAsyncEventArgs e)
- {
- // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
- if (!IsBound)
- throw new InvalidOperationException ("You must call the Bind method before performing this operation.");
- if (!islistening)
- throw new InvalidOperationException ("You must call the Listen method before performing this operation.");
- if (e.BufferList != null)
- throw new ArgumentException ("Multiple buffers cannot be used with this method.");
- if (e.Count < 0)
- throw new ArgumentOutOfRangeException ("e.Count");
+ public AddressFamily AddressFamily {
+ get { return address_family; }
+ }
- Socket acceptSocket = e.AcceptSocket;
- if (acceptSocket != null) {
- if (acceptSocket.IsBound || acceptSocket.Connected)
- throw new InvalidOperationException ("AcceptSocket: The socket must not be bound or connected.");
- }
+ public bool Blocking {
+ get { return is_blocking; }
+ set {
+ ThrowIfDisposedAndClosed ();
- e.curSocket = this;
- Worker w = e.Worker;
- w.Init (this, e, SocketOperation.Accept);
- int count;
- lock (readQ) {
- readQ.Enqueue (e.Worker);
- count = readQ.Count;
+ int error;
+ Blocking_internal (safe_handle, value, out error);
+
+ if (error != 0)
+ throw new SocketException (error);
+
+ is_blocking = value;
}
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, w.result);
- return true;
}
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static IntPtr Accept_internal(IntPtr sock, out int error, bool blocking);
- private static SafeSocketHandle Accept_internal(SafeSocketHandle safeHandle, out int error, bool blocking)
+ static void Blocking_internal (SafeSocketHandle safeHandle, bool block, out int error)
{
+ bool release = false;
try {
- safeHandle.RegisterForBlockingSyscall ();
- var ret = Accept_internal (safeHandle.DangerousGetHandle (), out error, blocking);
- return new SafeSocketHandle (ret, true);
+ safeHandle.DangerousAddRef (ref release);
+ Blocking_internal (safeHandle.DangerousGetHandle (), block, out error);
} finally {
- safeHandle.UnRegisterForBlockingSyscall ();
+ if (release)
+ safeHandle.DangerousRelease ();
}
}
- public Socket Accept() {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ internal extern static void Blocking_internal(IntPtr socket, bool block, out int error);
+
+ public bool Connected {
+ get { return is_connected; }
+ internal set { is_connected = value; }
+ }
+
+ public ProtocolType ProtocolType {
+ get { return protocol_type; }
+ }
+
+ public bool NoDelay {
+ get {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfUdp ();
+
+ return ((int) GetSocketOption (SocketOptionLevel.Tcp, SocketOptionName.NoDelay)) != 0;
+ }
+
+ set {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfUdp ();
+
+ SetSocketOption (SocketOptionLevel.Tcp, SocketOptionName.NoDelay, value ? 1 : 0);
+ }
+ }
+
+ public int ReceiveBufferSize {
+ get {
+ ThrowIfDisposedAndClosed ();
+
+ return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer);
+ }
+ set {
+ ThrowIfDisposedAndClosed ();
+
+ if (value < 0)
+ throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
+
+ SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, value);
+ }
+ }
+
+ public int SendBufferSize {
+ get {
+ ThrowIfDisposedAndClosed ();
+
+ return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendBuffer);
+ }
+ set {
+ ThrowIfDisposedAndClosed ();
+
+ if (value < 0)
+ throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
+
+ SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendBuffer, value);
+ }
+ }
+
+ public short Ttl {
+ get {
+ ThrowIfDisposedAndClosed ();
+
+ switch (address_family) {
+ case AddressFamily.InterNetwork:
+ return (short) (int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive);
+ case AddressFamily.InterNetworkV6:
+ return (short) (int) GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit);
+ default:
+ throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
+ }
+ }
+ set {
+ ThrowIfDisposedAndClosed ();
+
+ if (value < 0)
+ throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
+
+ switch (address_family) {
+ case AddressFamily.InterNetwork:
+ SetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive, value);
+ break;
+ case AddressFamily.InterNetworkV6:
+ SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit, value);
+ break;
+ default:
+ throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
+ }
+ }
+ }
+
+ public EndPoint RemoteEndPoint {
+ get {
+ ThrowIfDisposedAndClosed ();
+
+ /* If the seed EndPoint is null, Connect, Bind, etc has
+ * not yet been called. MS returns null in this case. */
+ if (!is_connected || seed_endpoint == null)
+ return null;
+
+ int error;
+ SocketAddress sa = RemoteEndPoint_internal (safe_handle, (int) address_family, out error);
+
+ if (error != 0)
+ throw new SocketException (error);
+
+ return seed_endpoint.Create (sa);
+ }
+ }
+
+ static SocketAddress RemoteEndPoint_internal (SafeSocketHandle safeHandle, int family, out int error)
+ {
+ bool release = false;
+ try {
+ safeHandle.DangerousAddRef (ref release);
+ return RemoteEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
+ } finally {
+ if (release)
+ safeHandle.DangerousRelease ();
+ }
+ }
+
+ /* Returns the remote endpoint details in addr and port */
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static SocketAddress RemoteEndPoint_internal (IntPtr socket, int family, out int error);
+
+#endregion
+
+#region Select
+
+ public static void Select (IList checkRead, IList checkWrite, IList checkError, int microSeconds)
+ {
+ var list = new List<Socket> ();
+ AddSockets (list, checkRead, "checkRead");
+ AddSockets (list, checkWrite, "checkWrite");
+ AddSockets (list, checkError, "checkError");
+
+ if (list.Count == 3)
+ throw new ArgumentNullException ("checkRead, checkWrite, checkError", "All the lists are null or empty.");
+
+ /* The 'sockets' array contains:
+ * - READ socket 0-n, null,
+ * - WRITE socket 0-n, null,
+ * - ERROR socket 0-n, null */
+ Socket [] sockets = list.ToArray ();
+
+ int error;
+ Select_internal (ref sockets, microSeconds, out error);
+
+ if (error != 0)
+ throw new SocketException (error);
+
+ if (sockets == null) {
+ if (checkRead != null)
+ checkRead.Clear ();
+ if (checkWrite != null)
+ checkWrite.Clear ();
+ if (checkError != null)
+ checkError.Clear ();
+ return;
+ }
+
+ int mode = 0;
+ int count = sockets.Length;
+ IList currentList = checkRead;
+ int currentIdx = 0;
+ for (int i = 0; i < count; i++) {
+ Socket sock = sockets [i];
+ if (sock == null) { // separator
+ if (currentList != null) {
+ // Remove non-signaled sockets after the current one
+ int to_remove = currentList.Count - currentIdx;
+ for (int k = 0; k < to_remove; k++)
+ currentList.RemoveAt (currentIdx);
+ }
+ currentList = (mode == 0) ? checkWrite : checkError;
+ currentIdx = 0;
+ mode++;
+ continue;
+ }
+
+ if (mode == 1 && currentList == checkWrite && !sock.is_connected) {
+ if ((int) sock.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error) == 0)
+ sock.is_connected = true;
+ }
+
+ /* Remove non-signaled sockets before the current one */
+ while (((Socket) currentList [currentIdx]) != sock)
+ currentList.RemoveAt (currentIdx);
+
+ currentIdx++;
+ }
+ }
+
+ static void AddSockets (List<Socket> sockets, IList list, string name)
+ {
+ if (list != null) {
+ foreach (Socket sock in list) {
+ if (sock == null) // MS throws a NullRef
+ throw new ArgumentNullException ("name", "Contains a null element");
+ sockets.Add (sock);
+ }
+ }
+
+ sockets.Add (null);
+ }
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static void Select_internal (ref Socket [] sockets, int microSeconds, out int error);
+
+#endregion
+
+#region Poll
+
+ public bool Poll (int time_us, SelectMode mode)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (mode != SelectMode.SelectRead && mode != SelectMode.SelectWrite && mode != SelectMode.SelectError)
+ throw new NotSupportedException ("'mode' parameter is not valid.");
+
+ int error;
+ bool result = Poll_internal (safe_handle, mode, time_us, out error);
+
+ if (error != 0)
+ throw new SocketException (error);
+
+ if (mode == SelectMode.SelectWrite && result && !is_connected) {
+ /* Update the is_connected state; for non-blocking Connect()
+ * this is when we can find out that the connect succeeded. */
+ if ((int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error) == 0)
+ is_connected = true;
+ }
+
+ return result;
+ }
+
+ static bool Poll_internal (SafeSocketHandle safeHandle, SelectMode mode, int timeout, out int error)
+ {
+ bool release = false;
+ try {
+ safeHandle.DangerousAddRef (ref release);
+ return Poll_internal (safeHandle.DangerousGetHandle (), mode, timeout, out error);
+ } finally {
+ if (release)
+ safeHandle.DangerousRelease ();
+ }
+ }
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static bool Poll_internal (IntPtr socket, SelectMode mode, int timeout, out int error);
+
+#endregion
+
+#region Accept
+
+ public Socket Accept()
+ {
+ ThrowIfDisposedAndClosed ();
int error = 0;
- var sock = Accept_internal(socket, out error, blocking);
+ SafeSocketHandle safe_handle = Accept_internal (this.safe_handle, out error, is_blocking);
if (error != 0) {
- if (closed)
- error = SOCKET_CLOSED;
+ if (is_closed)
+ error = SOCKET_CLOSED_CODE;
throw new SocketException(error);
}
- Socket accepted = new Socket(this.AddressFamily, this.SocketType,
- this.ProtocolType, sock);
+ Socket accepted = new Socket (this.AddressFamily, this.SocketType, this.ProtocolType, safe_handle) {
+ seed_endpoint = this.seed_endpoint,
+ Blocking = this.Blocking,
+ };
- accepted.seed_endpoint = this.seed_endpoint;
- accepted.Blocking = this.Blocking;
- return(accepted);
+ return accepted;
}
internal void Accept (Socket acceptSocket)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
+ ThrowIfDisposedAndClosed ();
+
int error = 0;
- var sock = Accept_internal (socket, out error, blocking);
-
+ SafeSocketHandle safe_handle = Accept_internal (this.safe_handle, out error, is_blocking);
+
if (error != 0) {
- if (closed)
- error = SOCKET_CLOSED;
+ if (is_closed)
+ error = SOCKET_CLOSED_CODE;
throw new SocketException (error);
}
-
+
acceptSocket.address_family = this.AddressFamily;
acceptSocket.socket_type = this.SocketType;
acceptSocket.protocol_type = this.ProtocolType;
- acceptSocket.socket = sock;
- acceptSocket.connected = true;
+ acceptSocket.safe_handle = safe_handle;
+ acceptSocket.is_connected = true;
acceptSocket.seed_endpoint = this.seed_endpoint;
acceptSocket.Blocking = this.Blocking;
- /* FIXME: figure out what if anything else
- * needs to be reset
- */
+ // FIXME: figure out what if anything else needs to be reset
+ }
+
+ public bool AcceptAsync (SocketAsyncEventArgs e)
+ {
+ // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
+
+ ThrowIfDisposedAndClosed ();
+
+ if (!is_bound)
+ throw new InvalidOperationException ("You must call the Bind method before performing this operation.");
+ if (!is_listening)
+ throw new InvalidOperationException ("You must call the Listen method before performing this operation.");
+ if (e.BufferList != null)
+ throw new ArgumentException ("Multiple buffers cannot be used with this method.");
+ if (e.Count < 0)
+ throw new ArgumentOutOfRangeException ("e.Count");
+
+ Socket acceptSocket = e.AcceptSocket;
+ if (acceptSocket != null) {
+ if (acceptSocket.is_bound || acceptSocket.is_connected)
+ throw new InvalidOperationException ("AcceptSocket: The socket must not be bound or connected.");
+ }
+
+ e.curSocket = this;
+ e.Worker.Init (this, e, SocketOperation.Accept);
+
+ SocketAsyncResult sockares = e.Worker.result;
+
+ QueueSocketAsyncResult (readQ, e.Worker, sockares);
+
+ return true;
}
public IAsyncResult BeginAccept(AsyncCallback callback, object state)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- if (!isbound || !islistening)
+ if (!is_bound || !is_listening)
throw new InvalidOperationException ();
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Accept);
- int count;
- lock (readQ) {
- readQ.Enqueue (req.Worker);
- count = readQ.Count;
- }
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, req);
- return req;
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Accept);
+
+ QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
+
+ return sockares;
}
- public IAsyncResult BeginAccept (int receiveSize,
- AsyncCallback callback,
- object state)
+ public IAsyncResult BeginAccept (int receiveSize, AsyncCallback callback, object state)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
if (receiveSize < 0)
throw new ArgumentOutOfRangeException ("receiveSize", "receiveSize is less than zero");
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.AcceptReceive);
- req.Buffer = new byte[receiveSize];
- req.Offset = 0;
- req.Size = receiveSize;
- req.SockFlags = SocketFlags.None;
- int count;
- lock (readQ) {
- readQ.Enqueue (req.Worker);
- count = readQ.Count;
- }
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, req);
- return req;
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.AcceptReceive) {
+ Buffer = new byte [receiveSize],
+ Offset = 0,
+ Size = receiveSize,
+ SockFlags = SocketFlags.None,
+ };
+
+ QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
+
+ return sockares;
}
- public IAsyncResult BeginAccept (Socket acceptSocket,
- int receiveSize,
- AsyncCallback callback,
- object state)
+ public IAsyncResult BeginAccept (Socket acceptSocket, int receiveSize, AsyncCallback callback, object state)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
if (receiveSize < 0)
throw new ArgumentOutOfRangeException ("receiveSize", "receiveSize is less than zero");
if (acceptSocket != null) {
- if (acceptSocket.disposed && acceptSocket.closed)
- throw new ObjectDisposedException (acceptSocket.GetType ().ToString ());
+ ThrowIfDisposedAndClosed (acceptSocket);
if (acceptSocket.IsBound)
throw new InvalidOperationException ();
throw new SocketException ((int)SocketError.InvalidArgument);
}
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.AcceptReceive);
- req.Buffer = new byte[receiveSize];
- req.Offset = 0;
- req.Size = receiveSize;
- req.SockFlags = SocketFlags.None;
- req.AcceptSocket = acceptSocket;
- int count;
- lock (readQ) {
- readQ.Enqueue (req.Worker);
- count = readQ.Count;
- }
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, req);
- return(req);
- }
-
- public IAsyncResult BeginConnect (IPAddress address, int port,
- AsyncCallback callback,
- object state)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (address == null)
- throw new ArgumentNullException ("address");
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.AcceptReceive) {
+ Buffer = new byte [receiveSize],
+ Offset = 0,
+ Size = receiveSize,
+ SockFlags = SocketFlags.None,
+ AcceptSocket = acceptSocket,
+ };
- if (address.ToString ().Length == 0)
- throw new ArgumentException ("The length of the IP address is zero");
+ QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
- if (port <= 0 || port > 65535)
- throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
+ return sockares;
+ }
- if (islistening)
- throw new InvalidOperationException ();
+ public Socket EndAccept (IAsyncResult result)
+ {
+ int bytes;
+ byte[] buffer;
+ return EndAccept (out buffer, out bytes, result);
+ }
- IPEndPoint iep = new IPEndPoint (address, port);
- return(BeginConnect (iep, callback, state));
+ public Socket EndAccept (out byte[] buffer, IAsyncResult asyncResult)
+ {
+ int bytes;
+ return EndAccept (out buffer, out bytes, asyncResult);
}
- public IAsyncResult BeginConnect (string host, int port,
- AsyncCallback callback,
- object state)
+ public Socket EndAccept (out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- if (host == null)
- throw new ArgumentNullException ("host");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndAccept", "asyncResult");
- if (address_family != AddressFamily.InterNetwork &&
- address_family != AddressFamily.InterNetworkV6)
- throw new NotSupportedException ("This method is valid only for sockets in the InterNetwork and InterNetworkV6 families");
+ if (!sockares.IsCompleted)
+ sockares.AsyncWaitHandle.WaitOne ();
- if (port <= 0 || port > 65535)
- throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
+ sockares.CheckIfThrowDelayedException ();
- if (islistening)
- throw new InvalidOperationException ();
+ buffer = sockares.Buffer;
+ bytesTransferred = sockares.Total;
- return BeginConnect (Dns.GetHostAddresses (host), port, callback, state);
+ return sockares.Socket;
}
- public IAsyncResult BeginDisconnect (bool reuseSocket,
- AsyncCallback callback,
- object state)
+ static SafeSocketHandle Accept_internal (SafeSocketHandle safeHandle, out int error, bool blocking)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Disconnect);
- req.ReuseSocket = reuseSocket;
- socket_pool_queue (Worker.Dispatcher, req);
- return(req);
+ try {
+ safeHandle.RegisterForBlockingSyscall ();
+ var ret = Accept_internal (safeHandle.DangerousGetHandle (), out error, blocking);
+ return new SafeSocketHandle (ret, true);
+ } finally {
+ safeHandle.UnRegisterForBlockingSyscall ();
+ }
}
- void CheckRange (byte[] buffer, int offset, int size)
+ /* Creates a new system socket, returning the handle */
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static IntPtr Accept_internal (IntPtr sock, out int error, bool blocking);
+
+#endregion
+
+#region Bind
+
+ public void Bind (EndPoint local_end)
{
- if (offset < 0)
- throw new ArgumentOutOfRangeException ("offset", "offset must be >= 0");
-
- if (offset > buffer.Length)
- throw new ArgumentOutOfRangeException ("offset", "offset must be <= buffer.Length");
+ ThrowIfDisposedAndClosed ();
- if (size < 0)
- throw new ArgumentOutOfRangeException ("size", "size must be >= 0");
-
- if (size > buffer.Length - offset)
- throw new ArgumentOutOfRangeException ("size", "size must be <= buffer.Length - offset");
+ if (local_end == null)
+ throw new ArgumentNullException("local_end");
+
+ int error;
+ Bind_internal (safe_handle, local_end.Serialize(), out error);
+
+ if (error != 0)
+ throw new SocketException (error);
+ if (error == 0)
+ is_bound = true;
+
+ seed_endpoint = local_end;
}
-
- public IAsyncResult BeginReceive(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- AsyncCallback callback,
- object state) {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ private static void Bind_internal (SafeSocketHandle safeHandle, SocketAddress sa, out int error)
+ {
+ bool release = false;
+ try {
+ safeHandle.DangerousAddRef (ref release);
+ Bind_internal (safeHandle.DangerousGetHandle (), sa, out error);
+ } finally {
+ if (release)
+ safeHandle.DangerousRelease ();
+ }
+ }
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ // Creates a new system socket, returning the handle
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ private extern static void Bind_internal(IntPtr sock, SocketAddress sa, out int error);
- CheckRange (buffer, offset, size);
+#endregion
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Receive);
- req.Buffer = buffer;
- req.Offset = offset;
- req.Size = size;
- req.SockFlags = socket_flags;
- int count;
- lock (readQ) {
- readQ.Enqueue (req.Worker);
- count = readQ.Count;
+#region Listen
+
+ public void Listen (int backlog)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (!is_bound)
+ throw new SocketException ((int) SocketError.InvalidArgument);
+
+ int error;
+ Listen_internal(safe_handle, backlog, out error);
+
+ if (error != 0)
+ throw new SocketException (error);
+
+ is_listening = true;
+ }
+
+ static void Listen_internal (SafeSocketHandle safeHandle, int backlog, out int error)
+ {
+ bool release = false;
+ try {
+ safeHandle.DangerousAddRef (ref release);
+ Listen_internal (safeHandle.DangerousGetHandle (), backlog, out error);
+ } finally {
+ if (release)
+ safeHandle.DangerousRelease ();
}
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, req);
- return req;
- }
-
- public IAsyncResult BeginReceive (byte[] buffer, int offset,
- int size, SocketFlags flags,
- out SocketError error,
- AsyncCallback callback,
- object state)
- {
- /* As far as I can tell from the docs and from
- * experimentation, a pointer to the
- * SocketError parameter is not supposed to be
- * saved for the async parts. And as we don't
- * set any socket errors in the setup code, we
- * just have to set it to Success.
- */
+ }
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static void Listen_internal (IntPtr sock, int backlog, out int error);
+
+#endregion
+
+#region Connect
+
+ public void Connect (IPAddress address, int port)
+ {
+ Connect (new IPEndPoint (address, port));
+ }
+
+ public void Connect (string host, int port)
+ {
+ Connect (Dns.GetHostAddresses (host), port);
+ }
+
+ public void Connect (IPAddress[] addresses, int port)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (addresses == null)
+ throw new ArgumentNullException ("addresses");
+ if (this.AddressFamily != AddressFamily.InterNetwork && this.AddressFamily != AddressFamily.InterNetworkV6)
+ throw new NotSupportedException ("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
+ if (is_listening)
+ throw new InvalidOperationException ();
+
+ // FIXME: do non-blocking sockets Poll here?
+ int error = 0;
+ foreach (IPAddress address in addresses) {
+ IPEndPoint iep = new IPEndPoint (address, port);
+
+ Connect_internal (safe_handle, iep.Serialize (), out error);
+ if (error == 0) {
+ is_connected = true;
+ is_bound = true;
+ seed_endpoint = iep;
+ return;
+ }
+ if (error != (int)SocketError.InProgress && error != (int)SocketError.WouldBlock)
+ continue;
+
+ if (!is_blocking) {
+ Poll (-1, SelectMode.SelectWrite);
+ error = (int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
+ if (error == 0) {
+ is_connected = true;
+ is_bound = true;
+ seed_endpoint = iep;
+ return;
+ }
+ }
+ }
+
+ if (error != 0)
+ throw new SocketException (error);
+ }
+
+
+ public void Connect (EndPoint remoteEP)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
+
+ IPEndPoint ep = remoteEP as IPEndPoint;
+ /* Dgram uses Any to 'disconnect' */
+ if (ep != null && socket_type != SocketType.Dgram) {
+ if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any))
+ throw new SocketException ((int) SocketError.AddressNotAvailable);
+ }
+
+ if (is_listening)
+ throw new InvalidOperationException ();
+
+ SocketAddress serial = remoteEP.Serialize ();
+
+ int error = 0;
+ Connect_internal (safe_handle, serial, out error);
+
+ if (error == 0 || error == 10035)
+ seed_endpoint = remoteEP; // Keep the ep around for non-blocking sockets
+
+ if (error != 0) {
+ if (is_closed)
+ error = SOCKET_CLOSED_CODE;
+ throw new SocketException (error);
+ }
+
+ is_connected = !(socket_type == SocketType.Dgram && ep != null && (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)));
+ is_bound = true;
+ }
+
+ public bool ConnectAsync (SocketAsyncEventArgs e)
+ {
+ // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
+
+ ThrowIfDisposedAndClosed ();
+
+ if (is_listening)
+ throw new InvalidOperationException ("You may not perform this operation after calling the Listen method.");
+ if (e.RemoteEndPoint == null)
+ throw new ArgumentNullException ("remoteEP");
+
+ e.curSocket = this;
+ e.Worker.Init (this, e, SocketOperation.Connect);
+
+ SocketAsyncResult result = e.Worker.result;
+
+ try {
+ IPAddress [] addresses;
+ IAsyncResult ares;
+
+ if (!GetCheckedIPs (e, out addresses)) {
+ result.EndPoint = e.RemoteEndPoint;
+ ares = BeginConnect (e.RemoteEndPoint, SocketAsyncEventArgs.Dispatcher, e);
+ } else {
+ DnsEndPoint dep = (e.RemoteEndPoint as DnsEndPoint);
+ result.Addresses = addresses;
+ result.Port = dep.Port;
+ ares = BeginConnect (addresses, dep.Port, SocketAsyncEventArgs.Dispatcher, e);
+ }
+
+ if (ares.IsCompleted && ares.CompletedSynchronously) {
+ ((SocketAsyncResult) ares).CheckIfThrowDelayedException ();
+ return false;
+ }
+ } catch (Exception exc) {
+ result.Complete (exc, true);
+ return false;
+ }
+
+ return true;
+ }
+
+ public IAsyncResult BeginConnect (IPAddress address, int port, AsyncCallback callback, object state)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (address == null)
+ throw new ArgumentNullException ("address");
+ if (address.ToString ().Length == 0)
+ throw new ArgumentException ("The length of the IP address is zero");
+ if (port <= 0 || port > 65535)
+ throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
+ if (is_listening)
+ throw new InvalidOperationException ();
+
+ return BeginConnect (new IPEndPoint (address, port), callback, state);
+ }
+
+ public IAsyncResult BeginConnect (string host, int port, AsyncCallback callback, object state)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (host == null)
+ throw new ArgumentNullException ("host");
+ if (address_family != AddressFamily.InterNetwork && address_family != AddressFamily.InterNetworkV6)
+ throw new NotSupportedException ("This method is valid only for sockets in the InterNetwork and InterNetworkV6 families");
+ if (port <= 0 || port > 65535)
+ throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
+ if (is_listening)
+ throw new InvalidOperationException ();
+
+ return BeginConnect (Dns.GetHostAddresses (host), port, callback, state);
+ }
+
+ public IAsyncResult BeginConnect (EndPoint end_point, AsyncCallback callback, object state)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (end_point == null)
+ throw new ArgumentNullException ("end_point");
+
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Connect) {
+ EndPoint = end_point,
+ };
+
+ // Bug #75154: Connect() should not succeed for .Any addresses.
+ if (end_point is IPEndPoint) {
+ IPEndPoint ep = (IPEndPoint) end_point;
+ if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)) {
+ sockares.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
+ return sockares;
+ }
+ }
+
+ int error = 0;
+
+ if (connect_in_progress) {
+ // This could happen when multiple IPs are used
+ // Calling connect() again will reset the connection attempt and cause
+ // an error. Better to just close the socket and move on.
+ connect_in_progress = false;
+ safe_handle.Dispose ();
+ var handle = Socket_internal (address_family, socket_type, protocol_type, out error);
+ safe_handle = new SafeSocketHandle (handle, true);
+ if (error != 0)
+ throw new SocketException (error);
+ }
+
+ bool blk = is_blocking;
+ if (blk)
+ Blocking = false;
+ Connect_internal (safe_handle, end_point.Serialize (), out error);
+ if (blk)
+ Blocking = true;
+
+ if (error == 0) {
+ // succeeded synch
+ is_connected = true;
+ is_bound = true;
+ sockares.Complete (true);
+ return sockares;
+ }
+
+ if (error != (int) SocketError.InProgress && error != (int) SocketError.WouldBlock) {
+ // error synch
+ is_connected = false;
+ is_bound = false;
+ sockares.Complete (new SocketException (error), true);
+ return sockares;
+ }
+
+ // continue asynch
+ is_connected = false;
+ is_bound = false;
+ connect_in_progress = true;
+
+ socket_pool_queue (SocketAsyncWorker.Dispatcher, sockares);
+
+ return sockares;
+ }
+
+ public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback callback, object state)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (addresses == null)
+ throw new ArgumentNullException ("addresses");
+ if (addresses.Length == 0)
+ throw new ArgumentException ("Empty addresses list");
+ if (this.AddressFamily != AddressFamily.InterNetwork && this.AddressFamily != AddressFamily.InterNetworkV6)
+ throw new NotSupportedException ("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
+ if (port <= 0 || port > 65535)
+ throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
+ if (is_listening)
+ throw new InvalidOperationException ();
+
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Connect) {
+ Addresses = addresses,
+ Port = port,
+ };
+
+ is_connected = false;
+
+ return BeginMConnect (sockares);
+ }
+
+ internal IAsyncResult BeginMConnect (SocketAsyncResult sockares)
+ {
+ IAsyncResult ares = null;
+ Exception exc = null;
+
+ for (int i = sockares.CurrentAddress; i < sockares.Addresses.Length; i++) {
+ try {
+ sockares.CurrentAddress++;
+
+ ares = BeginConnect (new IPEndPoint (sockares.Addresses [i], sockares.Port), null, sockares);
+ if (ares.IsCompleted && ares.CompletedSynchronously) {
+ ((SocketAsyncResult) ares).CheckIfThrowDelayedException ();
+ sockares.DoMConnectCallback ();
+ }
+
+ break;
+ } catch (Exception e) {
+ exc = e;
+ ares = null;
+ }
+ }
+
+ if (ares == null)
+ throw exc;
+
+ return sockares;
+ }
+
+ public void EndConnect (IAsyncResult result)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndConnect", "result");
+
+ if (!sockares.IsCompleted)
+ sockares.AsyncWaitHandle.WaitOne();
+
+ sockares.CheckIfThrowDelayedException();
+ }
+
+ static void Connect_internal (SafeSocketHandle safeHandle, SocketAddress sa, out int error)
+ {
+ try {
+ safeHandle.RegisterForBlockingSyscall ();
+ Connect_internal (safeHandle.DangerousGetHandle (), sa, out error);
+ } finally {
+ safeHandle.UnRegisterForBlockingSyscall ();
+ }
+ }
+
+ /* Connects to the remote address */
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static void Connect_internal(IntPtr sock, SocketAddress sa, out int error);
+
+ /* Returns :
+ * - false when it is ok to use RemoteEndPoint
+ * - true when addresses must be used (and addresses could be null/empty) */
+ bool GetCheckedIPs (SocketAsyncEventArgs e, out IPAddress [] addresses)
+ {
+ addresses = null;
+
+ // Connect to the first address that match the host name, like:
+ // http://blogs.msdn.com/ncl/archive/2009/07/20/new-ncl-features-in-net-4-0-beta-2.aspx
+ // while skipping entries that do not match the address family
+ DnsEndPoint dep = e.RemoteEndPoint as DnsEndPoint;
+ if (dep != null) {
+ addresses = Dns.GetHostAddresses (dep.Host);
+ return true;
+ } else {
+ e.ConnectByNameError = null;
+ return false;
+ }
+ }
+
+#endregion
+
+#region Disconnect
+
+ /* According to the docs, the MS runtime will throw PlatformNotSupportedException
+ * if the platform is newer than w2k. We should be able to cope... */
+ public void Disconnect (bool reuseSocket)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ int error = 0;
+ Disconnect_internal (safe_handle, reuseSocket, out error);
+
+ if (error != 0) {
+ if (error == 50) {
+ /* ERROR_NOT_SUPPORTED */
+ throw new PlatformNotSupportedException ();
+ } else {
+ throw new SocketException (error);
+ }
+ }
+
+ is_connected = false;
+ if (reuseSocket) {
+ /* Do managed housekeeping here... */
+ }
+ }
+
+ public bool DisconnectAsync (SocketAsyncEventArgs e)
+ {
+ // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
+
+ ThrowIfDisposedAndClosed ();
+
+ e.curSocket = this;
+ e.Worker.Init (this, e, SocketOperation.Disconnect);
+
+ SocketAsyncResult sockares = e.Worker.result;
+
+ socket_pool_queue (SocketAsyncWorker.Dispatcher, sockares);
+
+ return true;
+ }
+
+
+ public IAsyncResult BeginDisconnect (bool reuseSocket, AsyncCallback callback, object state)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Disconnect) {
+ ReuseSocket = reuseSocket,
+ };
+
+ socket_pool_queue (SocketAsyncWorker.Dispatcher, sockares);
+
+ return sockares;
+ }
+
+ public void EndDisconnect (IAsyncResult asyncResult)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndDisconnect", "asyncResult");
+
+ if (!sockares.IsCompleted)
+ sockares.AsyncWaitHandle.WaitOne ();
+
+ sockares.CheckIfThrowDelayedException ();
+ }
+
+ static void Disconnect_internal (SafeSocketHandle safeHandle, bool reuse, out int error)
+ {
+ bool release = false;
+ try {
+ safeHandle.DangerousAddRef (ref release);
+ Disconnect_internal (safeHandle.DangerousGetHandle (), reuse, out error);
+ } finally {
+ if (release)
+ safeHandle.DangerousRelease ();
+ }
+ }
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static void Disconnect_internal (IntPtr sock, bool reuse, out int error);
+
+#endregion
+
+#region Receive
+
+ public int Receive (byte [] buffer)
+ {
+ return Receive (buffer, SocketFlags.None);
+ }
+
+ public int Receive (byte [] buffer, SocketFlags flags)
+ {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
+
+ SocketError error;
+ int ret = Receive_nochecks (buffer, 0, buffer.Length, flags, out error);
+
+ if (error != SocketError.Success) {
+ if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
+ throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
+ throw new SocketException ((int) error);
+ }
+
+ return ret;
+ }
+
+ public int Receive (byte [] buffer, int size, SocketFlags flags)
+ {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, size);
+
+ SocketError error;
+ int ret = Receive_nochecks (buffer, 0, size, flags, out error);
+
+ if (error != SocketError.Success) {
+ if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
+ throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
+ throw new SocketException ((int) error);
+ }
+
+ return ret;
+ }
+
+ public int Receive (byte [] buffer, int offset, int size, SocketFlags flags)
+ {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
+
+ SocketError error;
+ int ret = Receive_nochecks (buffer, offset, size, flags, out error);
+
+ if (error != SocketError.Success) {
+ if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
+ throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
+ throw new SocketException ((int) error);
+ }
+
+ return ret;
+ }
+
+ public int Receive (byte [] buffer, int offset, int size, SocketFlags flags, out SocketError error)
+ {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
+
+ return Receive_nochecks (buffer, offset, size, flags, out error);
+ }
+
+ public int Receive (IList<ArraySegment<byte>> buffers)
+ {
+ SocketError error;
+ int ret = Receive (buffers, SocketFlags.None, out error);
+
+ if (error != SocketError.Success)
+ throw new SocketException ((int) error);
+
+ return ret;
+ }
+
+ [CLSCompliant (false)]
+ public int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
+ {
+ SocketError error;
+ int ret = Receive (buffers, socketFlags, out error);
+
+ if (error != SocketError.Success)
+ throw new SocketException ((int) error);
+
+ return(ret);
+ }
+
+ [CLSCompliant (false)]
+ public int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (buffers == null || buffers.Count == 0)
+ throw new ArgumentNullException ("buffers");
+
+ int numsegments = buffers.Count;
+ int nativeError;
+ int ret;
+
+ /* Only example I can find of sending a byte array reference directly into an internal
+ * call is in System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc.Win32/NamedPipeSocket.cs,
+ * so taking a lead from that... */
+ WSABUF[] bufarray = new WSABUF[numsegments];
+ GCHandle[] gch = new GCHandle[numsegments];
+
+ for (int i = 0; i < numsegments; i++) {
+ ArraySegment<byte> segment = buffers[i];
+
+ if (segment.Offset < 0 || segment.Count < 0 || segment.Count > segment.Array.Length - segment.Offset)
+ throw new ArgumentOutOfRangeException ("segment");
+
+ gch[i] = GCHandle.Alloc (segment.Array, GCHandleType.Pinned);
+ bufarray[i].len = segment.Count;
+ bufarray[i].buf = Marshal.UnsafeAddrOfPinnedArrayElement (segment.Array, segment.Offset);
+ }
+
+ try {
+ ret = Receive_internal (safe_handle, bufarray, socketFlags, out nativeError);
+ } finally {
+ for (int i = 0; i < numsegments; i++) {
+ if (gch[i].IsAllocated)
+ gch[i].Free ();
+ }
+ }
+
+ errorCode = (SocketError) nativeError;
+
+ return ret;
+ }
+
+ public bool ReceiveAsync (SocketAsyncEventArgs e)
+ {
+ // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
+
+ ThrowIfDisposedAndClosed ();
+
+ // LAME SPEC: the ArgumentException is never thrown, instead an NRE is
+ // thrown when e.Buffer and e.BufferList are null (works fine when one is
+ // set to a valid object)
+ if (e.Buffer == null && e.BufferList == null)
+ throw new NullReferenceException ("Either e.Buffer or e.BufferList must be valid buffers.");
+
+ e.curSocket = this;
+ e.Worker.Init (this, e, e.Buffer != null ? SocketOperation.Receive : SocketOperation.ReceiveGeneric);
+
+ SocketAsyncResult sockares = e.Worker.result;
+ sockares.SockFlags = e.SocketFlags;
+
+ if (e.Buffer != null) {
+ sockares.Buffer = e.Buffer;
+ sockares.Offset = e.Offset;
+ sockares.Size = e.Count;
+ } else {
+ sockares.Buffers = e.BufferList;
+ }
+
+ // Receive takes care of ReceiveGeneric
+ QueueSocketAsyncResult (readQ, e.Worker, sockares);
+
+ return true;
+ }
+
+ public IAsyncResult BeginReceive (byte[] buffer, int offset, int size, SocketFlags socket_flags, AsyncCallback callback, object state)
+ {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
+
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Receive) {
+ Buffer = buffer,
+ Offset = offset,
+ Size = size,
+ SockFlags = socket_flags,
+ };
+
+ QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
+
+ return sockares;
+ }
+
+ public IAsyncResult BeginReceive (byte[] buffer, int offset, int size, SocketFlags flags, out SocketError error, AsyncCallback callback, object state)
+ {
+ /* As far as I can tell from the docs and from experimentation, a pointer to the
+ * SocketError parameter is not supposed to be saved for the async parts. And as we don't
+ * set any socket errors in the setup code, we just have to set it to Success. */
error = SocketError.Success;
- return (BeginReceive (buffer, offset, size, flags, callback, state));
+ return BeginReceive (buffer, offset, size, flags, callback, state);
}
- [CLSCompliant (false)]
- public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers,
- SocketFlags socketFlags,
- AsyncCallback callback,
- object state)
+ [CLSCompliant (false)]
+ public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (buffers == null)
+ throw new ArgumentNullException ("buffers");
+
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.ReceiveGeneric) {
+ Buffers = buffers,
+ SockFlags = socketFlags,
+ };
+
+ QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
+
+ return sockares;
+ }
+
+ [CLSCompliant (false)]
+ public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
+ {
+ /* I assume the same SocketError semantics as above */
+ errorCode = SocketError.Success;
+ return BeginReceive (buffers, socketFlags, callback, state);
+ }
+
+ public int EndReceive (IAsyncResult result)
+ {
+ SocketError error;
+ int bytesReceived = EndReceive (result, out error);
+
+ if (error != SocketError.Success) {
+ if (error != SocketError.WouldBlock && error != SocketError.InProgress)
+ is_connected = false;
+ throw new SocketException ((int)error);
+ }
+
+ return bytesReceived;
+ }
+
+ public int EndReceive (IAsyncResult asyncResult, out SocketError errorCode)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceive", "asyncResult");
+
+ if (!sockares.IsCompleted)
+ sockares.AsyncWaitHandle.WaitOne ();
+
+ // If no socket error occurred, call CheckIfThrowDelayedException in case there are other
+ // kinds of exceptions that should be thrown.
+ if ((errorCode = sockares.ErrorCode) == SocketError.Success)
+ sockares.CheckIfThrowDelayedException();
+
+ return sockares.Total;
+ }
+
+ internal int Receive_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
+ {
+ int nativeError;
+ int ret = Receive_internal (safe_handle, buf, offset, size, flags, out nativeError);
+
+ error = (SocketError) nativeError;
+ if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
+ is_connected = false;
+ is_bound = false;
+ } else {
+ is_connected = true;
+ }
+
+ return ret;
+ }
+
+ static int Receive_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
+ {
+ try {
+ safeHandle.RegisterForBlockingSyscall ();
+ return Receive_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
+ } finally {
+ safeHandle.UnRegisterForBlockingSyscall ();
+ }
+ }
+
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ extern static int Receive_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
+
+ static int Receive_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, out int error)
+ {
+ try {
+ safeHandle.RegisterForBlockingSyscall ();
+ return Receive_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, out error);
+ } finally {
+ safeHandle.UnRegisterForBlockingSyscall ();
+ }
+ }
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static int Receive_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, out int error);
+
+#endregion
+
+#region ReceiveFrom
+
+ public int ReceiveFrom (byte [] buffer, ref EndPoint remoteEP)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
- if (buffers == null)
- throw new ArgumentNullException ("buffers");
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.ReceiveGeneric);
- req.Buffers = buffers;
- req.SockFlags = socketFlags;
- int count;
- lock(readQ) {
- readQ.Enqueue (req.Worker);
- count = readQ.Count;
- }
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, req);
- return req;
- }
-
- [CLSCompliant (false)]
- public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers,
- SocketFlags socketFlags,
- out SocketError errorCode,
- AsyncCallback callback,
- object state)
- {
- /* I assume the same SocketError semantics as
- * above
- */
- errorCode = SocketError.Success;
- return (BeginReceive (buffers, socketFlags, callback, state));
+ return ReceiveFrom_nochecks (buffer, 0, buffer.Length, SocketFlags.None, ref remoteEP);
}
- public IAsyncResult BeginReceiveFrom(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- ref EndPoint remote_end,
- AsyncCallback callback,
- object state) {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ public int ReceiveFrom (byte [] buffer, SocketFlags flags, ref EndPoint remoteEP)
+ {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
+ return ReceiveFrom_nochecks (buffer, 0, buffer.Length, flags, ref remoteEP);
+ }
- CheckRange (buffer, offset, size);
+ public int ReceiveFrom (byte [] buffer, int size, SocketFlags flags, ref EndPoint remoteEP)
+ {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, size);
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.ReceiveFrom);
- req.Buffer = buffer;
- req.Offset = offset;
- req.Size = size;
- req.SockFlags = socket_flags;
- req.EndPoint = remote_end;
- int count;
- lock (readQ) {
- readQ.Enqueue (req.Worker);
- count = readQ.Count;
- }
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, req);
- return req;
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
+
+ return ReceiveFrom_nochecks (buffer, 0, size, flags, ref remoteEP);
}
- [MonoTODO]
- public IAsyncResult BeginReceiveMessageFrom (
- byte[] buffer, int offset, int size,
- SocketFlags socketFlags, ref EndPoint remoteEP,
- AsyncCallback callback, object state)
+ public int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags flags, ref EndPoint remoteEP)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
if (remoteEP == null)
throw new ArgumentNullException ("remoteEP");
- CheckRange (buffer, offset, size);
-
- throw new NotImplementedException ();
+ return ReceiveFrom_nochecks (buffer, offset, size, flags, ref remoteEP);
}
- public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socket_flags,
- AsyncCallback callback, object state)
+ public bool ReceiveFromAsync (SocketAsyncEventArgs e)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ // We do not support recv into multiple buffers yet
+ if (e.BufferList != null)
+ throw new NotSupportedException ("Mono doesn't support using BufferList at this point.");
+ if (e.RemoteEndPoint == null)
+ throw new ArgumentNullException ("remoteEP", "Value cannot be null.");
- CheckRange (buffer, offset, size);
+ e.curSocket = this;
+ e.Worker.Init (this, e, SocketOperation.ReceiveFrom);
- if (!connected)
- throw new SocketException ((int)SocketError.NotConnected);
+ SocketAsyncResult sockares = e.Worker.result;
+ sockares.Buffer = e.Buffer;
+ sockares.Offset = e.Offset;
+ sockares.Size = e.Count;
+ sockares.EndPoint = e.RemoteEndPoint;
+ sockares.SockFlags = e.SocketFlags;
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Send);
- req.Buffer = buffer;
- req.Offset = offset;
- req.Size = size;
- req.SockFlags = socket_flags;
- int count;
- lock (writeQ) {
- writeQ.Enqueue (req.Worker);
- count = writeQ.Count;
- }
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, req);
- return req;
+ QueueSocketAsyncResult (readQ, e.Worker, sockares);
+
+ return true;
}
- public IAsyncResult BeginSend (byte[] buffer, int offset,
- int size,
- SocketFlags socketFlags,
- out SocketError errorCode,
- AsyncCallback callback,
- object state)
+ public IAsyncResult BeginReceiveFrom (byte[] buffer, int offset, int size, SocketFlags socket_flags, ref EndPoint remote_end, AsyncCallback callback, object state)
{
- if (!connected) {
- errorCode = SocketError.NotConnected;
- throw new SocketException ((int)errorCode);
- }
-
- errorCode = SocketError.Success;
-
- return (BeginSend (buffer, offset, size, socketFlags, callback,
- state));
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
+
+ if (remote_end == null)
+ throw new ArgumentNullException ("remote_end");
+
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.ReceiveFrom) {
+ Buffer = buffer,
+ Offset = offset,
+ Size = size,
+ SockFlags = socket_flags,
+ EndPoint = remote_end,
+ };
+
+ QueueSocketAsyncResult (readQ, sockares.Worker, sockares);
+
+ return sockares;
}
- public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers,
- SocketFlags socketFlags,
- AsyncCallback callback,
- object state)
+ public int EndReceiveFrom(IAsyncResult result, ref EndPoint end_point)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- if (buffers == null)
- throw new ArgumentNullException ("buffers");
+ if (end_point == null)
+ throw new ArgumentNullException ("remote_end");
- if (!connected)
- throw new SocketException ((int)SocketError.NotConnected);
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndReceiveFrom", "result");
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.SendGeneric);
- req.Buffers = buffers;
- req.SockFlags = socketFlags;
- int count;
- lock (writeQ) {
- writeQ.Enqueue (req.Worker);
- count = writeQ.Count;
- }
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, req);
- return req;
+ if (!sockares.IsCompleted)
+ sockares.AsyncWaitHandle.WaitOne();
+
+ sockares.CheckIfThrowDelayedException();
+
+ end_point = sockares.EndPoint;
+
+ return sockares.Total;
}
- [CLSCompliant (false)]
- public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers,
- SocketFlags socketFlags,
- out SocketError errorCode,
- AsyncCallback callback,
- object state)
+ internal int ReceiveFrom_nochecks (byte [] buf, int offset, int size, SocketFlags flags, ref EndPoint remote_end)
{
- if (!connected) {
- errorCode = SocketError.NotConnected;
- throw new SocketException ((int)errorCode);
- }
-
- errorCode = SocketError.Success;
- return (BeginSend (buffers, socketFlags, callback, state));
+ int error;
+ return ReceiveFrom_nochecks_exc (buf, offset, size, flags, ref remote_end, true, out error);
}
- delegate void SendFileHandler (string fileName, byte [] preBuffer, byte [] postBuffer, TransmitFileOptions flags);
+ internal int ReceiveFrom_nochecks_exc (byte [] buf, int offset, int size, SocketFlags flags, ref EndPoint remote_end, bool throwOnError, out int error)
+ {
+ SocketAddress sockaddr = remote_end.Serialize();
- sealed class SendFileAsyncResult : IAsyncResult {
- IAsyncResult ares;
- SendFileHandler d;
+ int cnt = ReceiveFrom_internal (safe_handle, buf, offset, size, flags, ref sockaddr, out error);
- public SendFileAsyncResult (SendFileHandler d, IAsyncResult ares)
- {
- this.d = d;
- this.ares = ares;
- }
+ SocketError err = (SocketError) error;
+ if (err != 0) {
+ if (err != SocketError.WouldBlock && err != SocketError.InProgress) {
+ is_connected = false;
+ } else if (err == SocketError.WouldBlock && is_blocking) { // This might happen when ReceiveTimeout is set
+ if (throwOnError)
+ throw new SocketException ((int) SocketError.TimedOut, TIMEOUT_EXCEPTION_MSG);
+ error = (int) SocketError.TimedOut;
+ return 0;
+ }
- public object AsyncState {
- get { return ares.AsyncState; }
- }
+ if (throwOnError)
+ throw new SocketException (error);
- public WaitHandle AsyncWaitHandle {
- get { return ares.AsyncWaitHandle; }
+ return 0;
}
- public bool CompletedSynchronously {
- get { return ares.CompletedSynchronously; }
- }
+ is_connected = true;
+ is_bound = true;
- public bool IsCompleted {
- get { return ares.IsCompleted; }
+ /* If sockaddr is null then we're a connection oriented protocol and should ignore the
+ * remote_end parameter (see MSDN documentation for Socket.ReceiveFrom(...) ) */
+ if (sockaddr != null) {
+ /* Stupidly, EndPoint.Create() is an instance method */
+ remote_end = remote_end.Create (sockaddr);
}
- public SendFileHandler Delegate {
- get { return d; }
- }
+ seed_endpoint = remote_end;
- public IAsyncResult Original {
- get { return ares; }
- }
+ return cnt;
}
- public IAsyncResult BeginSendFile (string fileName,
- AsyncCallback callback,
- object state)
+ static int ReceiveFrom_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ try {
+ safeHandle.RegisterForBlockingSyscall ();
+ return ReceiveFrom_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, ref sockaddr, out error);
+ } finally {
+ safeHandle.UnRegisterForBlockingSyscall ();
+ }
+ }
- if (!connected)
- throw new NotSupportedException ();
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static int ReceiveFrom_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error);
- if (!File.Exists (fileName))
- throw new FileNotFoundException ();
+#endregion
- return BeginSendFile (fileName, null, null, 0, callback, state);
- }
+#region ReceiveMessageFrom
- public IAsyncResult BeginSendFile (string fileName,
- byte[] preBuffer,
- byte[] postBuffer,
- TransmitFileOptions flags,
- AsyncCallback callback,
- object state)
+ [MonoTODO ("Not implemented")]
+ public int ReceiveMessageFrom (byte[] buffer, int offset, int size, ref SocketFlags socketFlags, ref EndPoint remoteEP, out IPPacketInformation ipPacketInformation)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (!connected)
- throw new NotSupportedException ();
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
- if (!File.Exists (fileName))
- throw new FileNotFoundException ();
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
- SendFileHandler d = new SendFileHandler (SendFile);
- return new SendFileAsyncResult (d, d.BeginInvoke (fileName, preBuffer, postBuffer, flags, ar => {
- SendFileAsyncResult sfar = new SendFileAsyncResult (d, ar);
- callback (sfar);
- }, state));
+ // FIXME: figure out how we get hold of the IPPacketInformation
+ throw new NotImplementedException ();
}
- public IAsyncResult BeginSendTo(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- EndPoint remote_end,
- AsyncCallback callback,
- object state) {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ [MonoTODO ("Not implemented")]
+ public bool ReceiveMessageFromAsync (SocketAsyncEventArgs e)
+ {
+ // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
- CheckRange (buffer, offset, size);
+ ThrowIfDisposedAndClosed ();
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.SendTo);
- req.Buffer = buffer;
- req.Offset = offset;
- req.Size = size;
- req.SockFlags = socket_flags;
- req.EndPoint = remote_end;
- int count;
- lock (writeQ) {
- writeQ.Enqueue (req.Worker);
- count = writeQ.Count;
- }
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, req);
- return req;
+ throw new NotImplementedException ();
}
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Bind_internal(IntPtr sock,
- SocketAddress sa,
- out int error);
-
- private static void Bind_internal (SafeSocketHandle safeHandle,
- SocketAddress sa,
- out int error)
+ [MonoTODO]
+ public IAsyncResult BeginReceiveMessageFrom (byte[] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP, AsyncCallback callback, object state)
{
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- Bind_internal (safeHandle.DangerousGetHandle (), sa, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
- }
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
- public void Bind(EndPoint local_end) {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
- if (local_end == null)
- throw new ArgumentNullException("local_end");
-
- int error;
-
- Bind_internal(socket, local_end.Serialize(), out error);
- if (error != 0)
- throw new SocketException (error);
- if (error == 0)
- isbound = true;
-
- seed_endpoint = local_end;
+ throw new NotImplementedException ();
}
- public void Connect (IPAddress address, int port)
- {
- Connect (new IPEndPoint (address, port));
- }
-
- public void Connect (IPAddress[] addresses, int port)
+ [MonoTODO]
+ public int EndReceiveMessageFrom (IAsyncResult asyncResult, ref SocketFlags socketFlags, ref EndPoint endPoint, out IPPacketInformation ipPacketInformation)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (addresses == null)
- throw new ArgumentNullException ("addresses");
+ ThrowIfDisposedAndClosed ();
- if (this.AddressFamily != AddressFamily.InterNetwork &&
- this.AddressFamily != AddressFamily.InterNetworkV6)
- throw new NotSupportedException ("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
+ if (endPoint == null)
+ throw new ArgumentNullException ("endPoint");
- if (islistening)
- throw new InvalidOperationException ();
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceiveMessageFrom", "asyncResult");
- /* FIXME: do non-blocking sockets Poll here? */
- int error = 0;
- foreach (IPAddress address in addresses) {
- IPEndPoint iep = new IPEndPoint (address, port);
- SocketAddress serial = iep.Serialize ();
-
- Connect_internal (socket, serial, out error);
- if (error == 0) {
- connected = true;
- isbound = true;
- seed_endpoint = iep;
- return;
- } else if (error != (int)SocketError.InProgress &&
- error != (int)SocketError.WouldBlock) {
- continue;
- }
-
- if (!blocking) {
- Poll (-1, SelectMode.SelectWrite);
- error = (int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
- if (error == 0) {
- connected = true;
- isbound = true;
- seed_endpoint = iep;
- return;
- }
- }
- }
- if (error != 0)
- throw new SocketException (error);
+ throw new NotImplementedException ();
}
- public void Connect (string host, int port)
+#endregion
+
+#region Send
+
+ public int Send (byte [] buffer)
{
- IPAddress [] addresses = Dns.GetHostAddresses (host);
- Connect (addresses, port);
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
+
+ SocketError error;
+ int ret = Send_nochecks (buffer, 0, buffer.Length, SocketFlags.None, out error);
+
+ if (error != SocketError.Success)
+ throw new SocketException ((int) error);
+
+ return ret;
}
- public bool DisconnectAsync (SocketAsyncEventArgs e)
+ public int Send (byte [] buffer, SocketFlags flags)
{
- // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
- e.curSocket = this;
- e.Worker.Init (this, e, SocketOperation.Disconnect);
- socket_pool_queue (Worker.Dispatcher, e.Worker.result);
- return true;
- }
+ SocketError error;
+ int ret = Send_nochecks (buffer, 0, buffer.Length, flags, out error);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern static void Disconnect_internal(IntPtr sock, bool reuse, out int error);
+ if (error != SocketError.Success)
+ throw new SocketException ((int) error);
- private static void Disconnect_internal(SafeSocketHandle safeHandle, bool reuse, out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- Disconnect_internal (safeHandle.DangerousGetHandle (), reuse, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
+ return ret;
}
- /* According to the docs, the MS runtime will throw
- * PlatformNotSupportedException if the platform is
- * newer than w2k. We should be able to cope...
- */
- public void Disconnect (bool reuseSocket)
+ public int Send (byte [] buffer, int size, SocketFlags flags)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, size);
- int error = 0;
-
- Disconnect_internal (socket, reuseSocket, out error);
+ SocketError error;
+ int ret = Send_nochecks (buffer, 0, size, flags, out error);
- if (error != 0) {
- if (error == 50) {
- /* ERROR_NOT_SUPPORTED */
- throw new PlatformNotSupportedException ();
- } else {
- throw new SocketException (error);
- }
- }
+ if (error != SocketError.Success)
+ throw new SocketException ((int) error);
- connected = false;
-
- if (reuseSocket) {
- /* Do managed housekeeping here... */
- }
+ return ret;
}
-#if !MOBILE
- [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)
+ public int Send (byte [] buffer, int offset, int size, SocketFlags flags)
{
- var si = new SocketInformation ();
- si.Options =
- (islistening ? SocketInformationOptions.Listening : 0) |
- (connected ? SocketInformationOptions.Connected : 0) |
- (blocking ? 0 : SocketInformationOptions.NonBlocking) |
- (useoverlappedIO ? SocketInformationOptions.UseOnlyOverlappedIO : 0);
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
- si.ProtocolInformation = Mono.DataConverter.Pack ("iiiil", (int)address_family, (int)socket_type, (int)protocol_type, isbound ? 1 : 0, (long)Handle);
- socket = null;
+ SocketError error;
+ int ret = Send_nochecks (buffer, offset, size, flags, out error);
- return si;
+ if (error != SocketError.Success)
+ throw new SocketException ((int) error);
+
+ return ret;
}
-#endif
-
- public Socket EndAccept (IAsyncResult result)
+
+ public int Send (byte [] buffer, int offset, int size, SocketFlags flags, out SocketError error)
{
- int bytes;
- byte[] buffer;
-
- return(EndAccept (out buffer, out bytes, result));
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
+
+ return Send_nochecks (buffer, offset, size, flags, out error);
}
- public Socket EndAccept (out byte[] buffer, IAsyncResult asyncResult)
+ public
+ int Send (IList<ArraySegment<byte>> buffers)
{
- int bytes;
- return(EndAccept (out buffer, out bytes, asyncResult));
+ SocketError error;
+ int ret = Send (buffers, SocketFlags.None, out error);
+
+ if (error != SocketError.Success)
+ throw new SocketException ((int) error);
+
+ return ret;
}
- public Socket EndAccept (out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
+ public
+ int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
-
- SocketAsyncResult req = asyncResult as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
+ SocketError error;
+ int ret = Send (buffers, socketFlags, out error);
- if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
- throw InvalidAsyncOp ("EndAccept");
- if (!asyncResult.IsCompleted)
- asyncResult.AsyncWaitHandle.WaitOne ();
+ if (error != SocketError.Success)
+ throw new SocketException ((int) error);
- req.CheckIfThrowDelayedException ();
-
- buffer = req.Buffer;
- bytesTransferred = req.Total;
-
- return(req.Socket);
+ return ret;
}
- public void EndConnect (IAsyncResult result)
+ [CLSCompliant (false)]
+ public int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
+
+ if (buffers == null)
+ throw new ArgumentNullException ("buffers");
+ if (buffers.Count == 0)
+ throw new ArgumentException ("Buffer is empty", "buffers");
+
+ int numsegments = buffers.Count;
+ int nativeError;
+ int ret;
+
+ WSABUF[] bufarray = new WSABUF[numsegments];
+ GCHandle[] gch = new GCHandle[numsegments];
- if (result == null)
- throw new ArgumentNullException ("result");
+ for(int i = 0; i < numsegments; i++) {
+ ArraySegment<byte> segment = buffers[i];
- SocketAsyncResult req = result as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "result");
+ if (segment.Offset < 0 || segment.Count < 0 || segment.Count > segment.Array.Length - segment.Offset)
+ throw new ArgumentOutOfRangeException ("segment");
+
+ gch[i] = GCHandle.Alloc (segment.Array, GCHandleType.Pinned);
+ bufarray[i].len = segment.Count;
+ bufarray[i].buf = Marshal.UnsafeAddrOfPinnedArrayElement (segment.Array, segment.Offset);
+ }
+
+ try {
+ ret = Send_internal (safe_handle, bufarray, socketFlags, out nativeError);
+ } finally {
+ for(int i = 0; i < numsegments; i++) {
+ if (gch[i].IsAllocated) {
+ gch[i].Free ();
+ }
+ }
+ }
- if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
- throw InvalidAsyncOp ("EndConnect");
- if (!result.IsCompleted)
- result.AsyncWaitHandle.WaitOne();
+ errorCode = (SocketError)nativeError;
- req.CheckIfThrowDelayedException();
+ return ret;
}
- public void EndDisconnect (IAsyncResult asyncResult)
+ internal int Send_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ if (size == 0) {
+ error = SocketError.Success;
+ return 0;
+ }
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
+ int nativeError;
+ int ret = Send_internal (safe_handle, buf, offset, size, flags, out nativeError);
- SocketAsyncResult req = asyncResult as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
+ error = (SocketError)nativeError;
- if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
- throw InvalidAsyncOp ("EndDisconnect");
- if (!asyncResult.IsCompleted)
- asyncResult.AsyncWaitHandle.WaitOne ();
+ if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
+ is_connected = false;
+ is_bound = false;
+ } else {
+ is_connected = true;
+ }
- req.CheckIfThrowDelayedException ();
+ return ret;
}
- [MonoTODO]
- public int EndReceiveMessageFrom (IAsyncResult asyncResult,
- ref SocketFlags socketFlags,
- ref EndPoint endPoint,
- out IPPacketInformation ipPacketInformation)
+ public bool SendAsync (SocketAsyncEventArgs e)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
+ ThrowIfDisposedAndClosed ();
- if (endPoint == null)
- throw new ArgumentNullException ("endPoint");
+ if (e.Buffer == null && e.BufferList == null)
+ throw new NullReferenceException ("Either e.Buffer or e.BufferList must be valid buffers.");
- SocketAsyncResult req = asyncResult as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
+ e.curSocket = this;
+ e.Worker.Init (this, e, e.Buffer != null ? SocketOperation.Send : SocketOperation.SendGeneric);
- if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
- throw InvalidAsyncOp ("EndReceiveMessageFrom");
- throw new NotImplementedException ();
+ SocketAsyncResult sockares = e.Worker.result;
+ sockares.SockFlags = e.SocketFlags;
+
+ if (e.Buffer != null) {
+ sockares.Buffer = e.Buffer;
+ sockares.Offset = e.Offset;
+ sockares.Size = e.Count;
+ } else {
+ sockares.Buffers = e.BufferList;
+ }
+
+ // Send takes care of SendGeneric
+ QueueSocketAsyncResult (writeQ, e.Worker, sockares);
+
+ return true;
}
- public void EndSendFile (IAsyncResult asyncResult)
+ public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ if (!is_connected) {
+ errorCode = SocketError.NotConnected;
+ throw new SocketException ((int) errorCode);
+ }
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
+ errorCode = SocketError.Success;
+ return BeginSend (buffer, offset, size, socketFlags, callback, state);
+ }
- SendFileAsyncResult ares = asyncResult as SendFileAsyncResult;
- if (ares == null)
- throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
+ public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socket_flags, AsyncCallback callback, object state)
+ {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
- ares.Delegate.EndInvoke (ares.Original);
+ if (!is_connected)
+ throw new SocketException ((int)SocketError.NotConnected);
+
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.Send) {
+ Buffer = buffer,
+ Offset = offset,
+ Size = size,
+ SockFlags = socket_flags,
+ };
+
+ QueueSocketAsyncResult (writeQ, sockares.Worker, sockares);
+
+ return sockares;
}
- public int EndSendTo (IAsyncResult result)
+ public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- if (result == null)
- throw new ArgumentNullException ("result");
+ if (buffers == null)
+ throw new ArgumentNullException ("buffers");
+ if (!is_connected)
+ throw new SocketException ((int)SocketError.NotConnected);
- SocketAsyncResult req = result as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "result");
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.SendGeneric) {
+ Buffers = buffers,
+ SockFlags = socketFlags,
+ };
- if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
- throw InvalidAsyncOp ("EndSendTo");
- if (!result.IsCompleted)
- result.AsyncWaitHandle.WaitOne();
+ QueueSocketAsyncResult (writeQ, sockares.Worker, sockares);
- req.CheckIfThrowDelayedException();
- return req.Total;
+ return sockares;
}
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void GetSocketOption_arr_internal(IntPtr socket,
- SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val,
- out int error);
-
- private static void GetSocketOption_arr_internal (SafeSocketHandle safeHandle,
- SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val,
- out int error)
+ [CLSCompliant (false)]
+ public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- GetSocketOption_arr_internal (safeHandle.DangerousGetHandle (), level, name, ref byte_val, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
+ if (!is_connected) {
+ errorCode = SocketError.NotConnected;
+ throw new SocketException ((int)errorCode);
}
+
+ errorCode = SocketError.Success;
+ return BeginSend (buffers, socketFlags, callback, state);
}
- public void GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, byte [] optionValue)
+ public int EndSend (IAsyncResult result)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (optionValue == null)
- throw new SocketException ((int) SocketError.Fault,
- "Error trying to dereference an invalid pointer");
+ SocketError error;
+ int bytesSent = EndSend (result, out error);
- int error;
+ if (error != SocketError.Success) {
+ if (error != SocketError.WouldBlock && error != SocketError.InProgress)
+ is_connected = false;
+ throw new SocketException ((int)error);
+ }
- GetSocketOption_arr_internal (socket, optionLevel, optionName, ref optionValue,
- out error);
- if (error != 0)
- throw new SocketException (error);
+ return bytesSent;
}
- public byte [] GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int length)
+ public int EndSend (IAsyncResult asyncResult, out SocketError errorCode)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- byte[] byte_val=new byte[length];
- int error;
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndSend", "asyncResult");
- GetSocketOption_arr_internal (socket, optionLevel, optionName, ref byte_val,
- out error);
- if (error != 0)
- throw new SocketException (error);
+ if (!sockares.IsCompleted)
+ sockares.AsyncWaitHandle.WaitOne ();
- return(byte_val);
- }
+ /* If no socket error occurred, call CheckIfThrowDelayedException in
+ * case there are other kinds of exceptions that should be thrown.*/
+ if ((errorCode = sockares.ErrorCode) == SocketError.Success)
+ sockares.CheckIfThrowDelayedException ();
- // See Socket.IOControl, WSAIoctl documentation in MSDN. The
- // common options between UNIX and Winsock are FIONREAD,
- // FIONBIO and SIOCATMARK. Anything else will depend on the
- // system except SIO_KEEPALIVE_VALS which is properly handled
- // on both windows and linux.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern static int WSAIoctl (IntPtr sock, int ioctl_code, byte [] input,
- byte [] output, out int error);
+ return sockares.Total;
+ }
- private static int WSAIoctl (SafeSocketHandle safeHandle, int ioctl_code, byte [] input,
- byte [] output, out int error)
+ static int Send_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
{
bool release = false;
try {
safeHandle.DangerousAddRef (ref release);
- return WSAIoctl (safeHandle.DangerousGetHandle (), ioctl_code, input, output, out error);
+ return Send_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
} finally {
if (release)
safeHandle.DangerousRelease ();
}
}
- public int IOControl (int ioctl_code, byte [] in_value, byte [] out_value)
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ extern static int Send_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
+
+ static int Send_internal (SafeSocketHandle safeHandle, byte[] buf, int offset, int count, SocketFlags flags, out int error)
{
- if (disposed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ try {
+ safeHandle.RegisterForBlockingSyscall ();
+ return Send_internal (safeHandle.DangerousGetHandle (), buf, offset, count, flags, out error);
+ } finally {
+ safeHandle.UnRegisterForBlockingSyscall ();
+ }
+ }
- int error;
- int result = WSAIoctl (socket, ioctl_code, in_value, out_value,
- out error);
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static int Send_internal(IntPtr sock, byte[] buf, int offset, int count, SocketFlags flags, out int error);
- if (error != 0)
- throw new SocketException (error);
-
- if (result == -1)
- throw new InvalidOperationException ("Must use Blocking property instead.");
+#endregion
- return result;
- }
+#region SendTo
- public int IOControl (IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
+ public int SendTo (byte [] buffer, EndPoint remote_end)
{
- return IOControl ((int) ioControlCode, optionInValue, optionOutValue);
- }
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Listen_internal(IntPtr sock, int backlog, out int error);
+ if (remote_end == null)
+ throw new ArgumentNullException ("remote_end");
- private static void Listen_internal (SafeSocketHandle safeHandle, int backlog, out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- Listen_internal (safeHandle.DangerousGetHandle (), backlog, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
+ return SendTo_nochecks (buffer, 0, buffer.Length, SocketFlags.None, remote_end);
}
- public void Listen (int backlog)
+ public int SendTo (byte [] buffer, SocketFlags flags, EndPoint remote_end)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
- if (!isbound)
- throw new SocketException ((int)SocketError.InvalidArgument);
+ if (remote_end == null)
+ throw new ArgumentNullException ("remote_end");
- int error;
- Listen_internal(socket, backlog, out error);
+ return SendTo_nochecks (buffer, 0, buffer.Length, flags, remote_end);
+ }
- if (error != 0)
- throw new SocketException (error);
+ public int SendTo (byte [] buffer, int size, SocketFlags flags, EndPoint remote_end)
+ {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, 0, size);
- islistening = true;
+ if (remote_end == null)
+ throw new ArgumentNullException ("remote_end");
+
+ return SendTo_nochecks (buffer, 0, size, flags, remote_end);
}
- public bool Poll (int time_us, SelectMode mode)
+ public int SendTo (byte [] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
- if (mode != SelectMode.SelectRead &&
- mode != SelectMode.SelectWrite &&
- mode != SelectMode.SelectError)
- throw new NotSupportedException ("'mode' parameter is not valid.");
+ if (remote_end == null)
+ throw new ArgumentNullException("remote_end");
+
+ return SendTo_nochecks (buffer, offset, size, flags, remote_end);
+ }
+ internal int SendTo_nochecks (byte [] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
+ {
int error;
- bool result = Poll_internal (socket, mode, time_us, out error);
- if (error != 0)
- throw new SocketException (error);
+ int ret = SendTo_internal (safe_handle, buffer, offset, size, flags, remote_end.Serialize (), out error);
- if (mode == SelectMode.SelectWrite && result && !connected) {
- /* Update the connected state; for
- * non-blocking Connect()s this is
- * when we can find out that the
- * connect succeeded.
- */
- if ((int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error) == 0) {
- connected = true;
- }
+ SocketError err = (SocketError) error;
+ if (err != 0) {
+ if (err != SocketError.WouldBlock && err != SocketError.InProgress)
+ is_connected = false;
+ throw new SocketException (error);
}
-
- return result;
- }
- public int Receive (byte [] buffer)
- {
- return Receive (buffer, SocketFlags.None);
+ is_connected = true;
+ is_bound = true;
+ seed_endpoint = remote_end;
+
+ return ret;
}
- public int Receive (byte [] buffer, SocketFlags flags)
+ public bool SendToAsync (SocketAsyncEventArgs e)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ ThrowIfDisposedAndClosed ();
- SocketError error;
+ if (e.BufferList != null)
+ throw new NotSupportedException ("Mono doesn't support using BufferList at this point.");
+ if (e.RemoteEndPoint == null)
+ throw new ArgumentNullException ("remoteEP", "Value cannot be null.");
- int ret = Receive_nochecks (buffer, 0, buffer.Length, flags, out error);
-
- if (error != SocketError.Success) {
- if (error == SocketError.WouldBlock && blocking) // This might happen when ReceiveTimeout is set
- throw new SocketException ((int) error, timeout_exc_msg);
- throw new SocketException ((int) error);
- }
+ e.curSocket = this;
+ e.Worker.Init (this, e, SocketOperation.SendTo);
- return ret;
+ SocketAsyncResult sockares = e.Worker.result;
+ sockares.Buffer = e.Buffer;
+ sockares.Offset = e.Offset;
+ sockares.Size = e.Count;
+ sockares.SockFlags = e.SocketFlags;
+ sockares.EndPoint = e.RemoteEndPoint;
+
+ QueueSocketAsyncResult (writeQ, e.Worker, sockares);
+
+ return true;
}
- public int Receive (byte [] buffer, int size, SocketFlags flags)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
- CheckRange (buffer, 0, size);
+ public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, SocketFlags socket_flags, EndPoint remote_end, AsyncCallback callback, object state)
+ {
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
- SocketError error;
+ SocketAsyncResult sockares = new SocketAsyncResult (this, state, callback, SocketOperation.SendTo) {
+ Buffer = buffer,
+ Offset = offset,
+ Size = size,
+ SockFlags = socket_flags,
+ EndPoint = remote_end,
+ };
- int ret = Receive_nochecks (buffer, 0, size, flags, out error);
-
- if (error != SocketError.Success) {
- if (error == SocketError.WouldBlock && blocking) // This might happen when ReceiveTimeout is set
- throw new SocketException ((int) error, timeout_exc_msg);
- throw new SocketException ((int) error);
- }
+ QueueSocketAsyncResult (writeQ, sockares.Worker, sockares);
- return ret;
+ return sockares;
}
- public int Receive (byte [] buffer, int offset, int size, SocketFlags flags)
+ public int EndSendTo (IAsyncResult result)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndSendTo", "result");
- CheckRange (buffer, offset, size);
-
- SocketError error;
+ if (!sockares.IsCompleted)
+ sockares.AsyncWaitHandle.WaitOne();
- int ret = Receive_nochecks (buffer, offset, size, flags, out error);
-
- if (error != SocketError.Success) {
- if (error == SocketError.WouldBlock && blocking) // This might happen when ReceiveTimeout is set
- throw new SocketException ((int) error, timeout_exc_msg);
- throw new SocketException ((int) error);
- }
+ sockares.CheckIfThrowDelayedException();
- return ret;
+ return sockares.Total;
}
- public int Receive (byte [] buffer, int offset, int size, SocketFlags flags, out SocketError error)
+ static int SendTo_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ try {
+ safeHandle.RegisterForBlockingSyscall ();
+ return SendTo_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, sa, out error);
+ } finally {
+ safeHandle.UnRegisterForBlockingSyscall ();
+ }
+ }
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static int SendTo_internal (IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error);
- CheckRange (buffer, offset, size);
-
- return Receive_nochecks (buffer, offset, size, flags, out error);
+#endregion
+
+#region SendFile
+
+ public void SendFile (string fileName)
+ {
+ ThrowIfDisposedAndClosed ();
+
+ if (!is_connected)
+ throw new NotSupportedException ();
+ if (!is_blocking)
+ throw new InvalidOperationException ();
+
+ SendFile (fileName, null, null, 0);
}
- public bool ReceiveFromAsync (SocketAsyncEventArgs e)
+ public void SendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- // We do not support recv into multiple buffers yet
- if (e.BufferList != null)
- throw new NotSupportedException ("Mono doesn't support using BufferList at this point.");
- if (e.RemoteEndPoint == null)
- throw new ArgumentNullException ("remoteEP", "Value cannot be null.");
+ if (!is_connected)
+ throw new NotSupportedException ();
+ if (!is_blocking)
+ throw new InvalidOperationException ();
- e.curSocket = this;
- e.Worker.Init (this, e, SocketOperation.ReceiveFrom);
- SocketAsyncResult res = e.Worker.result;
- res.Buffer = e.Buffer;
- res.Offset = e.Offset;
- res.Size = e.Count;
- res.EndPoint = e.RemoteEndPoint;
- res.SockFlags = e.SocketFlags;
- int count;
- lock (readQ) {
- readQ.Enqueue (e.Worker);
- count = readQ.Count;
+ if (!SendFile_internal (safe_handle, fileName, preBuffer, postBuffer, flags)) {
+ SocketException exc = new SocketException ();
+ if (exc.ErrorCode == 2 || exc.ErrorCode == 3)
+ throw new FileNotFoundException ();
+ throw exc;
}
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, res);
- return true;
}
- public int ReceiveFrom (byte [] buffer, ref EndPoint remoteEP)
+ public IAsyncResult BeginSendFile (string fileName, AsyncCallback callback, object state)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ ThrowIfDisposedAndClosed ();
- if (remoteEP == null)
- throw new ArgumentNullException ("remoteEP");
+ if (!is_connected)
+ throw new NotSupportedException ();
+ if (!File.Exists (fileName))
+ throw new FileNotFoundException ();
- return ReceiveFrom_nochecks (buffer, 0, buffer.Length, SocketFlags.None, ref remoteEP);
+ return BeginSendFile (fileName, null, null, 0, callback, state);
}
- public int ReceiveFrom (byte [] buffer, SocketFlags flags, ref EndPoint remoteEP)
+ public IAsyncResult BeginSendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags, AsyncCallback callback, object state)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ if (!is_connected)
+ throw new NotSupportedException ();
+ if (!File.Exists (fileName))
+ throw new FileNotFoundException ();
- if (remoteEP == null)
- throw new ArgumentNullException ("remoteEP");
+ SendFileHandler handler = new SendFileHandler (SendFile);
- return ReceiveFrom_nochecks (buffer, 0, buffer.Length, flags, ref remoteEP);
+ return new SendFileAsyncResult (handler, handler.BeginInvoke (fileName, preBuffer, postBuffer, flags, ar => callback (new SendFileAsyncResult (handler, ar)), state));
}
- public int ReceiveFrom (byte [] buffer, int size, SocketFlags flags,
- ref EndPoint remoteEP)
+ public void EndSendFile (IAsyncResult asyncResult)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ ThrowIfDisposedAndClosed ();
- if (remoteEP == null)
- throw new ArgumentNullException ("remoteEP");
+ if (asyncResult == null)
+ throw new ArgumentNullException ("asyncResult");
- if (size < 0 || size > buffer.Length)
- throw new ArgumentOutOfRangeException ("size");
+ SendFileAsyncResult ares = asyncResult as SendFileAsyncResult;
+ if (ares == null)
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
- return ReceiveFrom_nochecks (buffer, 0, size, flags, ref remoteEP);
+ ares.Delegate.EndInvoke (ares.Original);
}
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int RecvFrom_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- ref SocketAddress sockaddr,
- out int error);
-
- private static int RecvFrom_internal (SafeSocketHandle safeHandle,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- ref SocketAddress sockaddr,
- out int error)
+ static bool SendFile_internal (SafeSocketHandle safeHandle, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags)
{
try {
safeHandle.RegisterForBlockingSyscall ();
- return RecvFrom_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, ref sockaddr, out error);
+ return SendFile_internal (safeHandle.DangerousGetHandle (), filename, pre_buffer, post_buffer, flags);
} finally {
safeHandle.UnRegisterForBlockingSyscall ();
}
}
- public int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags flags,
- ref EndPoint remoteEP)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static bool SendFile_internal (IntPtr sock, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags);
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ delegate void SendFileHandler (string fileName, byte [] preBuffer, byte [] postBuffer, TransmitFileOptions flags);
- if (remoteEP == null)
- throw new ArgumentNullException ("remoteEP");
+ sealed class SendFileAsyncResult : IAsyncResult {
+ IAsyncResult ares;
+ SendFileHandler d;
- CheckRange (buffer, offset, size);
+ public SendFileAsyncResult (SendFileHandler d, IAsyncResult ares)
+ {
+ this.d = d;
+ this.ares = ares;
+ }
- return ReceiveFrom_nochecks (buffer, offset, size, flags, ref remoteEP);
- }
+ public object AsyncState {
+ get { return ares.AsyncState; }
+ }
- internal int ReceiveFrom_nochecks (byte [] buf, int offset, int size, SocketFlags flags,
- ref EndPoint remote_end)
- {
- int error;
- return ReceiveFrom_nochecks_exc (buf, offset, size, flags, ref remote_end, true, out error);
- }
+ public WaitHandle AsyncWaitHandle {
+ get { return ares.AsyncWaitHandle; }
+ }
- internal int ReceiveFrom_nochecks_exc (byte [] buf, int offset, int size, SocketFlags flags,
- ref EndPoint remote_end, bool throwOnError, out int error)
- {
- SocketAddress sockaddr = remote_end.Serialize();
- int cnt = RecvFrom_internal (socket, buf, offset, size, flags, ref sockaddr, out error);
- SocketError err = (SocketError) error;
- if (err != 0) {
- if (err != SocketError.WouldBlock && err != SocketError.InProgress)
- connected = false;
- else if (err == SocketError.WouldBlock && blocking) { // This might happen when ReceiveTimeout is set
- if (throwOnError)
- throw new SocketException ((int) SocketError.TimedOut, timeout_exc_msg);
- error = (int) SocketError.TimedOut;
- return 0;
- }
+ public bool CompletedSynchronously {
+ get { return ares.CompletedSynchronously; }
+ }
- if (throwOnError)
- throw new SocketException (error);
- return 0;
+ public bool IsCompleted {
+ get { return ares.IsCompleted; }
}
- connected = true;
- isbound = true;
+ public SendFileHandler Delegate {
+ get { return d; }
+ }
- // If sockaddr is null then we're a connection
- // oriented protocol and should ignore the
- // remote_end parameter (see MSDN
- // documentation for Socket.ReceiveFrom(...) )
-
- if ( sockaddr != null ) {
- // Stupidly, EndPoint.Create() is an
- // instance method
- remote_end = remote_end.Create (sockaddr);
+ public IAsyncResult Original {
+ get { return ares; }
}
-
- seed_endpoint = remote_end;
-
- return cnt;
}
+#endregion
+
+#region SendPackets
+
[MonoTODO ("Not implemented")]
- public bool ReceiveMessageFromAsync (SocketAsyncEventArgs e)
+ public bool SendPacketsAsync (SocketAsyncEventArgs e)
{
// NO check is made whether e != null in MS.NET (NRE is thrown in such case)
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
+
+ ThrowIfDisposedAndClosed ();
+
throw new NotImplementedException ();
}
-
- [MonoTODO ("Not implemented")]
- public int ReceiveMessageFrom (byte[] buffer, int offset,
- int size,
- ref SocketFlags socketFlags,
- ref EndPoint remoteEP,
- out IPPacketInformation ipPacketInformation)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+#endregion
- if (remoteEP == null)
- throw new ArgumentNullException ("remoteEP");
+#region DuplicateAndClose
- CheckRange (buffer, offset, size);
+#if !MOBILE
+ [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)
+ {
+ var si = new SocketInformation ();
+ si.Options =
+ (is_listening ? SocketInformationOptions.Listening : 0) |
+ (is_connected ? SocketInformationOptions.Connected : 0) |
+ (is_blocking ? 0 : SocketInformationOptions.NonBlocking) |
+ (use_overlapped_io ? SocketInformationOptions.UseOnlyOverlappedIO : 0);
- /* FIXME: figure out how we get hold of the
- * IPPacketInformation
- */
- throw new NotImplementedException ();
- }
+ si.ProtocolInformation = Mono.DataConverter.Pack ("iiiil", (int)address_family, (int)socket_type, (int)protocol_type, is_bound ? 1 : 0, (long)Handle);
+ safe_handle = null;
- [MonoTODO ("Not implemented")]
- public bool SendPacketsAsync (SocketAsyncEventArgs e)
- {
- // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- throw new NotImplementedException ();
+ return si;
}
+#endif
- public int Send (byte [] buf)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+#endregion
- if (buf == null)
- throw new ArgumentNullException ("buf");
+#region GetSocketOption
- SocketError error;
+ public void GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, byte [] optionValue)
+ {
+ ThrowIfDisposedAndClosed ();
- int ret = Send_nochecks (buf, 0, buf.Length, SocketFlags.None, out error);
+ if (optionValue == null)
+ throw new SocketException ((int) SocketError.Fault, "Error trying to dereference an invalid pointer");
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
+ int error;
+ GetSocketOption_arr_internal (safe_handle, optionLevel, optionName, ref optionValue, out error);
- return ret;
+ if (error != 0)
+ throw new SocketException (error);
}
- public int Send (byte [] buf, SocketFlags flags)
+ public byte [] GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int length)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- if (buf == null)
- throw new ArgumentNullException ("buf");
+ int error;
+ byte[] byte_val = new byte [length];
+ GetSocketOption_arr_internal (safe_handle, optionLevel, optionName, ref byte_val, out error);
- SocketError error;
+ if (error != 0)
+ throw new SocketException (error);
- int ret = Send_nochecks (buf, 0, buf.Length, flags, out error);
+ return byte_val;
+ }
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
+ public object GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName)
+ {
+ ThrowIfDisposedAndClosed ();
- return ret;
+ int error;
+ object obj_val;
+ GetSocketOption_obj_internal (safe_handle, optionLevel, optionName, out obj_val, out error);
+
+ if (error != 0)
+ throw new SocketException (error);
+
+ if (optionName == SocketOptionName.Linger)
+ return (LingerOption) obj_val;
+ else if (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)
+ return (MulticastOption) obj_val;
+ else if (obj_val is int)
+ return (int) obj_val;
+ else
+ return obj_val;
}
- public int Send (byte [] buf, int size, SocketFlags flags)
+ static void GetSocketOption_arr_internal (SafeSocketHandle safeHandle, SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val, out int error)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ bool release = false;
+ try {
+ safeHandle.DangerousAddRef (ref release);
+ GetSocketOption_arr_internal (safeHandle.DangerousGetHandle (), level, name, ref byte_val, out error);
+ } finally {
+ if (release)
+ safeHandle.DangerousRelease ();
+ }
+ }
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static void GetSocketOption_arr_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val, out int error);
+
+ static void GetSocketOption_obj_internal (SafeSocketHandle safeHandle, SocketOptionLevel level, SocketOptionName name, out object obj_val, out int error)
+ {
+ bool release = false;
+ try {
+ safeHandle.DangerousAddRef (ref release);
+ GetSocketOption_obj_internal (safeHandle.DangerousGetHandle (), level, name, out obj_val, out error);
+ } finally {
+ if (release)
+ safeHandle.DangerousRelease ();
+ }
+ }
- if (buf == null)
- throw new ArgumentNullException ("buf");
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static void GetSocketOption_obj_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, out object obj_val, out int error);
- CheckRange (buf, 0, size);
+#endregion
- SocketError error;
+#region SetSocketOption
- int ret = Send_nochecks (buf, 0, size, flags, out error);
+ public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, byte [] optionValue)
+ {
+ ThrowIfDisposedAndClosed ();
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
+ // I'd throw an ArgumentNullException, but this is what MS does.
+ if (optionValue == null)
+ throw new SocketException ((int) SocketError.Fault, "Error trying to dereference an invalid pointer");
+
+ int error;
+ SetSocketOption_internal (safe_handle, optionLevel, optionName, null, optionValue, 0, out error);
- return ret;
+ if (error != 0) {
+ if (error == (int) SocketError.InvalidArgument)
+ throw new ArgumentException ();
+ throw new SocketException (error);
+ }
}
- public int Send (byte [] buf, int offset, int size, SocketFlags flags)
+ public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, object optionValue)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- if (buf == null)
- throw new ArgumentNullException ("buffer");
+ // NOTE: if a null is passed, the byte[] overload is used instead...
+ if (optionValue == null)
+ throw new ArgumentNullException("optionValue");
- CheckRange (buf, offset, size);
+ int error;
- SocketError error;
+ if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.Linger) {
+ LingerOption linger = optionValue as LingerOption;
+ if (linger == null)
+ throw new ArgumentException ("A 'LingerOption' value must be specified.", "optionValue");
+ SetSocketOption_internal (safe_handle, optionLevel, optionName, linger, null, 0, out error);
+ } else if (optionLevel == SocketOptionLevel.IP && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
+ MulticastOption multicast = optionValue as MulticastOption;
+ if (multicast == null)
+ throw new ArgumentException ("A 'MulticastOption' value must be specified.", "optionValue");
+ SetSocketOption_internal (safe_handle, optionLevel, optionName, multicast, null, 0, out error);
+ } else if (optionLevel == SocketOptionLevel.IPv6 && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
+ IPv6MulticastOption multicast = optionValue as IPv6MulticastOption;
+ if (multicast == null)
+ throw new ArgumentException ("A 'IPv6MulticastOption' value must be specified.", "optionValue");
+ SetSocketOption_internal (safe_handle, optionLevel, optionName, multicast, null, 0, out error);
+ } else {
+ throw new ArgumentException ("Invalid value specified.", "optionValue");
+ }
+
+ if (error != 0) {
+ if (error == (int) SocketError.InvalidArgument)
+ throw new ArgumentException ();
+ throw new SocketException (error);
+ }
+ }
- int ret = Send_nochecks (buf, offset, size, flags, out error);
+ public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, bool optionValue)
+ {
+ ThrowIfDisposedAndClosed ();
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
+ int error;
+ int int_val = optionValue ? 1 : 0;
+ SetSocketOption_internal (safe_handle, optionLevel, optionName, null, null, int_val, out error);
- return ret;
+ if (error != 0) {
+ if (error == (int) SocketError.InvalidArgument)
+ throw new ArgumentException ();
+ throw new SocketException (error);
+ }
}
- public int Send (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
+ public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ ThrowIfDisposedAndClosed ();
- if (buf == null)
- throw new ArgumentNullException ("buffer");
-
- CheckRange (buf, offset, size);
+ int error;
+ SetSocketOption_internal (safe_handle, optionLevel, optionName, null, null, optionValue, out error);
- return Send_nochecks (buf, offset, size, flags, out error);
+ if (error != 0) {
+ if (error == (int) SocketError.InvalidArgument)
+ throw new ArgumentException ();
+ throw new SocketException (error);
+ }
}
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool SendFile (IntPtr sock, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags);
-
- private static bool SendFile (SafeSocketHandle safeHandle, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags)
+ static void SetSocketOption_internal (SafeSocketHandle safeHandle, SocketOptionLevel level, SocketOptionName name, object obj_val, byte [] byte_val, int int_val, out int error)
{
+ bool release = false;
try {
- safeHandle.RegisterForBlockingSyscall ();
- return SendFile (safeHandle.DangerousGetHandle (), filename, pre_buffer, post_buffer, flags);
+ safeHandle.DangerousAddRef (ref release);
+ SetSocketOption_internal (safeHandle.DangerousGetHandle (), level, name, obj_val, byte_val, int_val, out error);
} finally {
- safeHandle.UnRegisterForBlockingSyscall ();
+ if (release)
+ safeHandle.DangerousRelease ();
}
}
- public void SendFile (string fileName)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (!connected)
- throw new NotSupportedException ();
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static void SetSocketOption_internal (IntPtr socket, SocketOptionLevel level, SocketOptionName name, object obj_val, byte [] byte_val, int int_val, out int error);
- if (!blocking)
- throw new InvalidOperationException ();
+#endregion
- SendFile (fileName, null, null, 0);
- }
+#region IOControl
- public void SendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags)
+ public int IOControl (int ioctl_code, byte [] in_value, byte [] out_value)
{
- if (disposed && closed)
+ if (is_disposed)
throw new ObjectDisposedException (GetType ().ToString ());
- if (!connected)
- throw new NotSupportedException ();
+ int error;
+ int result = IOControl_internal (safe_handle, ioctl_code, in_value, out_value, out error);
- if (!blocking)
- throw new InvalidOperationException ();
+ if (error != 0)
+ throw new SocketException (error);
+ if (result == -1)
+ throw new InvalidOperationException ("Must use Blocking property instead.");
- if (!SendFile (socket, fileName, preBuffer, postBuffer, flags)) {
- SocketException exc = new SocketException ();
- if (exc.ErrorCode == 2 || exc.ErrorCode == 3)
- throw new FileNotFoundException ();
- throw exc;
- }
+ return result;
}
- public bool SendToAsync (SocketAsyncEventArgs e)
+ public int IOControl (IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
{
- // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
-
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
- if (e.BufferList != null)
- throw new NotSupportedException ("Mono doesn't support using BufferList at this point.");
- if (e.RemoteEndPoint == null)
- throw new ArgumentNullException ("remoteEP", "Value cannot be null.");
+ return IOControl ((int) ioControlCode, optionInValue, optionOutValue);
+ }
- e.curSocket = this;
- e.Worker.Init (this, e, SocketOperation.SendTo);
- SocketAsyncResult res = e.Worker.result;
- res.Buffer = e.Buffer;
- res.Offset = e.Offset;
- res.Size = e.Count;
- res.SockFlags = e.SocketFlags;
- res.EndPoint = e.RemoteEndPoint;
- int count;
- lock (writeQ) {
- writeQ.Enqueue (e.Worker);
- count = writeQ.Count;
+ static int IOControl_internal (SafeSocketHandle safeHandle, int ioctl_code, byte [] input, byte [] output, out int error)
+ {
+ bool release = false;
+ try {
+ safeHandle.DangerousAddRef (ref release);
+ return IOControl_internal (safeHandle.DangerousGetHandle (), ioctl_code, input, output, out error);
+ } finally {
+ if (release)
+ safeHandle.DangerousRelease ();
}
- if (count == 1)
- socket_pool_queue (Worker.Dispatcher, res);
- return true;
}
-
- public int SendTo (byte [] buffer, EndPoint remote_end)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ /* See Socket.IOControl, WSAIoctl documentation in MSDN. The common options between UNIX
+ * and Winsock are FIONREAD, FIONBIO and SIOCATMARK. Anything else will depend on the system
+ * except SIO_KEEPALIVE_VALS which is properly handled on both windows and linux. */
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static int IOControl_internal (IntPtr sock, int ioctl_code, byte [] input, byte [] output, out int error);
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
+#endregion
- return SendTo_nochecks (buffer, 0, buffer.Length, SocketFlags.None, remote_end);
+#region Close
+
+ public void Close ()
+ {
+ linger_timeout = 0;
+ Dispose ();
}
- public int SendTo (byte [] buffer, SocketFlags flags, EndPoint remote_end)
+ public void Close (int timeout)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ linger_timeout = timeout;
+ Dispose ();
+ }
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ internal extern static void Close_internal (IntPtr socket, out int error);
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
-
- return SendTo_nochecks (buffer, 0, buffer.Length, flags, remote_end);
- }
+#endregion
- public int SendTo (byte [] buffer, int size, SocketFlags flags, EndPoint remote_end)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+#region Shutdown
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ public void Shutdown (SocketShutdown how)
+ {
+ ThrowIfDisposedAndClosed ();
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
+ if (!is_connected)
+ throw new SocketException (10057); // Not connected
- CheckRange (buffer, 0, size);
+ int error;
+ Shutdown_internal (safe_handle, how, out error);
- return SendTo_nochecks (buffer, 0, size, flags, remote_end);
+ if (error != 0)
+ throw new SocketException (error);
}
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int SendTo_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- SocketAddress sa,
- out int error);
-
- private static int SendTo_internal (SafeSocketHandle safeHandle,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- SocketAddress sa,
- out int error)
+ static void Shutdown_internal (SafeSocketHandle safeHandle, SocketShutdown how, out int error)
{
+ bool release = false;
try {
- safeHandle.RegisterForBlockingSyscall ();
- return SendTo_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, sa, out error);
+ safeHandle.DangerousAddRef (ref release);
+ Shutdown_internal (safeHandle.DangerousGetHandle (), how, out error);
} finally {
- safeHandle.UnRegisterForBlockingSyscall ();
+ if (release)
+ safeHandle.DangerousRelease ();
}
}
- public int SendTo (byte [] buffer, int offset, int size, SocketFlags flags,
- EndPoint remote_end)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (remote_end == null)
- throw new ArgumentNullException("remote_end");
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ extern static void Shutdown_internal (IntPtr socket, SocketShutdown how, out int error);
- CheckRange (buffer, offset, size);
+#endregion
- return SendTo_nochecks (buffer, offset, size, flags, remote_end);
- }
+#region Dispose
- internal int SendTo_nochecks (byte [] buffer, int offset, int size, SocketFlags flags,
- EndPoint remote_end)
+ protected virtual void Dispose (bool disposing)
{
- SocketAddress sockaddr = remote_end.Serialize ();
+ if (is_disposed)
+ return;
- int ret, error;
+ is_disposed = true;
+ bool was_connected = is_connected;
+ is_connected = false;
- ret = SendTo_internal (socket, buffer, offset, size, flags, sockaddr, out error);
+ if (safe_handle != null) {
+ is_closed = true;
+ IntPtr x = Handle;
- SocketError err = (SocketError) error;
- if (err != 0) {
- if (err != SocketError.WouldBlock && err != SocketError.InProgress)
- connected = false;
+ if (was_connected)
+ Linger (x);
- throw new SocketException (error);
+ safe_handle.Dispose ();
}
+ }
- connected = true;
- isbound = true;
- seed_endpoint = remote_end;
-
- return ret;
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.SuppressFinalize (this);
}
- public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, byte [] optionValue)
+ void Linger (IntPtr handle)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ if (!is_connected || linger_timeout <= 0)
+ return;
- // I'd throw an ArgumentNullException, but this is what MS does.
- if (optionValue == null)
- throw new SocketException ((int) SocketError.Fault,
- "Error trying to dereference an invalid pointer");
-
+ /* We don't want to receive any more data */
int error;
+ Shutdown_internal (handle, SocketShutdown.Receive, out error);
- SetSocketOption_internal (socket, optionLevel, optionName, null,
- optionValue, 0, out error);
+ if (error != 0)
+ return;
- if (error != 0) {
- if (error == (int) SocketError.InvalidArgument)
- throw new ArgumentException ();
- throw new SocketException (error);
+ int seconds = linger_timeout / 1000;
+ int ms = linger_timeout % 1000;
+ if (ms > 0) {
+ /* If the other end closes, this will return 'true' with 'Available' == 0 */
+ Poll_internal (handle, SelectMode.SelectRead, ms * 1000, out error);
+ if (error != 0)
+ return;
+ }
+
+ if (seconds > 0) {
+ LingerOption linger = new LingerOption (true, seconds);
+ SetSocketOption_internal (handle, SocketOptionLevel.Socket, SocketOptionName.Linger, linger, null, 0, out error);
+ /* Not needed, we're closing upon return */
+ //if (error != 0)
+ // return;
}
}
- public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, object optionValue)
+#endregion
+
+ void ThrowIfDisposedAndClosed (Socket socket)
+ {
+ if (socket.is_disposed && socket.is_closed)
+ throw new ObjectDisposedException (socket.GetType ().ToString ());
+ }
+
+ void ThrowIfDisposedAndClosed ()
{
- if (disposed && closed)
+ if (is_disposed && is_closed)
throw new ObjectDisposedException (GetType ().ToString ());
+ }
- // NOTE: if a null is passed, the byte[] overload is used instead...
- if (optionValue == null)
- throw new ArgumentNullException("optionValue");
-
- int error;
+ void ThrowIfBufferNull (byte[] buffer)
+ {
+ if (buffer == null)
+ throw new ArgumentNullException ("buffer");
+ }
- if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.Linger) {
- LingerOption linger = optionValue as LingerOption;
- if (linger == null)
- throw new ArgumentException ("A 'LingerOption' value must be specified.", "optionValue");
- SetSocketOption_internal (socket, optionLevel, optionName, linger, null, 0, out error);
- } else if (optionLevel == SocketOptionLevel.IP && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
- MulticastOption multicast = optionValue as MulticastOption;
- if (multicast == null)
- throw new ArgumentException ("A 'MulticastOption' value must be specified.", "optionValue");
- SetSocketOption_internal (socket, optionLevel, optionName, multicast, null, 0, out error);
- } else if (optionLevel == SocketOptionLevel.IPv6 && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
- IPv6MulticastOption multicast = optionValue as IPv6MulticastOption;
- if (multicast == null)
- throw new ArgumentException ("A 'IPv6MulticastOption' value must be specified.", "optionValue");
- SetSocketOption_internal (socket, optionLevel, optionName, multicast, null, 0, out error);
- } else {
- throw new ArgumentException ("Invalid value specified.", "optionValue");
- }
+ void ThrowIfBufferOutOfRange (byte[] buffer, int offset, int size)
+ {
+ if (offset < 0)
+ throw new ArgumentOutOfRangeException ("offset", "offset must be >= 0");
+ if (offset > buffer.Length)
+ throw new ArgumentOutOfRangeException ("offset", "offset must be <= buffer.Length");
+ if (size < 0)
+ throw new ArgumentOutOfRangeException ("size", "size must be >= 0");
+ if (size > buffer.Length - offset)
+ throw new ArgumentOutOfRangeException ("size", "size must be <= buffer.Length - offset");
+ }
- if (error != 0) {
- if (error == (int) SocketError.InvalidArgument)
- throw new ArgumentException ();
- throw new SocketException (error);
- }
+ void ThrowIfUdp ()
+ {
+#if !NET_2_1 || MOBILE
+ if (protocol_type == ProtocolType.Udp)
+ throw new SocketException ((int)SocketError.ProtocolOption);
+#endif
}
- public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, bool optionValue)
+ SocketAsyncResult ValidateEndIAsyncResult (IAsyncResult ares, string methodName, string argName)
{
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
+ if (ares == null)
+ throw new ArgumentNullException (argName);
- int error;
- int int_val = (optionValue) ? 1 : 0;
- SetSocketOption_internal (socket, optionLevel, optionName, null, null, int_val, out error);
- if (error != 0) {
- if (error == (int) SocketError.InvalidArgument)
- throw new ArgumentException ();
- throw new SocketException (error);
+ SocketAsyncResult sockares = ares as SocketAsyncResult;
+ if (sockares == null)
+ throw new ArgumentException ("Invalid IAsyncResult", argName);
+ if (Interlocked.CompareExchange (ref sockares.EndCalled, 1, 0) == 1)
+ throw new InvalidOperationException (methodName + " can only be called once per asynchronous operation");
+
+ return sockares;
+ }
+
+ void QueueSocketAsyncResult (Queue<SocketAsyncWorker> queue, SocketAsyncWorker worker, SocketAsyncResult sockares)
+ {
+ int count;
+ lock (queue) {
+ queue.Enqueue (worker);
+ count = queue.Count;
}
+
+ if (count == 1)
+ socket_pool_queue (SocketAsyncWorker.Dispatcher, sockares);
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ struct WSABUF {
+ public int len;
+ public IntPtr buf;
}
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ internal static extern void cancel_blocking_socket_operation (Thread thread);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ internal static extern void socket_pool_queue (SocketAsyncCallback d, SocketAsyncResult r);
}
}
--- /dev/null
+// System.Net.Sockets.SocketAsyncCallback.cs
+//
+// Authors:
+// Ludovic Henry <ludovic@xamarin.com>
+//
+// Copyright (C) 2015 Xamarin, Inc. (https://www.xamarin.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.Net.Sockets
+{
+ internal delegate void SocketAsyncCallback (SocketAsyncResult sar);
+}
{
bool disposed;
int in_progress;
- internal Socket.Worker Worker;
+ internal SocketAsyncWorker Worker;
EndPoint remote_ep;
public Exception ConnectByNameError { get; internal set; }
public SocketAsyncEventArgs ()
{
- Worker = new Socket.Worker (this);
+ Worker = new SocketAsyncWorker (this);
AcceptSocket = null;
Buffer = null;
BufferList = null;
static void DispatcherCB (IAsyncResult ares)
{
SocketAsyncEventArgs args = (SocketAsyncEventArgs) ares.AsyncState;
+
if (Interlocked.Exchange (ref args.in_progress, 0) != 1)
throw new InvalidOperationException ("No operation in progress");
- SocketAsyncOperation op = args.LastOperation;
- // Notes;
- // -SocketOperation.AcceptReceive not used in SocketAsyncEventArgs
- // -SendPackets and ReceiveMessageFrom are not implemented yet
- if (op == SocketAsyncOperation.Receive)
+
+ /* Notes;
+ * -SocketOperation.AcceptReceive not used in SocketAsyncEventArgs
+ * -SendPackets and ReceiveMessageFrom are not implemented yet */
+ switch (args.LastOperation) {
+ case SocketAsyncOperation.Receive:
args.ReceiveCallback (ares);
- else if (op == SocketAsyncOperation.Send)
+ break;
+ case SocketAsyncOperation.Send:
args.SendCallback (ares);
- else if (op == SocketAsyncOperation.ReceiveFrom)
+ break;
+ case SocketAsyncOperation.ReceiveFrom:
args.ReceiveFromCallback (ares);
- else if (op == SocketAsyncOperation.SendTo)
+ break;
+ case SocketAsyncOperation.SendTo:
args.SendToCallback (ares);
- else if (op == SocketAsyncOperation.Accept)
+ break;
+ case SocketAsyncOperation.Accept:
args.AcceptCallback (ares);
- else if (op == SocketAsyncOperation.Disconnect)
+ break;
+ case SocketAsyncOperation.Disconnect:
args.DisconnectCallback (ares);
- else if (op == SocketAsyncOperation.Connect)
+ break;
+ case SocketAsyncOperation.Connect:
args.ConnectCallback (ares);
+ break;
/*
- else if (op == Socket.SocketOperation.ReceiveMessageFrom)
- else if (op == Socket.SocketOperation.SendPackets)
+ case SocketOperation.ReceiveMessageFrom:
+ case SocketOperation.SendPackets:
*/
- else
- throw new NotImplementedException (String.Format ("Operation {0} is not implemented", op));
-
+ default:
+ throw new NotImplementedException (String.Format ("Operation {0} is not implemented", args.LastOperation));
+ }
}
internal void ReceiveCallback (IAsyncResult ares)
--- /dev/null
+// System.Net.Sockets.SocketAsyncResult.cs
+//
+// Authors:
+// Ludovic Henry <ludovic@xamarin.com>
+//
+// Copyright (C) 2015 Xamarin, Inc. (https://www.xamarin.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.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Runtime.Remoting.Messaging;
+using System.Threading;
+
+namespace System.Net.Sockets
+{
+ [StructLayout (LayoutKind.Sequential)]
+ internal sealed class SocketAsyncResult: IAsyncResult
+ {
+ /* Same structure in the runtime. Keep this in sync with
+ * MonoSocketAsyncResult in metadata/socket-io.h and
+ * ProcessAsyncReader in System.Diagnostics/Process.cs. */
+
+ public Socket socket;
+ IntPtr handle;
+ object state;
+ AsyncCallback callback; // used from the runtime
+ WaitHandle wait_handle;
+
+ Exception delayed_exception;
+
+ public EndPoint EndPoint; // Connect,ReceiveFrom,SendTo
+ public byte [] Buffer; // Receive,ReceiveFrom,Send,SendTo
+ public int Offset; // Receive,ReceiveFrom,Send,SendTo
+ public int Size; // Receive,ReceiveFrom,Send,SendTo
+ public SocketFlags SockFlags; // Receive,ReceiveFrom,Send,SendTo
+ public Socket AcceptSocket; // AcceptReceive
+ public IPAddress[] Addresses; // Connect
+ public int Port; // Connect
+ public IList<ArraySegment<byte>> Buffers; // Receive, Send
+ public bool ReuseSocket; // Disconnect
+
+ // Return values
+ Socket accept_socket;
+ int total;
+
+ bool completed_synchronously;
+ bool completed;
+ bool is_blocking;
+ internal int error;
+ public SocketOperation operation;
+ AsyncResult async_result;
+ public int EndCalled;
+
+ /* These fields are not in MonoSocketAsyncResult */
+ public SocketAsyncWorker Worker;
+ public int CurrentAddress; // Connect
+
+ public SocketAsyncResult ()
+ {
+ }
+
+ public SocketAsyncResult (Socket socket, object state, AsyncCallback callback, SocketOperation operation)
+ {
+ Init (socket, state, callback, operation, new SocketAsyncWorker (this));
+ }
+
+ public object AsyncState {
+ get {
+ return state;
+ }
+ }
+
+ public WaitHandle AsyncWaitHandle {
+ get {
+ lock (this) {
+ if (wait_handle == null)
+ wait_handle = new ManualResetEvent (completed);
+ }
+
+ return wait_handle;
+ }
+ set {
+ wait_handle = value;
+ }
+ }
+
+ public bool CompletedSynchronously {
+ get {
+ return completed_synchronously;
+ }
+ }
+
+ public bool IsCompleted {
+ get {
+ return completed;
+ }
+ set {
+ completed = value;
+ lock (this) {
+ if (wait_handle != null && value)
+ ((ManualResetEvent) wait_handle).Set ();
+ }
+ }
+ }
+
+ public Socket Socket {
+ get {
+ return accept_socket;
+ }
+ }
+
+ public int Total {
+ get { return total; }
+ set { total = value; }
+ }
+
+ public SocketError ErrorCode {
+ get {
+ SocketException ex = delayed_exception as SocketException;
+ if (ex != null)
+ return ex.SocketErrorCode;
+
+ if (error != 0)
+ return (SocketError) error;
+
+ return SocketError.Success;
+ }
+ }
+
+ public void Init (Socket socket, object state, AsyncCallback callback, SocketOperation operation, SocketAsyncWorker worker)
+ {
+ this.socket = socket;
+ this.is_blocking = socket != null ? socket.is_blocking : true;
+ this.handle = socket != null ? socket.Handle : IntPtr.Zero;
+ this.state = state;
+ this.callback = callback;
+ this.operation = operation;
+
+ if (wait_handle != null)
+ ((ManualResetEvent) wait_handle).Reset ();
+
+ delayed_exception = null;
+
+ EndPoint = null;
+ Buffer = null;
+ Offset = 0;
+ Size = 0;
+ SockFlags = SocketFlags.None;
+ AcceptSocket = null;
+ Addresses = null;
+ Port = 0;
+ Buffers = null;
+ ReuseSocket = false;
+ accept_socket = null;
+ total = 0;
+
+ completed_synchronously = false;
+ completed = false;
+ is_blocking = false;
+ error = 0;
+ async_result = null;
+ EndCalled = 0;
+ Worker = worker;
+ }
+
+ public void DoMConnectCallback ()
+ {
+ if (callback == null)
+ return;
+ ThreadPool.UnsafeQueueUserWorkItem (_ => callback (this), null);
+ }
+
+ public void Dispose ()
+ {
+ Init (null, null, null, 0, Worker);
+ if (wait_handle != null) {
+ wait_handle.Close ();
+ wait_handle = null;
+ }
+ }
+
+ public void CheckIfThrowDelayedException ()
+ {
+ if (delayed_exception != null) {
+ socket.is_connected = false;
+ throw delayed_exception;
+ }
+
+ if (error != 0) {
+ socket.is_connected = false;
+ throw new SocketException (error);
+ }
+ }
+
+ void CompleteDisposed (object unused)
+ {
+ Complete ();
+ }
+
+ public void Complete ()
+ {
+ if (operation != SocketOperation.Receive && socket.is_disposed)
+ delayed_exception = new ObjectDisposedException (socket.GetType ().ToString ());
+
+ IsCompleted = true;
+
+ Queue<SocketAsyncWorker> queue = null;
+ switch (operation) {
+ case SocketOperation.Receive:
+ case SocketOperation.ReceiveFrom:
+ case SocketOperation.ReceiveGeneric:
+ case SocketOperation.Accept:
+ queue = socket.readQ;
+ break;
+ case SocketOperation.Send:
+ case SocketOperation.SendTo:
+ case SocketOperation.SendGeneric:
+ queue = socket.writeQ;
+ break;
+ }
+
+ if (queue != null) {
+ lock (queue) {
+ /* queue.Count will only be 0 if the socket is closed while receive/send/accept
+ * operation(s) are pending and at least one call to this method is waiting
+ * on the lock while another one calls CompleteAllOnDispose() */
+ if (queue.Count > 0)
+ queue.Dequeue (); /* remove ourselves */
+ if (queue.Count > 0) {
+ if (!socket.is_disposed) {
+ Socket.socket_pool_queue (SocketAsyncWorker.Dispatcher, (queue.Peek ()).result);
+ } else {
+ /* CompleteAllOnDispose */
+ SocketAsyncWorker [] workers = queue.ToArray ();
+ for (int i = 0; i < workers.Length; i++)
+ ThreadPool.UnsafeQueueUserWorkItem (workers [i].result.CompleteDisposed, null);
+ queue.Clear ();
+ }
+ }
+ }
+ }
+
+ // IMPORTANT: 'callback', if any is scheduled from unmanaged code
+ }
+
+ public void Complete (bool synch)
+ {
+ this.completed_synchronously = synch;
+ Complete ();
+ }
+
+ public void Complete (int total)
+ {
+ this.total = total;
+ Complete ();
+ }
+
+ public void Complete (Exception e, bool synch)
+ {
+ this.completed_synchronously = synch;
+ this.delayed_exception = e;
+ Complete ();
+ }
+
+ public void Complete (Exception e)
+ {
+ this.delayed_exception = e;
+ Complete ();
+ }
+
+ public void Complete (Socket s)
+ {
+ this.accept_socket = s;
+ Complete ();
+ }
+
+ public void Complete (Socket s, int total)
+ {
+ this.accept_socket = s;
+ this.total = total;
+ Complete ();
+ }
+ }
+}
--- /dev/null
+// System.Net.Sockets.SocketAsyncWorker.cs
+//
+// Authors:
+// Ludovic Henry <ludovic@xamarin.com>
+//
+// Copyright (C) 2015 Xamarin, Inc. (https://www.xamarin.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.Net.Sockets
+{
+ internal sealed class SocketAsyncWorker
+ {
+ public SocketAsyncResult result;
+ SocketAsyncEventArgs args;
+
+ public SocketAsyncWorker (SocketAsyncEventArgs args)
+ {
+ this.args = args;
+ result = new SocketAsyncResult ();
+ result.Worker = this;
+ }
+
+ public SocketAsyncWorker (SocketAsyncResult ares)
+ {
+ this.result = ares;
+ }
+
+ public void Dispose ()
+ {
+ if (result != null) {
+ result.Dispose ();
+ result = null;
+ args = null;
+ }
+ }
+
+ public static SocketAsyncCallback Dispatcher = new SocketAsyncCallback (DispatcherCB);
+
+ static void DispatcherCB (SocketAsyncResult sar)
+ {
+ /* SendPackets and ReceiveMessageFrom are not implemented yet */
+ switch (sar.operation) {
+ case SocketOperation.Receive:
+ case SocketOperation.ReceiveGeneric:
+ case SocketOperation.RecvJustCallback:
+ sar.Worker.Receive ();
+ break;
+ case SocketOperation.Send:
+ case SocketOperation.SendGeneric:
+ case SocketOperation.SendJustCallback:
+ sar.Worker.Send ();
+ break;
+ case SocketOperation.ReceiveFrom:
+ sar.Worker.ReceiveFrom ();
+ break;
+ case SocketOperation.SendTo:
+ sar.Worker.SendTo ();
+ break;
+ case SocketOperation.Connect:
+ sar.Worker.Connect ();
+ break;
+ case SocketOperation.Accept:
+ sar.Worker.Accept ();
+ break;
+ case SocketOperation.AcceptReceive:
+ sar.Worker.AcceptReceive ();
+ break;
+ case SocketOperation.Disconnect:
+ sar.Worker.Disconnect ();
+ break;
+ // case SocketOperation.ReceiveMessageFrom
+ // sar.Worker.ReceiveMessageFrom ()
+ // break;
+ // case SocketOperation.SendPackets:
+ // sar.Worker.SendPackets ();
+ // break;
+ default:
+ throw new NotImplementedException (String.Format ("Operation {0} is not implemented", sar.operation));
+ }
+ }
+
+ /* This is called when reusing a SocketAsyncEventArgs */
+ public void Init (Socket sock, SocketAsyncEventArgs args, SocketOperation op)
+ {
+ result.Init (sock, args, SocketAsyncEventArgs.Dispatcher, op, this);
+
+ SocketAsyncOperation async_op;
+
+ // Notes;
+ // -SocketOperation.AcceptReceive not used in SocketAsyncEventArgs
+ // -SendPackets and ReceiveMessageFrom are not implemented yet
+ switch (op) {
+ case SocketOperation.Connect:
+ async_op = SocketAsyncOperation.Connect;
+ break;
+ case SocketOperation.Accept:
+ async_op = SocketAsyncOperation.Accept;
+ break;
+ case SocketOperation.Disconnect:
+ async_op = SocketAsyncOperation.Disconnect;
+ break;
+ case SocketOperation.Receive:
+ case SocketOperation.ReceiveGeneric:
+ async_op = SocketAsyncOperation.Receive;
+ break;
+ case SocketOperation.ReceiveFrom:
+ async_op = SocketAsyncOperation.ReceiveFrom;
+ break;
+ // case SocketOperation.ReceiveMessageFrom:
+ // async_op = SocketAsyncOperation.ReceiveMessageFrom;
+ // break;
+ case SocketOperation.Send:
+ case SocketOperation.SendGeneric:
+ async_op = SocketAsyncOperation.Send;
+ break;
+ // case SocketOperation.SendPackets:
+ // async_op = SocketAsyncOperation.SendPackets;
+ // break;
+ case SocketOperation.SendTo:
+ async_op = SocketAsyncOperation.SendTo;
+ break;
+ default:
+ throw new NotImplementedException (String.Format ("Operation {0} is not implemented", op));
+ }
+
+ args.SetLastOperation (async_op);
+ args.SocketError = SocketError.Success;
+ args.BytesTransferred = 0;
+ }
+
+ public void Accept ()
+ {
+ Socket acc_socket = null;
+ try {
+ if (args != null && args.AcceptSocket != null) {
+ result.socket.Accept (args.AcceptSocket);
+ acc_socket = args.AcceptSocket;
+ } else {
+ acc_socket = result.socket.Accept ();
+ if (args != null)
+ args.AcceptSocket = acc_socket;
+ }
+ } catch (Exception e) {
+ result.Complete (e);
+ return;
+ }
+
+ result.Complete (acc_socket);
+ }
+
+ /* only used in 2.0 profile and newer, but
+ * leave in older profiles to keep interface
+ * to runtime consistent
+ */
+ public void AcceptReceive ()
+ {
+ Socket acc_socket = null;
+ try {
+ if (result.AcceptSocket == null) {
+ acc_socket = result.socket.Accept ();
+ } else {
+ acc_socket = result.AcceptSocket;
+ result.socket.Accept (acc_socket);
+ }
+ } catch (Exception e) {
+ result.Complete (e);
+ return;
+ }
+
+ /* It seems the MS runtime
+ * special-cases 0-length requested
+ * receive data. See bug 464201.
+ */
+ int total = 0;
+ if (result.Size > 0) {
+ try {
+ SocketError error;
+ total = acc_socket.Receive_nochecks (result.Buffer, result.Offset, result.Size, result.SockFlags, out error);
+ if (error != 0) {
+ result.Complete (new SocketException ((int) error));
+ return;
+ }
+ } catch (Exception e) {
+ result.Complete (e);
+ return;
+ }
+ }
+
+ result.Complete (acc_socket, total);
+ }
+
+ public void Connect ()
+ {
+ if (result.EndPoint == null) {
+ result.Complete (new SocketException ((int)SocketError.AddressNotAvailable));
+ return;
+ }
+
+ SocketAsyncResult mconnect = result.AsyncState as SocketAsyncResult;
+ bool is_mconnect = (mconnect != null && mconnect.Addresses != null);
+ try {
+ int error_code;
+ EndPoint ep = result.EndPoint;
+ error_code = (int) result.socket.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
+ if (error_code == 0) {
+ if (is_mconnect)
+ result = mconnect;
+ result.socket.seed_endpoint = ep;
+ result.socket.is_connected = true;
+ result.socket.is_bound = true;
+ result.socket.connect_in_progress = false;
+ result.error = 0;
+ result.Complete ();
+ if (is_mconnect)
+ result.DoMConnectCallback ();
+ return;
+ }
+
+ if (!is_mconnect) {
+ result.socket.connect_in_progress = false;
+ result.Complete (new SocketException (error_code));
+ return;
+ }
+
+ if (mconnect.CurrentAddress >= mconnect.Addresses.Length) {
+ mconnect.Complete (new SocketException (error_code));
+ if (is_mconnect)
+ mconnect.DoMConnectCallback ();
+ return;
+ }
+ mconnect.socket.BeginMConnect (mconnect);
+ } catch (Exception e) {
+ result.socket.connect_in_progress = false;
+ if (is_mconnect)
+ result = mconnect;
+ result.Complete (e);
+ if (is_mconnect)
+ result.DoMConnectCallback ();
+ return;
+ }
+ }
+
+ /* Also only used in 2.0 profile and newer */
+ public void Disconnect ()
+ {
+ try {
+ if (args != null)
+ result.ReuseSocket = args.DisconnectReuseSocket;
+ result.socket.Disconnect (result.ReuseSocket);
+ } catch (Exception e) {
+ result.Complete (e);
+ return;
+ }
+ result.Complete ();
+ }
+
+ public void Receive ()
+ {
+ if (result.operation == SocketOperation.ReceiveGeneric) {
+ ReceiveGeneric ();
+ return;
+ }
+ // Actual recv() done in the runtime
+ result.Complete ();
+ }
+
+ public void ReceiveFrom ()
+ {
+ int total = 0;
+ try {
+ total = result.socket.ReceiveFrom_nochecks (result.Buffer, result.Offset, result.Size, result.SockFlags, ref result.EndPoint);
+ } catch (Exception e) {
+ result.Complete (e);
+ return;
+ }
+
+ result.Complete (total);
+ }
+
+ public void ReceiveGeneric ()
+ {
+ int total = 0;
+ try {
+ total = result.socket.Receive (result.Buffers, result.SockFlags);
+ } catch (Exception e) {
+ result.Complete (e);
+ return;
+ }
+ result.Complete (total);
+ }
+
+ int send_so_far;
+
+ void UpdateSendValues (int last_sent)
+ {
+ if (result.error == 0) {
+ send_so_far += last_sent;
+ result.Offset += last_sent;
+ result.Size -= last_sent;
+ }
+ }
+
+ public void Send ()
+ {
+ if (result.operation == SocketOperation.SendGeneric) {
+ SendGeneric ();
+ return;
+ }
+ // Actual send() done in the runtime
+ if (result.error == 0) {
+ UpdateSendValues (result.Total);
+ if (result.socket.is_disposed) {
+ result.Complete ();
+ return;
+ }
+
+ if (result.Size > 0) {
+ Socket.socket_pool_queue (SocketAsyncWorker.Dispatcher, result);
+ return; // Have to finish writing everything. See bug #74475.
+ }
+ result.Total = send_so_far;
+ send_so_far = 0;
+ }
+ result.Complete ();
+ }
+
+ public void SendTo ()
+ {
+ int total = 0;
+ try {
+ total = result.socket.SendTo_nochecks (result.Buffer, result.Offset, result.Size, result.SockFlags, result.EndPoint);
+
+ UpdateSendValues (total);
+ if (result.Size > 0) {
+ Socket.socket_pool_queue (SocketAsyncWorker.Dispatcher, result);
+ return; // Have to finish writing everything. See bug #74475.
+ }
+ result.Total = send_so_far;
+ send_so_far = 0;
+ } catch (Exception e) {
+ send_so_far = 0;
+ result.Complete (e);
+ return;
+ }
+
+ result.Complete ();
+ }
+
+ public void SendGeneric ()
+ {
+ int total = 0;
+ try {
+ total = result.socket.Send (result.Buffers, result.SockFlags);
+ } catch (Exception e) {
+ result.Complete (e);
+ return;
+ }
+ result.Complete (total);
+ }
+ }
+}
--- /dev/null
+// System.Net.Sockets.SocketOperation.cs
+//
+// Authors:
+// Ludovic Henry <ludovic@xamarin.com>
+//
+// Copyright (C) 2015 Xamarin, Inc. (https://www.xamarin.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.Net.Sockets
+{
+ // Used by the runtime
+ internal enum SocketOperation {
+ Accept,
+ Connect,
+ Receive,
+ ReceiveFrom,
+ Send,
+ SendTo,
+ RecvJustCallback,
+ SendJustCallback,
+ UsedInProcess,
+ UsedInConsole2,
+ Disconnect,
+ AcceptReceive,
+ ReceiveGeneric,
+ SendGeneric
+ }
+}
+++ /dev/null
-// System.Net.Sockets.Socket.cs
-//
-// Authors:
-// Phillip Pearson (pp@myelin.co.nz)
-// Dick Porter <dick@ximian.com>
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-// Sridhar Kulkarni (sridharkulkarni@gmail.com)
-// Brian Nickel (brian.nickel@gmail.com)
-//
-// Copyright (C) 2001, 2002 Phillip Pearson and Ximian, Inc.
-// http://www.myelin.co.nz
-// (c) 2004-2011 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;
-using System.Net;
-using System.Collections;
-using System.Collections.Generic;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Threading;
-using System.IO;
-using System.Security;
-using System.Text;
-
-#if !NET_2_1
-using System.Net.Configuration;
-using System.Net.NetworkInformation;
-#endif
-
-namespace System.Net.Sockets {
-
- public partial class Socket : IDisposable {
- [StructLayout (LayoutKind.Sequential)]
- struct WSABUF {
- public int len;
- public IntPtr buf;
- }
-
- // Used by the runtime
- internal enum SocketOperation {
- Accept,
- Connect,
- Receive,
- ReceiveFrom,
- Send,
- SendTo,
- RecvJustCallback,
- SendJustCallback,
- UsedInProcess,
- UsedInConsole2,
- Disconnect,
- AcceptReceive,
- ReceiveGeneric,
- SendGeneric
- }
-
- [StructLayout (LayoutKind.Sequential)]
- internal sealed class SocketAsyncResult: IAsyncResult
- {
- /* Same structure in the runtime */
- /*
- Keep this in sync with MonoSocketAsyncResult in
- metadata/socket-io.h and ProcessAsyncReader
- in System.Diagnostics/Process.cs.
- */
-
- public Socket Sock;
- public IntPtr handle;
- object state;
- AsyncCallback callback; // used from the runtime
- WaitHandle waithandle;
-
- Exception delayedException;
-
- public EndPoint EndPoint; // Connect,ReceiveFrom,SendTo
- public byte [] Buffer; // Receive,ReceiveFrom,Send,SendTo
- public int Offset; // Receive,ReceiveFrom,Send,SendTo
- public int Size; // Receive,ReceiveFrom,Send,SendTo
- public SocketFlags SockFlags; // Receive,ReceiveFrom,Send,SendTo
- public Socket AcceptSocket; // AcceptReceive
- public IPAddress[] Addresses; // Connect
- public int Port; // Connect
- public IList<ArraySegment<byte>> Buffers; // Receive, Send
- public bool ReuseSocket; // Disconnect
-
- // Return values
- Socket acc_socket;
- int total;
-
- bool completed_sync;
- bool completed;
- public bool blocking;
- internal int error;
- public SocketOperation operation;
- public object ares;
- public int EndCalled;
-
- // These fields are not in MonoSocketAsyncResult
- public Worker Worker;
- public int CurrentAddress; // Connect
-
- public SocketAsyncResult ()
- {
- }
-
- public void Init (Socket sock, object state, AsyncCallback callback, SocketOperation operation)
- {
- this.Sock = sock;
- if (sock != null) {
- this.blocking = sock.blocking;
- this.handle = sock.Handle;
- } else {
- this.blocking = true;
- this.handle = IntPtr.Zero;
- }
- this.state = state;
- this.callback = callback;
- GC.KeepAlive (this.callback);
- this.operation = operation;
- SockFlags = SocketFlags.None;
- if (waithandle != null)
- ((ManualResetEvent) waithandle).Reset ();
-
- delayedException = null;
-
- EndPoint = null;
- Buffer = null;
- Offset = 0;
- Size = 0;
- SockFlags = 0;
- AcceptSocket = null;
- Addresses = null;
- Port = 0;
- Buffers = null;
- ReuseSocket = false;
- acc_socket = null;
- total = 0;
-
- completed_sync = false;
- completed = false;
- blocking = false;
- error = 0;
- ares = null;
- EndCalled = 0;
- Worker = null;
- }
-
- public void DoMConnectCallback ()
- {
- if (callback == null)
- return;
- ThreadPool.UnsafeQueueUserWorkItem (_ => { callback (this); }, null);
- }
-
- public void Dispose ()
- {
- Init (null, null, null, 0);
- if (waithandle != null) {
- waithandle.Close ();
- waithandle = null;
- }
- }
-
- public SocketAsyncResult (Socket sock, object state, AsyncCallback callback, SocketOperation operation)
- {
- this.Sock = sock;
- this.blocking = sock.blocking;
- this.handle = sock.Handle;
- this.state = state;
- this.callback = callback;
- GC.KeepAlive (this.callback);
- this.operation = operation;
- SockFlags = SocketFlags.None;
- Worker = new Worker (this);
- }
-
- public void CheckIfThrowDelayedException ()
- {
- if (delayedException != null) {
- Sock.connected = false;
- throw delayedException;
- }
-
- if (error != 0) {
- Sock.connected = false;
- throw new SocketException (error);
- }
- }
-
- void CompleteAllOnDispose (Queue queue)
- {
- object [] pending = queue.ToArray ();
- queue.Clear ();
-
- WaitCallback cb;
- for (int i = 0; i < pending.Length; i++) {
- Worker worker = (Worker) pending [i];
- SocketAsyncResult ares = worker.result;
- cb = new WaitCallback (ares.CompleteDisposed);
- ThreadPool.UnsafeQueueUserWorkItem (cb, null);
- }
- }
-
- void CompleteDisposed (object unused)
- {
- Complete ();
- }
-
- public void Complete ()
- {
- if (operation != SocketOperation.Receive && Sock.disposed)
- delayedException = new ObjectDisposedException (Sock.GetType ().ToString ());
-
- IsCompleted = true;
-
- Queue queue = null;
- if (operation == SocketOperation.Receive ||
- operation == SocketOperation.ReceiveFrom ||
- operation == SocketOperation.ReceiveGeneric ||
- operation == SocketOperation.Accept) {
- queue = Sock.readQ;
- } else if (operation == SocketOperation.Send ||
- operation == SocketOperation.SendTo ||
- operation == SocketOperation.SendGeneric) {
-
- queue = Sock.writeQ;
- }
-
- if (queue != null) {
- Worker worker = null;
- SocketAsyncCall sac = null;
- lock (queue) {
- // queue.Count will only be 0 if the socket is closed while receive/send/accept
- // operation(s) are pending and at least one call to this method is
- // waiting on the lock while another one calls CompleteAllOnDispose()
- if (queue.Count > 0)
- queue.Dequeue (); // remove ourselves
- if (queue.Count > 0) {
- worker = (Worker) queue.Peek ();
- if (!Sock.disposed) {
- sac = Worker.Dispatcher;
- } else {
- CompleteAllOnDispose (queue);
- }
- }
- }
-
- if (sac != null)
- Socket.socket_pool_queue (sac, worker.result);
- }
- // IMPORTANT: 'callback', if any is scheduled from unmanaged code
- }
-
- public void Complete (bool synch)
- {
- completed_sync = synch;
- Complete ();
- }
-
- public void Complete (int total)
- {
- this.total = total;
- Complete ();
- }
-
- public void Complete (Exception e, bool synch)
- {
- completed_sync = synch;
- delayedException = e;
- Complete ();
- }
-
- public void Complete (Exception e)
- {
- delayedException = e;
- Complete ();
- }
-
- public void Complete (Socket s)
- {
- acc_socket = s;
- Complete ();
- }
-
- public void Complete (Socket s, int total)
- {
- acc_socket = s;
- this.total = total;
- Complete ();
- }
-
- public object AsyncState {
- get {
- return state;
- }
- }
-
- public WaitHandle AsyncWaitHandle {
- get {
- lock (this) {
- if (waithandle == null)
- waithandle = new ManualResetEvent (completed);
- }
-
- return waithandle;
- }
- set {
- waithandle=value;
- }
- }
-
- public bool CompletedSynchronously {
- get {
- return(completed_sync);
- }
- }
-
- public bool IsCompleted {
- get {
- return(completed);
- }
- set {
- completed=value;
- lock (this) {
- if (waithandle != null && value) {
- ((ManualResetEvent) waithandle).Set ();
- }
- }
- }
- }
-
- public Socket Socket {
- get {
- return acc_socket;
- }
- }
-
- public int Total {
- get { return total; }
- set { total = value; }
- }
-
- public SocketError ErrorCode {
- get {
- SocketException ex = delayedException as SocketException;
- if (ex != null)
- return(ex.SocketErrorCode);
-
- if (error != 0)
- return((SocketError)error);
-
- return(SocketError.Success);
- }
- }
- }
-
- internal sealed class Worker
- {
- public SocketAsyncResult result;
- SocketAsyncEventArgs args;
-
- public Worker (SocketAsyncEventArgs args)
- {
- this.args = args;
- result = new SocketAsyncResult ();
- result.Worker = this;
- }
-
- public Worker (SocketAsyncResult ares)
- {
- this.result = ares;
- }
-
- public void Dispose ()
- {
- if (result != null) {
- result.Dispose ();
- result = null;
- args = null;
- }
- }
-
- public static SocketAsyncCall Dispatcher = new SocketAsyncCall (DispatcherCB);
-
- static void DispatcherCB (SocketAsyncResult sar)
- {
- SocketOperation op = sar.operation;
- if (op == Socket.SocketOperation.Receive || op == Socket.SocketOperation.ReceiveGeneric ||
- op == Socket.SocketOperation.RecvJustCallback)
- sar.Worker.Receive ();
- else if (op == Socket.SocketOperation.Send || op == Socket.SocketOperation.SendGeneric ||
- op == Socket.SocketOperation.SendJustCallback)
- sar.Worker.Send ();
- else if (op == Socket.SocketOperation.ReceiveFrom)
- sar.Worker.ReceiveFrom ();
- else if (op == Socket.SocketOperation.SendTo)
- sar.Worker.SendTo ();
- else if (op == Socket.SocketOperation.Connect)
- sar.Worker.Connect ();
- else if (op == Socket.SocketOperation.Accept)
- sar.Worker.Accept ();
- else if (op == Socket.SocketOperation.AcceptReceive)
- sar.Worker.AcceptReceive ();
- else if (op == Socket.SocketOperation.Disconnect)
- sar.Worker.Disconnect ();
-
- // SendPackets and ReceiveMessageFrom are not implemented yet
- /*
- else if (op == Socket.SocketOperation.ReceiveMessageFrom)
- async_op = SocketAsyncOperation.ReceiveMessageFrom;
- else if (op == Socket.SocketOperation.SendPackets)
- async_op = SocketAsyncOperation.SendPackets;
- */
- else
- throw new NotImplementedException (String.Format ("Operation {0} is not implemented", op));
- }
-
- /* This is called when reusing a SocketAsyncEventArgs */
- public void Init (Socket sock, SocketAsyncEventArgs args, SocketOperation op)
- {
- result.Init (sock, args, SocketAsyncEventArgs.Dispatcher, op);
- result.Worker = this;
- SocketAsyncOperation async_op;
-
- // Notes;
- // -SocketOperation.AcceptReceive not used in SocketAsyncEventArgs
- // -SendPackets and ReceiveMessageFrom are not implemented yet
- if (op == Socket.SocketOperation.Connect)
- async_op = SocketAsyncOperation.Connect;
- else if (op == Socket.SocketOperation.Accept)
- async_op = SocketAsyncOperation.Accept;
- else if (op == Socket.SocketOperation.Disconnect)
- async_op = SocketAsyncOperation.Disconnect;
- else if (op == Socket.SocketOperation.Receive || op == Socket.SocketOperation.ReceiveGeneric)
- async_op = SocketAsyncOperation.Receive;
- else if (op == Socket.SocketOperation.ReceiveFrom)
- async_op = SocketAsyncOperation.ReceiveFrom;
- /*
- else if (op == Socket.SocketOperation.ReceiveMessageFrom)
- async_op = SocketAsyncOperation.ReceiveMessageFrom;
- */
- else if (op == Socket.SocketOperation.Send || op == Socket.SocketOperation.SendGeneric)
- async_op = SocketAsyncOperation.Send;
- /*
- else if (op == Socket.SocketOperation.SendPackets)
- async_op = SocketAsyncOperation.SendPackets;
- */
- else if (op == Socket.SocketOperation.SendTo)
- async_op = SocketAsyncOperation.SendTo;
- else
- throw new NotImplementedException (String.Format ("Operation {0} is not implemented", op));
-
- args.SetLastOperation (async_op);
- args.SocketError = SocketError.Success;
- args.BytesTransferred = 0;
- }
-
- public void Accept ()
- {
- Socket acc_socket = null;
- try {
- if (args != null && args.AcceptSocket != null) {
- result.Sock.Accept (args.AcceptSocket);
- acc_socket = args.AcceptSocket;
- } else {
- acc_socket = result.Sock.Accept ();
- if (args != null)
- args.AcceptSocket = acc_socket;
- }
- } catch (Exception e) {
- result.Complete (e);
- return;
- }
-
- result.Complete (acc_socket);
- }
-
- /* only used in 2.0 profile and newer, but
- * leave in older profiles to keep interface
- * to runtime consistent
- */
- public void AcceptReceive ()
- {
- Socket acc_socket = null;
- try {
- if (result.AcceptSocket == null) {
- acc_socket = result.Sock.Accept ();
- } else {
- acc_socket = result.AcceptSocket;
- result.Sock.Accept (acc_socket);
- }
- } catch (Exception e) {
- result.Complete (e);
- return;
- }
-
- /* It seems the MS runtime
- * special-cases 0-length requested
- * receive data. See bug 464201.
- */
- int total = 0;
- if (result.Size > 0) {
- try {
- SocketError error;
- total = acc_socket.Receive_nochecks (result.Buffer,
- result.Offset,
- result.Size,
- result.SockFlags,
- out error);
- if (error != 0) {
- result.Complete (new SocketException ((int) error));
- return;
- }
- } catch (Exception e) {
- result.Complete (e);
- return;
- }
- }
-
- result.Complete (acc_socket, total);
- }
-
- public void Connect ()
- {
- if (result.EndPoint == null) {
- result.Complete (new SocketException ((int)SocketError.AddressNotAvailable));
- return;
- }
-
- SocketAsyncResult mconnect = result.AsyncState as SocketAsyncResult;
- bool is_mconnect = (mconnect != null && mconnect.Addresses != null);
- try {
- int error_code;
- EndPoint ep = result.EndPoint;
- error_code = (int) result.Sock.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
- if (error_code == 0) {
- if (is_mconnect)
- result = mconnect;
- result.Sock.seed_endpoint = ep;
- result.Sock.connected = true;
- result.Sock.isbound = true;
- result.Sock.connect_in_progress = false;
- result.error = 0;
- result.Complete ();
- if (is_mconnect)
- result.DoMConnectCallback ();
- return;
- }
-
- if (!is_mconnect) {
- result.Sock.connect_in_progress = false;
- result.Complete (new SocketException (error_code));
- return;
- }
-
- if (mconnect.CurrentAddress >= mconnect.Addresses.Length) {
- mconnect.Complete (new SocketException (error_code));
- if (is_mconnect)
- mconnect.DoMConnectCallback ();
- return;
- }
- mconnect.Sock.BeginMConnect (mconnect);
- } catch (Exception e) {
- result.Sock.connect_in_progress = false;
- if (is_mconnect)
- result = mconnect;
- result.Complete (e);
- if (is_mconnect)
- result.DoMConnectCallback ();
- return;
- }
- }
-
- /* Also only used in 2.0 profile and newer */
- public void Disconnect ()
- {
- try {
- if (args != null)
- result.ReuseSocket = args.DisconnectReuseSocket;
- result.Sock.Disconnect (result.ReuseSocket);
- } catch (Exception e) {
- result.Complete (e);
- return;
- }
- result.Complete ();
- }
-
- public void Receive ()
- {
- if (result.operation == SocketOperation.ReceiveGeneric) {
- ReceiveGeneric ();
- return;
- }
- // Actual recv() done in the runtime
- result.Complete ();
- }
-
- public void ReceiveFrom ()
- {
- int total = 0;
- try {
- total = result.Sock.ReceiveFrom_nochecks (result.Buffer,
- result.Offset,
- result.Size,
- result.SockFlags,
- ref result.EndPoint);
- } catch (Exception e) {
- result.Complete (e);
- return;
- }
-
- result.Complete (total);
- }
-
- public void ReceiveGeneric ()
- {
- int total = 0;
- try {
- total = result.Sock.Receive (result.Buffers, result.SockFlags);
- } catch (Exception e) {
- result.Complete (e);
- return;
- }
- result.Complete (total);
- }
-
- int send_so_far;
-
- void UpdateSendValues (int last_sent)
- {
- if (result.error == 0) {
- send_so_far += last_sent;
- result.Offset += last_sent;
- result.Size -= last_sent;
- }
- }
-
- public void Send ()
- {
- if (result.operation == SocketOperation.SendGeneric) {
- SendGeneric ();
- return;
- }
- // Actual send() done in the runtime
- if (result.error == 0) {
- UpdateSendValues (result.Total);
- if (result.Sock.disposed) {
- result.Complete ();
- return;
- }
-
- if (result.Size > 0) {
- Socket.socket_pool_queue (Worker.Dispatcher, result);
- return; // Have to finish writing everything. See bug #74475.
- }
- result.Total = send_so_far;
- send_so_far = 0;
- }
- result.Complete ();
- }
-
- public void SendTo ()
- {
- int total = 0;
- try {
- total = result.Sock.SendTo_nochecks (result.Buffer,
- result.Offset,
- result.Size,
- result.SockFlags,
- result.EndPoint);
-
- UpdateSendValues (total);
- if (result.Size > 0) {
- Socket.socket_pool_queue (Worker.Dispatcher, result);
- return; // Have to finish writing everything. See bug #74475.
- }
- result.Total = send_so_far;
- send_so_far = 0;
- } catch (Exception e) {
- send_so_far = 0;
- result.Complete (e);
- return;
- }
-
- result.Complete ();
- }
-
- public void SendGeneric ()
- {
- int total = 0;
- try {
- total = result.Sock.Send (result.Buffers, result.SockFlags);
- } catch (Exception e) {
- result.Complete (e);
- return;
- }
- result.Complete (total);
- }
- }
-
- private Queue readQ = new Queue (2);
- private Queue writeQ = new Queue (2);
-
- internal delegate void SocketAsyncCall (SocketAsyncResult sar);
-
- /*
- * These two fields are looked up by name by the runtime, don't change
- * their name without also updating the runtime code.
- */
- private static int ipv4Supported = -1, ipv6Supported = -1;
- int linger_timeout;
-
- static Socket ()
- {
- // initialize ipv4Supported and ipv6Supported
- CheckProtocolSupport ();
- }
-
- internal static void CheckProtocolSupport ()
- {
- if(ipv4Supported == -1) {
- try {
- Socket tmp = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- tmp.Close();
-
- ipv4Supported = 1;
- } catch {
- ipv4Supported = 0;
- }
- }
-
- if (ipv6Supported == -1) {
- // We need to put a try/catch around ConfigurationManager methods as will always throw an exception
- // when run in a mono embedded application. This occurs as embedded applications do not have a setup
- // for application config. The exception is not thrown when called from a normal .NET application.
- //
- // We, then, need to guard calls to the ConfigurationManager. If the config is not found or throws an
- // exception, will fall through to the existing Socket / API directly below in the code.
- //
- // Also note that catching ConfigurationErrorsException specifically would require library dependency
- // System.Configuration, and wanted to avoid that.
-#if !NET_2_1
-#if CONFIGURATION_DEP
- try {
- SettingsSection config;
- config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
- if (config != null)
- ipv6Supported = config.Ipv6.Enabled ? -1 : 0;
- } catch {
- ipv6Supported = -1;
- }
-#else
- try {
- NetConfig config = System.Configuration.ConfigurationSettings.GetConfig("system.net/settings") as NetConfig;
- if (config != null)
- ipv6Supported = config.ipv6Enabled ? -1 : 0;
- } catch {
- ipv6Supported = -1;
- }
-#endif
-#endif
- if (ipv6Supported != 0) {
- try {
- Socket tmp = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
- tmp.Close();
-
- ipv6Supported = 1;
- } catch {
- ipv6Supported = 0;
- }
- }
- }
- }
-
- public static bool SupportsIPv4 {
- get {
- CheckProtocolSupport();
- return ipv4Supported == 1;
- }
- }
-
- [ObsoleteAttribute ("Use OSSupportsIPv6 instead")]
- public static bool SupportsIPv6 {
- get {
- CheckProtocolSupport();
- return ipv6Supported == 1;
- }
- }
-#if NET_2_1
- public static bool OSSupportsIPv4 {
- get {
- CheckProtocolSupport();
- return ipv4Supported == 1;
- }
- }
-#endif
-#if NET_2_1
- public static bool OSSupportsIPv6 {
- get {
- CheckProtocolSupport();
- return ipv6Supported == 1;
- }
- }
-#else
- public static bool OSSupportsIPv6 {
- get {
- NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces ();
-
- foreach (NetworkInterface adapter in nics) {
- if (adapter.Supports (NetworkInterfaceComponent.IPv6))
- return true;
- }
- return false;
- }
- }
-#endif
-
- /* the field "socket" is looked up by name by the runtime */
- private SafeSocketHandle socket;
- private AddressFamily address_family;
- private SocketType socket_type;
- private ProtocolType protocol_type;
- internal bool blocking=true;
- private bool isbound;
- /* When true, the socket was connected at the time of
- * the last IO operation
- */
- private bool connected;
- /* true if we called Close_internal */
- private bool closed;
- internal bool disposed;
- bool connect_in_progress;
-
- /*
- * This EndPoint is used when creating new endpoints. Because
- * there are many types of EndPoints possible,
- * seed_endpoint.Create(addr) is used for creating new ones.
- * As such, this value is set on Bind, SentTo, ReceiveFrom,
- * Connect, etc.
- */
- internal EndPoint seed_endpoint = null;
-
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern IntPtr Socket_internal(AddressFamily family,
- SocketType type,
- ProtocolType proto,
- out int error);
-
- public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
- {
-#if NET_2_1 && !MOBILE
- switch (addressFamily) {
- case AddressFamily.InterNetwork: // ok
- case AddressFamily.InterNetworkV6: // ok
- case AddressFamily.Unknown: // SocketException will be thrown later (with right error #)
- break;
- // case AddressFamily.Unspecified:
- default:
- throw new ArgumentException ("addressFamily");
- }
-
- switch (socketType) {
- case SocketType.Stream: // ok
- case SocketType.Unknown: // SocketException will be thrown later (with right error #)
- break;
- default:
- throw new ArgumentException ("socketType");
- }
-
- switch (protocolType) {
- case ProtocolType.Tcp: // ok
- case ProtocolType.Unspecified: // ok
- case ProtocolType.Unknown: // SocketException will be thrown later (with right error #)
- break;
- default:
- throw new ArgumentException ("protocolType");
- }
-#endif
- address_family = addressFamily;
- socket_type = socketType;
- protocol_type = protocolType;
-
- int error;
-
- var handle = Socket_internal (addressFamily, socketType, protocolType, out error);
- socket = new SafeSocketHandle (handle, true);
-
- if (error != 0)
- throw new SocketException (error);
-#if !NET_2_1 || MOBILE
- SocketDefaults ();
-#endif
- }
-
- [MonoTODO ("Currently hardcoded to IPv4. Ideally, support v4/v6 dual-stack.")]
- public Socket (SocketType socketType, ProtocolType protocolType)
- : this (AddressFamily.InterNetwork, socketType, protocolType)
- {
- }
-
- ~Socket ()
- {
- Dispose (false);
- }
-
-
- public AddressFamily AddressFamily {
- get { return address_family; }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern static void Blocking_internal(IntPtr socket,
- bool block,
- out int error);
-
- private static void Blocking_internal (SafeSocketHandle safeHandle,
- bool block,
- out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- Blocking_internal (safeHandle.DangerousGetHandle (), block, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
- }
-
- public bool Blocking {
- get {
- return(blocking);
- }
- set {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- int error;
-
- Blocking_internal (socket, value, out error);
-
- if (error != 0)
- throw new SocketException (error);
-
- blocking=value;
- }
- }
-
- public bool Connected {
- get { return connected; }
- internal set { connected = value; }
- }
-
- public ProtocolType ProtocolType {
- get { return protocol_type; }
- }
-
- public bool NoDelay {
- get {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- ThrowIfUpd ();
-
- return (int)(GetSocketOption (
- SocketOptionLevel.Tcp,
- SocketOptionName.NoDelay)) != 0;
- }
-
- set {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- ThrowIfUpd ();
-
- SetSocketOption (
- SocketOptionLevel.Tcp,
- SocketOptionName.NoDelay, value ? 1 : 0);
- }
- }
-
- public int ReceiveBufferSize {
- get {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
- return((int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer));
- }
- set {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
- if (value < 0) {
- throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
- }
-
- SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, value);
- }
- }
-
- public int SendBufferSize {
- get {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
- return((int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendBuffer));
- }
- set {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
- if (value < 0) {
- throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
- }
-
- SetSocketOption (SocketOptionLevel.Socket,
- SocketOptionName.SendBuffer,
- value);
- }
- }
-
- public short Ttl {
- get {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
-
- short ttl_val;
-
- if (address_family == AddressFamily.InterNetwork) {
- ttl_val = (short)((int)GetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive));
- } else if (address_family == AddressFamily.InterNetworkV6) {
- ttl_val = (short)((int)GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit));
- } else {
- throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
- }
-
- return(ttl_val);
- }
- set {
- if (disposed && closed) {
- throw new ObjectDisposedException (GetType ().ToString ());
- }
- if (value < 0) {
- throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
- }
-
- if (address_family == AddressFamily.InterNetwork) {
- SetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive, value);
- } else if (address_family == AddressFamily.InterNetworkV6) {
- SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit, value);
- } else {
- throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
- }
- }
- }
-
- // Returns the remote endpoint details in addr and port
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static SocketAddress RemoteEndPoint_internal(IntPtr socket, int family, out int error);
-
- private static SocketAddress RemoteEndPoint_internal (SafeSocketHandle safeHandle, int family, out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- return RemoteEndPoint_internal (safeHandle.DangerousGetHandle (), family, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
- }
-
- public EndPoint RemoteEndPoint {
- get {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- /*
- * If the seed EndPoint is null, Connect, Bind,
- * etc has not yet been called. MS returns null
- * in this case.
- */
- if (!connected || seed_endpoint == null)
- return null;
- SocketAddress sa;
- int error;
-
- sa=RemoteEndPoint_internal(socket, (int) address_family, out error);
-
- if (error != 0)
- throw new SocketException (error);
-
- return seed_endpoint.Create (sa);
- }
- }
-
- void Linger (IntPtr handle)
- {
- if (!connected || linger_timeout <= 0)
- return;
-
- // We don't want to receive any more data
- int error;
- Shutdown_internal (handle, SocketShutdown.Receive, out error);
- if (error != 0)
- return;
-
- int seconds = linger_timeout / 1000;
- int ms = linger_timeout % 1000;
- if (ms > 0) {
- // If the other end closes, this will return 'true' with 'Available' == 0
- Poll_internal (handle, SelectMode.SelectRead, ms * 1000, out error);
- if (error != 0)
- return;
-
- }
- if (seconds > 0) {
- LingerOption linger = new LingerOption (true, seconds);
- SetSocketOption_internal (handle, SocketOptionLevel.Socket, SocketOptionName.Linger, linger, null, 0, out error);
- /* Not needed, we're closing upon return */
- /*if (error != 0)
- return; */
- }
- }
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void cancel_blocking_socket_operation (Thread thread);
-
- protected virtual void Dispose (bool disposing)
- {
- if (disposed)
- return;
-
- disposed = true;
- bool was_connected = connected;
- connected = false;
-
- if (socket != null) {
- closed = true;
- IntPtr x = Handle;
-
- if (was_connected)
- Linger (x);
-
- socket.Dispose ();
- }
- }
-
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- // Closes the socket
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern static void Close_internal(IntPtr socket, out int error);
-
- public void Close ()
- {
- linger_timeout = 0;
- ((IDisposable) this).Dispose ();
- }
-
- public void Close (int timeout)
- {
- linger_timeout = timeout;
- ((IDisposable) this).Dispose ();
- }
-
- // Connects to the remote address
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Connect_internal(IntPtr sock,
- SocketAddress sa,
- out int error);
-
- private static void Connect_internal (SafeSocketHandle safeHandle,
- SocketAddress sa,
- out int error)
- {
- try {
- safeHandle.RegisterForBlockingSyscall ();
- Connect_internal (safeHandle.DangerousGetHandle (), sa, out error);
- } finally {
- safeHandle.UnRegisterForBlockingSyscall ();
- }
- }
-
- public void Connect (EndPoint remoteEP)
- {
- SocketAddress serial = null;
-
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (remoteEP == null)
- throw new ArgumentNullException ("remoteEP");
-
- IPEndPoint ep = remoteEP as IPEndPoint;
- if (ep != null && socket_type != SocketType.Dgram) /* Dgram uses Any to 'disconnect' */
- if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any))
- throw new SocketException ((int) SocketError.AddressNotAvailable);
-
- if (islistening)
- throw new InvalidOperationException ();
- serial = remoteEP.Serialize ();
-
- int error = 0;
-
- Connect_internal (socket, serial, out error);
-
- if (error == 0 || error == 10035)
- seed_endpoint = remoteEP; // Keep the ep around for non-blocking sockets
-
- if (error != 0) {
- if (closed)
- error = SOCKET_CLOSED;
- throw new SocketException (error);
- }
-
- if (socket_type == SocketType.Dgram && ep != null && (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)))
- connected = false;
- else
- connected = true;
- isbound = true;
- }
-
- public bool ReceiveAsync (SocketAsyncEventArgs e)
- {
- // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- // LAME SPEC: the ArgumentException is never thrown, instead an NRE is
- // thrown when e.Buffer and e.BufferList are null (works fine when one is
- // set to a valid object)
- if (e.Buffer == null && e.BufferList == null)
- throw new NullReferenceException ("Either e.Buffer or e.BufferList must be valid buffers.");
-
- e.curSocket = this;
- SocketOperation op = (e.Buffer != null) ? SocketOperation.Receive : SocketOperation.ReceiveGeneric;
- e.Worker.Init (this, e, op);
- SocketAsyncResult res = e.Worker.result;
- if (e.Buffer != null) {
- res.Buffer = e.Buffer;
- res.Offset = e.Offset;
- res.Size = e.Count;
- } else {
- res.Buffers = e.BufferList;
- }
- res.SockFlags = e.SocketFlags;
- int count;
- lock (readQ) {
- readQ.Enqueue (e.Worker);
- count = readQ.Count;
- }
- if (count == 1) {
- // Receive takes care of ReceiveGeneric
- socket_pool_queue (Worker.Dispatcher, res);
- }
-
- return true;
- }
-
- public bool SendAsync (SocketAsyncEventArgs e)
- {
- // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
- if (e.Buffer == null && e.BufferList == null)
- throw new NullReferenceException ("Either e.Buffer or e.BufferList must be valid buffers.");
-
- e.curSocket = this;
- SocketOperation op = (e.Buffer != null) ? SocketOperation.Send : SocketOperation.SendGeneric;
- e.Worker.Init (this, e, op);
- SocketAsyncResult res = e.Worker.result;
- if (e.Buffer != null) {
- res.Buffer = e.Buffer;
- res.Offset = e.Offset;
- res.Size = e.Count;
- } else {
- res.Buffers = e.BufferList;
- }
- res.SockFlags = e.SocketFlags;
- int count;
- lock (writeQ) {
- writeQ.Enqueue (e.Worker);
- count = writeQ.Count;
- }
- if (count == 1) {
- // Send takes care of SendGeneric
- socket_pool_queue (Worker.Dispatcher, res);
- }
- return true;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern static bool Poll_internal (IntPtr socket, SelectMode mode, int timeout, out int error);
-
- private static bool Poll_internal (SafeSocketHandle safeHandle, SelectMode mode, int timeout, out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- return Poll_internal (safeHandle.DangerousGetHandle (), mode, timeout, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Receive_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- out int error);
-
- private static int Receive_internal (SafeSocketHandle safeHandle,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- out int error)
- {
- try {
- safeHandle.RegisterForBlockingSyscall ();
- return Receive_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, out error);
- } finally {
- safeHandle.UnRegisterForBlockingSyscall ();
- }
- }
-
- internal int Receive_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
- {
- int nativeError;
- int ret = Receive_internal (socket, buf, offset, size, flags, out nativeError);
- error = (SocketError) nativeError;
- if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
- connected = false;
- isbound = false;
- } else {
- connected = true;
- }
-
- return ret;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void GetSocketOption_obj_internal(IntPtr socket,
- SocketOptionLevel level, SocketOptionName name, out object obj_val,
- out int error);
-
- private static void GetSocketOption_obj_internal (SafeSocketHandle safeHandle,
- SocketOptionLevel level, SocketOptionName name, out object obj_val,
- out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- GetSocketOption_obj_internal (safeHandle.DangerousGetHandle (), level, name, out obj_val, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Send_internal(IntPtr sock,
- byte[] buf, int offset,
- int count,
- SocketFlags flags,
- out int error);
-
- private static int Send_internal (SafeSocketHandle safeHandle,
- byte[] buf, int offset,
- int count,
- SocketFlags flags,
- out int error)
- {
- try {
- safeHandle.RegisterForBlockingSyscall ();
- return Send_internal (safeHandle.DangerousGetHandle (), buf, offset, count, flags, out error);
- } finally {
- safeHandle.UnRegisterForBlockingSyscall ();
- }
- }
-
- internal int Send_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
- {
- if (size == 0) {
- error = SocketError.Success;
- return 0;
- }
-
- int nativeError;
-
- int ret = Send_internal (socket, buf, offset, size, flags, out nativeError);
-
- error = (SocketError)nativeError;
-
- if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
- connected = false;
- isbound = false;
- } else {
- connected = true;
- }
-
- return ret;
- }
-
- public object GetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- object obj_val;
- int error;
-
- GetSocketOption_obj_internal (socket, optionLevel, optionName, out obj_val,
- out error);
- if (error != 0)
- throw new SocketException (error);
-
- if (optionName == SocketOptionName.Linger) {
- return((LingerOption)obj_val);
- } else if (optionName == SocketOptionName.AddMembership ||
- optionName == SocketOptionName.DropMembership) {
- return((MulticastOption)obj_val);
- } else if (obj_val is int) {
- return((int)obj_val);
- } else {
- return(obj_val);
- }
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static void Shutdown_internal (IntPtr socket, SocketShutdown how, out int error);
-
- private static void Shutdown_internal (SafeSocketHandle safeHandle, SocketShutdown how, out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- Shutdown_internal (safeHandle.DangerousGetHandle (), how, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
- }
-
- public void Shutdown (SocketShutdown how)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (!connected)
- throw new SocketException (10057); // Not connected
-
- int error;
-
- Shutdown_internal (socket, how, out error);
- if (error != 0)
- throw new SocketException (error);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void SetSocketOption_internal (IntPtr socket, SocketOptionLevel level,
- SocketOptionName name, object obj_val,
- byte [] byte_val, int int_val,
- out int error);
-
- private static void SetSocketOption_internal (SafeSocketHandle safeHandle, SocketOptionLevel level,
- SocketOptionName name, object obj_val,
- byte [] byte_val, int int_val,
- out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- SetSocketOption_internal (safeHandle.DangerousGetHandle (), level, name, obj_val, byte_val, int_val, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
- }
-
- public void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- int error;
-
- SetSocketOption_internal (socket, optionLevel, optionName, null,
- null, optionValue, out error);
-
- if (error != 0)
- throw new SocketException (error);
- }
-
- private void ThrowIfUpd ()
- {
-#if !NET_2_1 || MOBILE
- if (protocol_type == ProtocolType.Udp)
- throw new SocketException ((int)SocketError.ProtocolOption);
-#endif
- }
-
- public
- IAsyncResult BeginConnect(EndPoint end_point, AsyncCallback callback, object state)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (end_point == null)
- throw new ArgumentNullException ("end_point");
-
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Connect);
- req.EndPoint = end_point;
-
- // Bug #75154: Connect() should not succeed for .Any addresses.
- if (end_point is IPEndPoint) {
- IPEndPoint ep = (IPEndPoint) end_point;
- if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)) {
- req.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
- return req;
- }
- }
-
- int error = 0;
- if (connect_in_progress) {
- // This could happen when multiple IPs are used
- // Calling connect() again will reset the connection attempt and cause
- // an error. Better to just close the socket and move on.
- connect_in_progress = false;
- socket.Dispose ();
- var handle = Socket_internal (address_family, socket_type, protocol_type, out error);
- socket = new SafeSocketHandle (handle, true);
- if (error != 0)
- throw new SocketException (error);
- }
- bool blk = blocking;
- if (blk)
- Blocking = false;
- SocketAddress serial = end_point.Serialize ();
- Connect_internal (socket, serial, out error);
- if (blk)
- Blocking = true;
- if (error == 0) {
- // succeeded synch
- connected = true;
- isbound = true;
- req.Complete (true);
- return req;
- }
-
- if (error != (int) SocketError.InProgress && error != (int) SocketError.WouldBlock) {
- // error synch
- connected = false;
- isbound = false;
- req.Complete (new SocketException (error), true);
- return req;
- }
-
- // continue asynch
- connected = false;
- isbound = false;
- connect_in_progress = true;
- socket_pool_queue (Worker.Dispatcher, req);
- return req;
- }
-
- public
- IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback callback, object state)
-
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (addresses == null)
- throw new ArgumentNullException ("addresses");
-
- if (addresses.Length == 0)
- throw new ArgumentException ("Empty addresses list");
-
- if (this.AddressFamily != AddressFamily.InterNetwork &&
- this.AddressFamily != AddressFamily.InterNetworkV6)
- throw new NotSupportedException ("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
-
- if (port <= 0 || port > 65535)
- throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
- if (islistening)
- throw new InvalidOperationException ();
-
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Connect);
- req.Addresses = addresses;
- req.Port = port;
- connected = false;
- return BeginMConnect (req);
- }
-
- IAsyncResult BeginMConnect (SocketAsyncResult req)
- {
- IAsyncResult ares = null;
- Exception exc = null;
- for (int i = req.CurrentAddress; i < req.Addresses.Length; i++) {
- IPAddress addr = req.Addresses [i];
- IPEndPoint ep = new IPEndPoint (addr, req.Port);
- try {
- req.CurrentAddress++;
- ares = BeginConnect (ep, null, req);
- if (ares.IsCompleted && ares.CompletedSynchronously) {
- ((SocketAsyncResult) ares).CheckIfThrowDelayedException ();
- req.DoMConnectCallback ();
- }
- break;
- } catch (Exception e) {
- exc = e;
- ares = null;
- }
- }
-
- if (ares == null)
- throw exc;
-
- return req;
- }
-
- // Returns false when it is ok to use RemoteEndPoint
- // true when addresses must be used (and addresses could be null/empty)
- bool GetCheckedIPs (SocketAsyncEventArgs e, out IPAddress [] addresses)
- {
- addresses = null;
- // Connect to the first address that match the host name, like:
- // http://blogs.msdn.com/ncl/archive/2009/07/20/new-ncl-features-in-net-4-0-beta-2.aspx
- // while skipping entries that do not match the address family
- DnsEndPoint dep = (e.RemoteEndPoint as DnsEndPoint);
- if (dep != null) {
- addresses = Dns.GetHostAddresses (dep.Host);
- return true;
- } else {
- e.ConnectByNameError = null;
- return false;
- }
- }
-
- bool ConnectAsyncReal (SocketAsyncEventArgs e)
- {
- bool use_remoteep = true;
- IPAddress [] addresses = null;
- use_remoteep = !GetCheckedIPs (e, out addresses);
- e.curSocket = this;
- Worker w = e.Worker;
- w.Init (this, e, SocketOperation.Connect);
- SocketAsyncResult result = w.result;
- IAsyncResult ares = null;
- try {
- if (use_remoteep) {
- result.EndPoint = e.RemoteEndPoint;
- ares = BeginConnect (e.RemoteEndPoint, SocketAsyncEventArgs.Dispatcher, e);
- }
- else {
-
- DnsEndPoint dep = (e.RemoteEndPoint as DnsEndPoint);
- result.Addresses = addresses;
- result.Port = dep.Port;
-
- ares = BeginConnect (addresses, dep.Port, SocketAsyncEventArgs.Dispatcher, e);
- }
- if (ares.IsCompleted && ares.CompletedSynchronously) {
- ((SocketAsyncResult) ares).CheckIfThrowDelayedException ();
- return false;
- }
- } catch (Exception exc) {
- result.Complete (exc, true);
- return false;
- }
- return true;
- }
-
- public bool ConnectAsync (SocketAsyncEventArgs e)
- {
- // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
- if (islistening)
- throw new InvalidOperationException ("You may not perform this operation after calling the Listen method.");
- if (e.RemoteEndPoint == null)
- throw new ArgumentNullException ("remoteEP");
-
- return ConnectAsyncReal (e);
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static int Receive_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
-
- private static int Receive_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
- {
- try {
- safeHandle.RegisterForBlockingSyscall ();
- return Receive_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
- } finally {
- safeHandle.UnRegisterForBlockingSyscall ();
- }
- }
-
- public
- int Receive (IList<ArraySegment<byte>> buffers)
- {
- int ret;
- SocketError error;
- ret = Receive (buffers, SocketFlags.None, out error);
- if (error != SocketError.Success) {
- throw new SocketException ((int)error);
- }
- return(ret);
- }
-
- [CLSCompliant (false)]
- public
- int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
- {
- int ret;
- SocketError error;
- ret = Receive (buffers, socketFlags, out error);
- if (error != SocketError.Success) {
- throw new SocketException ((int)error);
- }
- return(ret);
- }
-
- [CLSCompliant (false)]
- public
- int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (buffers == null ||
- buffers.Count == 0) {
- throw new ArgumentNullException ("buffers");
- }
-
- int numsegments = buffers.Count;
- int nativeError;
- int ret;
-
- /* Only example I can find of sending a byte
- * array reference directly into an internal
- * call is in
- * System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc.Win32/NamedPipeSocket.cs,
- * so taking a lead from that...
- */
- WSABUF[] bufarray = new WSABUF[numsegments];
- GCHandle[] gch = new GCHandle[numsegments];
-
- for(int i = 0; i < numsegments; i++) {
- ArraySegment<byte> segment = buffers[i];
-
- if (segment.Offset < 0 || segment.Count < 0 ||
- segment.Count > segment.Array.Length - segment.Offset)
- throw new ArgumentOutOfRangeException ("segment");
-
- gch[i] = GCHandle.Alloc (segment.Array, GCHandleType.Pinned);
- bufarray[i].len = segment.Count;
- bufarray[i].buf = Marshal.UnsafeAddrOfPinnedArrayElement (segment.Array, segment.Offset);
- }
-
- try {
- ret = Receive_internal (socket, bufarray,
- socketFlags,
- out nativeError);
- } finally {
- for(int i = 0; i < numsegments; i++) {
- if (gch[i].IsAllocated) {
- gch[i].Free ();
- }
- }
- }
-
- errorCode = (SocketError)nativeError;
- return(ret);
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static int Send_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
-
- private static int Send_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
- {
- bool release = false;
- try {
- safeHandle.DangerousAddRef (ref release);
- return Send_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
- } finally {
- if (release)
- safeHandle.DangerousRelease ();
- }
- }
-
- public
- int Send (IList<ArraySegment<byte>> buffers)
- {
- int ret;
- SocketError error;
- ret = Send (buffers, SocketFlags.None, out error);
- if (error != SocketError.Success) {
- throw new SocketException ((int)error);
- }
- return(ret);
- }
-
- public
- int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
- {
- int ret;
- SocketError error;
- ret = Send (buffers, socketFlags, out error);
- if (error != SocketError.Success) {
- throw new SocketException ((int)error);
- }
- return(ret);
- }
-
- [CLSCompliant (false)]
- public
- int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
- if (buffers == null)
- throw new ArgumentNullException ("buffers");
- if (buffers.Count == 0)
- throw new ArgumentException ("Buffer is empty", "buffers");
- int numsegments = buffers.Count;
- int nativeError;
- int ret;
-
- WSABUF[] bufarray = new WSABUF[numsegments];
- GCHandle[] gch = new GCHandle[numsegments];
- for(int i = 0; i < numsegments; i++) {
- ArraySegment<byte> segment = buffers[i];
-
- if (segment.Offset < 0 || segment.Count < 0 ||
- segment.Count > segment.Array.Length - segment.Offset)
- throw new ArgumentOutOfRangeException ("segment");
-
- gch[i] = GCHandle.Alloc (segment.Array, GCHandleType.Pinned);
- bufarray[i].len = segment.Count;
- bufarray[i].buf = Marshal.UnsafeAddrOfPinnedArrayElement (segment.Array, segment.Offset);
- }
-
- try {
- ret = Send_internal (socket, bufarray, socketFlags, out nativeError);
- } finally {
- for(int i = 0; i < numsegments; i++) {
- if (gch[i].IsAllocated) {
- gch[i].Free ();
- }
- }
- }
- errorCode = (SocketError)nativeError;
- return(ret);
- }
-
- Exception InvalidAsyncOp (string method)
- {
- return new InvalidOperationException (method + " can only be called once per asynchronous operation");
- }
-
- public
- int EndReceive (IAsyncResult result)
- {
- SocketError error;
- int bytesReceived = EndReceive (result, out error);
- if (error != SocketError.Success) {
- if (error != SocketError.WouldBlock && error != SocketError.InProgress)
- connected = false;
- throw new SocketException ((int)error);
- }
- return bytesReceived;
- }
-
- public
- int EndReceive (IAsyncResult asyncResult, out SocketError errorCode)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
-
- SocketAsyncResult req = asyncResult as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
-
- if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
- throw InvalidAsyncOp ("EndReceive");
- if (!asyncResult.IsCompleted)
- asyncResult.AsyncWaitHandle.WaitOne ();
-
- errorCode = req.ErrorCode;
- // If no socket error occurred, call CheckIfThrowDelayedException in case there are other
- // kinds of exceptions that should be thrown.
- if (errorCode == SocketError.Success)
- req.CheckIfThrowDelayedException();
-
- return(req.Total);
- }
-
- public
- int EndSend (IAsyncResult result)
- {
- SocketError error;
- int bytesSent = EndSend (result, out error);
- if (error != SocketError.Success) {
- if (error != SocketError.WouldBlock && error != SocketError.InProgress)
- connected = false;
- throw new SocketException ((int)error);
- }
- return bytesSent;
- }
-
- public
- int EndSend (IAsyncResult asyncResult, out SocketError errorCode)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
-
- SocketAsyncResult req = asyncResult as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "result");
-
- if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
- throw InvalidAsyncOp ("EndSend");
- if (!asyncResult.IsCompleted)
- asyncResult.AsyncWaitHandle.WaitOne ();
-
- errorCode = req.ErrorCode;
- // If no socket error occurred, call CheckIfThrowDelayedException in case there are other
- // kinds of exceptions that should be thrown.
- if (errorCode == SocketError.Success)
- req.CheckIfThrowDelayedException ();
-
- return(req.Total);
- }
-
- // Used by Udpclient
- public
- int EndReceiveFrom(IAsyncResult result, ref EndPoint end_point)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if (result == null)
- throw new ArgumentNullException ("result");
-
- if (end_point == null)
- throw new ArgumentNullException ("remote_end");
-
- SocketAsyncResult req = result as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "result");
-
- if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
- throw InvalidAsyncOp ("EndReceiveFrom");
- if (!result.IsCompleted)
- result.AsyncWaitHandle.WaitOne();
-
- req.CheckIfThrowDelayedException();
- end_point = req.EndPoint;
- return req.Total;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static extern void socket_pool_queue (SocketAsyncCall d, SocketAsyncResult r);
- }
-}
-
static Dns ()
{
- System.Net.Sockets.Socket.CheckProtocolSupport();
-
#if !MOBILE
if (Environment.GetEnvironmentVariable ("MONO_DNS") != null) {
resolver = new SimpleResolver ();
}
public bool CloseConnectionGroup (string connectionGroupName)
{
+ WebConnectionGroup cncGroup = null;
+
lock (this) {
- WebConnectionGroup cncGroup = GetConnectionGroup (connectionGroupName);
+ cncGroup = GetConnectionGroup (connectionGroupName);
if (cncGroup != null) {
- cncGroup.Close ();
RemoveConnectionGroup (cncGroup);
- return true;
}
}
+ // WebConnectionGroup.Close() must *not* be called inside the lock
+ if (cncGroup != null) {
+ cncGroup.Close ();
+ return true;
+ }
+
return false;
}
public void Close ()
{
+ List<WebConnection> connectionsToClose = null;
+
//TODO: what do we do with the queue? Empty it out and abort the requests?
//TODO: abort requests or wait for them to finish
lock (sPoint) {
var node = iter;
iter = iter.Next;
+ // Closing connections inside the lock leads to a deadlock.
+ if (connectionsToClose == null)
+ connectionsToClose = new List<WebConnection>();
+
+ connectionsToClose.Add (cnc);
connections.Remove (node);
+ }
+ }
+
+ if (connectionsToClose != null) {
+ foreach (var cnc in connectionsToClose) {
cnc.Close (false);
OnConnectionClosed ();
}
internal const string nameSha1 = "sha1";
internal const string oidSubjectAltName = "2.5.29.17";
internal const string nameSubjectAltName = "Subject Alternative Name";
+ internal const string oidAes128 = "2.16.840.1.101.3.4.1.2";
+ internal const string nameAes128 = "aes128";
+ internal const string oidAes256 = "2.16.840.1.101.3.4.1.42";
+ internal const string nameAes256 = "aes256";
+ internal const string oidSha256 = "2.16.840.1.101.3.4.2.1";
+ internal const string nameSha256 = "sha256";
+ internal const string oidSha512 = "2.16.840.1.101.3.4.2.3";
+ internal const string nameSha512 = "sha512";
internal const string oidNetscapeCertType = "2.16.840.1.113730.1.1";
internal const string nameNetscapeCertType = "Netscape Cert Type";
return nameNetscapeCertType;
case oidMd5:
return nameMd5;
+ case oidAes128:
+ return nameAes128;
+ case oidAes256:
+ return nameAes256;
case oidSha1:
return nameSha1;
+ case oidSha256:
+ return nameSha256;
+ case oidSha512:
+ return nameSha512;
default:
return _name;
}
return oidNetscapeCertType;
case nameMd5:
return oidMd5;
+ case nameAes128:
+ return oidAes128;
+ case nameAes256:
+ return oidAes256;
case nameSha1:
return oidSha1;
+ case nameSha256:
+ return oidSha256;
+ case nameSha512:
+ return oidSha512;
default:
return _value;
}
System.Net.Sockets/SelectMode.cs
System.Net.Sockets/SendPacketsElement.cs
System.Net.Sockets/Socket.cs
-System.Net.Sockets/Socket_2_1.cs
+System.Net.Sockets/SocketAsyncCallback.cs
System.Net.Sockets/SocketAsyncEventArgs.cs
System.Net.Sockets/SocketAsyncOperation.cs
+System.Net.Sockets/SocketAsyncResult.cs
+System.Net.Sockets/SocketAsyncWorker.cs
System.Net.Sockets/SocketError.cs
System.Net.Sockets/SocketException.cs
System.Net.Sockets/SocketFlags.cs
System.Net.Sockets/SocketInformation.cs
System.Net.Sockets/SocketInformationOptions.cs
+System.Net.Sockets/SocketOperation.cs
System.Net.Sockets/SocketOptionLevel.cs
System.Net.Sockets/SocketOptionName.cs
System.Net.Sockets/SocketShutdown.cs
ReferenceSources/SystemNetworkCredential.cs
ReferenceSources/WebHeaderCollectionType.cs
ReferenceSources/Win32Exception.cs
+ReferenceSources/MonoSocketRuntimeWorkItem.cs
../../../external/referencesource/System/misc/PrivilegedConfigurationManager.cs
../../../external/referencesource/System/regex/system/text/regularexpressions/Regex.cs
../../../external/referencesource/System/sys/system/runtime/versioning/FrameworkName.cs
../../../external/referencesource/System/sys/system/threading/Barrier.cs
+../../../external/referencesource/System/sys/system/windows/markup/ValueSerializerAttribute.cs
../../../external/referencesource/System/security/system/security/permissions/typedescriptorpermission.cs
}
}
+ [Test] // Covers #26363
+ public void GetProcesses_StartTime ()
+ {
+ foreach (var p in Process.GetProcesses ()) {
+ if (!p.HasExited && p.StartTime.Year < 1800)
+ Assert.Fail ("Process should not be started since the 18th century.");
+ }
+ }
+
[Test]
public void PriorityClass_NotStarted ()
{
MemoryStream backing = new MemoryStream (data);
DeflateStream compressing = new DeflateStream (backing, CompressionMode.Decompress);
compressing.Read (dummy, 0, 1);
- }
+ }
[Test]
[ExpectedException (typeof (ArgumentNullException))]
backing.Close();
}
#endif
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void CheckBufferOverrun ()
+ {
+ byte[] data = new byte [20];
+ MemoryStream backing = new MemoryStream ();
+ DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
+ compressing.Write (data, 0, data.Length + 1);
+ compressing.Close ();
+ backing.Close ();
+ }
+
+ [Test]
+ public void Bug28777_EmptyFlush ()
+ {
+ MemoryStream backing = new MemoryStream ();
+ DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
+ compressing.Flush ();
+ compressing.Close ();
+ backing.Close ();
+ }
+
+ [Test]
+ public void Bug28777_DoubleFlush ()
+ {
+ byte[] buffer = new byte [4096];
+ MemoryStream backing = new MemoryStream ();
+ DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
+ compressing.Write (buffer, 0, buffer.Length);
+ compressing.Flush ();
+ compressing.Flush ();
+ compressing.Close ();
+ backing.Close ();
+ }
}
}
EndPoint remoteEP = new IPEndPoint (IPAddress.Loopback, 8001);
try {
- s.ReceiveFrom ((Byte []) null, -1, (SocketFlags) 666,
+ s.ReceiveFrom ((Byte []) null, 0, (SocketFlags) 666,
ref remoteEP);
Assert.Fail ("#1");
} catch (ArgumentNullException ex) {
byte [] buffer = new byte [5];
EndPoint remoteEP = null;
try {
- s.ReceiveFrom (buffer, -1, (SocketFlags) 666, ref remoteEP);
+ s.ReceiveFrom (buffer, buffer.Length, (SocketFlags) 666, ref remoteEP);
Assert.Fail ("#1");
} catch (ArgumentNullException ex) {
Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
EndPoint remoteEP = null;
try {
- s.ReceiveFrom (buffer, -1, -1, (SocketFlags) 666, ref remoteEP);
+ s.ReceiveFrom (buffer, 0, buffer.Length, (SocketFlags) 666, ref remoteEP);
Assert.Fail ("#1");
} catch (ArgumentNullException ex) {
Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
Oid o = new Oid ("1.2.840.113549.1.1.1");
Assert.AreEqual ("1.2.840.113549.1.1.1", o.Value, "RSA Value");
Assert.AreEqual ("RSA", o.FriendlyName, "RSA FriendlyName");
+ o = new Oid ();
+ o.FriendlyName = "RSA";
+ Assert.AreEqual (o.Value, "1.2.840.113549.1.1.1", "RSA Value from FriendlyName");
o = new Oid ("1.2.840.113549.1.7.1");
Assert.AreEqual ("1.2.840.113549.1.7.1", o.Value, "PKCS 7 Data Value");
o = new Oid ("1.2.840.113549.3.7");
Assert.AreEqual ("1.2.840.113549.3.7", o.Value, "3des Value");
Assert.AreEqual ("3des", o.FriendlyName, "3des FriendlyName");
+ o = new Oid ();
+ o.FriendlyName = "3des";
+ Assert.AreEqual (o.Value, "1.2.840.113549.3.7", "3des Value from FriendlyName");
+
+ o = new Oid ("2.16.840.1.101.3.4.1.2");
+ Assert.AreEqual ("2.16.840.1.101.3.4.1.2", o.Value, "aes128 Value");
+ Assert.AreEqual ("aes128", o.FriendlyName, "aes128 FriendlyName");
+ o = new Oid ();
+ o.FriendlyName = "aes128";
+ Assert.AreEqual (o.Value, "2.16.840.1.101.3.4.1.2", "aes123 Value from FriendlyName");
+
+ o = new Oid ("2.16.840.1.101.3.4.1.42");
+ Assert.AreEqual ("2.16.840.1.101.3.4.1.42", o.Value, "aes256 Value");
+ Assert.AreEqual ("aes256", o.FriendlyName, "aes256 FriendlyName");
+ o = new Oid ();
+ o.FriendlyName = "aes256";
+ Assert.AreEqual (o.Value, "2.16.840.1.101.3.4.1.42", "aes256 Value from FriendlyName");
+
+ o = new Oid ("2.16.840.1.101.3.4.2.1");
+ Assert.AreEqual ("2.16.840.1.101.3.4.2.1", o.Value, "sha256 Value");
+ Assert.AreEqual ("sha256", o.FriendlyName, "sha256 FriendlyName");
+ o = new Oid ();
+ o.FriendlyName = "sha256";
+ Assert.AreEqual (o.Value, "2.16.840.1.101.3.4.2.1", "sha256 Value from FriendlyName");
+
+ o = new Oid ("2.16.840.1.101.3.4.2.3");
+ Assert.AreEqual ("2.16.840.1.101.3.4.2.3", o.Value, "sha512 Value");
+ Assert.AreEqual ("sha512", o.FriendlyName, "sha512 FriendlyName");
+ o = new Oid ();
+ o.FriendlyName = "sha512";
+ Assert.AreEqual (o.Value, "2.16.840.1.101.3.4.2.3", "sha512 Value from FriendlyName");
// TODO: add other well known oid as we find them
}
System.Net.Sockets/SelectMode.cs
System.Net.Sockets/SendPacketsElement.cs
System.Net.Sockets/Socket.cs
+System.Net.Sockets/SocketAsyncCallback.cs
System.Net.Sockets/SocketAsyncEventArgs.cs
System.Net.Sockets/SocketAsyncOperation.cs
+System.Net.Sockets/SocketAsyncResult.cs
+System.Net.Sockets/SocketAsyncWorker.cs
System.Net.Sockets/SocketError.cs
System.Net.Sockets/SocketException.cs
System.Net.Sockets/SocketFlags.cs
System.Net.Sockets/SocketInformation.cs
System.Net.Sockets/SocketInformationOptions.cs
+System.Net.Sockets/SocketOperation.cs
System.Net.Sockets/SocketOptionLevel.cs
System.Net.Sockets/SocketOptionName.cs
System.Net.Sockets/SocketShutdown.cs
System.Net.Sockets/SocketType.cs
-System.Net.Sockets/Socket_2_1.cs
System.Net.Sockets/TcpClient.cs
System.Net.Sockets/TcpListener.cs
System.Net.Sockets/TransmitFileOptions.cs
resources/collation.cjkKO.bin \
resources/collation.cjkKOlv2.bin
-REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS
+REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION
MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime, $(PROFILE))
ifndef MOBILE_STATIC
-REFERENCE_SOURCES_FLAGS += -d:FEATURE_REMOTING,MONO_COM,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID
+REFERENCE_SOURCES_FLAGS += -d:FEATURE_REMOTING,MONO_COM
endif
LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
public unsafe int IndexOf (string s, string target, int start, int length, CompareOptions opt)
{
if (opt == CompareOptions.Ordinal)
- return IndexOfOrdinal (s, target, start, length);
+ throw new NotSupportedException ("Should not be reached");
if (opt == CompareOptions.OrdinalIgnoreCase)
- return IndexOfOrdinalIgnoreCase (s, target, start, length);
+ throw new NotSupportedException ("Should not be reached");
if (opt == CompareOptions.None) {
bool testWasUnable;
int ret = QuickIndexOf (s, target, start, length, out testWasUnable);
return -1;
}
- int IndexOfOrdinalIgnoreCase (string s, string target, int start, int length)
- {
- if (target.Length == 0)
- return 0;
- else if (target.Length > length)
- return -1;
-
- int end = start + length - target.Length + 1;
- for (int i = start; i < end; i++) {
- bool no = false;
- for (int j = 0; j < target.Length; j++) {
- // I think almost all text has more lower letters than upper ones. Thus with this invariant comparison ToLower() should be faster since it costs less operations.
- if (textInfo.ToLower (s [i + j]) != textInfo.ToLower (target [j])) {
- no = true;
- break;
- }
- }
- if (no)
- continue;
- return i;
- }
- return -1;
- }
-
// char
public int IndexOf (string s, char target, CompareOptions opt)
public unsafe int IndexOf (string s, char target, int start, int length, CompareOptions opt)
{
if (opt == CompareOptions.Ordinal)
- return IndexOfOrdinal (s, target, start, length);
+ throw new NotSupportedException ("Should not be reached");
if (opt == CompareOptions.OrdinalIgnoreCase)
- return IndexOfOrdinalIgnoreCase (s, target, start, length);
+ throw new NotSupportedException ("Should not be reached");
byte* alwaysMatchFlags = stackalloc byte [16];
byte* neverMatchFlags = stackalloc byte [16];
byte* targetSortKey = stackalloc byte [4];
return -1;
}
- int IndexOfOrdinalIgnoreCase (string s, char target, int start, int length)
- {
- int end = start + length;
- target = textInfo.ToLower (target);
- for (int i = start; i < end; i++)
- if (textInfo.ToLower (s [i]) == target)
- return i;
- return -1;
- }
-
// Searches target byte[] keydata
unsafe int IndexOfSortKey (string s, int start, int length, byte* sortkey, char target, int ti, bool noLv4, ref Context ctx)
{
if (opt == CompareOptions.Ordinal)
return LastIndexOfOrdinal (s, target, start, length);
if (opt == CompareOptions.OrdinalIgnoreCase)
- return LastIndexOfOrdinalIgnoreCase (s, target, start, length);
+ throw new NotSupportedException ("Should not be reached");
byte* alwaysMatchFlags = stackalloc byte [16];
byte* neverMatchFlags = stackalloc byte [16];
byte* targetSortKey = stackalloc byte [4];
return -1;
}
- int LastIndexOfOrdinalIgnoreCase (string s, string target, int start, int length)
- {
- if (target.Length == 0)
- return start;
- if (s.Length < length || target.Length > length)
- return -1;
- int end = start - length + target.Length - 1;
- char tail = textInfo.ToLower (target [target.Length - 1]);
- for (int i = start; i > end;) {
- if (textInfo.ToLower (s [i]) != tail) {
- i--;
- continue;
- }
- int x = i - target.Length + 1;
- i--;
- bool mismatch = false;
- for (int j = target.Length - 2; j >= 0; j--)
- if (textInfo.ToLower (s [x + j]) != textInfo.ToLower (target [j])) {
- mismatch = true;
- break;
- }
- if (mismatch)
- continue;
- return x;
- }
- return -1;
- }
-
// char
public int LastIndexOf (string s, char target, CompareOptions opt)
public unsafe int LastIndexOf (string s, char target, int start, int length, CompareOptions opt)
{
if (opt == CompareOptions.Ordinal)
- return LastIndexOfOrdinal (s, target, start, length);
+ throw new NotSupportedException ();
if (opt == CompareOptions.OrdinalIgnoreCase)
- return LastIndexOfOrdinalIgnoreCase (s, target, start, length);
+ throw new NotSupportedException ();
byte* alwaysMatchFlags = stackalloc byte [16];
byte* neverMatchFlags = stackalloc byte [16];
byte* targetSortKey = stackalloc byte [4];
return -1;
}
- int LastIndexOfOrdinalIgnoreCase (string s, char target, int start, int length)
- {
- if (s.Length == 0)
- return -1;
- int end = start - length;
- char c = textInfo.ToUpper (target);
- for (int i = start; i > end; i--)
- if (textInfo.ToUpper (s [i]) == c)
- return i;
- return -1;
- }
-
// Searches target byte[] keydata
unsafe int LastIndexOfSortKey (string s, int start, int orgStart, int length, byte* sortkey, int ti, bool noLv4, ref Context ctx)
{
--- /dev/null
+namespace System
+{
+ partial class Buffer
+ {
+ public static int ByteLength (Array array)
+ {
+ // note: the other methods in this class also use ByteLength to test for
+ // null and non-primitive arguments as a side-effect.
+
+ if (array == null)
+ throw new ArgumentNullException ("array");
+
+ int length = _ByteLength (array);
+ if (length < 0)
+ throw new ArgumentException (Locale.GetText ("Object must be an array of primitives."));
+
+ return length;
+ }
+
+ public static byte GetByte (Array array, int index)
+ {
+ if (index < 0 || index >= ByteLength (array))
+ throw new ArgumentOutOfRangeException ("index");
+
+ return _GetByte (array, index);
+ }
+
+ public static void SetByte (Array array, int index, byte value)
+ {
+ if (index < 0 || index >= ByteLength (array))
+ throw new ArgumentOutOfRangeException ("index");
+
+ _SetByte (array, index, value);
+ }
+
+ public static void BlockCopy (Array src, int srcOffset, Array dst, int dstOffset, int count)
+ {
+ if (src == null)
+ throw new ArgumentNullException ("src");
+
+ if (dst == null)
+ throw new ArgumentNullException ("dst");
+
+ if (srcOffset < 0)
+ throw new ArgumentOutOfRangeException ("srcOffset", Locale.GetText(
+ "Non-negative number required."));
+
+ if (dstOffset < 0)
+ throw new ArgumentOutOfRangeException ("dstOffset", Locale.GetText (
+ "Non-negative number required."));
+
+ if (count < 0)
+ throw new ArgumentOutOfRangeException ("count", Locale.GetText (
+ "Non-negative number required."));
+
+ // We do the checks in unmanaged code for performance reasons
+ bool res = InternalBlockCopy (src, srcOffset, dst, dstOffset, count);
+ if (!res) {
+ // watch for integer overflow
+ if ((srcOffset > ByteLength (src) - count) || (dstOffset > ByteLength (dst) - count))
+ throw new ArgumentException (Locale.GetText (
+ "Offset and length were out of bounds for the array or count is greater than " +
+ "the number of elements from index to the end of the source collection."));
+ }
+ }
+
+ internal static unsafe void memcpy4 (byte *dest, byte *src, int size) {
+ /*while (size >= 32) {
+ // using long is better than int and slower than double
+ // FIXME: enable this only on correct alignment or on platforms
+ // that can tolerate unaligned reads/writes of doubles
+ ((double*)dest) [0] = ((double*)src) [0];
+ ((double*)dest) [1] = ((double*)src) [1];
+ ((double*)dest) [2] = ((double*)src) [2];
+ ((double*)dest) [3] = ((double*)src) [3];
+ dest += 32;
+ src += 32;
+ size -= 32;
+ }*/
+ while (size >= 16) {
+ ((int*)dest) [0] = ((int*)src) [0];
+ ((int*)dest) [1] = ((int*)src) [1];
+ ((int*)dest) [2] = ((int*)src) [2];
+ ((int*)dest) [3] = ((int*)src) [3];
+ dest += 16;
+ src += 16;
+ size -= 16;
+ }
+ while (size >= 4) {
+ ((int*)dest) [0] = ((int*)src) [0];
+ dest += 4;
+ src += 4;
+ size -= 4;
+ }
+ while (size > 0) {
+ ((byte*)dest) [0] = ((byte*)src) [0];
+ dest += 1;
+ src += 1;
+ --size;
+ }
+ }
+ internal static unsafe void memcpy2 (byte *dest, byte *src, int size) {
+ while (size >= 8) {
+ ((short*)dest) [0] = ((short*)src) [0];
+ ((short*)dest) [1] = ((short*)src) [1];
+ ((short*)dest) [2] = ((short*)src) [2];
+ ((short*)dest) [3] = ((short*)src) [3];
+ dest += 8;
+ src += 8;
+ size -= 8;
+ }
+ while (size >= 2) {
+ ((short*)dest) [0] = ((short*)src) [0];
+ dest += 2;
+ src += 2;
+ size -= 2;
+ }
+ if (size > 0)
+ ((byte*)dest) [0] = ((byte*)src) [0];
+ }
+ static unsafe void memcpy1 (byte *dest, byte *src, int size) {
+ while (size >= 8) {
+ ((byte*)dest) [0] = ((byte*)src) [0];
+ ((byte*)dest) [1] = ((byte*)src) [1];
+ ((byte*)dest) [2] = ((byte*)src) [2];
+ ((byte*)dest) [3] = ((byte*)src) [3];
+ ((byte*)dest) [4] = ((byte*)src) [4];
+ ((byte*)dest) [5] = ((byte*)src) [5];
+ ((byte*)dest) [6] = ((byte*)src) [6];
+ ((byte*)dest) [7] = ((byte*)src) [7];
+ dest += 8;
+ src += 8;
+ size -= 8;
+ }
+ while (size >= 2) {
+ ((byte*)dest) [0] = ((byte*)src) [0];
+ ((byte*)dest) [1] = ((byte*)src) [1];
+ dest += 2;
+ src += 2;
+ size -= 2;
+ }
+ if (size > 0)
+ ((byte*)dest) [0] = ((byte*)src) [0];
+ }
+
+ internal static unsafe void Memcpy (byte *dest, byte *src, int size) {
+ // FIXME: if pointers are not aligned, try to align them
+ // so a faster routine can be used. Handle the case where
+ // the pointers can't be reduced to have the same alignment
+ // (just ignore the issue on x86?)
+ if ((((int)dest | (int)src) & 3) != 0) {
+ if (((int)dest & 1) != 0 && ((int)src & 1) != 0 && size >= 1) {
+ dest [0] = src [0];
+ ++dest;
+ ++src;
+ --size;
+ }
+ if (((int)dest & 2) != 0 && ((int)src & 2) != 0 && size >= 2) {
+ ((short*)dest) [0] = ((short*)src) [0];
+ dest += 2;
+ src += 2;
+ size -= 2;
+ }
+ if ((((int)dest | (int)src) & 1) != 0) {
+ memcpy1 (dest, src, size);
+ return;
+ }
+ if ((((int)dest | (int)src) & 2) != 0) {
+ memcpy2 (dest, src, size);
+ return;
+ }
+ }
+ memcpy4 (dest, src, size);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//
+// CompareInfo.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2015 Xamarin Inc (http://www.xamarin.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.Generic;
+using System.Runtime.CompilerServices;
+using Mono.Globalization.Unicode;
+using System.Threading;
+
+namespace System.Globalization
+{
+ partial class CompareInfo
+ {
+ [NonSerialized]
+ SimpleCollator collator;
+
+ // Maps culture IDs to SimpleCollator objects
+ static Dictionary<string, SimpleCollator> collators;
+ static bool managedCollation;
+ static bool managedCollationChecked;
+
+ static bool UseManagedCollation {
+ get {
+ if (!managedCollationChecked) {
+ managedCollation = Environment.internalGetEnvironmentVariable ("MONO_DISABLE_MANAGED_COLLATION") != "yes" && MSCompatUnicodeTable.IsReady;
+ managedCollationChecked = true;
+ }
+
+ return managedCollation;
+ }
+ }
+
+ SimpleCollator GetCollator ()
+ {
+ if (collator != null)
+ return collator;
+
+ if (collators == null) {
+ Interlocked.CompareExchange (ref collators, new Dictionary<string, SimpleCollator> (StringComparer.Ordinal), null);
+ }
+
+ lock (collators) {
+ if (!collators.TryGetValue (m_sortName, out collator)) {
+ collator = new SimpleCollator (CultureInfo.GetCultureInfo (m_name));
+ collators [m_sortName] = collator;
+ }
+ }
+
+ return collator;
+ }
+
+ SortKey CreateSortKeyCore (string source, CompareOptions options)
+ {
+ if (UseManagedCollation)
+ return GetCollator ().GetSortKey (source, options);
+ SortKey key=new SortKey (culture, source, options);
+
+ /* Need to do the icall here instead of in the
+ * SortKey constructor, as we need access to
+ * this instance's collator.
+ */
+ assign_sortkey (key, source, options);
+
+ return(key);
+ }
+
+ int internal_index_switch (string s, int sindex, int count, char c, CompareOptions opt, bool first)
+ {
+ if (opt == CompareOptions.Ordinal && first)
+ return s.IndexOfUnchecked (c, sindex, count);
+
+ return UseManagedCollation ?
+ internal_index_managed (s, sindex, count, c, opt, first) :
+ internal_index (s, sindex, count, c, opt, first);
+ }
+
+ int internal_index_switch (string s1, int sindex, int count, string s2, CompareOptions opt, bool first)
+ {
+ if (opt == CompareOptions.Ordinal && first)
+ return s1.IndexOfUnchecked (s2, sindex, count);
+
+ return UseManagedCollation ?
+ internal_index_managed (s1, sindex, count, s2, opt, first) :
+ internal_index (s1, sindex, count, s2, opt, first);
+ }
+
+ int internal_compare_switch (string str1, int offset1, int length1, string str2, int offset2, int length2, CompareOptions options)
+ {
+ return UseManagedCollation ?
+ internal_compare_managed (str1, offset1, length1,
+ str2, offset2, length2, options) :
+ internal_compare (str1, offset1, length1,
+ str2, offset2, length2, options);
+ }
+
+ int internal_compare_managed (string str1, int offset1, int length1, string str2, int offset2, int length2, CompareOptions options)
+ {
+ return GetCollator ().Compare (str1, offset1, length1,
+ str2, offset2, length2, options);
+ }
+
+ int internal_index_managed (string s, int sindex, int count, char c, CompareOptions opt, bool first)
+ {
+ return first ?
+ GetCollator ().IndexOf (s, c, sindex, count, opt) :
+ GetCollator ().LastIndexOf (s, c, sindex, count, opt);
+ }
+
+ int internal_index_managed (string s1, int sindex, int count, string s2, CompareOptions opt, bool first)
+ {
+ return first ?
+ GetCollator ().IndexOf (s1, s2, sindex, count, opt) :
+ GetCollator ().LastIndexOf (s1, s2, sindex, count, opt);
+ }
+
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ private extern void assign_sortkey (object key, string source,
+ CompareOptions options);
+
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ private extern int internal_compare (string str1, int offset1,
+ int length1, string str2,
+ int offset2, int length2,
+ CompareOptions options);
+
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ private extern int internal_index (string source, int sindex,
+ int count, char value,
+ CompareOptions options,
+ bool first);
+
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ private extern int internal_index (string source, int sindex,
+ int count, string value,
+ CompareOptions options,
+ bool first);
+ }
+}
\ No newline at end of file
// TODO: should query runtime with culture name for a list of culture's calendars
int calendarId;
+ int numberIndex;
+
+ int iDefaultAnsiCodePage;
+ int iDefaultOemCodePage;
+ int iDefaultMacCodePage;
+ int iDefaultEbcdicCodePage;
+ bool isRightToLeft;
+ string sListSeparator;
+
private CultureData (string name)
{
this.sRealName = name;
// Store for specific data about each calendar
invariant.calendars = new CalendarData[CalendarData.MAX_CALENDARS];
invariant.calendars[0] = CalendarData.Invariant;
+
+ invariant.iDefaultAnsiCodePage = 1252; // default ansi code page ID (ACP)
+ invariant.iDefaultOemCodePage = 437; // default oem code page ID (OCP or OEM)
+ invariant.iDefaultMacCodePage = 10000; // default macintosh code page
+ invariant.iDefaultEbcdicCodePage = 037; // default EBCDIC code page
+
+ invariant.sListSeparator = ",";
Interlocked.CompareExchange (ref s_Invariant, invariant, null);
}
}
}
- public static CultureData GetCultureData (string cultureName, bool useUserOverride, int datetimeIndex, int calendarId, string iso2lang)
+ public static CultureData GetCultureData (string cultureName, bool useUserOverride, int datetimeIndex, int calendarId, int numberIndex, string iso2lang,
+ int ansiCodePage, int oemCodePage, int macCodePage, int ebcdicCodePage, bool rightToLeft, string listSeparator)
{
if (string.IsNullOrEmpty (cultureName))
return Invariant;
cd.fill_culture_data (datetimeIndex);
cd.bUseOverrides = useUserOverride;
cd.calendarId = calendarId;
+ cd.numberIndex = numberIndex;
cd.sISO639Language = iso2lang;
+ cd.iDefaultAnsiCodePage = ansiCodePage;
+ cd.iDefaultOemCodePage = oemCodePage;
+ cd.iDefaultMacCodePage = macCodePage;
+ cd.iDefaultEbcdicCodePage = ebcdicCodePage;
+ cd.isRightToLeft = rightToLeft;
+ cd.sListSeparator = listSeparator;
return cd;
}
public CalendarData GetCalendar (int calendarId)
{
- // arrays are 0 based, calendarIds are 1 based
+ // arrays are 0 based, calendarIds are 1 based
int calendarIndex = calendarId - 1;
// Have to have calendars
}
}
- internal String CultureName {
- get {
- return sRealName;
- }
- }
+ internal bool IsInvariantCulture {
+ get {
+ return string.IsNullOrEmpty (sRealName);
+ }
+ }
- internal String SCOMPAREINFO {
- get {
- return "";
+ internal String CultureName {
+ get {
+ return sRealName;
+ }
+ }
+
+ internal String SCOMPAREINFO {
+ get {
+ return "";
+ }
+ }
+
+ internal String STEXTINFO {
+ get {
+ return sRealName;
+ }
}
- }
internal int ILANGUAGE {
get {
}
}
+ internal int IDEFAULTANSICODEPAGE {
+ get {
+ return iDefaultAnsiCodePage;
+ }
+ }
+
+ internal int IDEFAULTOEMCODEPAGE {
+ get {
+ return iDefaultOemCodePage;
+ }
+ }
+
+ internal int IDEFAULTMACCODEPAGE {
+ get {
+ return iDefaultMacCodePage;
+ }
+ }
+
+ internal int IDEFAULTEBCDICCODEPAGE {
+ get {
+ return iDefaultEbcdicCodePage;
+ }
+ }
+
+ internal bool IsRightToLeft {
+ get {
+ return isRightToLeft;
+ }
+ }
+
+ internal String SLIST {
+ get {
+ return sListSeparator;
+ }
+ }
+
#region from reference sources
// Are overrides enabled?
{
return str;
}
+
+ internal static bool IsCustomCultureId(int cultureId)
+ {
+ return false;
+ }
+
+ internal void GetNFIValues (NumberFormatInfo nfi)
+ {
+ if (this.IsInvariantCulture)
+ {
+ // Same as default values
+ }
+ else
+ {
+ //
+ // We don't have information for the following four. All cultures use
+ // the same value of the number formatting values.
+ //
+ // PercentDecimalDigits
+ // PercentDecimalSeparator
+ // PercentGroupSize
+ // PercentGroupSeparator
+ //
+ fill_number_data (nfi, numberIndex);
+ }
+
+ //
+ // We don't have percent values, so use the number values
+ //
+ nfi.percentDecimalDigits = nfi.numberDecimalDigits;
+ nfi.percentDecimalSeparator = nfi.numberDecimalSeparator;
+ nfi.percentGroupSizes = nfi.numberGroupSizes;
+ nfi.percentGroupSeparator = nfi.numberGroupSeparator;
+ }
+
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ extern static void fill_number_data (NumberFormatInfo nfi, int numberIndex);
}
}
{
return string.Format (CultureInfo.InvariantCulture, key, values);
}
+
+ internal static String GetRuntimeResourceString (string key)
+ {
+ return key;
+ }
+
+ internal static String GetRuntimeResourceString (string key, params object[] values)
+ {
+ return string.Format (CultureInfo.InvariantCulture, key, values);
+ }
+
+ internal static string GetResourceStringEncodingName (int codePage)
+ {
+ switch (codePage) {
+ case 1200: return GetResourceString ("Globalization.cp_1200");
+ case 1201: return GetResourceString ("Globalization.cp_1201");
+ case 65001: return GetResourceString ("Globalization.cp_65001");
+ default: return codePage.ToString (CultureInfo.InvariantCulture);
+ }
+ }
+
+ internal static bool IsWindows8OrAbove {
+ get {
+ return false;
+ }
+ }
}
}
\ No newline at end of file
{
static internal T UnsafeCast<T>(Object o) where T : class
{
- return (T)o;
+ return Array.UnsafeMov<object, T> (o);
+ }
+
+ static internal int UnsafeEnumCast<T>(T val) where T : struct
+ {
+ return Array.UnsafeMov<T, int> (val);
+ }
+
+ static internal long UnsafeEnumCastLong<T>(T val) where T : struct
+ {
+ throw new NotImplementedException ();
}
}
}
\ No newline at end of file
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
+
using System.Runtime.CompilerServices;
namespace System.Reflection
{
internal sealed class MonoRuntimeWorkItem : IThreadPoolWorkItem
{
- AsyncResult ares;
+ AsyncResult async_result;
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern void ExecuteWorkItem();
return constraints;
}
- public override Type MakeGenericType (params Type[] typeArguments)
+ internal static object CreateInstanceForAnotherGenericParameter (Type genericType, RuntimeType genericArgument)
{
- if (IsUserType)
- throw new NotSupportedException ();
- if (!IsGenericTypeDefinition)
- throw new InvalidOperationException ("not a generic type definition");
- if (typeArguments == null)
- throw new ArgumentNullException ("typeArguments");
- if (GetGenericArguments().Length != typeArguments.Length)
- throw new ArgumentException (String.Format ("The type or method has {0} generic parameter(s) but {1} generic argument(s) where provided. A generic argument must be provided for each generic parameter.", GetGenericArguments ().Length, typeArguments.Length), "typeArguments");
-
- bool hasUserType = false;
-
- Type[] systemTypes = new Type[typeArguments.Length];
- for (int i = 0; i < typeArguments.Length; ++i) {
- Type t = typeArguments [i];
- if (t == null)
- throw new ArgumentNullException ("typeArguments");
-
- if (!(t is MonoType))
- hasUserType = true;
- systemTypes [i] = t;
- }
-
- if (hasUserType) {
-#if FULL_AOT_RUNTIME
- throw new NotSupportedException ("User types are not supported under full aot");
-#else
- return new MonoGenericClass (this, typeArguments);
-#endif
- }
-
- Type res = MakeGenericType (this, systemTypes);
- if (res == null)
- throw new TypeLoadException ();
- return res;
+ var gt = (RuntimeType) MakeGenericType (genericType, new Type [] { genericArgument });
+ var ctor = gt.GetDefaultConstructor ();
+ return ctor.InternalInvoke (null, null);
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern string getFullName(bool full_name, bool assembly_qualified);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override Type [] GetGenericArguments ();
+ extern Type[] GetGenericArgumentsInternal (bool runtimeArray);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern GenericParameterAttributes GetGenericParameterAttributes ();
{
Buffer.Memcpy (dest, src, size);
}
+
+ /* Used by the runtime */
+ internal static unsafe void bzero (byte *dest, int len) {
+ memset (dest, 0, len);
+ }
+
+ internal static unsafe void bzero_aligned_1 (byte *dest, int len) {
+ ((byte*)dest) [0] = 0;
+ }
+
+ internal static unsafe void bzero_aligned_2 (byte *dest, int len) {
+ ((short*)dest) [0] = 0;
+ }
+
+ internal static unsafe void bzero_aligned_4 (byte *dest, int len) {
+ ((int*)dest) [0] = 0;
+ }
+
+ internal static unsafe void bzero_aligned_8 (byte *dest, int len) {
+ ((long*)dest) [0] = 0;
+ }
+
+ internal static unsafe void memcpy_aligned_1 (byte *dest, byte *src, int size) {
+ ((byte*)dest) [0] = ((byte*)src) [0];
+ }
+
+ internal static unsafe void memcpy_aligned_2 (byte *dest, byte *src, int size) {
+ ((short*)dest) [0] = ((short*)src) [0];
+ }
+
+ internal static unsafe void memcpy_aligned_4 (byte *dest, byte *src, int size) {
+ ((int*)dest) [0] = ((int*)src) [0];
+ }
+
+ internal static unsafe void memcpy_aligned_8 (byte *dest, byte *src, int size) {
+ ((long*)dest) [0] = ((long*)src) [0];
+ }
+
#endregion
// Certain constructors are redirected to CreateString methods with
--- /dev/null
+using System.Runtime.CompilerServices;
+
+namespace System.Globalization
+{
+ partial class TextInfo
+ {
+ unsafe static ushort *to_lower_data_low;
+ unsafe static ushort *to_lower_data_high;
+ unsafe static ushort *to_upper_data_low;
+ unsafe static ushort *to_upper_data_high;
+
+ [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
+ unsafe static extern void GetDataTablePointersLite (out ushort *to_lower_data_low, out ushort *to_lower_data_high, out ushort *to_upper_data_low, out ushort *to_upper_data_high);
+
+ static readonly object cookie = new object ();
+
+ unsafe static void ReadDataTable ()
+ {
+ if (to_lower_data_low == null) {
+ lock (cookie) {
+ if (to_lower_data_low != null)
+ return;
+
+ GetDataTablePointersLite (out to_lower_data_low, out to_lower_data_high, out to_upper_data_low, out to_upper_data_high);
+ }
+ }
+ }
+
+ unsafe string ToUpperInternal (string str)
+ {
+ if (str.Length == 0)
+ return String.Empty;
+
+ string tmp = String.FastAllocateString (str.Length);
+ fixed (char* source = str, dest = tmp) {
+
+ char* destPtr = (char*)dest;
+ char* sourcePtr = (char*)source;
+
+ for (int n = 0; n < str.Length; n++) {
+ *destPtr = ToUpper (*sourcePtr);
+ sourcePtr++;
+ destPtr++;
+ }
+ }
+ return tmp;
+ }
+
+ unsafe string ToLowerInternal (string str)
+ {
+ if (str.Length == 0)
+ return String.Empty;
+
+ string tmp = String.FastAllocateString (str.Length);
+ fixed (char* source = str, dest = tmp) {
+
+ char* destPtr = (char*)dest;
+ char* sourcePtr = (char*)source;
+
+ for (int n = 0; n < str.Length; n++) {
+ *destPtr = ToLower (*sourcePtr);
+ sourcePtr++;
+ destPtr++;
+ }
+ }
+ return tmp;
+ }
+
+ char ToUpperInternal (char c)
+ {
+ switch (c) {
+ case '\u0069': // Latin lowercase i
+ if (!IsAsciiCasingSameAsInvariant)
+ return '\u0130'; // dotted capital I
+ break;
+ case '\u0131': // dotless i
+ return '\u0049'; // I
+
+ case '\u01c5': // see ToLower()
+ return '\u01c4';
+ case '\u01c8': // see ToLower()
+ return '\u01c7';
+ case '\u01cb': // see ToLower()
+ return '\u01ca';
+ case '\u01f2': // see ToLower()
+ return '\u01f1';
+ case '\u0390': // GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+ return '\u03aa'; // it is not in ICU
+ case '\u03b0': // GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+ return '\u03ab'; // it is not in ICU
+ case '\u03d0': // GREEK BETA
+ return '\u0392';
+ case '\u03d1': // GREEK THETA
+ return '\u0398';
+ case '\u03d5': // GREEK PHI
+ return '\u03a6';
+ case '\u03d6': // GREEK PI
+ return '\u03a0';
+ case '\u03f0': // GREEK KAPPA
+ return '\u039a';
+ case '\u03f1': // GREEK RHO
+ return '\u03a1';
+ // am not sure why miscellaneous GREEK symbols are
+ // not handled here.
+ }
+
+ return ToUpperInvariant (c);
+ }
+
+ char ToLowerInternal (char c)
+ {
+ switch (c) {
+ case '\u0049': // Latin uppercase I
+ if (!IsAsciiCasingSameAsInvariant)
+ return '\u0131'; // I becomes dotless i
+ break;
+ case '\u0130': // I-dotted
+ return '\u0069'; // i
+
+ case '\u01c5': // LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
+ return '\u01c6';
+ // \u01c7 -> \u01c9 (LJ) : invariant
+ case '\u01c8': // LATIN CAPITAL LETTER L WITH SMALL LETTER J
+ return '\u01c9';
+ // \u01ca -> \u01cc (NJ) : invariant
+ case '\u01cb': // LATIN CAPITAL LETTER N WITH SMALL LETTER J
+ return '\u01cc';
+ // WITH CARON : invariant
+ // WITH DIAERESIS AND * : invariant
+
+ case '\u01f2': // LATIN CAPITAL LETTER D WITH SMALL LETTER Z
+ return '\u01f3';
+ case '\u03d2': // ? it is not in ICU
+ return '\u03c5';
+ case '\u03d3': // ? it is not in ICU
+ return '\u03cd';
+ case '\u03d4': // ? it is not in ICU
+ return '\u03cb';
+ }
+ return ToLowerInvariant (c);
+ }
+
+ static char ToLowerInvariant (char c)
+ {
+ ReadDataTable ();
+
+ unsafe {
+ if (c <= ((char)0x24cf))
+ return (char) to_lower_data_low [c];
+ if (c >= ((char)0xff21))
+ return (char) to_lower_data_high[c - 0xff21];
+ }
+ return c;
+ }
+
+ static char ToUpperInvariant (char c)
+ {
+ ReadDataTable ();
+
+ unsafe {
+ if (c <= ((char)0x24e9))
+ return (char) to_upper_data_low [c];
+ if (c >= ((char)0xff21))
+ return (char) to_upper_data_high [c - 0xff21];
+ }
+ return c;
+ }
+
+ static unsafe int InternalCompareStringOrdinalIgnoreCase (String strA, int indexA, String strB, int indexB, int lenA, int lenB)
+ {
+ if (strA == null) {
+ return strB == null ? 0 : -1;
+ }
+ if (strB == null) {
+ return 1;
+ }
+ int lengthA = Math.Min (lenA, strA.Length - indexA);
+ int lengthB = Math.Min (lenB, strB.Length - indexB);
+
+ if (lengthA == lengthB && Object.ReferenceEquals (strA, strB))
+ return 0;
+
+ fixed (char* aptr = strA, bptr = strB) {
+ char* ap = aptr + indexA;
+ char* end = ap + Math.Min (lengthA, lengthB);
+ char* bp = bptr + indexB;
+ while (ap < end) {
+ if (*ap != *bp) {
+ char c1 = Char.ToUpperInvariant (*ap);
+ char c2 = Char.ToUpperInvariant (*bp);
+ if (c1 != c2)
+ return c1 - c2;
+ }
+ ap++;
+ bp++;
+ }
+ return lengthA - lengthB;
+ }
+ }
+ }
+}
\ No newline at end of file
+++ /dev/null
-namespace System
-{
- [Flags]
- internal enum TimeZoneInfoOptions {
- None = 1,
- NoThrowOnInvalidTime = 2
- };
-}
\ No newline at end of file
--- /dev/null
+namespace System.Reflection.Emit
+{
+ abstract class TypeBuilderInstantiation : TypeInfo
+ {
+ internal static Type MakeGenericType (Type type, Type[] typeArguments)
+ {
+#if FULL_AOT_RUNTIME
+ throw new NotSupportedException ("User types are not supported under full aot");
+#else
+ return new MonoGenericClass (type, typeArguments);
+#endif
+ }
+ }
+}
\ No newline at end of file
+++ /dev/null
-// ConcurrentOrderedList.cs
-//
-// Copyright (c) 2010 Jérémie "Garuma" Laval
-//
-// 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.Threading;
-using System.Collections;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-
-#if INSIDE_MONO_PARALLEL
-using System.Collections.Concurrent;
-
-namespace Mono.Collections.Concurrent
-#else
-namespace System.Collections.Concurrent
-#endif
-{
-#if INSIDE_MONO_PARALLEL
- public
-#endif
- class ConcurrentOrderedList<T>: ICollection<T>, IEnumerable<T>
- {
- class Node
- {
- public T Data;
- public int Key;
- public Node Next;
- public bool Marked;
-
- public Node ()
- {
-
- }
-
- public Node (Node wrapped)
- {
- Marked = true;
- Next = wrapped;
- }
- }
-
- Node head;
- Node tail;
-
- IEqualityComparer<T> comparer;
-
- int count;
-
- public ConcurrentOrderedList () : this (EqualityComparer<T>.Default)
- {
-
- }
-
- public ConcurrentOrderedList (IEqualityComparer<T> comparer)
- {
- if (comparer == null)
- throw new ArgumentNullException ("comparer");
-
- this.comparer = comparer;
-
- head = new Node ();
- tail = new Node ();
- head.Next = tail;
- }
-
- public bool TryAdd (T data)
- {
- Node node = new Node ();
- node.Data = data;
- node.Key = comparer.GetHashCode (data);
-
- if (ListInsert (node)) {
- Interlocked.Increment (ref count);
- return true;
- }
-
- return false;
- }
-
- public bool TryRemove (T data)
- {
- T dummy;
- return TryRemoveHash (comparer.GetHashCode (data), out dummy);
- }
-
- public bool TryRemoveHash (int key, out T data)
- {
- if (ListDelete (key, out data)) {
- Interlocked.Decrement (ref count);
- return true;
- }
-
- return false;
- }
-
- public bool TryPop (out T data)
- {
- return ListPop (out data);
- }
-
- public bool Contains (T data)
- {
- return ContainsHash (comparer.GetHashCode (data));
- }
-
- public bool ContainsHash (int key)
- {
- Node node;
-
- if (!ListFind (key, out node))
- return false;
-
- return true;
-
- }
-
- public bool TryGetFromHash (int key, out T data)
- {
- data = default (T);
- Node node;
-
- if (!ListFind (key, out node))
- return false;
-
- data = node.Data;
- return true;
- }
-
- public void Clear ()
- {
- head.Next = tail;
- }
-
- public void CopyTo (T[] array, int startIndex)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (startIndex < 0)
- throw new ArgumentOutOfRangeException ("startIndex");
- if (count > array.Length - startIndex)
- throw new ArgumentException ("array", "The number of elements is greater than the available space from startIndex to the end of the destination array.");
-
- foreach (T item in this) {
- if (startIndex >= array.Length)
- break;
-
- array[startIndex++] = item;
- }
- }
-
- public IEqualityComparer<T> Comparer {
- get {
- return comparer;
- }
- }
-
- public int Count {
- get {
- return count;
- }
- }
-
- Node ListSearch (int key, ref Node left)
- {
- Node leftNodeNext = null, rightNode = null;
-
- do {
- Node t = head;
- Node tNext = t.Next;
- do {
- if (!tNext.Marked) {
- left = t;
- leftNodeNext = tNext;
- }
- t = tNext.Marked ? tNext.Next : tNext;
- if (t == tail)
- break;
-
- tNext = t.Next;
- } while (tNext.Marked || t.Key < key);
-
- rightNode = t;
-
- if (leftNodeNext == rightNode) {
- if (rightNode != tail && rightNode.Next.Marked)
- continue;
- else
- return rightNode;
- }
-
- if (Interlocked.CompareExchange (ref left.Next, rightNode, leftNodeNext) == leftNodeNext) {
- if (rightNode != tail && rightNode.Next.Marked)
- continue;
- else
- return rightNode;
- }
- } while (true);
- }
-
- bool ListDelete (int key, out T data)
- {
- Node rightNode = null, rightNodeNext = null, leftNode = null;
- data = default (T);
-
- do {
- rightNode = ListSearch (key, ref leftNode);
- if (rightNode == tail || rightNode.Key != key)
- return false;
-
- data = rightNode.Data;
-
- rightNodeNext = rightNode.Next;
- if (!rightNodeNext.Marked)
- if (Interlocked.CompareExchange (ref rightNode.Next, new Node (rightNodeNext), rightNodeNext) == rightNodeNext)
- break;
- } while (true);
-
- if (Interlocked.CompareExchange (ref leftNode.Next, rightNodeNext, rightNode) != rightNodeNext)
- ListSearch (rightNode.Key, ref leftNode);
-
- return true;
- }
-
- bool ListPop (out T data)
- {
- Node rightNode = null, rightNodeNext = null, leftNode = head;
- data = default (T);
-
- do {
- rightNode = head.Next;
- if (rightNode == tail)
- return false;
-
- data = rightNode.Data;
-
- rightNodeNext = rightNode.Next;
- if (!rightNodeNext.Marked)
- if (Interlocked.CompareExchange (ref rightNode.Next, new Node (rightNodeNext), rightNodeNext) == rightNodeNext)
- break;
- } while (true);
-
- if (Interlocked.CompareExchange (ref leftNode.Next, rightNodeNext, rightNode) != rightNodeNext)
- ListSearch (rightNode.Key, ref leftNode);
-
- return true;
- }
-
- bool ListInsert (Node newNode)
- {
- int key = newNode.Key;
- Node rightNode = null, leftNode = null;
-
- do {
- rightNode = ListSearch (key, ref leftNode);
- if (rightNode != tail && rightNode.Key == key)
- return false;
-
- newNode.Next = rightNode;
- if (Interlocked.CompareExchange (ref leftNode.Next, newNode, rightNode) == rightNode)
- return true;
- } while (true);
- }
-
- bool ListFind (int key, out Node data)
- {
- Node rightNode = null, leftNode = null;
- data = null;
-
- data = rightNode = ListSearch (key, ref leftNode);
-
- return rightNode != tail && rightNode.Key == key;
- }
-
- IEnumerator<T> IEnumerable<T>.GetEnumerator ()
- {
- return GetEnumeratorInternal ();
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumeratorInternal ();
- }
-
- IEnumerator<T> GetEnumeratorInternal ()
- {
- Node node = head.Next;
-
- while (node != tail) {
- while (node.Marked) {
- node = node.Next;
- if (node == tail)
- yield break;
- }
- yield return node.Data;
- node = node.Next;
- }
- }
-
- bool ICollection<T>.IsReadOnly {
- get {
- return false;
- }
- }
-
- void ICollection<T>.Add (T item)
- {
- TryAdd (item);
- }
-
- bool ICollection<T>.Remove (T item)
- {
- return TryRemove (item);
- }
- }
-}
-
+++ /dev/null
-//
-// Comparer.cs
-//
-// Authors:
-// Ben Maurer (bmaurer@ximian.com)
-// Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.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.Runtime.InteropServices;
-
-namespace System.Collections.Generic {
- [Serializable]
- public abstract class Comparer<T> : IComparer<T>, IComparer
- {
- static readonly Comparer <T> _default = typeof (IComparable<T>).IsAssignableFrom (typeof (T)) ?
- (Comparer<T>) Activator.CreateInstance (typeof (GenericComparer <>).MakeGenericType (typeof (T))) :
- new DefaultComparer ();
-
- public abstract int Compare (T x, T y);
-
- public static Comparer<T> Default {
- get {
- return _default;
- }
- }
-
- public static Comparer<T> Create (Comparison<T> comparison)
- {
- if (comparison == null)
- throw new ArgumentNullException ("comparison");
-
- return new ComparisonComparer<T> (comparison);
- }
-
- int IComparer.Compare (object x, object y)
- {
- if (x == y)
- return 0;
- if (x == null)
- return y == null ? 0 : -1;
- if (y == null)
- return 1;
-
- if (x is T && y is T)
- return Compare ((T) x, (T) y);
-
- throw new ArgumentException ();
- }
-
- [Serializable]
- sealed class DefaultComparer : Comparer<T>
- {
- public override int Compare (T x, T y)
- {
- // `null' is less than any other ref type
- if (x == null)
- return y == null ? 0 : -1;
- if (y == null)
- return 1;
-
- var i = x as IComparable;
- if (i != null)
- return i.CompareTo (y);
-
- i = y as IComparable;
- if (i != null)
- return -i.CompareTo (x);
-
- throw new ArgumentException ("At least one argument has to implement IComparable interface");
- }
- }
- }
-
- [Serializable]
- sealed class GenericComparer<T> : Comparer<T> where T : IComparable<T>
- {
- public override int Compare (T x, T y)
- {
- // `null' is less than any other ref type
- if (x == null)
- return y == null ? 0 : -1;
- if (y == null)
- return 1;
-
- return x.CompareTo (y);
- }
- }
- [Serializable]
- sealed class ComparisonComparer<T> : Comparer<T>
- {
- readonly Comparison<T> comparison;
-
- public ComparisonComparer (Comparison<T> comparison)
- {
- this.comparison = comparison;
- }
-
- public override int Compare (T x, T y)
- {
- return comparison (x, y);
- }
- }
-}
+++ /dev/null
-//
-// EqualityComparer.cs
-//
-// Authors:
-// Ben Maurer (bmaurer@ximian.com)
-// Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.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.Runtime.InteropServices;
-
-namespace System.Collections.Generic {
- [Serializable]
- public abstract class EqualityComparer <T> : IEqualityComparer, IEqualityComparer <T> {
-
- static EqualityComparer ()
- {
- var t = typeof (T);
- if (t == typeof (string)) {
- _default = (EqualityComparer<T>) (object) new InternalStringComparer ();
- return;
- }
-
- if (t == typeof (int)) {
- _default = (EqualityComparer<T>) (object) new IntEqualityComparer ();
- return;
- }
-
- if (t.IsEnum && Enum.GetUnderlyingType (t) == typeof (int)) {
- _default = new EnumIntEqualityComparer<T> ();
- return;
- }
-
- if (typeof (IEquatable <T>).IsAssignableFrom (t))
- _default = (EqualityComparer <T>) Activator.CreateInstance (typeof (GenericEqualityComparer <>).MakeGenericType (t));
- else
- _default = new DefaultComparer<T> ();
- }
-
- public abstract int GetHashCode (T obj);
- public abstract bool Equals (T x, T y);
-
- static readonly EqualityComparer <T> _default;
-
- public static EqualityComparer <T> Default {
- get {
- return _default;
- }
- }
-
- int IEqualityComparer.GetHashCode (object obj)
- {
- if (obj == null)
- return 0;
-
- if (!(obj is T))
- throw new ArgumentException ("Argument is not compatible", "obj");
-
- return GetHashCode ((T)obj);
- }
-
- bool IEqualityComparer.Equals (object x, object y)
- {
- if (x == y)
- return true;
-
- if (x == null || y == null)
- return false;
-
- if (!(x is T))
- throw new ArgumentException ("Argument is not compatible", "x");
- if (!(y is T))
- throw new ArgumentException ("Argument is not compatible", "y");
- return Equals ((T)x, (T)y);
- }
-
- internal virtual int IndexOf (T[] array, T value, int startIndex, int endIndex)
- {
- for (int i = startIndex; i < endIndex; ++i) {
- if (Equals (Array.UnsafeLoad (array, i), value))
- return i;
- }
-
- return -1;
- }
- }
-
- [Serializable]
- sealed class DefaultComparer<T> : EqualityComparer<T> {
-
- public override int GetHashCode (T obj)
- {
- if (obj == null)
- return 0;
- return obj.GetHashCode ();
- }
-
- public override bool Equals (T x, T y)
- {
- if (x == null)
- return y == null;
-
- return x.Equals (y);
- }
- }
-
- [Serializable]
- sealed class InternalStringComparer : EqualityComparer<string> {
-
- public override int GetHashCode (string obj)
- {
- if (obj == null)
- return 0;
- return obj.GetHashCode ();
- }
-
- public override bool Equals (string x, string y)
- {
- if (x == null)
- return y == null;
-
- if ((object) x == (object) y)
- return true;
-
- return x.Equals (y);
- }
-
- internal override int IndexOf (string[] array, string value, int startIndex, int endIndex)
- {
- for (int i = startIndex; i < endIndex; ++i) {
- if (Array.UnsafeLoad (array, i) == value)
- return i;
- }
-
- return -1;
- }
- }
-
- [Serializable]
- sealed class IntEqualityComparer : EqualityComparer<int>
- {
- public override int GetHashCode (int obj)
- {
- return obj;
- }
-
- public override bool Equals (int x, int y)
- {
- return x == y;
- }
-
- internal override int IndexOf (int[] array, int value, int startIndex, int endIndex)
- {
- for (int i = startIndex; i < endIndex; ++i) {
- if (Array.UnsafeLoad (array, i) == value)
- return i;
- }
-
- return -1;
- }
- }
-
- [Serializable]
- sealed class EnumIntEqualityComparer<T> : EqualityComparer<T>
- {
- public override int GetHashCode (T obj)
- {
- return Array.UnsafeMov<T, int> (obj);
- }
-
- public override bool Equals (T x, T y)
- {
- return Array.UnsafeMov<T, int> (x) == Array.UnsafeMov<T, int> (y);
- }
-
- internal override int IndexOf (T[] array, T value, int startIndex, int endIndex)
- {
- int v = Array.UnsafeMov<T, int> (value);
- var a = Array.UnsafeMov<T[], int[]> (array);
- for (int i = startIndex; i < endIndex; ++i) {
- if (Array.UnsafeLoad (a, i) == v)
- return i;
- }
-
- return -1;
- }
- }
-
- [Serializable]
- sealed class GenericEqualityComparer <T> : EqualityComparer <T> where T : IEquatable <T> {
-
- public override int GetHashCode (T obj)
- {
- if (obj == null)
- return 0;
- return obj.GetHashCode ();
- }
-
- public override bool Equals (T x, T y)
- {
- if (x == null)
- return y == null;
-
- return x.Equals (y);
- }
- }
-}
private int ilOffset = OFFSET_UNKNOWN;
private int nativeOffset = OFFSET_UNKNOWN;
private long methodAddress;
+ private uint methodIndex;
private MethodBase methodBase;
private string fileName;
private int lineNumber;
#endregion
[MethodImplAttribute (MethodImplOptions.InternalCall)]
- extern static int GetILOffsetFromFile (string path, int methodToken, int nativeOffset);
+ extern static int GetILOffsetFromFile (string path, int methodToken, uint methodIndex, int nativeOffset);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern static bool get_frame_info (int skip, bool needFileInfo, out MethodBase method,
return methodAddress;
}
+ internal uint GetMethodIndex ()
+ {
+ return methodIndex;
+ }
+
internal string GetInternalMethodName ()
{
return internalMethodName;
+++ /dev/null
-/CodePageDataItem.cs -crlf
+++ /dev/null
-// ::MONO
-//
-// System.Globalization.CalendarAlgorithmType.cs
-//
-//
-// Copyright (C) 2004 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;
-
-namespace System.Globalization
-{
- [System.Runtime.InteropServices.ComVisible(true)]
- public enum CalendarAlgorithmType
- {
- Unknown = 0,
- SolarCalendar = 1,
- LunarCalendar = 2,
- LunisolarCalendar = 3,
- }
-
-}
+++ /dev/null
-// ::MONO
-//
-// System.Globalization.CalendarWeekRule.cs
-//
-// Copyright (C) Wictor Wilén 2001 (wictor@iBizkit.se)
-//
-// Contributors: Wictor Wilén
-//
-// Revisions
-// 2001-09-14: First draft
-// 2001-09-15: First release
-
-//
-// Copyright (C) 2004 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.
-//
-
-
-namespace System.Globalization
-{
- /// <summary>
- /// The System.Globalization.CalendarWeekRule enumeration
- /// </summary>
- [System.Runtime.InteropServices.ComVisible(true)]
- [System.Serializable]
- public enum CalendarWeekRule
- {
- FirstDay = 0,
- FirstFullWeek = 1,
- FirstFourDayWeek = 2
-
- }
-
-}
+++ /dev/null
-//
-// System.Globalization.CompareInfo.cs
-//
-// Authors:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-//
-// Copyright (C) 2004 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.Reflection;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using Mono.Globalization.Unicode;
-
-namespace System.Globalization
-{
- [Serializable]
- [StructLayout (LayoutKind.Sequential)]
-
- [ComVisible (true)]
- public class CompareInfo : IDeserializationCallback {
-
- static readonly bool useManagedCollation =
- Environment.internalGetEnvironmentVariable ("MONO_DISABLE_MANAGED_COLLATION")
- != "yes" && MSCompatUnicodeTable.IsReady;
-
- internal static bool UseManagedCollation {
- get { return useManagedCollation; }
- }
-
- void IDeserializationCallback.OnDeserialization(object sender)
- {
- if (UseManagedCollation) {
- collator = new SimpleCollator (new CultureInfo (culture));
- } else {
- /* This will build the ICU collator, and store
- * the pointer in ICU_collator
- */
- /*
- try {
- this.construct_compareinfo (icu_name);
- } catch {
- // ICU_collator=IntPtr.Zero;
- }
- */
- }
- }
-
- //[MethodImplAttribute (MethodImplOptions.InternalCall)]
- //private extern void construct_compareinfo (string locale);
-
- //[MethodImplAttribute (MethodImplOptions.InternalCall)]
- //private extern void free_internal_collator ();
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern int internal_compare (string str1, int offset1,
- int length1, string str2,
- int offset2, int length2,
- CompareOptions options);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern void assign_sortkey (object key, string source,
- CompareOptions options);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern int internal_index (string source, int sindex,
- int count, char value,
- CompareOptions options,
- bool first);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern int internal_index (string source, int sindex,
- int count, string value,
- CompareOptions options,
- bool first);
-
- const CompareOptions ValidCompareOptions_NoStringSort =
- CompareOptions.None | CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace |
- CompareOptions.IgnoreSymbols | CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth |
- CompareOptions.OrdinalIgnoreCase | CompareOptions.Ordinal;
-
- const CompareOptions ValidCompareOptions = ValidCompareOptions_NoStringSort | CompareOptions.StringSort;
-
- // Keep in synch with MonoCompareInfo in the runtime.
- private int culture;
-// [NonSerialized]
-// private string icu_name;
-// [NonSerialized]
-// private IntPtr ICU_collator;
-
-#pragma warning disable 169
- private int win32LCID; // Unused, but MS.NET serializes this
-#pragma warning restore 169
-
- readonly string m_name; // MS.NET serializes this
-
- [NonSerialized]
- SimpleCollator collator;
-
- // Maps culture IDs to SimpleCollator objects
- private static Dictionary<int, SimpleCollator> collators;
-
- [NonSerialized]
- // Protects access to 'collators'
- private static object monitor = new Object ();
-
- internal CompareInfo (CultureInfo ci)
- {
- this.culture = ci.LCID;
- this.m_name = ci.Name;
- if (UseManagedCollation) {
- lock (monitor) {
- if (collators == null)
- collators = new Dictionary<int, SimpleCollator> ();
-
- if (!collators.TryGetValue (ci.LCID, out collator)) {
- collator = new SimpleCollator (ci);
- collators [ci.LCID] = collator;
- }
- }
- } else {
-/*
- this.icu_name = ci.IcuName;
- this.construct_compareinfo (icu_name);
-*/
- }
- }
-/*
- ~CompareInfo ()
- {
- free_internal_collator ();
- }
-*/
- private int internal_compare_managed (string str1, int offset1,
- int length1, string str2,
- int offset2, int length2,
- CompareOptions options)
- {
- return collator.Compare (str1, offset1, length1,
- str2, offset2, length2, options);
- }
-
- private int internal_compare_switch (string str1, int offset1,
- int length1, string str2,
- int offset2, int length2,
- CompareOptions options)
- {
- if (options == CompareOptions.Ordinal)
- return String.CompareOrdinalUnchecked (str1, offset1, length1, str2, offset2, length2);
- if (options == CompareOptions.OrdinalIgnoreCase)
- return TextInfo.CompareOrdinalIgnoreCaseEx (str1, offset1, str2, offset2, length1, length2);
-
- return UseManagedCollation ?
- internal_compare_managed (str1, offset1, length1,
- str2, offset2, length2, options) :
- internal_compare (str1, offset1, length1,
- str2, offset2, length2, options);
- }
-
- public virtual int Compare (string string1, string string2)
- {
- return Compare (string1, string2, CompareOptions.None);
- }
-
- public virtual int Compare (string string1, string string2,
- CompareOptions options)
- {
- if ((options & ValidCompareOptions) != options)
- throw new ArgumentException ("options");
-
- if (string1 == null) {
- if (string2 == null)
- return 0;
- return -1;
- }
- if (string2 == null)
- return 1;
-
- /* Short cut... */
- if(string1.Length == 0 && string2.Length == 0)
- return(0);
-
- return(internal_compare_switch (string1, 0, string1.Length,
- string2, 0, string2.Length,
- options));
- }
-
- public virtual int Compare (string string1, int offset1,
- string string2, int offset2)
- {
- return Compare (string1, offset1, string2, offset2, CompareOptions.None);
- }
-
- public virtual int Compare (string string1, int offset1,
- string string2, int offset2,
- CompareOptions options)
- {
- if ((options & ValidCompareOptions) != options)
- throw new ArgumentException ("options");
-
- if (string1 == null) {
- if (string2 == null)
- return 0;
- return -1;
- }
- if (string2 == null)
- return 1;
-
- /* Not in the spec, but ms does these short
- * cuts before checking the offsets (breaking
- * the offset >= string length specified check
- * in the process...)
- */
- if((string1.Length == 0 || offset1 == string1.Length) &&
- (string2.Length == 0 || offset2 == string2.Length))
- return(0);
-
- if(offset1 < 0 || offset2 < 0) {
- throw new ArgumentOutOfRangeException ("Offsets must not be less than zero");
- }
-
- if(offset1 > string1.Length) {
- throw new ArgumentOutOfRangeException ("Offset1 is greater than or equal to the length of string1");
- }
-
- if(offset2 > string2.Length) {
- throw new ArgumentOutOfRangeException ("Offset2 is greater than or equal to the length of string2");
- }
-
- return(internal_compare_switch (string1, offset1,
- string1.Length-offset1,
- string2, offset2,
- string2.Length-offset2,
- options));
- }
-
- public virtual int Compare (string string1, int offset1,
- int length1, string string2,
- int offset2, int length2)
- {
- return Compare (string1, offset1, length1, string2, offset2, length2, CompareOptions.None);
- }
-
- public virtual int Compare (string string1, int offset1,
- int length1, string string2,
- int offset2, int length2,
- CompareOptions options)
- {
- if ((options & ValidCompareOptions) != options)
- throw new ArgumentException ("options");
-
- if (string1 == null) {
- if (string2 == null)
- return 0;
- return -1;
- }
- if (string2 == null)
- return 1;
-
- /* Not in the spec, but ms does these short
- * cuts before checking the offsets (breaking
- * the offset >= string length specified check
- * in the process...)
- */
- if((string1.Length == 0 ||
- offset1 == string1.Length ||
- length1 == 0) &&
- (string2.Length == 0 ||
- offset2 == string2.Length ||
- length2 == 0))
- return(0);
-
- if(offset1 < 0 || length1 < 0 ||
- offset2 < 0 || length2 < 0) {
- throw new ArgumentOutOfRangeException ("Offsets and lengths must not be less than zero");
- }
-
- if(offset1 > string1.Length) {
- throw new ArgumentOutOfRangeException ("Offset1 is greater than or equal to the length of string1");
- }
-
- if(offset2 > string2.Length) {
- throw new ArgumentOutOfRangeException ("Offset2 is greater than or equal to the length of string2");
- }
-
- if(length1 > string1.Length-offset1) {
- throw new ArgumentOutOfRangeException ("Length1 is greater than the number of characters from offset1 to the end of string1");
- }
-
- if(length2 > string2.Length-offset2) {
- throw new ArgumentOutOfRangeException ("Length2 is greater than the number of characters from offset2 to the end of string2");
- }
-
- return(internal_compare_switch (string1, offset1, length1,
- string2, offset2, length2,
- options));
- }
-
- public override bool Equals(object value)
- {
- CompareInfo other=value as CompareInfo;
- if(other==null) {
- return(false);
- }
-
- return(other.culture==culture);
- }
-
- public static CompareInfo GetCompareInfo(int culture)
- {
- return(new CultureInfo (culture).CompareInfo);
- }
-
- public static CompareInfo GetCompareInfo(string name)
- {
- if(name == null) {
- throw new ArgumentNullException("name");
- }
- return(new CultureInfo (name).CompareInfo);
- }
-
- public static CompareInfo GetCompareInfo(int culture,
- Assembly assembly)
- {
- /* The assembly parameter is supposedly there
- * to allow some sort of compare algorithm
- * versioning.
- */
- if(assembly == null) {
- throw new ArgumentNullException("assembly");
- }
- if(assembly!=typeof (Object).Module.Assembly) {
- throw new ArgumentException ("Assembly is an invalid type");
- }
- return(GetCompareInfo (culture));
- }
-
- public static CompareInfo GetCompareInfo(string name,
- Assembly assembly)
- {
- /* The assembly parameter is supposedly there
- * to allow some sort of compare algorithm
- * versioning.
- */
- if(name == null) {
- throw new ArgumentNullException("name");
- }
- if(assembly == null) {
- throw new ArgumentNullException("assembly");
- }
- if(assembly!=typeof (Object).Module.Assembly) {
- throw new ArgumentException ("Assembly is an invalid type");
- }
- return(GetCompareInfo (name));
- }
-
- public override int GetHashCode()
- {
- return(LCID);
- }
-
- internal int GetHashCodeOfString (string source, CompareOptions options)
- {
- return GetSortKey (source, options).GetHashCode ();
- }
-
- public virtual SortKey GetSortKey(string source)
- {
- return(GetSortKey (source, CompareOptions.None));
- }
-
- public virtual SortKey GetSortKey(string source,
- CompareOptions options)
- {
- switch (options) {
- case CompareOptions.Ordinal:
- case CompareOptions.OrdinalIgnoreCase:
- throw new ArgumentException ("Now allowed CompareOptions.", "options");
- }
- if (UseManagedCollation)
- return collator.GetSortKey (source, options);
- SortKey key=new SortKey (culture, source, options);
-
- /* Need to do the icall here instead of in the
- * SortKey constructor, as we need access to
- * this instance's collator.
- */
- assign_sortkey (key, source, options);
-
- return(key);
- }
-
- public virtual int IndexOf (string source, char value)
- {
- return(IndexOf (source, value, 0, source.Length,
- CompareOptions.None));
- }
-
- public virtual int IndexOf (string source, string value)
- {
- return(IndexOf (source, value, 0, source.Length,
- CompareOptions.None));
- }
-
- public virtual int IndexOf (string source, char value,
- CompareOptions options)
- {
- return(IndexOf (source, value, 0, source.Length,
- options));
- }
-
- public virtual int IndexOf (string source, char value,
- int startIndex)
- {
- return(IndexOf (source, value, startIndex,
- source.Length - startIndex,
- CompareOptions.None));
- }
-
- public virtual int IndexOf (string source, string value,
- CompareOptions options)
- {
- return(IndexOf (source, value, 0, source.Length,
- options));
- }
-
- public virtual int IndexOf (string source, string value,
- int startIndex)
- {
- return(IndexOf (source, value, startIndex,
- source.Length - startIndex,
- CompareOptions.None));
- }
-
- public virtual int IndexOf (string source, char value,
- int startIndex,
- CompareOptions options)
- {
- return(IndexOf (source, value, startIndex,
- source.Length - startIndex, options));
- }
-
- public virtual int IndexOf (string source, char value,
- int startIndex, int count)
- {
- return IndexOf (source, value, startIndex, count,
- CompareOptions.None);
- }
-
- public virtual int IndexOf (string source, string value,
- int startIndex,
- CompareOptions options)
- {
- return(IndexOf (source, value, startIndex,
- source.Length - startIndex, options));
- }
-
- public virtual int IndexOf (string source, string value,
- int startIndex, int count)
- {
- return(IndexOf (source, value, startIndex, count,
- CompareOptions.None));
- }
-
- private int internal_index_managed (string s, int sindex,
- int count, char c, CompareOptions opt,
- bool first)
- {
- return first ?
- collator.IndexOf (s, c, sindex, count, opt) :
- collator.LastIndexOf (s, c, sindex, count, opt);
- }
-
- private int internal_index_switch (string s, int sindex,
- int count, char c, CompareOptions opt,
- bool first)
- {
- // - forward IndexOf() icall is much faster than
- // manged version, so always use icall. However,
- // it does not work for OrdinalIgnoreCase, so
- // do not avoid managed collator for that option.
- return UseManagedCollation && ! (first && opt == CompareOptions.Ordinal) ?
- internal_index_managed (s, sindex, count, c, opt, first) :
- internal_index (s, sindex, count, c, opt, first);
- }
-
- public virtual int IndexOf (string source, char value,
- int startIndex, int count,
- CompareOptions options)
- {
- if(source==null) {
- throw new ArgumentNullException ("source");
- }
- if(startIndex<0) {
- throw new ArgumentOutOfRangeException ("startIndex");
- }
- if(count<0 || (source.Length - startIndex) < count) {
- throw new ArgumentOutOfRangeException ("count");
- }
- if ((options & ValidCompareOptions_NoStringSort) != options)
- throw new ArgumentException ("options");
-
- if(count==0) {
- return(-1);
- }
-
- if((options & CompareOptions.Ordinal)!=0) {
- return source.IndexOfUnchecked (value, startIndex, count);
- }
- return (internal_index_switch (source, startIndex,
- count, value, options,
- true));
- }
-
- private int internal_index_managed (string s1, int sindex,
- int count, string s2, CompareOptions opt,
- bool first)
- {
- return first ?
- collator.IndexOf (s1, s2, sindex, count, opt) :
- collator.LastIndexOf (s1, s2, sindex, count, opt);
- }
-
- private int internal_index_switch (string s1, int sindex,
- int count, string s2, CompareOptions opt,
- bool first)
- {
- // - forward IndexOf() icall is much faster than
- // manged version, so always use icall. However,
- // it does not work for OrdinalIgnoreCase, so
- // do not avoid managed collator for that option.
- return UseManagedCollation && ! (first && opt == CompareOptions.Ordinal) ?
- internal_index_managed (s1, sindex, count, s2, opt, first) :
- internal_index (s1, sindex, count, s2, opt, first);
- }
-
- public virtual int IndexOf (string source, string value,
- int startIndex, int count,
- CompareOptions options)
- {
- if(source==null) {
- throw new ArgumentNullException ("source");
- }
- if(value==null) {
- throw new ArgumentNullException ("value");
- }
- if(startIndex<0) {
- throw new ArgumentOutOfRangeException ("startIndex");
- }
- if(count<0 || (source.Length - startIndex) < count) {
- throw new ArgumentOutOfRangeException ("count");
- }
- if ((options & ValidCompareOptions_NoStringSort) != options)
- throw new ArgumentException ("options");
- if(value.Length==0) {
- return(startIndex);
- }
- if(count==0) {
- return(-1);
- }
-
- return (internal_index_switch (source, startIndex, count,
- value, options, true));
- }
-
- public virtual bool IsPrefix(string source, string prefix)
- {
- return(IsPrefix (source, prefix, CompareOptions.None));
- }
-
- public virtual bool IsPrefix(string source, string prefix,
- CompareOptions options)
- {
- if(source == null) {
- throw new ArgumentNullException("source");
- }
- if(prefix == null) {
- throw new ArgumentNullException("prefix");
- }
-
- if ((options & ValidCompareOptions_NoStringSort) != options)
- throw new ArgumentException ("options");
-
- if (UseManagedCollation)
- return collator.IsPrefix (source, prefix, options);
-
- if(source.Length < prefix.Length) {
- return(false);
- } else {
- return(Compare (source, 0, prefix.Length,
- prefix, 0, prefix.Length,
- options)==0);
- }
- }
-
- public virtual bool IsSuffix(string source, string suffix)
- {
- return(IsSuffix (source, suffix, CompareOptions.None));
- }
-
- public virtual bool IsSuffix(string source, string suffix,
- CompareOptions options)
- {
- if(source == null) {
- throw new ArgumentNullException("source");
- }
- if(suffix == null) {
- throw new ArgumentNullException("suffix");
- }
-
- if ((options & ValidCompareOptions_NoStringSort) != options)
- throw new ArgumentException ("options");
-
- if (UseManagedCollation)
- return collator.IsSuffix (source, suffix, options);
-
- if(source.Length < suffix.Length) {
- return(false);
- } else {
- return(Compare (source,
- source.Length - suffix.Length,
- suffix.Length, suffix, 0,
- suffix.Length, options)==0);
- }
- }
-
- public virtual int LastIndexOf(string source, char value)
- {
- return(LastIndexOf (source, value, source.Length - 1,
- source.Length, CompareOptions.None));
- }
-
- public virtual int LastIndexOf(string source, string value)
- {
- return(LastIndexOf (source, value, source.Length - 1,
- source.Length, CompareOptions.None));
- }
-
- public virtual int LastIndexOf(string source, char value,
- CompareOptions options)
- {
- return(LastIndexOf (source, value, source.Length - 1,
- source.Length, options));
- }
-
- public virtual int LastIndexOf(string source, char value,
- int startIndex)
- {
- return(LastIndexOf (source, value, startIndex,
- startIndex + 1,
- CompareOptions.None));
- }
-
- public virtual int LastIndexOf(string source, string value,
- CompareOptions options)
- {
- return(LastIndexOf (source, value, source.Length - 1,
- source.Length, options));
- }
-
- public virtual int LastIndexOf(string source, string value,
- int startIndex)
- {
- return(LastIndexOf (source, value, startIndex,
- startIndex + 1,
- CompareOptions.None));
- }
-
- public virtual int LastIndexOf(string source, char value,
- int startIndex,
- CompareOptions options)
- {
- return(LastIndexOf (source, value, startIndex,
- startIndex + 1,
- options));
- }
-
- public virtual int LastIndexOf(string source, char value,
- int startIndex, int count)
- {
- return(LastIndexOf (source, value, startIndex, count,
- CompareOptions.None));
- }
-
- public virtual int LastIndexOf(string source, string value,
- int startIndex,
- CompareOptions options)
- {
- return(LastIndexOf (source, value, startIndex,
- startIndex + 1,
- options));
- }
-
- public virtual int LastIndexOf(string source, string value,
- int startIndex, int count)
- {
- return(LastIndexOf (source, value, startIndex, count,
- CompareOptions.None));
- }
-
- public virtual int LastIndexOf(string source, char value,
- int startIndex, int count,
- CompareOptions options)
- {
- if(source == null) {
- throw new ArgumentNullException("source");
- }
- if(startIndex < 0) {
- throw new ArgumentOutOfRangeException ("startIndex");
- }
- if(count < 0 || (startIndex - count) < -1) {
- throw new ArgumentOutOfRangeException("count");
- }
- if ((options & ValidCompareOptions_NoStringSort) != options)
- throw new ArgumentException ("options");
-
- if(count==0) {
- return(-1);
- }
-
- if((options & CompareOptions.Ordinal)!=0) {
- for(int pos=startIndex;
- pos > startIndex - count;
- pos--) {
- if(source[pos]==value) {
- return(pos);
- }
- }
- return(-1);
- } else {
- return (internal_index_switch (source, startIndex,
- count, value, options,
- false));
- }
- }
-
- public virtual int LastIndexOf(string source, string value,
- int startIndex, int count,
- CompareOptions options)
- {
- if(source == null) {
- throw new ArgumentNullException("source");
- }
- if(value == null) {
- throw new ArgumentNullException("value");
- }
- if(startIndex < 0) {
- throw new ArgumentOutOfRangeException ("startIndex");
- }
- if(count < 0 || (startIndex - count) < -1) {
- throw new ArgumentOutOfRangeException("count");
- }
- if ((options & ValidCompareOptions_NoStringSort) != options)
- throw new ArgumentException ("options");
- if(count == 0) {
- return(-1);
- }
-
- int valuelen=value.Length;
- if(valuelen==0) {
- return(startIndex);
- }
-
- return(internal_index_switch (source, startIndex, count,
- value, options, false));
- }
-
- [ComVisible (false)]
- public static bool IsSortable (char ch)
- {
- return MSCompatUnicodeTable.IsSortable (ch);
- }
-
- [ComVisible (false)]
- public static bool IsSortable (string text)
- {
- return MSCompatUnicodeTable.IsSortable (text);
- }
-
- public override string ToString()
- {
- return("CompareInfo - "+culture);
- }
-
- /* LAMESPEC: not mentioned in the spec, but corcompare
- * shows it. Some documentation about what it does
- * would be nice.
- */
- public int LCID {
- get {
- return culture;
- }
- }
-
- [ComVisible (false)]
- public virtual string Name {
- get { return m_name; }
- }
- }
-}
+++ /dev/null
-// CompareOptions.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:34:52 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 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.
-//
-
-
-namespace System.Globalization {
-
-
- [System.Runtime.InteropServices.ComVisible(true)]
- [System.Serializable]
- [Flags]
- public enum CompareOptions {
- None = 0,
- IgnoreCase = 1,
- IgnoreNonSpace = 2,
- IgnoreSymbols = 4,
- IgnoreKanaType = 8,
- IgnoreWidth = 16,
-
- StringSort = 0x20000000,
- Ordinal = 0x40000000,
- OrdinalIgnoreCase = 0x10000000
- } // CompareOptions
-
-} // System.Globalization
int default_calendar_type;
bool m_useUserOverride;
[NonSerialized]
- volatile NumberFormatInfo numInfo;
+ internal volatile NumberFormatInfo numInfo;
internal volatile DateTimeFormatInfo dateTimeInfo;
volatile TextInfo textInfo;
- private string m_name;
+ internal string m_name;
[NonSerialized]
private string englishname;
[NonSerialized]
private unsafe readonly void *textinfo_data;
+ [StructLayout (LayoutKind.Sequential)]
+ struct Data {
+ public int ansi;
+ public int ebcdic;
+ public int mac;
+ public int oem;
+ public bool right_to_left;
+ public byte list_sep;
+ }
+
int m_dataItem; // MS.NET serializes this.
#pragma warning restore 169, 649
for (int i = 1; i < infos.Length; ++i) {
var ci = infos [i];
- infos [i].m_cultureData = CultureData.GetCultureData (ci.m_name, false, ci.datetime_index, ci.CalendarType, ci.iso2lang);
+ var ti = ci.GetTextInfoData ();
+ infos [i].m_cultureData = CultureData.GetCultureData (ci.m_name, false, ci.datetime_index, ci.CalendarType, ci.number_index, ci.iso2lang,
+ ti.ansi, ti.oem, ti.mac, ti.ebcdic, ti.right_to_left, ((char)ti.list_sep).ToString ());
}
return infos;
}
+ unsafe Data GetTextInfoData ()
+ {
+ return *(Data*) textinfo_data;
+ }
+
public override int GetHashCode ()
{
return cultureID.GetHashCode ();
public virtual NumberFormatInfo NumberFormat {
get {
- if (!constructed) Construct ();
- CheckNeutral ();
- if (numInfo == null){
- lock (this){
- if (numInfo == null) {
- numInfo = new NumberFormatInfo (m_isReadOnly);
- construct_number_format ();
- }
- }
+ if (numInfo == null) {
+ NumberFormatInfo temp = new NumberFormatInfo(this.m_cultureData);
+ temp.isReadOnly = m_isReadOnly;
+ numInfo = temp;
}
return numInfo;
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern static CultureInfo [] internal_get_cultures (bool neutral, bool specific, bool installed);
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern void construct_number_format ();
-
private void ConstructInvariant (bool read_only)
{
cultureID = InvariantCultureId;
private unsafe TextInfo CreateTextInfo (bool readOnly)
{
- return new TextInfo (this, cultureID, this.textinfo_data, readOnly);
+ TextInfo tempTextInfo = new TextInfo (this.m_cultureData);
+ tempTextInfo.SetReadOnlyState (readOnly);
+ return tempTextInfo;
}
public CultureInfo (int culture) : this (culture, true) {}
if (culture == InvariantCultureId) {
/* Short circuit the invariant culture */
- ConstructInvariant (read_only);
m_cultureData = CultureData.Invariant;
+ ConstructInvariant (read_only);
return;
}
throw new CultureNotFoundException ("culture", msg);
}
- m_cultureData = CultureData.GetCultureData (m_name, m_useUserOverride, datetime_index, CalendarType, iso2lang);
+ var ti = GetTextInfoData ();
+ m_cultureData = CultureData.GetCultureData (m_name, m_useUserOverride, datetime_index, CalendarType, number_index, iso2lang,
+ ti.ansi, ti.oem, ti.mac, ti.ebcdic, ti.right_to_left, ((char)ti.list_sep).ToString ());
}
public CultureInfo (string name) : this (name, true) {}
if (name.Length == 0) {
/* Short circuit the invariant culture */
- ConstructInvariant (read_only);
m_cultureData = CultureData.Invariant;
+ ConstructInvariant (read_only);
return;
}
throw CreateNotFoundException (name);
}
- m_cultureData = CultureData.GetCultureData (m_name, useUserOverride, datetime_index, CalendarType, iso2lang);
+ var ti = GetTextInfoData ();
+ m_cultureData = CultureData.GetCultureData (m_name, useUserOverride, datetime_index, CalendarType, number_index, iso2lang,
+ ti.ansi, ti.oem, ti.mac, ti.ebcdic, ti.right_to_left, ((char)ti.list_sep).ToString ());
}
// This is used when creating by specific name and creating by
if (ci.IsNeutralCulture)
ci = CreateSpecificCultureFromNeutral (ci.Name);
- ci.m_cultureData = CultureData.GetCultureData (ci.m_name, false, ci.datetime_index, ci.CalendarType, ci.iso2lang);
+ var ti = ci.GetTextInfoData ();
+
+ ci.m_cultureData = CultureData.GetCultureData (ci.m_name, false, ci.datetime_index, ci.CalendarType, ci.number_index, ci.iso2lang,
+ ti.ansi, ti.oem, ti.mac, ti.ebcdic, ti.right_to_left, ((char)ti.list_sep).ToString ());
return ci;
}
}
}
+ internal string SortName {
+ get {
+ return m_name;
+ }
+ }
+
#region reference sources
// TODO:
internal static readonly bool IsTaiwanSku;
+++ /dev/null
-//
-// System.Globalization.CultureNotFoundException.cs
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@novell.com)
-//
-// Copyright (c) 2010 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;
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-
-namespace System.Globalization {
- [Serializable]
- [ComVisible (true)]
- public class CultureNotFoundException : ArgumentException, ISerializable {
- string invalid_culture_name;
- int? invalid_culture_id;
-
- public CultureNotFoundException () : base ("Culture not found")
- {
- }
-
- public CultureNotFoundException (string message) : base (message)
- {
- }
-
- protected CultureNotFoundException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- invalid_culture_name = (string) info.GetValue ("invalid_culture_name", typeof (string));
- invalid_culture_id = (int?) info.GetValue ("invalid_culture_id", typeof (int?));
- }
-
- public CultureNotFoundException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- public CultureNotFoundException (string paramName, string message)
- : base (message, paramName)
- {
- }
-
- public CultureNotFoundException (string message, int invalidCultureId, Exception innerException)
- : base (message, innerException)
- {
- invalid_culture_id = invalidCultureId;
- }
-
- public CultureNotFoundException (string paramName, int invalidCultureId, string message)
- : base (message, paramName)
- {
- invalid_culture_id = invalidCultureId;
- }
-
- public CultureNotFoundException (string message, string invalidCultureName, Exception innerException)
- : base (message, innerException)
- {
- invalid_culture_name = invalidCultureName;
- }
-
- public CultureNotFoundException (string paramName, string invalidCultureName, string message)
- : base (message, paramName)
- {
- invalid_culture_name = invalidCultureName;
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
-
- base.GetObjectData (info, context);
- info.AddValue ("invalid_culture_name", invalid_culture_name, typeof (string));
- info.AddValue ("invalid_culture_id", invalid_culture_id, typeof (int?));
- }
-
- public virtual int? InvalidCultureId {
- get { return invalid_culture_id; }
- }
-
- public virtual string InvalidCultureName {
- get { return invalid_culture_name; }
- }
-
- public override string Message {
- get {
- if (invalid_culture_name == null && invalid_culture_id.HasValue == false)
- return base.Message;
-
- if (invalid_culture_name != null)
- return String.Format ("Culture name {0} is invalid", invalid_culture_name);
- return String.Format ("Culture ID {0} is invalid", invalid_culture_id);
- }
- }
- }
-}
-
+++ /dev/null
-// CultureTypes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:35:02 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 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.
-//
-
-
-namespace System.Globalization {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- [System.Runtime.InteropServices.ComVisible(true)]
- [System.Serializable]
- public enum CultureTypes {
- NeutralCultures = 1,
- SpecificCultures = 2,
- InstalledWin32Cultures = 4,
- AllCultures = 7,
- UserCustomCulture = 8,
- ReplacementCultures = 16,
- [Obsolete]
- WindowsOnlyCultures = 32,
- [Obsolete]
- FrameworkCultures = 64,
- } // CultureTypes
-
-} // System.Globalization
+++ /dev/null
-//
-// System.Globalization.DateTimeFormatInfo.cs
-//
-// Authors:
-// Martin Weindel (martin.weindel@t-online.de)
-// Marek Safar (marek.safar@gmail.com)
-//
-// (C) Martin Weindel (martin.weindel@t-online.de)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.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.Generic;
-
-namespace System.Globalization
-{
- public sealed partial class DateTimeFormatInfo : ICloneable, IFormatProvider
- {
- [NonSerialized]
- private string m_fullTimeSpanPositivePattern;
- internal String FullTimeSpanPositivePattern {
- get {
- if (m_fullTimeSpanPositivePattern == null) {
- String decimalSeparator = Culture.NumberFormat.NumberDecimalSeparator;
-
- m_fullTimeSpanPositivePattern = "d':'h':'mm':'ss'" + decimalSeparator + "'FFFFFFF";
- }
-
- return m_fullTimeSpanPositivePattern;
- }
- }
- }
-}
+++ /dev/null
-// DateTimeStyles.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:32:07 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.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.
-//
-
-
-namespace System.Globalization {
-
- [Flags]
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public enum DateTimeStyles {
- None = 0x00000000,
- AllowLeadingWhite = 0x00000001,
- AllowTrailingWhite = 0x00000002,
- AllowInnerWhite = 0x00000004,
- AllowWhiteSpaces = AllowLeadingWhite | AllowTrailingWhite | AllowInnerWhite,
- NoCurrentDateDefault = 0x00000008,
- AdjustToUniversal = 0x00000010,
- AssumeLocal = 0x00000020,
- AssumeUniversal = 0x00000040,
- RoundtripKind = 0x00000080,
- } // DateTimeStyles
-
-} // System.Globalization
+++ /dev/null
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System.Globalization {
-
- [System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
- public enum DigitShapes {
- Context = 0,
- None = 1,
- NativeNational = 2
- }
-}
+++ /dev/null
-// GregorianCalendarTypes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:35:19 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 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.
-//
-
-
-namespace System.Globalization {
-
-
- [System.Runtime.InteropServices.ComVisible(true)]
- [System.Serializable]
- public enum GregorianCalendarTypes {
-
- /// <summary>
- /// </summary>
- Localized = 1,
-
- /// <summary>
- /// </summary>
- USEnglish = 2,
-
- /// <summary>
- /// </summary>
- MiddleEastFrench = 9,
-
- /// <summary>
- /// </summary>
- Arabic = 10,
-
- /// <summary>
- /// </summary>
- TransliteratedEnglish = 11,
-
- /// <summary>
- /// </summary>
- TransliteratedFrench = 12,
- } // GregorianCalendarTypes
-
-} // System.Globalization
+++ /dev/null
-//
-// System.Globalization.NumberFormatInfo.cs
-//
-// Author:
-// Derek Holden (dholden@draper.com)
-// Bob Smith (bob@thestuff.net)
-// Mohammad DAMT (mdamt@cdl2000.com)
-//
-// (C) Derek Holden
-// (C) Bob Smith http://www.thestuff.net
-// (c) 2003, PT Cakram Datalingga Duaribu http://www.cdl2000.com
-//
-
-//
-// Copyright (C) 2004 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.
-//
-
-//
-// NumberFormatInfo. One can only assume it is the class gotten
-// back from a GetFormat() method from an IFormatProvider /
-// IFormattable implementer. There are some discrepencies with the
-// ECMA spec and the SDK docs, surprisingly. See my conversation
-// with myself on it at:
-// http://lists.ximian.com/archives/public/mono-list/2001-July/000794.html
-//
-// Other than that this is totally ECMA compliant.
-//
-
-using System.Diagnostics.Contracts;
-using System.Runtime.InteropServices;
-
-namespace System.Globalization {
-
- [ComVisible (true)]
- [Serializable]
- [StructLayout (LayoutKind.Sequential)]
- public sealed class NumberFormatInfo : ICloneable, IFormatProvider {
-
-/* Keep in sync with object-internals.h */
-
-#pragma warning disable 649
- private bool isReadOnly;
- // used for temporary storage. Used in InitPatterns ()
- string decimalFormats;
- string currencyFormats;
- string percentFormats;
- string digitPattern = "#";
- string zeroPattern = "0";
-
- // Currency Related Format Info
- private int currencyDecimalDigits;
- private string currencyDecimalSeparator;
- private string currencyGroupSeparator;
- private int[] currencyGroupSizes;
- private int currencyNegativePattern;
- private int currencyPositivePattern;
- private string currencySymbol;
-
- private string nanSymbol;
- private string negativeInfinitySymbol;
- private string negativeSign;
-
- // Number Related Format Info
- private int numberDecimalDigits;
- private string numberDecimalSeparator;
- private string numberGroupSeparator;
- private int[] numberGroupSizes;
- private int numberNegativePattern;
-
- // Percent Related Format Info
- private int percentDecimalDigits;
- private string percentDecimalSeparator;
- private string percentGroupSeparator;
- private int[] percentGroupSizes;
- private int percentNegativePattern;
- private int percentPositivePattern;
- private string percentSymbol;
-
- private string perMilleSymbol;
- private string positiveInfinitySymbol;
- private string positiveSign;
-#pragma warning restore 649
-
-#pragma warning disable 169
- internal string ansiCurrencySymbol; // TODO, MS.NET serializes this.
- int m_dataItem; // Unused, but MS.NET serializes this.
- bool m_useUserOverride; // Unused, but MS.NET serializes this.
- bool validForParseAsNumber; // Unused, but MS.NET serializes this.
- bool validForParseAsCurrency; // Unused, but MS.NET serializes this.
-#pragma warning restore 169
-
-#if !MOBILE
- string[] nativeDigits = invariantNativeDigits;
- int digitSubstitution = 1; // DigitShapes.None.
- static readonly string [] invariantNativeDigits = new string [] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
-#endif
-
- internal NumberFormatInfo (int lcid, bool read_only)
- {
- isReadOnly = read_only;
-
- //FIXME: should add more LCID
- // CultureInfo uses this one also.
- if (lcid != 0x007F)
- lcid = 0x007F;
-
- // The Invariant Culture Info ID.
- if (lcid == 0x007f) {
- // Currency Related Format Info
- currencyDecimalDigits = 2;
- currencyDecimalSeparator = ".";
- currencyGroupSeparator = ",";
- currencyGroupSizes = new int[1] { 3 };
- currencyNegativePattern = 0;
- currencyPositivePattern = 0;
- currencySymbol = "\u00a4";
-
- nanSymbol = "NaN";
- negativeInfinitySymbol = "-Infinity";
- negativeSign = "-";
-
- // Number Related Format Info
- numberDecimalDigits = 2;
- numberDecimalSeparator = ".";
- numberGroupSeparator = ",";
- numberGroupSizes = new int[1] { 3 };
- numberNegativePattern = 1;
-
- // Percent Related Format Info
- percentDecimalDigits = 2;
- percentDecimalSeparator = ".";
- percentGroupSeparator = ",";
- percentGroupSizes = new int[1] { 3 };
- percentNegativePattern = 0;
- percentPositivePattern = 0;
- percentSymbol= "%";
-
- perMilleSymbol = "\u2030";
- positiveInfinitySymbol = "Infinity";
- positiveSign = "+";
- }
- }
-
- internal NumberFormatInfo (bool read_only) : this (0x007f, read_only)
- {
- }
-
- public NumberFormatInfo () : this (false)
- {
- }
-
- // this is called by mono/mono/metadata/locales.c
-#pragma warning disable 169
- void InitPatterns ()
- {
- string [] partOne, partTwo;
- string [] posNeg = decimalFormats.Split (new char [1] {';'}, 2);
-
- if (posNeg.Length == 2) {
-
- partOne = posNeg [0].Split (new char [1] {'.'}, 2);
-
- if (partOne.Length == 2) {
- // assumed same for both positive and negative
- // decimal digit side
- numberDecimalDigits = 0;
- for (int i = 0; i < partOne [1].Length; i ++) {
- if (partOne [1][i] == digitPattern [0]) {
- numberDecimalDigits ++;
- } else
- break;
- }
-
- // decimal grouping side
- partTwo = partOne [0].Split (',');
- if (partTwo.Length > 1) {
- numberGroupSizes = new int [partTwo.Length - 1];
- for (int i = 0; i < numberGroupSizes.Length; i ++) {
- string pat = partTwo [i + 1];
- numberGroupSizes [i] = pat.Length;
- }
- } else {
- numberGroupSizes = new int [1] { 0 };
- }
-
- if (posNeg [1].StartsWith ("(") && posNeg [1].EndsWith (")")) {
- numberNegativePattern = 0;
- } else if (posNeg [1].StartsWith ("- ")) {
- numberNegativePattern = 2;
- } else if (posNeg [1].StartsWith ("-")) {
- numberNegativePattern = 1;
- } else if (posNeg [1].EndsWith (" -")) {
- numberNegativePattern = 4;
- } else if (posNeg [1].EndsWith ("-")) {
- numberNegativePattern = 3;
- } else {
- numberNegativePattern = 1;
- }
- }
- }
-
- posNeg = currencyFormats.Split (new char [1] {';'}, 2);
- if (posNeg.Length == 2) {
- partOne = posNeg [0].Split (new char [1] {'.'}, 2);
-
- if (partOne.Length == 2) {
- // assumed same for both positive and negative
- // decimal digit side
- currencyDecimalDigits = 0;
- for (int i = 0; i < partOne [1].Length; i ++) {
- if (partOne [1][i] == zeroPattern [0])
- currencyDecimalDigits ++;
- else
- break;
- }
-
- // decimal grouping side
- partTwo = partOne [0].Split (',');
- if (partTwo.Length > 1) {
- currencyGroupSizes = new int [partTwo.Length - 1];
- for (int i = 0; i < currencyGroupSizes.Length; i ++) {
- string pat = partTwo [i + 1];
- currencyGroupSizes [i] = pat.Length;
- }
- } else {
- currencyGroupSizes = new int [1] { 0 };
- }
-
- if (posNeg [1].StartsWith ("(\u00a4 ") && posNeg [1].EndsWith (")")) {
- currencyNegativePattern = 14;
- } else if (posNeg [1].StartsWith ("(\u00a4") && posNeg [1].EndsWith (")")) {
- currencyNegativePattern = 0;
- } else if (posNeg [1].StartsWith ("\u00a4 ") && posNeg [1].EndsWith ("-")) {
- currencyNegativePattern = 11;
- } else if (posNeg [1].StartsWith ("\u00a4") && posNeg [1].EndsWith ("-")) {
- currencyNegativePattern = 3;
- } else if (posNeg [1].StartsWith ("(") && posNeg [1].EndsWith (" \u00a4")) {
- currencyNegativePattern = 15;
- } else if (posNeg [1].StartsWith ("(") && posNeg [1].EndsWith ("\u00a4")) {
- currencyNegativePattern = 4;
- } else if (posNeg [1].StartsWith ("-") && posNeg [1].EndsWith (" \u00a4")) {
- currencyNegativePattern = 8;
- } else if (posNeg [1].StartsWith ("-") && posNeg [1].EndsWith ("\u00a4")) {
- currencyNegativePattern = 5;
- } else if (posNeg [1].StartsWith ("-\u00a4 ")) {
- currencyNegativePattern = 9;
- } else if (posNeg [1].StartsWith ("-\u00a4")) {
- currencyNegativePattern = 1;
- } else if (posNeg [1].StartsWith ("\u00a4 -")) {
- currencyNegativePattern = 12;
- } else if (posNeg [1].StartsWith ("\u00a4-")) {
- currencyNegativePattern = 2;
- } else if (posNeg [1].EndsWith (" \u00a4-")) {
- currencyNegativePattern = 10;
- } else if (posNeg [1].EndsWith ("\u00a4-")) {
- currencyNegativePattern = 7;
- } else if (posNeg [1].EndsWith ("- \u00a4")) {
- currencyNegativePattern = 13;
- } else if (posNeg [1].EndsWith ("-\u00a4")) {
- currencyNegativePattern = 6;
- } else {
- currencyNegativePattern = 0;
- }
-
- if (posNeg [0].StartsWith ("\u00a4 ")) {
- currencyPositivePattern = 2;
- } else if (posNeg [0].StartsWith ("\u00a4")) {
- currencyPositivePattern = 0;
- } else if (posNeg [0].EndsWith (" \u00a4")) {
- currencyPositivePattern = 3;
- } else if (posNeg [0].EndsWith ("\u00a4")) {
- currencyPositivePattern = 1;
- } else {
- currencyPositivePattern = 0;
- }
- }
- }
-
- // we don't have percentNegativePattern in CLDR so
- // the percentNegativePattern are just guesses
- if (percentFormats.StartsWith ("%")) {
- percentPositivePattern = 2;
- percentNegativePattern = 2;
- } else if (percentFormats.EndsWith (" %")) {
- percentPositivePattern = 0;
- percentNegativePattern = 0;
- } else if (percentFormats.EndsWith ("%")) {
- percentPositivePattern = 1;
- percentNegativePattern = 1;
- } else {
- percentPositivePattern = 0;
- percentNegativePattern = 0;
- }
-
- partOne = percentFormats.Split (new char [1] {'.'}, 2);
-
- if (partOne.Length == 2) {
- // assumed same for both positive and negative
- // decimal digit side
- percentDecimalDigits = 0;
- for (int i = 0; i < partOne [1].Length; i ++) {
- if (partOne [1][i] == digitPattern [0])
- percentDecimalDigits ++;
- else
- break;
- }
-
- // percent grouping side
- partTwo = partOne [0].Split (',');
- if (partTwo.Length > 1) {
- percentGroupSizes = new int [partTwo.Length - 1];
- for (int i = 0; i < percentGroupSizes.Length; i ++) {
- string pat = partTwo [i + 1];
- percentGroupSizes [i] = pat.Length;
- }
- } else {
- percentGroupSizes = new int [1] { 0 };
- }
- }
-
- }
-#pragma warning restore 169
-
- // =========== Currency Format Properties =========== //
-
- public int CurrencyDecimalDigits {
- get {
- return currencyDecimalDigits;
- }
-
- set {
- if (value < 0 || value > 99)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 99");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyDecimalDigits = value;
- }
- }
-
- public string CurrencyDecimalSeparator {
- get {
- return currencyDecimalSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyDecimalSeparator = value;
- }
- }
-
-
- public string CurrencyGroupSeparator {
- get {
- return currencyGroupSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyGroupSeparator = value;
- }
- }
-
- public int[] CurrencyGroupSizes {
- get {
- return (int []) RawCurrencyGroupSizes.Clone ();
- }
-
- set {
- RawCurrencyGroupSizes = value;
- }
- }
-
- internal int[] RawCurrencyGroupSizes {
- get {
- return currencyGroupSizes;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- if (value.Length == 0) {
- currencyGroupSizes = EmptyArray<int>.Value;
- return;
- }
-
- // All elements except last need to be in range 1 - 9, last can be 0.
- int last = value.Length - 1;
-
- for (int i = 0; i < last; i++)
- if (value[i] < 1 || value[i] > 9)
- throw new ArgumentOutOfRangeException
- ("One of the elements in the array specified is not between 1 and 9");
-
- if (value[last] < 0 || value[last] > 9)
- throw new ArgumentOutOfRangeException
- ("Last element in the array specified is not between 0 and 9");
-
- currencyGroupSizes = (int[]) value.Clone();
- }
- }
-
- public int CurrencyNegativePattern {
- get {
- // See ECMA NumberFormatInfo page 8
- return currencyNegativePattern;
- }
-
- set {
- if (value < 0 || value > 15)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 15");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyNegativePattern = value;
- }
- }
-
- public int CurrencyPositivePattern {
- get {
- // See ECMA NumberFormatInfo page 11
- return currencyPositivePattern;
- }
-
- set {
- if (value < 0 || value > 3)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 3");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyPositivePattern = value;
- }
- }
-
- public string CurrencySymbol {
- get {
- return currencySymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencySymbol = value;
- }
- }
-
- // =========== Static Read-Only Properties =========== //
-
- public static NumberFormatInfo CurrentInfo {
- get {
- NumberFormatInfo nfi = (NumberFormatInfo) System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat;
- nfi.isReadOnly = true;
- return nfi;
- }
- }
-
- public static NumberFormatInfo InvariantInfo {
- get {
- // This uses invariant info, which is same as in the constructor
- NumberFormatInfo nfi = new NumberFormatInfo (true);
- return nfi;
- }
- }
-
- public bool IsReadOnly {
- get {
- return isReadOnly;
- }
- }
-
-
-
- public string NaNSymbol {
- get {
- return nanSymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- nanSymbol = value;
- }
- }
-
-#if !NET_2_1
- [MonoNotSupported ("We don't have native digit info")]
- [ComVisible (false)]
- public string [] NativeDigits {
- get { return nativeDigits; }
- set {
- if (value == null)
- throw new ArgumentNullException ("value");
- if (value.Length != 10)
- throw new ArgumentException ("Argument array length must be 10");
- foreach (string s in value)
- if (String.IsNullOrEmpty (s))
- throw new ArgumentException ("Argument array contains one or more null strings");
- nativeDigits = value;
- }
- }
-
- [MonoNotSupported ("We don't have native digit info")]
- [ComVisible (false)]
- public DigitShapes DigitSubstitution {
- get { return (DigitShapes) digitSubstitution; }
- set { digitSubstitution = (int) value; }
- }
-#endif
-
- public string NegativeInfinitySymbol {
- get {
- return negativeInfinitySymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- negativeInfinitySymbol = value;
- }
- }
-
- public string NegativeSign {
- get {
- return negativeSign;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- negativeSign = value;
- }
- }
-
- // =========== Number Format Properties =========== //
-
- public int NumberDecimalDigits {
- get {
- return numberDecimalDigits;
- }
-
- set {
- if (value < 0 || value > 99)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 99");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- numberDecimalDigits = value;
- }
- }
-
- public string NumberDecimalSeparator {
- get {
- return numberDecimalSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- numberDecimalSeparator = value;
- }
- }
-
-
- public string NumberGroupSeparator {
- get {
- return numberGroupSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- numberGroupSeparator = value;
- }
- }
-
- public int[] NumberGroupSizes {
- get {
- return (int []) RawNumberGroupSizes.Clone ();
- }
-
- set {
- RawNumberGroupSizes = value;
- }
- }
-
- internal int[] RawNumberGroupSizes {
- get {
- return numberGroupSizes;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- if (value.Length == 0) {
- numberGroupSizes = EmptyArray<int>.Value;
- return;
- }
- // All elements except last need to be in range 1 - 9, last can be 0.
- int last = value.Length - 1;
-
- for (int i = 0; i < last; i++)
- if (value[i] < 1 || value[i] > 9)
- throw new ArgumentOutOfRangeException
- ("One of the elements in the array specified is not between 1 and 9");
-
- if (value[last] < 0 || value[last] > 9)
- throw new ArgumentOutOfRangeException
- ("Last element in the array specified is not between 0 and 9");
-
- numberGroupSizes = (int[]) value.Clone();
- }
- }
-
- public int NumberNegativePattern {
- get {
- // See ECMA NumberFormatInfo page 27
- return numberNegativePattern;
- }
-
- set {
- if (value < 0 || value > 4)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 15");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- numberNegativePattern = value;
- }
- }
-
- // =========== Percent Format Properties =========== //
-
- public int PercentDecimalDigits {
- get {
- return percentDecimalDigits;
- }
-
- set {
- if (value < 0 || value > 99)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 99");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentDecimalDigits = value;
- }
- }
-
- public string PercentDecimalSeparator {
- get {
- return percentDecimalSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentDecimalSeparator = value;
- }
- }
-
-
- public string PercentGroupSeparator {
- get {
- return percentGroupSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentGroupSeparator = value;
- }
- }
-
- public int[] PercentGroupSizes {
- get {
- return (int []) RawPercentGroupSizes.Clone ();
- }
-
- set {
- RawPercentGroupSizes = value;
- }
- }
-
- internal int[] RawPercentGroupSizes {
- get {
- return percentGroupSizes;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- if (this == CultureInfo.CurrentCulture.NumberFormat)
- throw new Exception ("HERE the value was modified");
-
- if (value.Length == 0) {
- percentGroupSizes = EmptyArray<int>.Value;
- return;
- }
-
- // All elements except last need to be in range 1 - 9, last can be 0.
- int last = value.Length - 1;
-
- for (int i = 0; i < last; i++)
- if (value[i] < 1 || value[i] > 9)
- throw new ArgumentOutOfRangeException
- ("One of the elements in the array specified is not between 1 and 9");
-
- if (value[last] < 0 || value[last] > 9)
- throw new ArgumentOutOfRangeException
- ("Last element in the array specified is not between 0 and 9");
-
- percentGroupSizes = (int[]) value.Clone();
- }
- }
-
- public int PercentNegativePattern {
- get {
- // See ECMA NumberFormatInfo page 8
- return percentNegativePattern;
- }
-
- set {
- if (value < 0 || value > 2)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 15");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentNegativePattern = value;
- }
- }
-
- public int PercentPositivePattern {
- get {
- // See ECMA NumberFormatInfo page 11
- return percentPositivePattern;
- }
-
- set {
- if (value < 0 || value > 2)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 3");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentPositivePattern = value;
- }
- }
-
- public string PercentSymbol {
- get {
- return percentSymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentSymbol = value;
- }
- }
-
- public string PerMilleSymbol {
- get {
- return perMilleSymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- perMilleSymbol = value;
- }
- }
-
- public string PositiveInfinitySymbol {
- get {
- return positiveInfinitySymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- positiveInfinitySymbol = value;
- }
- }
-
- public string PositiveSign {
- get {
- return positiveSign;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (isReadOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- positiveSign = value;
- }
- }
-
- public object GetFormat (Type formatType)
- {
- return (formatType == typeof (NumberFormatInfo)) ? this : null;
- }
-
- public object Clone ()
- {
- NumberFormatInfo clone = (NumberFormatInfo) MemberwiseClone();
- // clone is not read only
- clone.isReadOnly = false;
- return clone;
- }
-
- public static NumberFormatInfo ReadOnly (NumberFormatInfo nfi)
- {
- NumberFormatInfo copy = (NumberFormatInfo)nfi.Clone();
- copy.isReadOnly = true;
- return copy;
- }
-
- public static NumberFormatInfo GetInstance(IFormatProvider formatProvider)
- {
- if (formatProvider != null) {
- NumberFormatInfo nfi;
- nfi = formatProvider.GetFormat (typeof (NumberFormatInfo)) as NumberFormatInfo;
- if (nfi != null)
- return nfi;
- }
-
- return CurrentInfo;
- }
-
- // private const NumberStyles InvalidNumberStyles = unchecked((NumberStyles) 0xFFFFFC00);
- private const NumberStyles InvalidNumberStyles = ~(NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite
- | NumberStyles.AllowLeadingSign | NumberStyles.AllowTrailingSign
- | NumberStyles.AllowParentheses | NumberStyles.AllowDecimalPoint
- | NumberStyles.AllowThousands | NumberStyles.AllowExponent
- | NumberStyles.AllowCurrencySymbol | NumberStyles.AllowHexSpecifier);
-
- internal static void ValidateParseStyleInteger(NumberStyles style) {
- // Check for undefined flags
- if ((style & InvalidNumberStyles) != 0) {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidNumberStyles"), "style");
- }
- Contract.EndContractBlock();
- if ((style & NumberStyles.AllowHexSpecifier) != 0) { // Check for hex number
- if ((style & ~NumberStyles.HexNumber) != 0) {
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidHexStyle"));
- }
- }
- }
-
- internal static void ValidateParseStyleFloatingPoint(NumberStyles style) {
- // Check for undefined flags
- if ((style & InvalidNumberStyles) != 0) {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidNumberStyles"), "style");
- }
- Contract.EndContractBlock();
- if ((style & NumberStyles.AllowHexSpecifier) != 0) { // Check for hex number
- throw new ArgumentException(Environment.GetResourceString("Arg_HexStyleNotSupported"));
- }
- }
- }
-}
+++ /dev/null
-//------------------------------------------------------------------------------
-//
-// System.Globalization.NumberStyles.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Thu 07/18/2001
-//
-// Modified: 7/20/01, Derek Holden (dholden@draper.com)
-// Added ECMA values for allows and masks for data types
-//
-//------------------------------------------------------------------------------
-
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System.Globalization {
-
- [Flags]
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public enum NumberStyles {
- None = 0x00000000,
- AllowLeadingWhite = 0x00000001,
- AllowTrailingWhite = 0x00000002,
- AllowLeadingSign = 0x00000004,
- AllowTrailingSign = 0x00000008,
- AllowParentheses = 0x00000010,
- AllowDecimalPoint = 0x00000020,
- AllowThousands = 0x00000040,
- AllowExponent = 0x00000080,
- AllowCurrencySymbol = 0x00000100,
- AllowHexSpecifier = 0x00000200,
-
- Integer = ( AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign ),
- HexNumber = ( AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier ),
- Number = ( AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |
- AllowTrailingSign | AllowDecimalPoint | AllowThousands ),
- Float = ( AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |
- AllowDecimalPoint | AllowExponent ),
- Currency = ( AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |
- AllowTrailingSign | AllowParentheses | AllowDecimalPoint |
- AllowThousands | AllowCurrencySymbol ),
- Any = ( AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |
- AllowTrailingSign | AllowParentheses | AllowDecimalPoint |
- AllowThousands | AllowExponent | AllowCurrencySymbol ),
- }
-
-} // Namespace
+++ /dev/null
-//
-// System.Globalization.SortKey.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System.Globalization {
-
- [System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
- [StructLayout (LayoutKind.Sequential)]
- public class SortKey {
- private string str;
- private CompareOptions options;
- private byte[] key;
- private int lcid;
-
- /* Hide the .ctor() */
- SortKey () {}
-
- internal SortKey (int lcid, string source, CompareOptions options)
- {
- this.lcid = lcid;
- str = source;
- this.options = options;
- }
-
- public virtual byte[] KeyData
- {
- get {
- return key;
- }
- }
-
- public virtual string OriginalString
- {
- get {
- return str;
- }
- }
-
- public static int Compare (SortKey sortkey1, SortKey sortkey2)
- {
- if (sortkey1 == null) {
- throw new ArgumentNullException ("sortkey1");
- }
- if (sortkey2 == null) {
- throw new ArgumentNullException ("sortkey2");
- }
-
- byte[] keydata1 = sortkey1.key;
- byte[] keydata2 = sortkey2.key;
-
- if (keydata1.Length == 0) {
- if (keydata2.Length == 0) {
- return 0;
- }
- return -1;
- }
-
- int min_len = (keydata1.Length < keydata2.Length) ? keydata1.Length : keydata2.Length;
-
- for (int i = 0; i < min_len; i++) {
- if (keydata1[i] > keydata2[i]) {
- return 1;
- } else if (keydata1[i] < keydata2[i]) {
- return -1;
- }
- }
-
- if (keydata1.Length < keydata2.Length) {
- return -1;
- } else if (keydata1.Length > keydata2.Length) {
- return 1;
- } else {
- return 0;
- }
- }
-
- public override bool Equals (object value)
- {
- SortKey other = (value as SortKey);
- if (other != null) {
- if ((this.lcid == other.lcid) &&
- (this.options == other.options) &&
- (Compare (this, other) == 0)) {
- return true;
- }
- }
-
- return false;
- }
-
- public override int GetHashCode ()
- {
- return str.GetHashCode ();
- }
-
- public override string ToString ()
- {
- return ("SortKey - " + lcid + ", " + options + ", " + str);
- }
- }
-}
+++ /dev/null
-//
-// SortVersion.cs
-//
-// Authors:
-// Marek Safar <marek.safar@gmail.com>
-//
-// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.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.Generic;
-
-namespace System.Globalization
-{
- [Serializable]
- public sealed class SortVersion : IEquatable<SortVersion>
- {
- public SortVersion (int fullVersion, Guid sortId)
- {
- FullVersion = fullVersion;
- SortId = sortId;
- }
-
- public Guid SortId { get; private set; }
-
- public int FullVersion { get; private set; }
-
- public override bool Equals (object obj)
- {
- return Equals (obj as SortVersion);
- }
-
- public override int GetHashCode ()
- {
- return FullVersion.GetHashCode ();
- }
-
- public bool Equals (SortVersion other)
- {
- if (other == null)
- return false;
-
- return FullVersion == other.FullVersion && SortId == other.SortId;
- }
-
- public static bool operator == (SortVersion left, SortVersion right)
- {
- if (left != null)
- return left.Equals (right);
-
- return right == null || right.Equals (left);
- }
-
- public static bool operator != (SortVersion left, SortVersion right)
- {
- return !(left == right);
- }
- }
-}
-
+++ /dev/null
-//
-// System.Globalization.StringInfo.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-// (C) 2004 Novell, Inc.
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System.Globalization {
-
- [Serializable]
- [ComVisible(true)]
- public class StringInfo {
-
- public StringInfo () : this (string.Empty)
- {
- }
-
- string s;
- int length;
-
- public StringInfo (string value)
- {
- // Argument check in property
- String = value;
- }
-
- [ComVisible (false)]
- public override bool Equals (object value)
- {
- StringInfo other = value as StringInfo;
- return other != null && s == other.s;
- }
-
- [ComVisible (false)]
- public override int GetHashCode ()
- {
- return s.GetHashCode ();
- }
-
- public int LengthInTextElements {
- get {
- if (length < 0) {
- length = 0;
- for (int idx = 0; idx < s.Length; length++)
- idx += GetNextTextElementLength (s, idx);
- }
- return length;
- }
- }
-
- public string String {
- get { return s; }
- set {
- if (value == null)
- throw new ArgumentNullException ("value");
- length = -1;
- s = value;
- }
- }
-
- public string SubstringByTextElements (int startingTextElement)
- {
- if (startingTextElement < 0 || s.Length == 0)
- throw new ArgumentOutOfRangeException ("startingTextElement");
- int idx = 0;
- for (int i = 0; i < startingTextElement; i++) {
- if (idx >= s.Length)
- throw new ArgumentOutOfRangeException ("startingTextElement");
- idx += GetNextTextElementLength (s, idx);
- }
- return s.Substring (idx);
- }
-
- public string SubstringByTextElements (int startingTextElement, int lengthInTextElements)
- {
- if (startingTextElement < 0 || s.Length == 0)
- throw new ArgumentOutOfRangeException ("startingTextElement");
- if (lengthInTextElements < 0)
- throw new ArgumentOutOfRangeException ("lengthInTextElements");
- int idx = 0;
- for (int i = 0; i < startingTextElement; i++) {
- if (idx >= s.Length)
- throw new ArgumentOutOfRangeException ("startingTextElement");
- idx += GetNextTextElementLength (s, idx);
- }
- int start = idx;
- for (int i = 0; i < lengthInTextElements; i++) {
- if (idx >= s.Length)
- throw new ArgumentOutOfRangeException ("lengthInTextElements");
- idx += GetNextTextElementLength (s, idx);
- }
- return s.Substring (start, idx - start);
- }
-
- public static string GetNextTextElement(string str)
- {
- if(str == null || str.Length == 0) {
- throw new ArgumentNullException("string is null");
- }
- return(GetNextTextElement (str, 0));
- }
-
- public static string GetNextTextElement(string str, int index)
- {
- int len = GetNextTextElementLength (str, index);
- return len != 1 ? str.Substring (index, len) : new string (str [index], 1);
- }
-
- static int GetNextTextElementLength(string str, int index)
- {
- if(str == null) {
- throw new ArgumentNullException("string is null");
- }
-
- if(index >= str.Length)
- return 0;
- if(index < 0)
- throw new ArgumentOutOfRangeException ("Index is not valid");
-
- /* Find the next base character, surrogate
- * pair or combining character sequence
- */
-
- char ch = str[index];
- UnicodeCategory cat = char.GetUnicodeCategory (ch);
-
- if (cat == UnicodeCategory.Surrogate) {
- /* Check that it's a high surrogate
- * followed by a low surrogate
- */
- if (ch >= 0xD800 && ch <= 0xDBFF) {
- if ((index + 1) < str.Length &&
- str[index + 1] >= 0xDC00 &&
- str[index + 1] <= 0xDFFF) {
- /* A valid surrogate pair */
- return 2;
- } else {
- /* High surrogate on its own */
- return 1;
- }
- } else {
- /* Low surrogate on its own */
- return 1;
- }
- } else {
- /* Look for a base character, which
- * may or may not be followed by a
- * series of combining characters
- */
-
- if (cat == UnicodeCategory.NonSpacingMark ||
- cat == UnicodeCategory.SpacingCombiningMark ||
- cat == UnicodeCategory.EnclosingMark) {
- /* Not a base character */
- return 1;
- }
-
- int count = 1;
-
- while (index + count < str.Length) {
- cat = char.GetUnicodeCategory (str[index + count]);
- if (cat != UnicodeCategory.NonSpacingMark &&
- cat != UnicodeCategory.SpacingCombiningMark &&
- cat != UnicodeCategory.EnclosingMark) {
- /* Finished the sequence */
- break;
- }
- count++;
- }
-
- return count;
- }
- }
-
- public static TextElementEnumerator GetTextElementEnumerator(string str)
- {
- if(str == null || str.Length == 0) {
- throw new ArgumentNullException("string is null");
- }
- return(new TextElementEnumerator (str, 0));
- }
-
- public static TextElementEnumerator GetTextElementEnumerator(string str, int index)
- {
- if(str == null) {
- throw new ArgumentNullException("string is null");
- }
-
- if(index < 0 || index >= str.Length) {
- throw new ArgumentOutOfRangeException ("Index is not valid");
- }
-
- return(new TextElementEnumerator (str, index));
- }
-
- public static int[] ParseCombiningCharacters(string str)
- {
- if(str == null) {
- throw new ArgumentNullException("string is null");
- }
-
- ArrayList indices = new ArrayList (str.Length);
- TextElementEnumerator tee = GetTextElementEnumerator (str);
-
- tee.Reset ();
- while(tee.MoveNext ()) {
- indices.Add (tee.ElementIndex);
- }
-
- return((int[])indices.ToArray (typeof (int)));
- }
- }
-}
+++ /dev/null
-//
-// System.Globalization.TextElementEnumerator.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-// (C) 2004 Novell, Inc.
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Globalization {
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible (true)]
- public class TextElementEnumerator: IEnumerator {
- private int index;
- private int elementindex;
- private int startpos;
- private string str;
- private string element;
-
- /* Hide the .ctor() */
- internal TextElementEnumerator(string str, int startpos) {
- this.index = -1;
- this.startpos = startpos;
- this.str = str.Substring (startpos);
- this.element = null;
- }
-
- public object Current
- {
- get {
- if (element == null) {
- throw new InvalidOperationException ();
- }
-
- return(element);
- }
- }
-
- public int ElementIndex
- {
- get {
- if (element == null) {
- throw new InvalidOperationException ();
- }
-
- return(elementindex + startpos);
- }
- }
-
- public string GetTextElement()
- {
- if (element == null) {
- throw new InvalidOperationException ();
- }
-
- return(element);
- }
-
- public bool MoveNext()
- {
- elementindex = index + 1;
-
- if (elementindex < str.Length) {
- element = StringInfo.GetNextTextElement (str, elementindex);
- index += element.Length;
-
- return(true);
- } else {
- element = null;
-
- return(false);
- }
- }
-
- public void Reset()
- {
- element = null;
- index = -1;
- }
- }
-}
+++ /dev/null
-//
-// System.Globalization.TextInfo.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Atsushi Enomoto (atsushi@ximian.com)
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2002 Ximian, Inc.
-// (C) 2005 Novell, Inc.
-//
-// TODO:
-// Missing the various code page mappings.
-// Missing the OnDeserialization implementation.
-//
-// 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.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Diagnostics.Contracts;
-
-namespace System.Globalization {
-
- [Serializable]
- [ComVisible (true)]
- [MonoTODO ("IDeserializationCallback isn't implemented.")]
- public class TextInfo: IDeserializationCallback, ICloneable
- {
- static TextInfo ()
- {
- unsafe {
- GetDataTablePointersLite (out to_lower_data_low, out to_lower_data_high, out to_upper_data_low, out to_upper_data_high);
- }
- }
-
- private readonly unsafe static ushort *to_lower_data_low;
- private readonly unsafe static ushort *to_lower_data_high;
- private readonly unsafe static ushort *to_upper_data_low;
- private readonly unsafe static ushort *to_upper_data_high;
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- private unsafe static extern void GetDataTablePointersLite (out ushort *to_lower_data_low, out ushort *to_lower_data_high,
- out ushort *to_upper_data_low, out ushort *to_upper_data_high);
-
- static char ToLowerInvariant (char c)
- {
- unsafe {
- if (c <= ((char)0x24cf))
- return (char) to_lower_data_low [c];
- if (c >= ((char)0xff21))
- return (char) to_lower_data_high[c - 0xff21];
- }
- return c;
- }
-
- static char ToUpperInvariant (char c)
- {
- unsafe {
- if (c <= ((char)0x24e9))
- return (char) to_upper_data_low [c];
- if (c >= ((char)0xff21))
- return (char) to_upper_data_high [c - 0xff21];
- }
- return c;
- }
-
- [StructLayout (LayoutKind.Sequential)]
- struct Data {
- public int ansi;
- public int ebcdic;
- public int mac;
- public int oem;
- public bool right_to_left;
- public byte list_sep;
- }
-
- string m_listSeparator;
- bool m_isReadOnly;
- string customCultureName;
-
-#pragma warning disable 169
- [NonSerialized]
- int m_nDataItem;
- bool m_useUserOverride;
-#pragma warning restore 169
-
- int m_win32LangID;
-
- [NonSerialized]
- readonly CultureInfo ci;
-
- [NonSerialized]
- readonly bool handleDotI;
-
- [NonSerialized]
- readonly Data data;
-
- internal unsafe TextInfo (CultureInfo ci, int lcid, void* data, bool read_only)
- {
- this.m_isReadOnly = read_only;
- this.m_win32LangID = lcid;
- this.ci = ci;
- if (data != null)
- this.data = *(Data*) data;
- else {
- this.data = new Data ();
- this.data.list_sep = (byte) ',';
- }
-
- CultureInfo tmp = ci;
- while (tmp.Parent != null && tmp.Parent.LCID != 0x7F && tmp.Parent != tmp)
- tmp = tmp.Parent;
-
- if (tmp != null) {
- switch (tmp.LCID) {
- case 44: // Azeri (az)
- case 31: // Turkish (tr)
- handleDotI = true;
- break;
- }
- }
- }
-
- private TextInfo (TextInfo textInfo)
- {
- m_win32LangID = textInfo.m_win32LangID;
- m_nDataItem = textInfo.m_nDataItem;
- m_useUserOverride = textInfo.m_useUserOverride;
- m_listSeparator = textInfo.ListSeparator;
- customCultureName = textInfo.CultureName;
- ci = textInfo.ci;
- handleDotI = textInfo.handleDotI;
- data = textInfo.data;
- }
-
- public virtual int ANSICodePage
- {
- get {
- return data.ansi;
- }
- }
-
- public virtual int EBCDICCodePage
- {
- get {
- return data.ebcdic;
- }
- }
-
- [ComVisible (false)]
- public int LCID {
- get { return m_win32LangID; }
- }
-
- public virtual string ListSeparator {
- get {
- if (m_listSeparator == null)
- m_listSeparator = ((char) data.list_sep).ToString ();
- return m_listSeparator;
- }
- [ComVisible (false)]
- set { m_listSeparator = value; }
- }
-
- public virtual int MacCodePage
- {
- get {
- return data.mac;
- }
- }
-
- public virtual int OEMCodePage
- {
- get {
- return data.oem;
- }
- }
-
- [ComVisible (false)]
- public string CultureName {
- get {
- if (customCultureName == null)
- customCultureName = ci == null ? String.Empty : ci.Name;
- return customCultureName;
- }
- }
-
- [ComVisible (false)]
- public bool IsReadOnly {
- get { return m_isReadOnly; }
- }
-
- [ComVisible (false)]
- public bool IsRightToLeft {
- get {
- return data.right_to_left;
- }
- }
-
- public override bool Equals (object obj)
- {
- if (obj == null)
- return false;
- TextInfo other = obj as TextInfo;
- if (other == null)
- return false;
- if (other.m_win32LangID != m_win32LangID)
- return false;
- if (other.ci != ci)
- return false;
- return true;
- }
-
- public override int GetHashCode()
- {
- return (m_win32LangID);
- }
-
- public override string ToString()
- {
- return "TextInfo - " + m_win32LangID;
- }
-
- public string ToTitleCase (string str)
- {
- if(str == null)
- throw new ArgumentNullException ("str");
-
- StringBuilder sb = null;
- int i = 0;
- int start = 0;
- while (i < str.Length) {
- if (!Char.IsLetter (str [i++]))
- continue;
- i--;
- char t = ToTitleCase (str [i]);
- bool capitalize = true;
- if (t == str [i]) {
- capitalize = false;
- bool allTitle = true;
- // if the word is all titlecase,
- // then don't capitalize it.
- int saved = i;
- while (++i < str.Length) {
- var ch = str [i];
- var category = char.GetUnicodeCategory (ch);
- if (IsSeparator (category))
- break;
- t = ToTitleCase (ch);
- if (t != ch) {
- allTitle = false;
- break;
- }
- }
- if (allTitle)
- continue;
- i = saved;
-
- // still check if all remaining
- // characters are lowercase,
- // where we don't have to modify
- // the source word.
- while (++i < str.Length) {
- var ch = str [i];
- var category = char.GetUnicodeCategory (ch);
- if (IsSeparator (category))
- break;
- if (ToLower (ch) != ch) {
- capitalize = true;
- i = saved;
- break;
- }
- }
- }
-
- if (capitalize) {
- if (sb == null)
- sb = new StringBuilder (str.Length);
- sb.Append (str, start, i - start);
- sb.Append (ToTitleCase (str [i]));
- start = i + 1;
- while (++i < str.Length) {
- var ch = str [i];
- var category = char.GetUnicodeCategory (ch);
- if (IsSeparator (category))
- break;
- sb.Append (ToLower (ch));
- }
- start = i;
- }
- }
- if (sb != null)
- sb.Append (str, start, str.Length - start);
-
- return sb != null ? sb.ToString () : str;
- }
-
- static bool IsSeparator (UnicodeCategory category)
- {
- switch (category) {
- case UnicodeCategory.SpaceSeparator:
- case UnicodeCategory.LineSeparator:
- case UnicodeCategory.ParagraphSeparator:
- case UnicodeCategory.Control:
- case UnicodeCategory.Format:
- case UnicodeCategory.ConnectorPunctuation:
- case UnicodeCategory.DashPunctuation:
- case UnicodeCategory.OpenPunctuation:
- case UnicodeCategory.ClosePunctuation:
- case UnicodeCategory.InitialQuotePunctuation:
- case UnicodeCategory.FinalQuotePunctuation:
- case UnicodeCategory.OtherPunctuation:
- return true;
- }
-
- return false;
- }
-
- // Only Azeri and Turkish have their own special cases.
- // Other than them, all languages have common special case
- // (enumerable enough).
- public virtual char ToLower (char c)
- {
- // quick ASCII range check
- if (c < 0x40 || 0x60 < c && c < 128)
- return c;
- else if ('A' <= c && c <= 'Z' && (!handleDotI || c != 'I'))
- return (char) (c + 0x20);
-
- if (ci == null || ci.LCID == 0x7F)
- return ToLowerInvariant (c);
-
- switch (c) {
- case '\u0049': // Latin uppercase I
- if (handleDotI)
- return '\u0131'; // I becomes dotless i
- break;
- case '\u0130': // I-dotted
- return '\u0069'; // i
-
- case '\u01c5': // LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
- return '\u01c6';
- // \u01c7 -> \u01c9 (LJ) : invariant
- case '\u01c8': // LATIN CAPITAL LETTER L WITH SMALL LETTER J
- return '\u01c9';
- // \u01ca -> \u01cc (NJ) : invariant
- case '\u01cb': // LATIN CAPITAL LETTER N WITH SMALL LETTER J
- return '\u01cc';
- // WITH CARON : invariant
- // WITH DIAERESIS AND * : invariant
-
- case '\u01f2': // LATIN CAPITAL LETTER D WITH SMALL LETTER Z
- return '\u01f3';
- case '\u03d2': // ? it is not in ICU
- return '\u03c5';
- case '\u03d3': // ? it is not in ICU
- return '\u03cd';
- case '\u03d4': // ? it is not in ICU
- return '\u03cb';
- }
- return ToLowerInvariant (c);
- }
-
- public virtual char ToUpper (char c)
- {
- // quick ASCII range check
- if (c < 0x60)
- return c;
- else if ('a' <= c && c <= 'z' && (!handleDotI || c != 'i'))
- return (char) (c - 0x20);
-
- if (ci == null || ci.LCID == 0x7F)
- return ToUpperInvariant (c);
-
- switch (c) {
- case '\u0069': // Latin lowercase i
- if (handleDotI)
- return '\u0130'; // dotted capital I
- break;
- case '\u0131': // dotless i
- return '\u0049'; // I
-
- case '\u01c5': // see ToLower()
- return '\u01c4';
- case '\u01c8': // see ToLower()
- return '\u01c7';
- case '\u01cb': // see ToLower()
- return '\u01ca';
- case '\u01f2': // see ToLower()
- return '\u01f1';
- case '\u0390': // GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
- return '\u03aa'; // it is not in ICU
- case '\u03b0': // GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
- return '\u03ab'; // it is not in ICU
- case '\u03d0': // GREEK BETA
- return '\u0392';
- case '\u03d1': // GREEK THETA
- return '\u0398';
- case '\u03d5': // GREEK PHI
- return '\u03a6';
- case '\u03d6': // GREEK PI
- return '\u03a0';
- case '\u03f0': // GREEK KAPPA
- return '\u039a';
- case '\u03f1': // GREEK RHO
- return '\u03a1';
- // am not sure why miscellaneous GREEK symbols are
- // not handled here.
- }
-
- return ToUpperInvariant (c);
- }
-
- private char ToTitleCase (char c)
- {
- // Handle some Latin characters.
- switch (c) {
- case '\u01c4':
- case '\u01c5':
- case '\u01c6':
- return '\u01c5';
- case '\u01c7':
- case '\u01c8':
- case '\u01c9':
- return '\u01c8';
- case '\u01ca':
- case '\u01cb':
- case '\u01cc':
- return '\u01cb';
- case '\u01f1':
- case '\u01f2':
- case '\u01f3':
- return '\u01f2';
- }
- if ('\u2170' <= c && c <= '\u217f' || // Roman numbers
- '\u24d0' <= c && c <= '\u24e9')
- return c;
- return ToUpper (c);
- }
-
- public unsafe virtual string ToLower (string str)
- {
- // In ICU (3.2) there are a few cases that one single
- // character results in multiple characters in e.g.
- // tr-TR culture. So I tried brute force conversion
- // test with single character as a string input, but
- // there was no such conversion. So I think it just
- // invokes ToLower(char).
- if (str == null)
- throw new ArgumentNullException ("str");
-
- if (str.Length == 0)
- return String.Empty;
-
- string tmp = String.FastAllocateString (str.Length);
- fixed (char* source = str, dest = tmp) {
-
- char* destPtr = (char*)dest;
- char* sourcePtr = (char*)source;
-
- for (int n = 0; n < str.Length; n++) {
- *destPtr = ToLower (*sourcePtr);
- sourcePtr++;
- destPtr++;
- }
- }
- return tmp;
- }
-
- public unsafe virtual string ToUpper (string str)
- {
- // In ICU (3.2) there is a case that string
- // is handled beyond per-character conversion, but
- // it is only lt-LT culture where MS.NET does not
- // handle any special transliteration. So I keep
- // ToUpper() just as character conversion.
- if (str == null)
- throw new ArgumentNullException ("str");
-
- if (str.Length == 0)
- return String.Empty;
-
- string tmp = String.FastAllocateString (str.Length);
- fixed (char* source = str, dest = tmp) {
-
- char* destPtr = (char*)dest;
- char* sourcePtr = (char*)source;
-
- for (int n = 0; n < str.Length; n++) {
- *destPtr = ToUpper (*sourcePtr);
- sourcePtr++;
- destPtr++;
- }
- }
- return tmp;
- }
-
- [ComVisible (false)]
- public static TextInfo ReadOnly (TextInfo textInfo)
- {
- if (textInfo == null)
- throw new ArgumentNullException ("textInfo");
-
- TextInfo ti = new TextInfo (textInfo);
- ti.m_isReadOnly = true;
- return ti;
- }
-
- /* IDeserialization interface */
- [MonoTODO]
- void IDeserializationCallback.OnDeserialization(object sender)
- {
- // FIXME: we need to re-create "data" in order to get most properties working
- }
-
- /* IClonable */
- [ComVisible (false)]
- public virtual object Clone ()
- {
- return new TextInfo (this);
- }
-
- internal int GetCaseInsensitiveHashCode (string str)
- {
- return StringComparer.CurrentCultureIgnoreCase.GetHashCode (str);
- }
-
- internal static unsafe int GetHashCodeOrdinalIgnoreCase (string s)
- {
- var length = s.Length;
- fixed (char * c = s) {
- char * cc = c;
- char * end = cc + length - 1;
- int h = 0;
- for (;cc < end; cc += 2) {
- h = (h << 5) - h + Char.ToUpperInvariant (*cc);
- h = (h << 5) - h + Char.ToUpperInvariant (cc [1]);
- }
- ++end;
- if (cc < end)
- h = (h << 5) - h + Char.ToUpperInvariant (*cc);
- return h;
- }
- }
-
- internal static unsafe int CompareOrdinalIgnoreCase(String str1, String str2)
- {
- return CompareOrdinalIgnoreCaseEx (str1, 0, str2, 0, str1.Length, str2.Length);
- }
-
- internal static int CompareOrdinalIgnoreCaseEx (String strA, int indexA, String strB, int indexB, int lenA, int lenB)
- {
- return CompareOrdinalCaseInsensitiveUnchecked (strA, indexA, lenA, strB, indexB, lenB);
- }
-
- static unsafe int CompareOrdinalCaseInsensitiveUnchecked (String strA, int indexA, int lenA, String strB, int indexB, int lenB)
- {
- if (strA == null) {
- return strB == null ? 0 : -1;
- }
- if (strB == null) {
- return 1;
- }
- int lengthA = Math.Min (lenA, strA.Length - indexA);
- int lengthB = Math.Min (lenB, strB.Length - indexB);
-
- if (lengthA == lengthB && Object.ReferenceEquals (strA, strB))
- return 0;
-
- fixed (char* aptr = strA, bptr = strB) {
- char* ap = aptr + indexA;
- char* end = ap + Math.Min (lengthA, lengthB);
- char* bp = bptr + indexB;
- while (ap < end) {
- if (*ap != *bp) {
- char c1 = Char.ToUpperInvariant (*ap);
- char c2 = Char.ToUpperInvariant (*bp);
- if (c1 != c2)
- return c1 - c2;
- }
- ap++;
- bp++;
- }
- return lengthA - lengthB;
- }
- }
-
- internal static unsafe int LastIndexOfStringOrdinalIgnoreCase(String source, String value, int startIndex, int count)
- {
- int valueLen = value.Length;
- if (count < valueLen)
- return -1;
-
- if (valueLen == 0)
- return startIndex;
-
- fixed (char* thisptr = source, valueptr = value) {
- char* ap = thisptr + startIndex - valueLen + 1;
- char* thisEnd = ap - count + valueLen - 1;
- while (ap != thisEnd) {
- for (int i = 0; i < valueLen; i++) {
- if (Char.ToUpperInvariant (ap[i]) != Char.ToUpperInvariant (valueptr[i]))
- goto NextVal;
- }
- return (int)(ap - thisptr);
- NextVal:
- ap--;
- }
- }
- return -1;
- }
-
- internal static int IndexOfStringOrdinalIgnoreCase(String source, String value, int startIndex, int count)
- {
- Contract.Assert(source != null, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated source != null");
- Contract.Assert(value != null, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated value != null");
- Contract.Assert(startIndex + count <= source.Length, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex + count <= source.Length");
-
- // We return 0 if both inputs are empty strings
- if (source.Length == 0 && value.Length == 0)
- {
- return 0;
- }
-
- // the search space within [source] starts at offset [startIndex] inclusive and includes
- // [count] characters (thus the last included character is at index [startIndex + count -1]
- // [end] is the index of the next character after the search space
- // (it points past the end of the search space)
- int end = startIndex + count;
-
- // maxStartIndex is the index beyond which we never *start* searching, inclusive; in other words;
- // a search could include characters beyond maxStartIndex, but we'd never begin a search at an
- // index strictly greater than maxStartIndex.
- int maxStartIndex = end - value.Length;
-
- for (; startIndex <= maxStartIndex; startIndex++)
- {
- // We should always have the same or more characters left to search than our actual pattern
- Contract.Assert(end - startIndex >= value.Length);
- // since this is an ordinal comparison, we can assume that the lengths must match
- if (CompareOrdinalIgnoreCaseEx(source, startIndex, value, 0, value.Length, value.Length) == 0)
- {
- return startIndex;
- }
- }
-
- // Not found
- return -1;
- }
- }
-}
+++ /dev/null
-//
-// System.Globalization.UnicodeCategory.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.
-//
-
-
-namespace System.Globalization {
-
- [System.Runtime.InteropServices.ComVisible(true)]
- [System.Serializable]
- public enum UnicodeCategory {
- UppercaseLetter = 0,
- LowercaseLetter = 1,
- TitlecaseLetter = 2,
- ModifierLetter = 3,
- OtherLetter = 4,
- NonSpacingMark = 5,
- SpacingCombiningMark = 6,
- EnclosingMark = 7,
- DecimalDigitNumber = 8,
- LetterNumber = 9,
- OtherNumber = 10,
- SpaceSeparator = 11,
- LineSeparator = 12,
- ParagraphSeparator = 13,
- Control = 14,
- Format = 15,
- Surrogate = 16,
- PrivateUse = 17,
- ConnectorPunctuation = 18,
- DashPunctuation = 19,
- OpenPunctuation = 20,
- ClosePunctuation = 21,
- InitialQuotePunctuation = 22,
- FinalQuotePunctuation = 23,
- OtherPunctuation = 24,
- MathSymbol = 25,
- CurrencySymbol = 26,
- ModifierSymbol = 27,
- OtherSymbol = 28,
- OtherNotAssigned = 29,
- }
-}
+++ /dev/null
-//
-// System.IO.DirectoryNotFoundException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.IO {
-
- [Serializable]
- [ComVisible (true)]
- public class DirectoryNotFoundException : IOException {
-
- // Constructors
- public DirectoryNotFoundException ()
- : base ("Directory not found")
- {
- }
-
- public DirectoryNotFoundException (string message)
- : base (message)
- {
- }
-
- public DirectoryNotFoundException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- protected DirectoryNotFoundException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.IO.DriveNotFoundException.cs
-//
-// Author:
-// Kornél Pál <http://www.kornelpal.hu/>
-//
-// Copyright (C) 2006 Kornél Pál
-//
-
-//
-// 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.Runtime.InteropServices;
-using System.Runtime.Serialization;
-
-namespace System.IO
-{
- [Serializable]
- [ComVisible (true)]
- public class DriveNotFoundException : IOException
- {
- private const int ErrorCode = unchecked((int)0x80070003);
-
- // Constructors
- public DriveNotFoundException ()
- : base ("Attempted to access a drive that is not available.")
- {
- this.HResult = ErrorCode;
- }
-
- public DriveNotFoundException (string message)
- : base (message)
- {
- this.HResult = ErrorCode;
- }
-
- public DriveNotFoundException (string message, Exception innerException)
- : base (message, innerException)
- {
- this.HResult = ErrorCode;
- }
-
- protected DriveNotFoundException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.IO.EndOfStreamException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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;
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.IO
-{
- [Serializable]
- [ComVisible (true)]
- public class EndOfStreamException : IOException
- {
- // Constructors
- public EndOfStreamException ()
- : base (Locale.GetText ("Failed to read past end of stream."))
- {
- }
-
- public EndOfStreamException (string message)
- : base (message)
- {
- }
-
- protected EndOfStreamException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public EndOfStreamException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
+++ /dev/null
-//
-// System.IO.FileLoadException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.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.Globalization;
-using System.Runtime.Serialization;
-using System.Security;
-using System.Security.Permissions;
-using System.Text;
-using System.Runtime.InteropServices;
-
-namespace System.IO {
-
- [Serializable]
- [ComVisible (true)]
- public class FileLoadException : IOException {
-
- // Fields
- const int Result = unchecked ((int)0x80070002);
- string msg;
- string fileName;
- string fusionLog;
-
- // Constructors
- public FileLoadException ()
- : base (Locale.GetText ("I/O Error"))
- {
- HResult = Result;
- msg = Locale.GetText ("I/O Error");
- }
-
- public FileLoadException (string message)
- : base (message)
- {
- HResult = Result;
- msg = message;
- }
-
- public FileLoadException (string message, string fileName)
- : base (message)
- {
- HResult = Result;
- this.msg = message;
- this.fileName = fileName;
- }
-
- public FileLoadException (string message, Exception inner)
- : base (message, inner)
- {
- HResult = Result;
- msg = message;
- }
-
- public FileLoadException (string message, string fileName, Exception inner)
- : base (message, inner)
- {
- HResult = Result;
- this.msg = message;
- this.fileName = fileName;
- }
-
- protected FileLoadException (SerializationInfo info, StreamingContext context)
- {
- fileName = info.GetString ("FileLoad_FileName");
- fusionLog = info.GetString ("FileLoad_FusionLog");
- }
-
- // Properties
- public override string Message {
- get { return msg; }
- }
-
- public string FileName
- {
- get { return fileName; }
- }
-
- public string FusionLog {
- // note: MS runtime throws a SecurityException when the Exception is created
- // but a FileLoadException once the exception as been thrown. Mono always
- // throw a SecurityException in both case (anyway fusionLog is currently empty)
- [SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
- get { return fusionLog; }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("FileLoad_FileName", fileName);
- info.AddValue ("FileLoad_FusionLog", fusionLog);
- }
-
- public override string ToString ()
- {
- StringBuilder sb = new StringBuilder (GetType ().FullName);
- sb.AppendFormat (": {0}", msg);
-
- if (fileName != null)
- sb.AppendFormat (" : {0}", fileName);
-
- if (this.InnerException != null)
- sb.AppendFormat (" ----> {0}", InnerException);
-
- if (this.StackTrace != null) {
- sb.Append (Environment.NewLine);
- sb.Append (StackTrace);
- }
-
- return sb.ToString ();
- }
- }
-}
+++ /dev/null
-//
-// System.IO.FileNotFoundException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.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.Globalization;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Text;
-using System.Runtime.InteropServices;
-
-namespace System.IO {
-
- [Serializable]
- [ComVisible (true)]
- public class FileNotFoundException : IOException {
-
- const int Result = unchecked ((int)0x80131621);
-
- private string fileName;
- private string fusionLog;
-
- // Constructors
- public FileNotFoundException ()
- : base (Locale.GetText ("Unable to find the specified file."))
- {
- HResult = Result;
- }
-
- public FileNotFoundException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public FileNotFoundException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- public FileNotFoundException (string message, string fileName)
- : base (message)
- {
- HResult = Result;
- this.fileName = fileName;
- }
-
- public FileNotFoundException (string message, string fileName, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- this.fileName = fileName;
- }
-
- protected FileNotFoundException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- fileName = info.GetString ("FileNotFound_FileName");
- fusionLog = info.GetString ("FileNotFound_FusionLog");
- }
-
- public string FileName
- {
- get { return fileName; }
- }
-
- public string FusionLog {
- // note: MS runtime throws a SecurityException when the Exception is created
- // but a FileLoadException once the exception as been thrown. Mono always
- // throw a SecurityException in both case (anyway fusionLog is currently empty)
- [SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
- get { return fusionLog; }
- }
-
- public override string Message {
- get {
- if (base.message == null) {
- if (fileName != null) {
- string message = string.Format (
- "Could not load file or assembly '{0}' or one of"
- + " its dependencies. The system cannot find the"
- + " file specified.", fileName);
- return message;
- }
- }
- return base.message;
- }
- }
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("FileNotFound_FileName", fileName);
- info.AddValue ("FileNotFound_FusionLog", fusionLog);
- }
-
- public override string ToString ()
- {
- StringBuilder sb = new StringBuilder (GetType ().FullName);
- sb.AppendFormat (": {0}", Message);
-
- if (fileName != null && fileName.Length > 0) {
- sb.Append (Environment.NewLine);
- sb.AppendFormat ("File name: '{0}'", fileName);
- }
-
- if (this.InnerException != null)
- sb.AppendFormat (" ---> {0}", InnerException);
-
- if (this.StackTrace != null) {
- sb.Append (Environment.NewLine);
- sb.Append (StackTrace);
- }
-
- return sb.ToString ();
- }
- }
-}
if (count > 0) {
// Use the fastest method, all range checks has been done
- Buffer.BlockCopyInternal (buf, buf_offset, dest, dest_offset, count);
+ Buffer.InternalBlockCopy (buf, buf_offset, dest, dest_offset, count);
buf_offset += count;
}
+++ /dev/null
-//
-// System.IO.IOException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.IO {
- [Serializable]
- [ComVisible (true)]
- public class IOException : SystemException {
-
- // Constructors
- public IOException ()
- : base ("I/O Error")
- {
- }
-
- public IOException (string message)
- : base (message)
- {
- }
-
- public IOException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- protected IOException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public IOException (string message, int hresult)
- : base (message)
- {
- this.HResult = hresult;
- }
- }
-}
+++ /dev/null
-//
-// System.IO.PathTooLongException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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;
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.IO
-{
- [Serializable]
- [ComVisible (true)]
- public class PathTooLongException : IOException
- {
- // Constructors
- public PathTooLongException ()
- : base (Locale.GetText ("Pathname is longer than the maximum length"))
- {
- }
-
- public PathTooLongException (string message)
- : base (message)
- {
- }
-
- protected PathTooLongException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public PathTooLongException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
+++ /dev/null
-//
-// System.Runtime.ConstrainedExecution.Consistency.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.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) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-
-namespace System.Runtime.ConstrainedExecution {
-
- [Serializable]
- public enum Cer {
- None,
- MayFail,
- Success
- }
-}
+++ /dev/null
-2008-04-02 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
-
- * ReliabilityContractAttribute.cs: Fix parameter names
-
-2005-10-28 Sebastien Pouliot <sebastien@ximian.com>
-
- * CriticialFinalizerObject.cs: Added [ReliabilityContract] to ctor.
- * ReliabilityContractAttribute.cs: Removed (obsoleted) default ctor.
-
-2005-05-24 Sebastien Pouliot <sebastien@ximian.com>
-
- * CriticialFinalizerObject.cs: Changed ComVisible to true.
- * ReliabilityContractAttribute.cs: Default constructor is obsolete.
- Properties don't have setters.
-
-2005-03-04 Kazuki Oikawa <kazuki@panicode.com>
-
- * PrePrepareMethodAttribute.cs:
- * ReliabilityContractAttribute.cs: Fixed attributes.
-
-2004-08-12 Sebastien Pouliot <sebastien@ximian.com>
-
- * CER.cs: Copied from System.Runtime.Reliability. Fixed attributes.
- * Consistency.cs: Copied from System.Runtime.Reliability. Fixed
- attributes.
- * PrePrepareMethodAttribute.cs: Copied from System.Runtime.Reliability.
- Fixed attributes.
- * CriticialFinalizerObject.cs: Added missing finalizer and attributes.
- * ReliabilityContractAttribute.cs: Copied from System.Runtime.
- Reliability. Fixed attributes.
-
-2004-08-03 Sebastien Pouliot <sebastien@ximian.com>
-
- * CriticalFinalizerObject.cs: Moved from System.Runtime.Reliability to
- match Fx 2.0 beta 1.
+++ /dev/null
-//
-// System.Runtime.ConstrainedExecution.Consistency.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.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) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-
-namespace System.Runtime.ConstrainedExecution {
-
- [Serializable]
- public enum Consistency {
- MayCorruptAppDomain = 1,
- MayCorruptInstance = 2,
- MayCorruptProcess = 0,
- WillNotCorruptState = 3
- }
-}
+++ /dev/null
-//
-// System.Runtime.ConstrainedExecution.CriticalFinalizerObject class
-//
-// Author:
-// Duncan Mak (duncan@ximian.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) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Runtime.ConstrainedExecution
-{
- [ComVisible (true)]
- public abstract class CriticalFinalizerObject
- {
- //
- // WARNING: If you add any fields here, update the definition
- // for the runtime structures as well
- //
-
- [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
- protected CriticalFinalizerObject ()
- {
- }
-
- [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
- ~CriticalFinalizerObject ()
- {
- }
- }
-}
+++ /dev/null
-//
-// System.Runtime.ConstrainedExecution.PrePrepareMethodAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.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) 2004 Novell, Inc (http://www.novell.com)
-//
-
-namespace System.Runtime.ConstrainedExecution
-{
- [AttributeUsage ((AttributeTargets.Constructor | AttributeTargets.Method), Inherited=false)]
- public sealed class PrePrepareMethodAttribute : Attribute
- {
- public PrePrepareMethodAttribute ()
- {
- }
- }
-}
+++ /dev/null
-//
-// System.Runtime.ConstrainedExecution.ReliabilityContractAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.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) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-
-namespace System.Runtime.ConstrainedExecution
-{
- [AttributeUsage ((AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Interface), Inherited=false)]
- public sealed class ReliabilityContractAttribute : Attribute
- {
- Consistency consistency;
- Cer cer;
-
- public ReliabilityContractAttribute (Consistency consistencyGuarantee, Cer cer)
- {
- this.consistency = consistencyGuarantee;
- this.cer = cer;
- }
-
- public Cer Cer {
- get { return cer; }
- }
-
- public Consistency ConsistencyGuarantee {
- get { return consistency; }
- }
- }
-}
+++ /dev/null
-
-//
-// Copyright (C) 2004 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.
-//
-
-// System.Runtime.InteropServices.ComTypes.BINDPTR.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Explicit, CharSet = CharSet.Unicode)]
- public struct BINDPTR {
- [FieldOffset (0)]
- public IntPtr lpfuncdesc;
- [FieldOffset (0)]
- public IntPtr lptcomp;
- [FieldOffset (0)]
- public IntPtr lpvardesc;
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.BIND_OPTS.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential)]
- public struct BIND_OPTS
- {
- public int cbStruct;
- public int grfFlags;
- public int grfMode;
- public int dwTickCountDeadline;
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.CALLCONV.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Serializable]
- public enum CALLCONV
- {
- CC_CDECL = 1,
- CC_PASCAL = 2,
- CC_MSCPASCAL = 2,
- CC_MACPASCAL = 3,
- CC_STDCALL = 4,
- CC_RESERVED = 5,
- CC_SYSCALL = 6,
- CC_MPWCDECL = 7,
- CC_MPWPASCAL = 8,
- CC_MAX = 9
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.CONNECTDATA.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct CONNECTDATA
- {
- [MarshalAs (UnmanagedType.Interface)]
- public object pUnk;
- public int dwCookie;
- }
-}
+++ /dev/null
-2008-04-02 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
-
- * IEnumVARIANT.cs: Fix parameter names
-
-2007-08-10 Atsushi Enomoto <atsushi@ximian.com>
-
- * ITypeInfo2.cs, ITypeLib2.cs : added missing 2.0 members.
- It is so strange that many of them overlap the base interfaces.
-
-2007-08-08 Atsushi Enomoto <atsushi@ximian.com>
-
- * IMoniker.cs ELEMDESC.cs VARDESC.cs IRunningObjectTable.cs :
- cosmetic 2.0 API fixes.
-
-2005-09-21 Kornél Pál <kornelpal@hotmail.com>
-
- * IEnumConnections.cs, IEnumMoniker.cs, IEnumString.cs, IStream.cs,
- ITypeInfo.cs, ITypeLib.cs:
- Removed UnmanagedType_80 that was required because mcs bug #75945
- was not discovered.
-
-2005-03-04 Kazuki Oikawa <kazuki@panicode.com>
-
- * IBindCtx.cs
- * IEnumConnectionPoints.cs
- * IEnumMoniker.cs
- * IEnumString.cs
- * IEnumVARIANT.cs
- * IMoniker.cs
- * IRunningObjectTable.cs: Added missing attributes and corrected the wrong declarations.
-
-2005-03-03 Kazuki Oikawa <kazuki@panicode.com>
-
- * IBindCtx.cs
- * IConnectionPoint.cs
- * IConnectionPointContainer.cs
- * IEnumConnectionPoints.cs
- * IEnumConnections.cs
- * IEnumMoniker.cs
- * IEnumString.cs
- * IEnumVARIANT.cs
- * IMoniker.cs
- * IPersistFile.cs
- * IRunningObjectTable.cs
- * IStream.cs
- * ITypeComp.cs
- * ITypeInfo.cs
- * ITypeInfo2.cs
- * ITypeLib.cs
- * ITypeLib2.cs
- * EXCEPINFO.cs
- * IDLDESC.cs
- * TYPELIBATTR.cs
- * VARDESC.cs
- * INVOKEKIND.cs
- * SYSKIND.cs: Added missing attributes and corrected wrong declaration.
-
-2005-02-26 Kazuki Oikawa <kazuki@panicode.com>
-
- * BINDPTR.cs
- * BIND_OPTS.cs
- * CALLCONV.cs
- * CONNECTDATA.cs
- * DESCKIND.cs
- * DISPPARAMS.cs
- * ELEMDESC.cs
- * EXCEPINFO.cs
- * FILETIME.cs
- * FUNCDESC.cs
- * FUNCFLAGS.cs
- * FUNCKIND.cs
- * IBindCtx.cs
- * IConnectionPoint.cs
- * IConnectionPointContainer.cs
- * IDLDESC.cs
- * IDLFLAG.cs
- * IEnumConnectionPoints.cs
- * IEnumConnections.cs
- * IEnumMoniker.cs
- * IEnumString.cs
- * IEnumVARIANT.cs
- * IMoniker.cs
- * IMPLTYPEFLAGS.cs
- * INVOKEKIND.cs
- * IPersistFile.cs
- * IRunningObjectTable.cs
- * IStream.cs
- * ITypeComp.cs
- * ITypeInfo.cs
- * ITypeInfo2.cs
- * ITypeLib.cs
- * ITypeLib2.cs
- * LIBFLAGS.cs
- * PARAMDESC.cs
- * PARAMFLAG.cs
- * STATSTG.cs
- * SYSKIND.cs
- * TYPEATTR.cs
- * TYPEDESC.cs
- * TYPEFLAGS.cs
- * TYPEKIND.cs
- * TYPELIBATTR.cs
- * VARDESC.cs
- * VARFLAGS.cs
- * VARKIND.cs: Added
\ No newline at end of file
+++ /dev/null
-
-//
-// Copyright (C) 2004 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.
-//
-
-// System.Runtime.InteropServices.ComTypes.DESCKIND.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-
- [Serializable]
- public enum DESCKIND {
- DESCKIND_NONE = 0,
- DESCKIND_FUNCDESC = 1,
- DESCKIND_VARDESC = 2,
- DESCKIND_TYPECOMP = 3,
- DESCKIND_IMPLICITAPPOBJ = 4,
- DESCKIND_MAX = 5
- }
-}
+++ /dev/null
-
-//
-// Copyright (C) 2004 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.
-//
-
-// System.Runtime.InteropServices.ComTypes.DISPPARAMS.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct DISPPARAMS {
- public IntPtr rgvarg;
- public IntPtr rgdispidNamedArgs;
- public int cArgs;
- public int cNamedArgs;
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.ELEMDESC.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct ELEMDESC
- {
- public TYPEDESC tdesc;
- public DESCUNION desc;
-
- [StructLayout (LayoutKind.Explicit, CharSet = CharSet.Unicode)]
- public struct DESCUNION
- {
- [FieldOffset (0)]
- public IDLDESC idldesc;
- [FieldOffset (0)]
- public PARAMDESC paramdesc;
- }
- }
-}
+++ /dev/null
-
-//
-// Copyright (C) 2004 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.
-//
-
-// System.Runtime.InteropServices.ComTypes.EXCEPINFO.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-#if !FULL_AOT_RUNTIME
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct EXCEPINFO {
- public short wCode;
- public short wReserved;
- [MarshalAs (UnmanagedType.BStr)]
- public string bstrSource;
- [MarshalAs (UnmanagedType.BStr)]
- public string bstrDescription;
- [MarshalAs (UnmanagedType.BStr)]
- public string bstrHelpFile;
- public int dwHelpContext;
- public IntPtr pvReserved;
- public IntPtr pfnDeferredFillIn;
- public int scode;
- }
-}
-#endif
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.FILETIME.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential)]
- public struct FILETIME
- {
- public int dwLowDateTime;
- public int dwHighDateTime;
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.FUNCDESC.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential)]
- public struct FUNCDESC
- {
- public int memid;
- public IntPtr lprgscode;
- public IntPtr lprgelemdescParam;
- public FUNCKIND funckind;
- public INVOKEKIND invkind;
- public CALLCONV callconv;
- public short cParams;
- public short cParamsOpt;
- public short oVft;
- public short cScodes;
- public ELEMDESC elemdescFunc;
- public short wFuncFlags;
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.FUNCFLAGS.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Flags, Serializable]
- public enum FUNCFLAGS
- {
- FUNCFLAG_FRESTRICTED = 1,
- FUNCFLAG_FSOURCE = 2,
- FUNCFLAG_FBINDABLE = 4,
- FUNCFLAG_FREQUESTEDIT = 8,
- FUNCFLAG_FDISPLAYBIND = 16,
- FUNCFLAG_FDEFAULTBIND = 32,
- FUNCFLAG_FHIDDEN = 64,
- FUNCFLAG_FUSESGETLASTERROR = 128,
- FUNCFLAG_FDEFAULTCOLLELEM = 256,
- FUNCFLAG_FUIDEFAULT = 512,
- FUNCFLAG_FNONBROWSABLE = 1024,
- FUNCFLAG_FREPLACEABLE = 2048,
- FUNCFLAG_FIMMEDIATEBIND = 4096
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.FUNCKIND.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Serializable]
- public enum FUNCKIND
- {
- FUNC_VIRTUAL = 0,
- FUNC_PUREVIRTUAL = 1,
- FUNC_NONVIRTUAL = 2,
- FUNC_STATIC = 3,
- FUNC_DISPATCH = 4
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IBindCtx.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("0000000e-0000-0000-c000-000000000046")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IBindCtx
- {
- void RegisterObjectBound ([MarshalAs(UnmanagedType.Interface)] object punk);
- void RevokeObjectBound ([MarshalAs(UnmanagedType.Interface)] object punk);
- void ReleaseBoundObjects ();
- void SetBindOptions ([In] ref BIND_OPTS pbindopts);
- void GetBindOptions (ref BIND_OPTS pbindopts);
- void GetRunningObjectTable (out IRunningObjectTable pprot);
- void RegisterObjectParam ([MarshalAs (UnmanagedType.LPWStr)] string pszKey, [MarshalAs (UnmanagedType.Interface)] object punk);
- void GetObjectParam ([MarshalAs (UnmanagedType.LPWStr)] string pszKey, [MarshalAs (UnmanagedType.Interface)] out object ppunk);
- void EnumObjectParam (out IEnumString ppenum);
- [PreserveSig]
- int RevokeObjectParam ([MarshalAs(UnmanagedType.LPWStr)] string pszKey);
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IConnectionPoint.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("b196b286-bab4-101a-b69c-00aa00341d07")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IConnectionPoint
- {
- void GetConnectionInterface (out Guid pIID);
- void GetConnectionPointContainer (out IConnectionPointContainer ppCPC);
- void Advise ([MarshalAs(UnmanagedType.Interface)] object pUnkSink, out int pdwCookie);
- void Unadvise (int dwCookie);
- void EnumConnections (out IEnumConnections ppEnum);
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IConnectionPointContainer.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("b196b284-bab4-101a-b69c-00aa00341d07")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IConnectionPointContainer
- {
- void EnumConnectionPoints (out IEnumConnectionPoints ppEnum);
- void FindConnectionPoint ([In] ref Guid riid, out IConnectionPoint ppCP);
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IDLDESC.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct IDLDESC
- {
- public IntPtr dwReserved;
- public IDLFLAG wIDLFlags;
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IDLFLAG.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Flags, Serializable]
- public enum IDLFLAG
- {
- IDLFLAG_NONE = 0,
- IDLFLAG_FIN = 1,
- IDLFLAG_FOUT = 2,
- IDLFLAG_FLCID = 4,
- IDLFLAG_FRETVAL = 8
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IEnumConnectionPoints.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("b196b285-bab4-101a-b69c-00aa00341d07")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IEnumConnectionPoints
- {
- [PreserveSigAttribute]
- int Next (int celt, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex = 0)] IConnectionPoint[] rgelt, IntPtr pceltFetched);
- [PreserveSigAttribute]
- int Skip (int celt);
- void Reset ();
- void Clone (out IEnumConnectionPoints ppenum);
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IEnumConnections.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("b196b287-bab4-101a-b69c-00aa00341d07")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IEnumConnections
- {
- [PreserveSigAttribute]
- int Next (int celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] CONNECTDATA[] rgelt, IntPtr pceltFetched);
- [PreserveSigAttribute]
- int Skip (int celt);
- void Reset ();
- void Clone (out IEnumConnections ppenum);
- }
-}
-
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IEnumMoniker.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("00000102-0000-0000-c000-000000000046")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IEnumMoniker
- {
- [PreserveSigAttribute]
- int Next (int celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IMoniker[] rgelt, IntPtr pceltFetched);
- [PreserveSigAttribute]
- int Skip (int celt);
- void Reset ();
- void Clone (out IEnumMoniker ppenum);
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IEnumString.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("00000101-0000-0000-c000-000000000046")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IEnumString
- {
- [PreserveSigAttribute]
- int Next (int celt, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex = 0)] string[] rgelt, IntPtr pceltFetched);
- [PreserveSigAttribute]
- int Skip (int celt);
- void Reset ();
- void Clone (out IEnumString ppenum);
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IEnumVARIANT.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("00020404-0000-0000-c000-000000000046")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IEnumVARIANT
- {
- [PreserveSigAttribute]
- int Next (int celt, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex=0)] object[] rgVar, IntPtr pceltFetched);
- [PreserveSigAttribute]
- int Skip (int celt);
- [PreserveSigAttribute]
- int Reset ();
- IEnumVARIANT Clone ();
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IMPLTYPEFLAGS.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Flags, Serializable]
- public enum IMPLTYPEFLAGS
- {
- IMPLTYPEFLAG_FDEFAULT = 1,
- IMPLTYPEFLAG_FSOURCE = 2,
- IMPLTYPEFLAG_FRESTRICTED = 4,
- IMPLTYPEFLAG_FDEFAULTVTABLE = 8
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IMoniker.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("0000000f-0000-0000-c000-000000000046")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IMoniker
- {
- void GetClassID (out Guid pClassID);
- [PreserveSig]
- int IsDirty ();
- void Load (IStream pStm);
- void Save (IStream pStm, [MarshalAs (UnmanagedType.Bool)] bool fClearDirty);
- void GetSizeMax (out long pcbSize);
- void BindToObject (IBindCtx pbc, IMoniker pmkToLeft, [In] ref Guid riidResult, [MarshalAs (UnmanagedType.Interface)] out object ppvResult);
- void BindToStorage (IBindCtx pbc, IMoniker pmkToLeft, [In] ref Guid riid, [MarshalAs (UnmanagedType.Interface)] out object ppvObj);
- void Reduce (IBindCtx pbc, int dwReduceHowFar, ref IMoniker ppmkToLeft, out IMoniker ppmkReduced);
- void ComposeWith (IMoniker pmkRight, [MarshalAs (UnmanagedType.Bool)] bool fOnlyIfNotGeneric, out IMoniker ppmkComposite);
- void Enum ([MarshalAs(UnmanagedType.Bool)] bool fForward, out IEnumMoniker ppenumMoniker);
- [PreserveSig]
- int IsEqual (IMoniker pmkOtherMoniker);
- void Hash (out int pdwHash);
- [PreserveSig]
- int IsRunning (IBindCtx pbc, IMoniker pmkToLeft, IMoniker pmkNewlyRunning);
- void GetTimeOfLastChange (IBindCtx pbc, IMoniker pmkToLeft, out FILETIME pFileTime);
- void Inverse (out IMoniker ppmk);
- void CommonPrefixWith (IMoniker pmkOther, out IMoniker ppmkPrefix);
- void RelativePathTo (IMoniker pmkOther, out IMoniker ppmkRelPath);
- void GetDisplayName (IBindCtx pbc, IMoniker pmkToLeft, [MarshalAs (UnmanagedType.LPWStr)] out string ppszDisplayName);
- void ParseDisplayName (IBindCtx pbc, IMoniker pmkToLeft, [MarshalAs (UnmanagedType.LPWStr)] string pszDisplayName, out int pchEaten, out IMoniker ppmkOut);
- [PreserveSig]
- int IsSystemMoniker (out int pdwMksys);
- }
-}
+++ /dev/null
-
-//
-// Copyright (C) 2004 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.
-//
-
-// System.Runtime.InteropServices.ComTypes.INVOKEKIND.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Flags]
- [Serializable]
- public enum INVOKEKIND {
- INVOKE_FUNC = 1,
- INVOKE_PROPERTYGET = 2,
- INVOKE_PROPERTYPUT = 4,
- INVOKE_PROPERTYPUTREF = 8
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IPersistFile.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("0000010b-0000-0000-c000-000000000046")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IPersistFile
- {
- void GetClassID (out Guid pClassID);
- [PreserveSig]
- int IsDirty ();
- void Load ([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, int dwMode);
- void Save ([MarshalAs (UnmanagedType.LPWStr)] string pszFileName, [MarshalAs (UnmanagedType.Bool)] bool fRemember);
- void SaveCompleted ([MarshalAs (UnmanagedType.LPWStr)]string pszFileName);
- void GetCurFile ([MarshalAs(UnmanagedType.LPWStr)] out string ppszFileName);
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IRunningObjectTable.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("00000010-0000-0000-c000-000000000046")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IRunningObjectTable
- {
- int Register (int grfFlags, [MarshalAs (UnmanagedType.Interface)] object punkObject, IMoniker pmkObjectName);
- void Revoke (int dwRegister);
- [PreserveSig]
- int IsRunning (IMoniker pmkObjectName);
- [PreserveSig]
- int GetObject (IMoniker pmkObjectName, [MarshalAs (UnmanagedType.Interface)] out object ppunkObject);
- void NoteChangeTime (int dwRegister, ref FILETIME pfiletime);
- [PreserveSig]
- int GetTimeOfLastChange (IMoniker pmkObjectName, out FILETIME pfiletime);
- void EnumRunning (out IEnumMoniker ppenumMoniker);
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.IStream.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-using System.Runtime.InteropServices.ComTypes;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("0000000c-0000-0000-c000-000000000046")]
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- public interface IStream
- {
- void Read ([Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] byte[] pv, int cb, IntPtr pcbRead);
- void Write ([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] byte[] pv, int cb, IntPtr pcbWritten);
- void Seek (long dlibMove, int dwOrigin, IntPtr plibNewPosition);
- void SetSize (long libNewSize);
- void CopyTo (IStream pstm, long cb, IntPtr pcbRead, IntPtr pcbWritten);
- void Commit (int grfCommitFlags);
- void Revert ();
- void LockRegion (long libOffset, long cb, int dwLockType);
- void UnlockRegion (long libOffset, long cb, int dwLockType);
- void Stat (out STATSTG pstatstg, int grfStatFlag);
- void Clone (out IStream ppstm);
- }
-}
+++ /dev/null
-
-//
-// Copyright (C) 2004 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.
-//
-
-// System.Runtime.InteropServices.ComTypes.ITypeComp.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid("00020403-0000-0000-c000-000000000046")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeComp {
- void Bind([MarshalAs(UnmanagedType.LPWStr)] string szName, int lHashVal, short wFlags, out ITypeInfo ppTInfo, out DESCKIND pDescKind, out BINDPTR pBindPtr);
- void BindType([MarshalAs(UnmanagedType.LPWStr)] string szName, int lHashVal, out ITypeInfo ppTInfo, out ITypeComp ppTComp);
- }
-}
+++ /dev/null
-
-//
-// Copyright (C) 2004 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.
-//
-
-// System.Runtime.InteropServices.ComTypes.ITypeInfo.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid("00020401-0000-0000-c000-000000000046")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeInfo {
- void GetTypeAttr (out IntPtr ppTypeAttr);
- void GetTypeComp (out ITypeComp ppTComp);
- void GetFuncDesc (int index, out IntPtr ppFuncDesc);
- void GetVarDesc (int index, out IntPtr ppVarDesc);
- void GetNames (int memid, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex=2)] string[] rgBstrNames, int cMaxNames, out int pcNames);
- void GetRefTypeOfImplType (int index, out int href);
- void GetImplTypeFlags (int index, out IMPLTYPEFLAGS pImplTypeFlags);
- void GetIDsOfNames ([In, MarshalAs(UnmanagedType.LPArray, ArraySubType = (UnmanagedType.LPWStr), SizeParamIndex=1)] string[] rgszNames, int cNames, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex=1)] int[] pMemId);
- void Invoke ([MarshalAs (UnmanagedType.IUnknown)] object pvInstance, int memid, short wFlags, ref DISPPARAMS pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, out int puArgErr);
- void GetDocumentation (int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile);
- void GetDllEntry (int memid, INVOKEKIND invKind, IntPtr pBstrDllName, IntPtr pBstrName, IntPtr pwOrdinal);
- void GetRefTypeInfo (int hRef, out ITypeInfo ppTI);
- void AddressOfMember (int memid, INVOKEKIND invKind, out IntPtr ppv);
- void CreateInstance ([MarshalAs (UnmanagedType.IUnknown)] object pUnkOuter, [In] ref Guid riid, [MarshalAs (UnmanagedType.IUnknown)] out object ppvObj);
- void GetMops (int memid, out string pBstrMops);
- void GetContainingTypeLib (out ITypeLib ppTLB, out int pIndex);
- [PreserveSig]
- void ReleaseTypeAttr (IntPtr pTypeAttr);
- [PreserveSig]
- void ReleaseFuncDesc (IntPtr pFuncDesc);
- [PreserveSig]
- void ReleaseVarDesc (IntPtr pVarDesc);
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.ITypeInfo2.cs
-//
-// Author:
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid("00020412-0000-0000-C000-000000000046")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeInfo2 : ITypeInfo
- {
- new void AddressOfMember (int memid, INVOKEKIND invKind, out IntPtr ppv);
- new void CreateInstance ([MarshalAs (UnmanagedType.IUnknown)] object pUnkOuter, [In] ref Guid riid, [MarshalAs (UnmanagedType.IUnknown)] out object ppvObj);
- new void GetContainingTypeLib (out ITypeLib ppTLB, out int pIndex);
- new void GetDllEntry (int memid, INVOKEKIND invKind, IntPtr pBstrDllName, IntPtr pBstrName, IntPtr pwOrdinal);
- new void GetDocumentation (int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile);
- new void GetIDsOfNames ([In, MarshalAs(UnmanagedType.LPArray, ArraySubType = (UnmanagedType.LPWStr), SizeParamIndex=1)] string[] rgszNames, int cNames, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex=1)] int[] pMemId);
-
- new void GetImplTypeFlags (int index, out IMPLTYPEFLAGS pImplTypeFlags);
- void GetTypeKind (out TYPEKIND pTypeKind);
- void GetTypeFlags (out int pTypeFlags);
- new void GetFuncDesc (int index, out IntPtr ppFuncDesc);
- new void GetMops (int memid, out string pBstrMops);
- new void GetNames (int memid, [Out, MarshalAs (UnmanagedType.LPArray, SizeParamIndex=2)] string[] rgBstrNames, int cMaxNames, out int pcNames);
- new void GetRefTypeInfo (int hRef, out ITypeInfo ppTI);
- new void GetRefTypeOfImplType (int index, out int href);
- new void GetTypeAttr (out IntPtr ppTypeAttr);
- new void GetTypeComp (out ITypeComp ppTComp);
- new void GetVarDesc (int index, out IntPtr ppVarDesc);
- void GetFuncIndexOfMemId (int memid, INVOKEKIND invKind, out int pFuncIndex);
- void GetVarIndexOfMemId (int memid, out int pVarIndex);
- void GetCustData (ref Guid guid, out object pVarVal);
- void GetFuncCustData(int index, ref Guid guid, out object pVarVal);
- void GetParamCustData(int indexFunc, int indexParam, ref Guid guid, out object pVarVal);
- void GetVarCustData(int index, ref Guid guid, out object pVarVal);
- void GetImplTypeCustData(int index, ref Guid guid, out object pVarVal);
- [LCIDConversion (1)]
- void GetDocumentation2(int memid, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll);
- void GetAllCustData(IntPtr pCustData);
- void GetAllFuncCustData(int index, IntPtr pCustData);
- void GetAllParamCustData(int indexFunc, int indexParam, IntPtr pCustData);
- void GetAllVarCustData(int index, IntPtr pCustData);
- void GetAllImplTypeCustData(int index, IntPtr pCustData);
- new void Invoke ([MarshalAs (UnmanagedType.IUnknown)] object pvInstance, int memid, short wFlags, ref DISPPARAMS pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, out int puArgErr);
- [PreserveSig]
- new void ReleaseTypeAttr (IntPtr pTypeAttr);
- [PreserveSig]
- new void ReleaseFuncDesc (IntPtr pFuncDesc);
- [PreserveSig]
- new void ReleaseVarDesc (IntPtr pVarDesc);
- }
-}
+++ /dev/null
-
-//
-// Copyright (C) 2004 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.
-//
-
-// System.Runtime.InteropServices.ComTypes.ITypeLib.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-using System;
-using System.Runtime.InteropServices.ComTypes;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid("00020402-0000-0000-c000-000000000046")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeLib {
- [PreserveSig]
- int GetTypeInfoCount ();
- void GetTypeInfo (int index, out ITypeInfo ppTI);
- void GetTypeInfoType (int index, out TYPEKIND pTKind);
- void GetTypeInfoOfGuid (ref Guid guid, out ITypeInfo ppTInfo);
- void GetLibAttr (out IntPtr ppTLibAttr);
- void GetTypeComp (out ITypeComp ppTComp);
- void GetDocumentation (int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile);
- [return: MarshalAs (UnmanagedType.Bool)]
- bool IsName ([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal);
- void FindName ([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal, [Out, MarshalAs (UnmanagedType.LPArray)] ITypeInfo[] ppTInfo, [Out, MarshalAs (UnmanagedType.LPArray)] int[] rgMemId, ref short pcFound);
- [PreserveSig]
- void ReleaseTLibAttr (IntPtr pTLibAttr);
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.ITypeLib2.cs
-//
-// Author:
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [ComImport]
- [Guid ("00020411-0000-0000-C000-000000000046")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeLib2 : ITypeLib
- {
- new void FindName ([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal, [Out, MarshalAs (UnmanagedType.LPArray)] ITypeInfo[] ppTInfo, [Out, MarshalAs (UnmanagedType.LPArray)] int[] rgMemId, ref short pcFound);
- void GetCustData(ref Guid guid, out object pVarVal);
- new void GetDocumentation (int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile);
- new void GetLibAttr (out IntPtr ppTLibAttr);
- void GetLibStatistics(IntPtr pcUniqueNames, out int pcchUniqueNames);
- [LCIDConversion(1)]
- void GetDocumentation2(int index, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll);
- void GetAllCustData(IntPtr pCustData);
- new void GetTypeComp (out ITypeComp ppTComp);
- new void GetTypeInfo (int index, out ITypeInfo ppTI);
- new void GetTypeInfoOfGuid (ref Guid guid, out ITypeInfo ppTInfo);
- new void GetTypeInfoType (int index, out TYPEKIND pTKind);
- [return: MarshalAs (UnmanagedType.Bool)]
- new bool IsName ([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal);
- [PreserveSig]
- new void ReleaseTLibAttr (IntPtr pTLibAttr);
- // undocumented
- [PreserveSig]
- new int GetTypeInfoCount ();
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.LIBFLAGS.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Flags, Serializable]
- public enum LIBFLAGS
- {
- LIBFLAG_FRESTRICTED = 1,
- LIBFLAG_FCONTROL = 2,
- LIBFLAG_FHIDDEN = 4,
- LIBFLAG_FHASDISKIMAGE = 8
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.PARAMDESC.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct PARAMDESC
- {
- public IntPtr lpVarValue;
- public PARAMFLAG wParamFlags;
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.PARAMFLAG.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Flags, Serializable]
- public enum PARAMFLAG
- {
- PARAMFLAG_NONE = 0,
- PARAMFLAG_FIN = 1,
- PARAMFLAG_FOUT = 2,
- PARAMFLAG_FLCID = 4,
- PARAMFLAG_FRETVAL = 8,
- PARAMFLAG_FOPT = 16,
- PARAMFLAG_FHASDEFAULT = 32,
- PARAMFLAG_FHASCUSTDATA = 64
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.STATSTG.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct STATSTG
- {
- public string pwcsName;
- public int type;
- public long cbSize;
- public FILETIME mtime;
- public FILETIME ctime;
- public FILETIME atime;
- public int grfMode;
- public int grfLocksSupported;
- public Guid clsid;
- public int grfStateBits;
- public int reserved;
- }
-
-}
-
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.SYSKIND.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Serializable]
- public enum SYSKIND
- {
- SYS_WIN16 = 0,
- SYS_WIN32 = 1,
- SYS_MAC = 2,
- SYS_WIN64 = 3
- }
-}
-
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.TYPEATTR.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct TYPEATTR
- {
- public const int MEMBER_ID_NIL = -1;
-
- public Guid guid;
- public int lcid;
- public int dwReserved;
- public int memidConstructor;
- public int memidDestructor;
- public IntPtr lpstrSchema;
- public int cbSizeInstance;
- public TYPEKIND typekind;
- public short cFuncs;
- public short cVars;
- public short cImplTypes;
- public short cbSizeVft;
- public short cbAlignment;
- public TYPEFLAGS wTypeFlags;
- public short wMajorVerNum;
- public short wMinorVerNum;
- public TYPEDESC tdescAlias;
- public IDLDESC idldescType;
- }
-}
-
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.TYPEDESC.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct TYPEDESC
- {
- public IntPtr lpValue;
- public short vt;
- }
-}
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.TYPEFLAGS.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Serializable, Flags]
- public enum TYPEFLAGS
- {
- TYPEFLAG_FAPPOBJECT = 1,
- TYPEFLAG_FCANCREATE = 2,
- TYPEFLAG_FLICENSED = 4,
- TYPEFLAG_FPREDECLID = 8,
- TYPEFLAG_FHIDDEN = 16,
- TYPEFLAG_FCONTROL = 32,
- TYPEFLAG_FDUAL = 64,
- TYPEFLAG_FNONEXTENSIBLE = 128,
- TYPEFLAG_FOLEAUTOMATION = 256,
- TYPEFLAG_FRESTRICTED = 512,
- TYPEFLAG_FAGGREGATABLE = 1024,
- TYPEFLAG_FREPLACEABLE = 2048,
- TYPEFLAG_FDISPATCHABLE = 4096,
- TYPEFLAG_FREVERSEBIND = 8192,
- TYPEFLAG_FPROXY = 16384
- }
-}
-
+++ /dev/null
-
-//
-// Copyright (C) 2004 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.
-//
-
-// System.Runtime.InteropServices.ComTypes/TYPEKIND.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
-
- [Serializable]
- public enum TYPEKIND {
- TKIND_ENUM = 0,
- TKIND_RECORD = 1,
- TKIND_MODULE = 2,
- TKIND_INTERFACE = 3,
- TKIND_DISPATCH = 4,
- TKIND_COCLASS = 5,
- TKIND_ALIAS = 6,
- TKIND_UNION = 7,
- TKIND_MAX = 8
- }
-}
-
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.TYPELIBATTR.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Serializable]
- [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct TYPELIBATTR
- {
- public Guid guid;
- public int lcid;
- public SYSKIND syskind;
- public short wMajorVerNum;
- public short wMinorVerNum;
- public LIBFLAGS wLibFlags;
- }
-}
-
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.VARDESC.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct VARDESC
- {
- public int memid;
- public string lpstrSchema;
- public DESCUNION desc;
- public ELEMDESC elemdescVar;
- public short wVarFlags;
- public VARKIND varkind;
-
- [StructLayout (LayoutKind.Explicit, CharSet = CharSet.Unicode)]
- public struct DESCUNION
- {
- [FieldOffset (0)]
- public IntPtr lpvarValue;
- [FieldOffset (0)]
- public int oInst;
- }
- }
-}
-
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.VARFLAGS.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-//
-// Copyright (C) 2004 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;
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Serializable, Flags]
- public enum VARFLAGS
- {
- VARFLAG_FREADONLY = 1,
- VARFLAG_FSOURCE = 2,
- VARFLAG_FBINDABLE = 4,
- VARFLAG_FREQUESTEDIT = 8,
- VARFLAG_FDISPLAYBIND = 16,
- VARFLAG_FDEFAULTBIND = 32,
- VARFLAG_FHIDDEN = 64,
- VARFLAG_FRESTRICTED = 128,
- VARFLAG_FDEFAULTCOLLELEM = 256,
- VARFLAG_FUIDEFAULT = 512,
- VARFLAG_FNONBROWSABLE = 1024,
- VARFLAG_FREPLACEABLE = 2048,
- VARFLAG_FIMMEDIATEBIND = 4096
- }
-}
-
+++ /dev/null
-//
-// System.Runtime.InteropServices.ComTypes.VARKIND.cs
-//
-// Author:
-// Kazuki Oikawa (kazuki@panicode.com)
-//
-
-
-namespace System.Runtime.InteropServices.ComTypes
-{
- [Serializable]
- public enum VARKIND
- {
- VAR_PERINSTANCE = 0,
- VAR_STATIC = 1,
- VAR_CONST = 2,
- VAR_DISPATCH = 3
- }
-}
-
+++ /dev/null
-2007-08-08 Atsushi Enomoto <atsushi@ximian.com>
-
- * IExpando.cs : [ComVisible]
-
-2003-11-13 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
-
- * IExpando.cs: Added attribute
-
-2002-11-20 Alejandro Sánchez Acosta <raciel@es.gnu.org>
-
- * IExpando.cs added.
+++ /dev/null
-//
-// System.Runtime.InteropServices.Expando.IExpando.cs
-//
-// Author:
-// Alejandro Sánchez Acosta (raciel@es.gnu.org)
-//
-// (C) Alejandro Sánchez Acosta
-//
-
-//
-// Copyright (C) 2004 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.Reflection;
-
-namespace System.Runtime.InteropServices.Expando
-{
- [Guid("afbf15e6-c37c-11d2-b88e-00a0c9b471b8")]
- [System.Runtime.InteropServices.ComVisible (true)]
- public interface IExpando : IReflect
- {
- FieldInfo AddField (string name);
-
- MethodInfo AddMethod (string name, Delegate method);
-
- PropertyInfo AddProperty(string name);
-
- void RemoveMember(MemberInfo m);
- }
-}
+++ /dev/null
-//
-// System.Runtime.Reliability.Consistency.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.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) 2004 Novell, Inc (http://www.novell.com)
-//
-
-using System.Runtime.InteropServices;
-namespace System.Runtime.Reliability
-{
- [Serializable]
- [ComVisible (false)]
- public enum CER
- {
- MayFail = 1,
- None = 0,
- Success = 2
- }
-}
+++ /dev/null
-2005-03-04 Kazuki Oikawa <kazuki@panicode.com>
-
- * CER.cs:
- * Consistency.cs:
- * PrePrepareMethodAttribute.cs:
- * ReliabilityContractAttribute.cs: Added missing attributes.
-
-2004-08-03 Sebastien Pouliot <sebastien@ximian.com>
-
- * CriticialFinalizerObject.cs: Moved to System.Runtime.
- ConstrainedExecution to match Fx 2.0 beta 1.
-
-2004-07-12 Duncan Mak <duncan@ximian.com>
-
- * CER.cs:
- * Consistency.cs:
- * CriticialFinalizerObject.cs:
- * PrePrepareMethodAttribute.cs:
- * ReliabilityContractAttribute.cs: Added.
-
+++ /dev/null
-//
-// System.Runtime.Reliability.Consistency.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.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) 2004 Novell, Inc (http://www.novell.com)
-//
-
-using System.Runtime.InteropServices;
-namespace System.Runtime.Reliability
-{
- [ComVisible (false)]
- [Serializable]
- public enum Consistency
- {
- MayCorruptAppDomain = 1,
- MayCorruptInstance = 2,
- MayCorruptProcess = 0,
- WillNotCorruptState = 3
- }
-}
+++ /dev/null
-//
-// System.Runtime.Reliability.PrePrepareMethodAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.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) 2004 Novell, Inc (http://www.novell.com)
-//
-
-using System.Runtime.InteropServices;
-namespace System.Runtime.Reliability
-{
- [Obsolete]
- [AttributeUsage (AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
- [ComVisible (false)]
- public sealed class PrePrepareMethodAttribute : Attribute
- {
- public PrePrepareMethodAttribute ()
- {
- }
- }
-}
+++ /dev/null
-//
-// System.Runtime.Reliability.ReliabilityContractAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.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) 2004 Novell, Inc (http://www.novell.com)
-//
-
-using System.Runtime.InteropServices;
-namespace System.Runtime.Reliability
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method | AttributeTargets.Interface, Inherited = false)]
- [ComVisible (false)]
- [Obsolete]
- public sealed class ReliabilityContractAttribute : Attribute
- {
- Consistency consistency;
- CER cer;
-
- public ReliabilityContractAttribute ()
- {
- }
-
- public ReliabilityContractAttribute (Consistency consistency, CER cer)
- {
- this.consistency = consistency;
- this.cer = cer;
- }
-
- public CER CER {
- get { return cer; }
- set { cer = value;}
- }
-
- public Consistency ConsistencyGuarantee {
-
- get { return consistency; }
-
- set { consistency = value; }
- }
- }
-}
-
return rp.ObjectIdentity.ClientDynamicProperties;
}
else
+ {
+#if FEATURE_REMOTING
return obj.ObjectIdentity.ServerDynamicProperties;
+#else
+ throw new NotSupportedException ();
+#endif
+ }
}
else if (ctx != null && obj == null)
{
int baseCount = 0;
Type baseType = type.BaseType;
- while (baseType != typeof (MarshalByRefObject) && baseType != typeof(object))
+ while (baseType != typeof (MarshalByRefObject) && baseType != null)
{
baseType = baseType.BaseType;
baseCount++;
+++ /dev/null
-//
-// System.AccessViolationException.cs
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [ComVisible(true)]
- [Serializable]
- public class AccessViolationException : SystemException
- {
- const int Result = unchecked ((int)0x80004003);
-
- // Constructors
- public AccessViolationException ()
- : base (Locale.GetText ("Attempted to read or write protected memory. This is often an indication that other memory has been corrupted."))
- {
- HResult = Result;
- }
-
- public AccessViolationException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public AccessViolationException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected AccessViolationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// Action.cs
-//
-// Authors:
-// Ben Maurer (bmaurer@ximian.com)
-// Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004, 2010 Novell
-//
-// 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.Runtime.CompilerServices;
-
-namespace System
-{
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public delegate void Action ();
-
- public delegate void Action <in T> (T obj);
-
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public delegate void Action <in T1, in T2> (T1 arg1, T2 arg2);
-
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public delegate void Action <in T1, in T2, in T3> (T1 arg1, T2 arg2, T3 arg3);
-
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public delegate void Action <in T1, in T2, in T3, in T4> (T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-
- public delegate void Action <in T1, in T2, in T3, in T4, in T5> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
- public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
- public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6, in T7> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
- public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
-}
+++ /dev/null
-//
-// System.AppDomainUnloadedException.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class AppDomainUnloadedException : SystemException
- {
- const int Result = unchecked ((int)0x80131014);
-
- // Constructors
- public AppDomainUnloadedException ()
- : base (Locale.GetText ("Can't access an unloaded application domain."))
- {
- HResult = Result;
- }
-
- public AppDomainUnloadedException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public AppDomainUnloadedException (string message, Exception innerException)
- :base (message, innerException)
- {
- HResult = Result;
- }
-
- protected AppDomainUnloadedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.ApplicationException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Miguel de Icaza (miguel@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class ApplicationException : Exception
- {
- const int Result = unchecked ((int)0x80131600);
-
- // Constructors
- public ApplicationException ()
- : base (Locale.GetText ("An application exception has occurred."))
- {
- HResult = Result;
- }
-
- public ApplicationException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public ApplicationException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected ApplicationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.ApplicationId class
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.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.Runtime.InteropServices;
-using System.Text;
-
-namespace System {
-
- [Serializable]
- [ComVisible (true)]
- public sealed class ApplicationId {
-
- private byte[] _token;
- private string _name;
- private Version _version;
- private string _proc;
- private string _culture;
-
- public ApplicationId (byte[] publicKeyToken, string name, Version version, string processorArchitecture, string culture)
- {
- if (publicKeyToken == null)
- throw new ArgumentNullException ("publicKeyToken");
- if (name == null)
- throw new ArgumentNullException ("name");
- if (version == null)
- throw new ArgumentNullException ("version");
-
- _token = (byte[]) publicKeyToken.Clone ();
- _name = name;
- _version = version;
- _proc = processorArchitecture;
- _culture = culture;
- }
-
- // properties
-
- public string Culture {
- get { return _culture; }
- }
-
- public string Name {
- get { return _name; }
- }
-
- public string ProcessorArchitecture {
- get { return _proc; }
- }
-
- public byte[] PublicKeyToken {
- get { return (byte[]) _token.Clone (); }
- }
-
- public Version Version {
- get { return _version; }
- }
-
- // methods
-
- public ApplicationId Copy ()
- {
- return new ApplicationId (_token, _name, _version, _proc, _culture);
- }
-
- public override bool Equals (object o)
- {
- if (o == null)
- return false;
- ApplicationId appid = (o as ApplicationId);
- if (appid == null)
- return false;
- if (_name != appid._name)
- return false;
- if (_proc != appid._proc)
- return false;
- if (_culture != appid._culture)
- return false;
- if (!_version.Equals (appid._version))
- return false;
- if (_token.Length != appid._token.Length)
- return false;
- for (int i=0; i < _token.Length; i++)
- if (_token [i] != appid._token [i])
- return false;
- return true;
- }
-
- public override int GetHashCode ()
- {
- int code = _name.GetHashCode () ^ _version.GetHashCode ();
- for (int i=0; i < _token.Length; i++)
- code ^= _token [i];
- // ProcessorArchitecture and Culture aren't part of the hash code
- // Confirmed by Microsoft in FDBK13339
- return code;
- }
-
- public override string ToString ()
- {
- StringBuilder sb = new StringBuilder ();
- sb.Append (_name);
- if (_culture != null)
- sb.AppendFormat (", culture=\"{0}\"", _culture);
- sb.AppendFormat (", version=\"{0}\", publicKeyToken=\"", _version);
- for (int i=0; i < _token.Length; i++)
- sb.Append (_token [i].ToString ("X2"));
- if (_proc != null)
- sb.AppendFormat ("\", processorArchitecture =\"{0}\"", _proc);
- else
- sb.Append ("\"");
- return sb.ToString ();
- }
- }
-}
+++ /dev/null
-//
-// System.ArgumentException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- [StructLayout (LayoutKind.Sequential)]
- public class ArgumentException : SystemException
- {
- const int Result = unchecked ((int)0x80070057);
-
- private string param_name;
-
- // Constructors
- public ArgumentException ()
- : base (Locale.GetText ("Value does not fall within the expected range."))
- {
- HResult = Result;
- }
-
- public ArgumentException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public ArgumentException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- public ArgumentException (string message, string paramName)
- : base (message)
- {
- this.param_name = paramName;
- HResult = Result;
- }
-
- public ArgumentException (string message, string paramName, Exception innerException)
- : base (message, innerException)
- {
- this.param_name = paramName;
- HResult = Result;
- }
-
- protected ArgumentException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- param_name = info.GetString ("ParamName");
- }
-
- // Properties
- public virtual string ParamName {
- get {
- return param_name;
- }
- }
-
- public override string Message {
- get {
- if (ParamName != null && ParamName.Length != 0)
- return base.Message + Environment.NewLine
- + Locale.GetText ("Parameter name: ")
- + ParamName;
- return base.Message;
- }
- }
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("ParamName", ParamName);
- }
- }
-}
+++ /dev/null
-//
-// System.ArgumentNullException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class ArgumentNullException : ArgumentException
- {
- const int Result = unchecked ((int)0x80004003);
-
- // Constructors
- public ArgumentNullException ()
- : base (Locale.GetText ("Argument cannot be null."))
- {
- HResult = Result;
- }
-
- public ArgumentNullException (string paramName)
- : base (Locale.GetText ("Argument cannot be null."), paramName)
- {
- HResult = Result;
- }
-
- public ArgumentNullException (string paramName, string message)
- : base (message, paramName)
- {
- HResult = Result;
- }
-
- public ArgumentNullException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected ArgumentNullException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.ArgumentOutOfRangeException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class ArgumentOutOfRangeException : ArgumentException
- {
- const int Result = unchecked ((int)0x80131502);
-
- private object actual_value;
-
- // Constructors
- public ArgumentOutOfRangeException ()
- : base (Locale.GetText ("Argument is out of range."))
- {
- HResult = Result;
- }
-
- public ArgumentOutOfRangeException (string paramName)
- : base (Locale.GetText ("Argument is out of range."), paramName)
- {
- HResult = Result;
- }
-
- public ArgumentOutOfRangeException (string paramName, string message)
- : base (message, paramName)
- {
- HResult = Result;
- }
-
- public ArgumentOutOfRangeException (string paramName, object actualValue, string message)
- : base (message, paramName)
- {
- this.actual_value = actualValue;
- HResult = Result;
- }
-
- protected ArgumentOutOfRangeException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- actual_value = info.GetString ("ActualValue");
- }
-
- public ArgumentOutOfRangeException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- // Properties
- public virtual object ActualValue {
- get {
- return actual_value;
- }
- }
-
- public override string Message {
- get {
- string basemsg = base.Message;
- if (actual_value == null)
- return basemsg;
- return basemsg + Environment.NewLine + actual_value;
- }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("ActualValue", actual_value);
- }
- }
-}
+++ /dev/null
-//
-// System.ArithmeticException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class ArithmeticException : SystemException
- {
- const int Result = unchecked ((int)0x80070216);
-
- // Constructors
- public ArithmeticException ()
- : base (Locale.GetText ("Overflow or underflow in the arithmetic operation."))
- {
- HResult = Result;
- }
-
- public ArithmeticException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public ArithmeticException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected ArithmeticException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
if (count < 0 || startIndex < array.GetLowerBound (0) || startIndex - 1 > array.GetUpperBound (0) - count)
throw new ArgumentOutOfRangeException ();
- return EqualityComparer<T>.Default.IndexOf (array, value, startIndex, startIndex + count);
+ return EqualityComparer<T>.Default.IndexOf (array, value, startIndex, count);
}
public static int LastIndexOf<T> (T [] array, T value)
+++ /dev/null
-//
-// System.ArrayTypeMismatchException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class ArrayTypeMismatchException : SystemException
- {
- const int Result = unchecked ((int)0x80131503);
-
- // Constructors
- public ArrayTypeMismatchException ()
- : base (Locale.GetText ("Source array type cannot be assigned to destination array type."))
- {
- HResult = Result;
- }
-
- public ArrayTypeMismatchException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public ArrayTypeMismatchException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected ArrayTypeMismatchException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.AsyncCallback.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System
-{
- [System.Runtime.InteropServices.ComVisible (true)]
- [Serializable]
- public delegate void AsyncCallback (IAsyncResult ar);
-}
+++ /dev/null
-//
-// System.AttributeTargets.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:31:48 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.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.Runtime.InteropServices;
-
-namespace System {
-
- [ComVisible (true)]
- [Serializable]
- [Flags]
- public enum AttributeTargets
- {
- Assembly = 0x00000001,
- Module = 0x00000002,
- Class = 0x00000004,
- Struct = 0x00000008,
- Enum = 0x00000010,
- Constructor = 0x00000020,
- Method = 0x00000040,
- Property = 0x00000080,
- Field = 0x00000100,
- Event = 0x00000200,
- Interface = 0x00000400,
- Parameter = 0x00000800,
- Delegate = 0x00001000,
- ReturnValue = 0x00002000,
-
- GenericParameter = 0x00004000,
- All = Assembly | Module | Class | Struct | Enum | Constructor |
- Method | Property | Field | Event | Interface | Parameter | Delegate | ReturnValue | GenericParameter
- }
-}
-
+++ /dev/null
-//
-// System.BadImageFormatException.cs
-//
-// Authors:
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc.
-// 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.Globalization;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class BadImageFormatException : SystemException
- {
- const int Result = unchecked ((int)0x8007000B);
-
- // Fields
- private string fileName;
- private string fusionLog;
-
- // Constructors
- public BadImageFormatException ()
- : base (Locale.GetText ("Format of the executable (.exe) or library (.dll) is invalid."))
- {
- HResult = Result;
- }
-
- public BadImageFormatException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- protected BadImageFormatException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- fileName = info.GetString ("BadImageFormat_FileName");
- fusionLog = info.GetString ("BadImageFormat_FusionLog");
- }
-
- public BadImageFormatException (string message, Exception inner)
- : base (message, inner)
- {
- HResult = Result;
- }
-
- public BadImageFormatException (string message, string fileName)
- : base (message)
- {
- this.fileName = fileName;
- HResult = Result;
- }
-
- public BadImageFormatException (string message, string fileName, Exception inner)
- : base (message, inner)
- {
- this.fileName = fileName;
- HResult = Result;
- }
-
- // Properties
- public override string Message
- {
- get {
- if (base.message == null) {
- return string.Format (
- "Could not load file or assembly '{0}' or one of"
- + " its dependencies. An attempt was made to load"
- + " a program with an incorrect format.", fileName);
- }
- return base.Message;
- }
- }
-
- public string FileName
- {
- get { return fileName; }
- }
-
- [MonoTODO ("Probably not entirely correct. fusionLog needs to be set somehow (we are probably missing internal constuctor)")]
- public string FusionLog {
- // note: MS runtime throws a SecurityException when the Exception is created
- // but a FileLoadException once the exception as been thrown. Mono always
- // throw a SecurityException in both case (anyway fusionLog is currently empty)
- [SecurityPermission (SecurityAction.Demand, ControlEvidence=true, ControlPolicy=true)]
- get { return fusionLog; }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("BadImageFormat_FileName", fileName);
- info.AddValue ("BadImageFormat_FusionLog", fusionLog);
- }
-
- public override string ToString ()
- {
- StringBuilder sb = new StringBuilder (GetType ().FullName);
- sb.AppendFormat (": {0}", Message);
-
- if (fileName != null && fileName.Length > 0) {
- sb.Append (Environment.NewLine);
- sb.AppendFormat ("File name: '{0}'", fileName);
- }
-
- if (this.InnerException != null)
- sb.AppendFormat (" ---> {0}", InnerException);
-
- if (this.StackTrace != null) {
- sb.Append (Environment.NewLine);
- sb.Append (StackTrace);
- }
-
- return sb.ToString ();
- }
- }
-}
+++ /dev/null
-//
-// System.Buffer.cs
-//
-// Authors:
-// Paolo Molaro (lupus@ximian.com)
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Diagnostics.Contracts;
-
-namespace System {
- [ComVisible (true)]
- public static class Buffer {
-
- public static int ByteLength (Array array)
- {
- // note: the other methods in this class also use ByteLength to test for
- // null and non-primitive arguments as a side-effect.
-
- if (array == null)
- throw new ArgumentNullException ("array");
-
- int length = ByteLengthInternal (array);
- if (length < 0)
- throw new ArgumentException (Locale.GetText ("Object must be an array of primitives."));
-
- return length;
- }
-
- public static byte GetByte (Array array, int index)
- {
- if (index < 0 || index >= ByteLength (array))
- throw new ArgumentOutOfRangeException ("index", Locale.GetText(
- "Value must be non-negative and less than the size of the collection."));
-
- return GetByteInternal (array, index);
- }
-
- public static void SetByte (Array array, int index, byte value)
- {
- if (index < 0 || index >= ByteLength (array))
- throw new ArgumentOutOfRangeException ("index", Locale.GetText(
- "Value must be non-negative and less than the size of the collection."));
-
- SetByteInternal (array, index, value);
- }
-
- public static void BlockCopy (Array src, int srcOffset, Array dst, int dstOffset, int count)
- {
- if (src == null)
- throw new ArgumentNullException ("src");
-
- if (dst == null)
- throw new ArgumentNullException ("dst");
-
- if (srcOffset < 0)
- throw new ArgumentOutOfRangeException ("srcOffset", Locale.GetText(
- "Non-negative number required."));
-
- if (dstOffset < 0)
- throw new ArgumentOutOfRangeException ("dstOffset", Locale.GetText (
- "Non-negative number required."));
-
- if (count < 0)
- throw new ArgumentOutOfRangeException ("count", Locale.GetText (
- "Non-negative number required."));
-
- // We do the checks in unmanaged code for performance reasons
- bool res = BlockCopyInternal (src, srcOffset, dst, dstOffset, count);
- if (!res) {
- // watch for integer overflow
- if ((srcOffset > ByteLength (src) - count) || (dstOffset > ByteLength (dst) - count))
- throw new ArgumentException (Locale.GetText (
- "Offset and length were out of bounds for the array or count is greater than " +
- "the number of elements from index to the end of the source collection."));
- }
- }
-
- // private
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static int ByteLengthInternal (Array array);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static byte GetByteInternal (Array array, int index);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static void SetByteInternal (Array array, int index, int value);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- internal extern static bool BlockCopyInternal (Array src, int src_offset, Array dest, int dest_offset, int count);
-
- internal static bool InternalBlockCopy (Array src, int src_offset, Array dest, int dest_offset, int count)
- {
- return BlockCopyInternal (src, src_offset, dest, dest_offset, count);
- }
-
- internal unsafe static void ZeroMemory (byte* src, long len)
- {
- while(len-- > 0)
- *(src + len) = 0;
- }
-
- internal unsafe static void Memcpy (byte* pDest, int destIndex, byte[] src, int srcIndex, int len)
- {
- Contract.Assert( (srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!");
- Contract.Assert(src.Length - srcIndex >= len, "not enough bytes in src");
- // If dest has 0 elements, the fixed statement will throw an
- // IndexOutOfRangeException. Special-case 0-byte copies.
- if (len==0)
- return;
- fixed(byte* pSrc = src) {
- Memcpy(pDest + destIndex, pSrc + srcIndex, len);
- }
- }
-
- internal unsafe static void Memcpy(byte[] dest, int destIndex, byte* src, int srcIndex, int len) {
- Contract.Assert( (srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!");
- Contract.Assert(dest.Length - destIndex >= len, "not enough bytes in dest");
- // If dest has 0 elements, the fixed statement will throw an
- // IndexOutOfRangeException. Special-case 0-byte copies.
- if (len==0)
- return;
- fixed(byte* pDest = dest) {
- Memcpy(pDest + destIndex, src + srcIndex, len);
- }
- }
-
- internal static unsafe void memcpy4 (byte *dest, byte *src, int size) {
- /*while (size >= 32) {
- // using long is better than int and slower than double
- // FIXME: enable this only on correct alignment or on platforms
- // that can tolerate unaligned reads/writes of doubles
- ((double*)dest) [0] = ((double*)src) [0];
- ((double*)dest) [1] = ((double*)src) [1];
- ((double*)dest) [2] = ((double*)src) [2];
- ((double*)dest) [3] = ((double*)src) [3];
- dest += 32;
- src += 32;
- size -= 32;
- }*/
- while (size >= 16) {
- ((int*)dest) [0] = ((int*)src) [0];
- ((int*)dest) [1] = ((int*)src) [1];
- ((int*)dest) [2] = ((int*)src) [2];
- ((int*)dest) [3] = ((int*)src) [3];
- dest += 16;
- src += 16;
- size -= 16;
- }
- while (size >= 4) {
- ((int*)dest) [0] = ((int*)src) [0];
- dest += 4;
- src += 4;
- size -= 4;
- }
- while (size > 0) {
- ((byte*)dest) [0] = ((byte*)src) [0];
- dest += 1;
- src += 1;
- --size;
- }
- }
- internal static unsafe void memcpy2 (byte *dest, byte *src, int size) {
- while (size >= 8) {
- ((short*)dest) [0] = ((short*)src) [0];
- ((short*)dest) [1] = ((short*)src) [1];
- ((short*)dest) [2] = ((short*)src) [2];
- ((short*)dest) [3] = ((short*)src) [3];
- dest += 8;
- src += 8;
- size -= 8;
- }
- while (size >= 2) {
- ((short*)dest) [0] = ((short*)src) [0];
- dest += 2;
- src += 2;
- size -= 2;
- }
- if (size > 0)
- ((byte*)dest) [0] = ((byte*)src) [0];
- }
- static unsafe void memcpy1 (byte *dest, byte *src, int size) {
- while (size >= 8) {
- ((byte*)dest) [0] = ((byte*)src) [0];
- ((byte*)dest) [1] = ((byte*)src) [1];
- ((byte*)dest) [2] = ((byte*)src) [2];
- ((byte*)dest) [3] = ((byte*)src) [3];
- ((byte*)dest) [4] = ((byte*)src) [4];
- ((byte*)dest) [5] = ((byte*)src) [5];
- ((byte*)dest) [6] = ((byte*)src) [6];
- ((byte*)dest) [7] = ((byte*)src) [7];
- dest += 8;
- src += 8;
- size -= 8;
- }
- while (size >= 2) {
- ((byte*)dest) [0] = ((byte*)src) [0];
- ((byte*)dest) [1] = ((byte*)src) [1];
- dest += 2;
- src += 2;
- size -= 2;
- }
- if (size > 0)
- ((byte*)dest) [0] = ((byte*)src) [0];
- }
-
- internal static unsafe void Memcpy (byte *dest, byte *src, int size) {
- // FIXME: if pointers are not aligned, try to align them
- // so a faster routine can be used. Handle the case where
- // the pointers can't be reduced to have the same alignment
- // (just ignore the issue on x86?)
- if ((((int)dest | (int)src) & 3) != 0) {
- if (((int)dest & 1) != 0 && ((int)src & 1) != 0 && size >= 1) {
- dest [0] = src [0];
- ++dest;
- ++src;
- --size;
- }
- if (((int)dest & 2) != 0 && ((int)src & 2) != 0 && size >= 2) {
- ((short*)dest) [0] = ((short*)src) [0];
- dest += 2;
- src += 2;
- size -= 2;
- }
- if ((((int)dest | (int)src) & 1) != 0) {
- memcpy1 (dest, src, size);
- return;
- }
- if ((((int)dest | (int)src) & 2) != 0) {
- memcpy2 (dest, src, size);
- return;
- }
- }
- memcpy4 (dest, src, size);
- }
- }
-}
+++ /dev/null
-//
-// System.CLSCompliantAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- /// <summary>
- /// Used to indicate if an element of a program is CLS compliant.
- /// </summary>
- [AttributeUsage (AttributeTargets.All)]
- [Serializable]
- [ComVisible (true)]
- public sealed class CLSCompliantAttribute : Attribute
- {
- bool is_compliant;
-
- public CLSCompliantAttribute (bool isCompliant)
- {
- this.is_compliant = isCompliant;
- }
-
- public bool IsCompliant {
- get {
- return is_compliant;
- }
- }
- }
-}
+++ /dev/null
-//
-// System.CannotUnloadAppDomainException.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class CannotUnloadAppDomainException : SystemException
- {
- const int Result = unchecked ((int)0x80131015);
-
- // Constructors
- public CannotUnloadAppDomainException ()
- : base (Locale.GetText ("Attempt to unload application domain failed."))
- {
- HResult = Result;
- }
-
- public CannotUnloadAppDomainException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- protected CannotUnloadAppDomainException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public CannotUnloadAppDomainException (string message, Exception innerException)
- :base (message, innerException)
- {
- HResult = Result;
- }
- }
-}
+++ /dev/null
-//
-// Comparison.cs
-//
-// Authors:
-// Ben Maurer (bmaurer@ximian.com)
-// Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004 Novell
-//
-// 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
-{
- public delegate int Comparison <in T> (T x, T y);
-}
-
+++ /dev/null
-//
-// System.ConsoleCancelEventArgs
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (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.
-//
-
-namespace System {
- [Serializable]
- public sealed class ConsoleCancelEventArgs : EventArgs {
- bool cancel;
- ConsoleSpecialKey specialKey;
-
- internal ConsoleCancelEventArgs (ConsoleSpecialKey key)
- {
- specialKey = key;
- }
-
- public bool Cancel {
- get { return cancel; }
- set { cancel = value; }
- }
-
- public ConsoleSpecialKey SpecialKey {
- get { return specialKey; }
- }
- }
-}
-
+++ /dev/null
-//
-// System.ConsoleCancelEventHandler
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (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.
-//
-namespace System {
- public delegate void ConsoleCancelEventHandler (object sender, ConsoleCancelEventArgs e);
-}
-
+++ /dev/null
-//
-// System.ConsoleColor
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (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.
-//
-namespace System {
- [Serializable]
- public enum ConsoleColor {
- Black,
- DarkBlue,
- DarkGreen,
- DarkCyan,
- DarkRed,
- DarkMagenta,
- DarkYellow,
- Gray,
- DarkGray,
- Blue,
- Green,
- Cyan,
- Red,
- Magenta,
- Yellow,
- White
- }
-}
-
+++ /dev/null
-//
-// System.ConsoleKey
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (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.
-//
-namespace System {
-
- [Serializable]
- public enum ConsoleKey {
- Backspace = 8,
- Tab = 9,
- Clear = 12,
- Enter = 13,
- Pause = 19,
- Escape = 27,
- Spacebar = 32,
- PageUp = 33,
- PageDown = 34,
- End = 35,
- Home = 36,
- LeftArrow = 37,
- UpArrow = 38,
- RightArrow = 39,
- DownArrow = 40,
- Select = 41,
- Print = 42,
- Execute = 43,
- PrintScreen = 44,
- Insert = 45,
- Delete = 46,
- Help = 47,
- D0 = 48,
- D1 = 49,
- D2 = 50,
- D3 = 51,
- D4 = 52,
- D5 = 53,
- D6 = 54,
- D7 = 55,
- D8 = 56,
- D9 = 57,
- A = 65,
- B = 66,
- C = 67,
- D = 68,
- E = 69,
- F = 70,
- G = 71,
- H = 72,
- I = 73,
- J = 74,
- K = 75,
- L = 76,
- M = 77,
- N = 78,
- O = 79,
- P = 80,
- Q = 81,
- R = 82,
- S = 83,
- T = 84,
- U = 85,
- V = 86,
- W = 87,
- X = 88,
- Y = 89,
- Z = 90,
- LeftWindows = 91,
- RightWindows = 92,
- Applications = 93,
- Sleep = 95,
- NumPad0 = 96,
- NumPad1 = 97,
- NumPad2 = 98,
- NumPad3 = 99,
- NumPad4 = 100,
- NumPad5 = 101,
- NumPad6 = 102,
- NumPad7 = 103,
- NumPad8 = 104,
- NumPad9 = 105,
- Multiply = 106,
- Add = 107,
- Separator = 108,
- Subtract = 109,
- Decimal = 110,
- Divide = 111,
- F1 = 112,
- F2 = 113,
- F3 = 114,
- F4 = 115,
- F5 = 116,
- F6 = 117,
- F7 = 118,
- F8 = 119,
- F9 = 120,
- F10 = 121,
- F11 = 122,
- F12 = 123,
- F13 = 124,
- F14 = 125,
- F15 = 126,
- F16 = 127,
- F17 = 128,
- F18 = 129,
- F19 = 130,
- F20 = 131,
- F21 = 132,
- F22 = 133,
- F23 = 134,
- F24 = 135,
- BrowserBack = 166,
- BrowserForward = 167,
- BrowserRefresh = 168,
- BrowserStop = 169,
- BrowserSearch = 170,
- BrowserFavorites = 171,
- BrowserHome = 172,
- VolumeMute = 173,
- VolumeDown = 174,
- VolumeUp = 175,
- MediaNext = 176,
- MediaPrevious = 177,
- MediaStop = 178,
- MediaPlay = 179,
- LaunchMail = 180,
- LaunchMediaSelect = 181,
- LaunchApp1 = 182,
- LaunchApp2 = 183,
- Oem1 = 186,
- OemPlus = 187,
- OemComma = 188,
- OemMinus = 189,
- OemPeriod = 190,
- Oem2 = 191,
- Oem3 = 192,
- Oem4 = 219,
- Oem5 = 220,
- Oem6 = 221,
- Oem7 = 222,
- Oem8 = 223,
- Oem102 = 226,
- Process = 229,
- Packet = 231,
- Attention = 246,
- CrSel = 247,
- ExSel = 248,
- EraseEndOfFile = 249,
- Play = 250,
- Zoom = 251,
- NoName = 252,
- Pa1 = 253,
- OemClear = 254,
- }
-}
-
+++ /dev/null
-//
-// System.ConsoleKeyInfo.cs
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (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.
-//
-namespace System {
- [Serializable]
- public struct ConsoleKeyInfo {
- internal static ConsoleKeyInfo Empty = new ConsoleKeyInfo ('\0', 0, false, false, false);
- ConsoleKey _key;
- char _keyChar;
- ConsoleModifiers _mods;
-
- public ConsoleKeyInfo (char keyChar, ConsoleKey key, bool shift, bool alt, bool control)
- {
- _key = key;
- _keyChar = keyChar;
- _mods = 0;
- SetModifiers (shift, alt, control);
- }
-
- internal ConsoleKeyInfo (ConsoleKeyInfo other)
- {
- _key = other._key;
- _keyChar = other._keyChar;
- _mods = other._mods;
- }
-
- internal void SetKey (ConsoleKey key)
- {
- _key = key;
- }
-
- internal void SetKeyChar (char keyChar)
- {
- _keyChar = keyChar;
- }
-
- internal void SetModifiers (bool shift, bool alt, bool control)
- {
- _mods = (shift) ? ConsoleModifiers.Shift : 0;
- _mods |= (alt) ? ConsoleModifiers.Alt : 0;
- _mods |= (control) ? ConsoleModifiers.Control : 0;
- }
-
- public ConsoleKey Key
- {
- get { return _key; }
- }
-
- public char KeyChar
- {
- get { return _keyChar; }
- }
-
- public ConsoleModifiers Modifiers
- {
- get { return _mods; }
- }
-
- public override bool Equals (object value)
- {
- if (!(value is ConsoleKeyInfo))
- return false;
-
- return Equals ((ConsoleKeyInfo) value);
- }
-
- public static bool operator == (ConsoleKeyInfo a, ConsoleKeyInfo b)
- {
- return a.Equals (b);
- }
-
- public static bool operator != (ConsoleKeyInfo a, ConsoleKeyInfo b)
- {
- return !a.Equals (b);
- }
-
- public bool Equals (ConsoleKeyInfo obj)
- {
- return _key == obj._key && _keyChar == obj._keyChar && _mods == obj._mods;
- }
-
- public override int GetHashCode ()
- {
- return _key.GetHashCode () ^ _keyChar.GetHashCode () ^ _mods.GetHashCode ();
- }
- }
-}
+++ /dev/null
-//
-// System.ConsoleModifiers
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (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.
-//
-namespace System {
- [Flags]
- [Serializable]
- public enum ConsoleModifiers {
- Alt = 1,
- Shift = 2,
- Control = 4
- }
-}
-
+++ /dev/null
-//
-// System.ConsoleSpecialKey
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (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.
-//
-namespace System {
- [Serializable]
- public enum ConsoleSpecialKey {
- ControlC,
- ControlBreak
- }
-}
-
-
+++ /dev/null
-//
-// System.ContextBoundObject.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public abstract class ContextBoundObject : MarshalByRefObject
- {
- protected ContextBoundObject ()
- {
- }
- }
-}
+++ /dev/null
-//
-// System.ContextMarshalException.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class ContextMarshalException : SystemException
- {
- const int Result = unchecked ((int)0x80131504);
-
- // Constructors
- public ContextMarshalException ()
- : base (Locale.GetText ("Attempt to marshal and object across a context failed."))
- {
- HResult = Result;
- }
-
- public ContextMarshalException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- protected ContextMarshalException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public ContextMarshalException (string message, Exception inner)
- :base (message, inner)
- {
- HResult = Result;
- }
- }
-}
+++ /dev/null
-//
-// System.ContextStaticAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- /// <summary>
- /// The ContextStatic attribute is used to flag fields as being unique
- /// </summary>
- [AttributeUsage (AttributeTargets.Field, Inherited=false)]
- [Serializable]
- [ComVisible (true)]
- public class ContextStaticAttribute : Attribute
- {
- public ContextStaticAttribute ()
- : base ()
- {
- }
- }
-}
+++ /dev/null
-//
-// Converter.cs
-//
-// Authors:
-// Ben Maurer (bmaurer@ximian.com)
-// Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004 Novell
-//
-// 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
-{
- public delegate TOutput Converter <in TInput, out TOutput> (TInput input);
-}
+++ /dev/null
-//
-// System.DataMisalignedException.cs
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public sealed class DataMisalignedException : SystemException
- {
- const int Result = unchecked ((int)0x80131541);
-
- // Constructors
- public DataMisalignedException ()
- : base (Locale.GetText ("A datatype misalignment was detected in a load or store instruction."))
- {
- HResult = Result;
- }
-
- public DataMisalignedException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public DataMisalignedException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- /*
- protected DataMisalignedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- */
- }
-}
-
+++ /dev/null
-//
-// System.DivideByZeroException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class DivideByZeroException : ArithmeticException
- {
- const int Result = unchecked ((int)0x80020012);
-
- // Constructors
- public DivideByZeroException ()
- : base (Locale.GetText ("Division by zero"))
- {
- HResult = Result;
- }
-
- public DivideByZeroException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public DivideByZeroException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected DivideByZeroException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.DllNotFoundException.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class DllNotFoundException : TypeLoadException
- {
- const int Result = unchecked ((int)0x80131524);
-
- // Constructors
- public DllNotFoundException ()
- : base (Locale.GetText ("DLL not found."))
- {
- HResult = Result;
- }
-
- public DllNotFoundException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- protected DllNotFoundException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public DllNotFoundException (string message, Exception inner)
- :base (message, inner)
- {
- HResult = Result;
- }
- }
-}
+++ /dev/null
-//
-// System.DuplicateWaitObjectException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [ComVisible (true)]
- [Serializable]
- public class DuplicateWaitObjectException : ArgumentException
- {
- const int Result = unchecked ((int)0x80131529);
-
- // Constructors
- public DuplicateWaitObjectException ()
- : base (Locale.GetText ("Duplicate objects in argument."))
- {
- HResult = Result;
- }
-
- public DuplicateWaitObjectException (string parameterName)
- : base (Locale.GetText ("Duplicate objects in argument."), parameterName)
- {
- HResult = Result;
- }
-
- public DuplicateWaitObjectException (string parameterName, string message)
- : base (message, parameterName)
- {
- HResult = Result;
- }
-
- public DuplicateWaitObjectException (string message, Exception innerException)
- : base(message, innerException)
- {
- HResult = Result;
- }
-
- protected DuplicateWaitObjectException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.EntryPointNotFoundException.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class EntryPointNotFoundException : TypeLoadException
- {
- const int Result = unchecked ((int)0x80131523);
-
- // Constructors
- public EntryPointNotFoundException ()
- : base (Locale.GetText ("Cannot load class because of missing entry method."))
- {
- HResult = Result;
- }
-
- public EntryPointNotFoundException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- protected EntryPointNotFoundException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public EntryPointNotFoundException (string message, Exception inner)
- :base (message, inner)
- {
- HResult = Result;
- }
- }
-}
* of icalls, do not require an increment.
*/
#pragma warning disable 169
- private const int mono_corlib_version = 123;
+ private const int mono_corlib_version = 127;
#pragma warning restore 169
[ComVisible (true)]
+++ /dev/null
-//
-// System.EventArgs.cs
-//
-// Author:
-// Michael Lambert (michaellambert@email.com)
-//
-// (C) 2001 Michael Lambert, All Rights Reserved
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class EventArgs
- {
- public static readonly EventArgs Empty = new EventArgs ();
-
- public EventArgs ()
- {
- }
- }
-}
+++ /dev/null
-//
-// System.EventHandler.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Marek Safar (marek.safar@gmail.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System {
-
- [Serializable]
- public delegate void EventHandler<TEventArgs> (object sender, TEventArgs e)
- ;
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible (true)]
- public delegate void EventHandler (object sender, EventArgs e);
-}
(vtable/MRGCTX) of the frames. */
IntPtr [] trace_ips;
Exception inner_exception;
- internal string message;
+ internal string _message;
string help_link;
string class_name;
string stack_trace;
public Exception (string message)
{
- this.message = message;
+ this._message = message;
}
protected Exception (SerializationInfo info, StreamingContext context)
throw new ArgumentNullException ("info");
class_name = info.GetString ("ClassName");
- message = info.GetString ("Message");
+ _message = info.GetString ("Message");
help_link = info.GetString ("HelpURL");
stack_trace = info.GetString ("StackTraceString");
_remoteStackTraceString = info.GetString ("RemoteStackTraceString");
public Exception (string message, Exception innerException)
{
inner_exception = innerException;
- this.message = message;
+ this._message = message;
}
public Exception InnerException {
get { return hresult; }
protected set { hresult = value; }
}
-
+
internal void SetErrorCode(int hr)
{
HResult = hr;
internal void SetMessage (string s)
{
- message = s;
+ _message = s;
}
internal void SetStackTrace (string s)
public virtual string Message {
get {
- if (message == null)
- message = string.Format (Locale.GetText ("Exception of type '{0}' was thrown."),
+ if (_message == null)
+ _message = string.Format (Locale.GetText ("Exception of type '{0}' was thrown."),
ClassName);
- return message;
+ return _message;
}
}
} else {
GetFullNameForStackTrace (sb, frame.GetMethod ());
- if (frame.GetILOffset () == -1)
- sb.AppendFormat ("<0x{0:x5} + 0x{1:x5}> ", frame.GetMethodAddress (), frame.GetNativeOffset ());
- else
+ if (frame.GetILOffset () == -1) {
+ sb.AppendFormat (" <0x{0:x5} + 0x{1:x5}> ", frame.GetMethodAddress (), frame.GetNativeOffset ());
+ if (frame.GetMethodIndex () != 0xffffff)
+ sb.AppendFormat ("{0} ", frame.GetMethodIndex ());
+ } else {
sb.AppendFormat (" [0x{0:x5}] ", frame.GetILOffset ());
+ }
sb.AppendFormat ("in {0}:{1} ", frame.GetSecureFileName (),
frame.GetFileLineNumber ());
throw new ArgumentNullException ("info");
info.AddValue ("ClassName", ClassName);
- info.AddValue ("Message", message);
+ info.AddValue ("Message", _message);
info.AddValue ("InnerException", inner_exception);
info.AddValue ("HelpURL", help_link);
info.AddValue ("StackTraceString", StackTrace);
return this;
}
- internal void GetFullNameForStackTrace (StringBuilder sb, MethodBase mi)
+ internal static void GetFullNameForStackTrace (StringBuilder sb, MethodBase mi)
{
- ParameterInfo[] p = mi.GetParametersInternal ();
- sb.Append (mi.DeclaringType.ToString ());
+ var declaringType = mi.DeclaringType;
+ if (declaringType.IsGenericType && !declaringType.IsGenericTypeDefinition)
+ declaringType = declaringType.GetGenericTypeDefinition ();
+
+ // Get generic definition
+ var bindingflags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
+ foreach (var m in declaringType.GetMethods (bindingflags)) {
+ if (m.MetadataToken == mi.MetadataToken) {
+ mi = m;
+ break;
+ }
+ }
+
+ sb.Append (declaringType.ToString ());
+
sb.Append (".");
sb.Append (mi.Name);
sb.Append ("]");
}
+ ParameterInfo[] p = mi.GetParametersInternal ();
+
sb.Append (" (");
for (int i = 0; i < p.Length; ++i) {
if (i > 0)
sb.Append (", ");
+
Type pt = p[i].ParameterType;
+ if (pt.IsGenericType && ! pt.IsGenericTypeDefinition)
+ pt = pt.GetGenericTypeDefinition ();
+
if (pt.IsClass && !String.IsNullOrEmpty (pt.Namespace)) {
sb.Append (pt.Namespace);
sb.Append (".");
{
return base.GetType ();
}
+
+ internal enum ExceptionMessageKind
+ {
+ ThreadAbort = 1,
+ ThreadInterrupted = 2,
+ OutOfMemory = 3
+ }
+
+ internal static String GetMessageFromNativeResources (ExceptionMessageKind kind)
+ {
+ switch (kind) {
+ case ExceptionMessageKind.ThreadAbort:
+ return "";
+ case ExceptionMessageKind.ThreadInterrupted:
+ return "";
+ case ExceptionMessageKind.OutOfMemory:
+ return "Out of memory";
+ }
+ return "";
+ }
}
}
+++ /dev/null
-//
-// System.ExecutionEngineException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Obsolete]
- [Serializable]
- [ComVisible (true)]
- public sealed class ExecutionEngineException : SystemException
- {
- // Constructors
- public ExecutionEngineException ()
- : base (Locale.GetText ("Internal error occurred.")) // Haha. Nice.
- {
- }
-
- public ExecutionEngineException (string message)
- : base (message)
- {
- }
-
- public ExecutionEngineException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- internal ExecutionEngineException (SerializationInfo info, StreamingContext context) : base(info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.FieldAccessException.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class FieldAccessException : MemberAccessException
- {
- const int Result = unchecked ((int)0x80131507);
-
- // Constructors
- public FieldAccessException ()
- : base (Locale.GetText ("Attempt to access a private/protected field failed."))
- {
- HResult = Result;
- }
-
- public FieldAccessException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- protected FieldAccessException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public FieldAccessException (string message, Exception inner)
- :base (message, inner)
- {
- HResult = Result;
- }
- }
-}
+++ /dev/null
-//
-// System.FlagsAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System {
-
- /// <summary>
- /// The FlagsAttribute tags enumerations as bitfields.
- /// </summary>
- ///
- /// <remarks>
- /// The FlagsAttribute can be used to tag an enumeration to be
- /// a bit field. This will allow the compiler and visual tools
- /// to treat the bits in an enumeration as a set of flags.
- /// </remarks>
-
- [AttributeUsage (AttributeTargets.Enum, Inherited=false)]
- [Serializable]
- [ComVisible (true)]
- public class FlagsAttribute : Attribute {
-
- // No methods.
-
- }
-}
+++ /dev/null
-//
-// System.FormatException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class FormatException : SystemException
- {
- const int Result = unchecked ((int)0x80131537);
-
- // Constructors
- public FormatException ()
- : base (Locale.GetText ("Invalid format."))
- {
- HResult = Result;
- }
-
- public FormatException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public FormatException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected FormatException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.Func.cs
-//
-// Authors:
-// Alejandro Serrano "Serras" (trupill@yahoo.es)
-// Marek Safar (marek.safar@gmail.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 TArg 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
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System {
-
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public delegate TResult Func<out TResult> ();
-
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public delegate TResult Func<in T, out TResult> (T arg);
-
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public delegate TResult Func<in T1, in T2, out TResult> (T1 arg1, T2 arg2);
-
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public delegate TResult Func<in T1, in T2, in T3, out TResult> (T1 arg1, T2 arg2, T3 arg3);
-
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public delegate TResult Func<in T1, in T2, in T3, in T4, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-
- public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
- public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
- public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
- public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
-}
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-
-#if !FULL_AOT_RUNTIME
+#if !(MONOTOUCH && FULL_AOT_RUNTIME)
using System.Security.Cryptography;
+++ /dev/null
-//
-// System.IAppDomainSetup.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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;
-using System.Runtime.InteropServices;
-
-namespace System {
-
- [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
- [Guid ("27FFF232-A7A8-40DD-8D4A-734AD59FCD41")]
- [ComVisible(true)]
- public interface IAppDomainSetup {
-
- string ApplicationBase { get; set; }
-
- string ApplicationName { get; set; }
-
- string CachePath { get; set; }
-
- string ConfigurationFile { get; set; }
-
- string DynamicBase { get; set; }
-
- string LicenseFile { get; set; }
-
- string PrivateBinPath { get; set; }
-
- string PrivateBinPathProbe { get; set; }
-
- string ShadowCopyDirectories { get; set; }
-
- string ShadowCopyFiles { get; set; }
- }
-}
+++ /dev/null
-//
-// System.IApplicationDescription interface
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System {
-
- public interface IApplicationDescription : ICloneable {
-
- string ApplicationCodeBase {
- get;
- }
-
- string ApplicationManifest {
- get;
- }
-
- string ApplicationManifestPath {
- get;
- }
-
- string DeploymentCodeBase {
- get;
- }
-
- string DeploymentManifest {
- get;
- }
-
- string DeploymentManifestPath {
- get;
- }
- }
-}
+++ /dev/null
-//------------------------------------------------------------------------------
-//
-// System.IAsyncResult.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Mon 08/24/2001
-//
-//------------------------------------------------------------------------------
-//
-// Copyright (C) 2004 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;
-using System.Threading;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System {
-
- [ComVisible(true)]
- public interface IAsyncResult
- {
- object AsyncState
- {
- get;
- }
-
- WaitHandle AsyncWaitHandle
- {
- get;
- }
-
- bool CompletedSynchronously
- {
- get;
- }
-
- bool IsCompleted
- {
- get;
- }
- }
-
-} // Namespace System
-
-
+++ /dev/null
-//
-// System.ICloneable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System {
- [ComVisible(true)]
-#if INSIDE_CORLIB
- public
-#else
- internal
-#endif
- interface ICloneable {
- object Clone ();
- }
-}
+++ /dev/null
-//
-// System.IComparable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Marek Safar (marek.safar@gmail.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System {
-
- [ComVisible(true)]
- public interface IComparable {
- int CompareTo (object obj);
- }
-
- public interface IComparable <in T> {
- int CompareTo (T other);
- }
-}
+++ /dev/null
-//
-// System.IConvertible.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.
-//
-
-//
-// Functions Implementing this interface should check out
-// System.Convert. Most of these methods are implemented
-// there for all these data types.
-//
-// System.Convert has ToType helper method for the object
-// ToType (Type conversionType, IFormatProvider provider)
-// method. In most cases you can specify your ToType function
-// as calling
-//
-// public Type value; // value of this data type
-// public object ToType(Type conversionType, IFormatProvider provider) {
-// Convert.ToType (value, conversionType, provider);
-// }
-//
-// Which is just a wrapper for your ToType methods.
-//
-// See http://lists.ximian.com/archives/public/mono-list/2001-July/000525.html
-// for more discussion on the topic
-//
-using System.Runtime.InteropServices;
-
-namespace System {
-
- [ComVisible(true)]
- [CLSCompliant(false)]
- public interface IConvertible {
-
- TypeCode GetTypeCode ();
-
- bool ToBoolean (IFormatProvider provider);
- byte ToByte (IFormatProvider provider);
- char ToChar (IFormatProvider provider);
- DateTime ToDateTime (IFormatProvider provider);
- decimal ToDecimal (IFormatProvider provider);
- double ToDouble (IFormatProvider provider);
- short ToInt16 (IFormatProvider provider);
- int ToInt32 (IFormatProvider provider);
- long ToInt64 (IFormatProvider provider);
- sbyte ToSByte (IFormatProvider provider);
- float ToSingle (IFormatProvider provider);
- string ToString (IFormatProvider provider);
- object ToType (Type conversionType, IFormatProvider provider);
- ushort ToUInt16 (IFormatProvider provider);
- uint ToUInt32 (IFormatProvider provider);
- ulong ToUInt64 (IFormatProvider provider);
- }
-}
+++ /dev/null
-//
-// System.ICustomFormatter.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System {
-
- [ComVisible(true)]
- public interface ICustomFormatter {
- string Format (string format, object arg, IFormatProvider formatProvider);
- }
-}
+++ /dev/null
-//
-// System.IDisposable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System {
-
- [ComVisible(true)]
- public interface IDisposable {
-
- void Dispose ();
-
- }
-}
+++ /dev/null
-//
-// System.IEquatable.cs
-//
-// Author:
-// Ben Maurer <bmaurer@novell.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.
-//
-
-namespace System {
- public interface IEquatable <T> {
- bool Equals (T other);
- }
-}
+++ /dev/null
-//
-// System.IFormatProvider.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System {
-
- [ComVisible(true)]
- public interface IFormatProvider {
- object GetFormat (Type formatType);
- }
-}
+++ /dev/null
-//
-// System.IFormattable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System {
-
- [ComVisible(true)]
- public interface IFormattable {
- string ToString (string format, IFormatProvider formatProvider);
- }
-}
+++ /dev/null
-//
-// System.IHostContext interface
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System {
-
- public interface IHostContext {
-
- bool AssumeTrust {
- get;
- }
-
- bool ExclusiveGrant {
- get;
- }
-
- bool IsFirstTimeInstall {
- get;
- }
-
- bool NoPrompt {
- get;
- }
-
- bool Persist {
- get;
- }
- }
-}
+++ /dev/null
-//
-// IObservable.cs
-//
-// Authors:
-// Marek Safar <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 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.
-//
-
-
-namespace System
-{
- public interface IObservable<out T>
- {
- IDisposable Subscribe (IObserver<T> observer);
- }
-}
-
+++ /dev/null
-//
-// IObserver.cs
-//
-// Authors:
-// Marek Safar <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 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.
-//
-
-
-namespace System
-{
- public interface IObserver<in T>
- {
- void OnCompleted ();
- void OnError (Exception error);
- void OnNext(T value);
- }
-}
-
+++ /dev/null
-//
-// IProgress.cs
-//
-// Authors:
-// Marek Safar <marek.safar@gmail.com>
-//
-// Copyright (C) 2011 Xamarin, Inc (http://www.xamarin.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
-{
- public interface IProgress<in T>
- {
- void Report (T value);
- }
-}
-
+++ /dev/null
-//
-// System.IServiceProvider.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- public interface IServiceProvider
- {
- object GetService (Type serviceType);
- }
-}
+++ /dev/null
-//
-// System.IndexOutOfRangeException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public sealed class IndexOutOfRangeException : SystemException
- {
- // Constructors
- public IndexOutOfRangeException ()
- : base (Locale.GetText ("Array index is out of range."))
- {
- }
-
- public IndexOutOfRangeException (string message)
- : base (message)
- {
- }
-
- public IndexOutOfRangeException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- internal IndexOutOfRangeException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// InsufficientExecutionStackException.cs
-//
-// Author: Paolo Molaro (lupus@ximian.com)
-//
-// Copyright (C) 2010 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;
-
-namespace System {
-
- [Serializable]
- public sealed class InsufficientExecutionStackException : SystemException
- {
- public InsufficientExecutionStackException ()
- : base ("Insufficient execution stack")
- {
- }
-
- public InsufficientExecutionStackException (string message)
- : base (message)
- {
- }
-
- public InsufficientExecutionStackException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
- }
-}
-
-
+++ /dev/null
-//
-// InsufficientMemoryException.cs
-//
-// Author: Duncan Mak (duncan@novell.com)
-//
-// Copyright (C) 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;
-
-namespace System {
-
- [Serializable]
- public sealed class InsufficientMemoryException : OutOfMemoryException
- {
- public InsufficientMemoryException ()
- : base ("Insufficient memory")
- {
- }
-
- public InsufficientMemoryException (string message)
- : base (message)
- {
- }
-
- public InsufficientMemoryException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.InvalidCastException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class InvalidCastException : SystemException
- {
- const int Result = unchecked ((int)0x80004002);
-
- // Constructors
- public InvalidCastException ()
- : base (Locale.GetText ("Cannot cast from source type to destination type."))
- {
- HResult = Result;
- }
-
- public InvalidCastException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public InvalidCastException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- public InvalidCastException(string message, int errorCode)
- : base(message)
- {
- HResult = errorCode;
- }
-
- protected InvalidCastException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.InvalidOperationException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class InvalidOperationException : SystemException
- {
- const int Result = unchecked ((int)0x80131509);
-
- // Constructors
- public InvalidOperationException ()
- : base (Locale.GetText ("Operation is not valid due to the current state of the object"))
- {
- HResult = Result;
- }
-
- public InvalidOperationException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public InvalidOperationException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected InvalidOperationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.InvalidProgramException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public sealed class InvalidProgramException : SystemException
- {
- // Constructors
- public InvalidProgramException ()
- : base (Locale.GetText ("Metadata is invalid."))
- {
- }
-
- public InvalidProgramException (string message)
- : base (message)
- {
- }
-
- public InvalidProgramException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- internal InvalidProgramException (SerializationInfo info, StreamingContext context) : base(info, context)
- {
- }
- }
-}
+++ /dev/null
-/*
- * System.InvalidimeZoneException
- *
- * Author(s)
- * Stephane Delcroix <stephane@delcroix.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-using System.Runtime.CompilerServices;
-
-namespace System
-{
- [Serializable]
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public
- class InvalidTimeZoneException : Exception
- {
- public InvalidTimeZoneException () : base ()
- {}
-
- public InvalidTimeZoneException (string message) : base (message)
- {}
-
- public InvalidTimeZoneException (string message, Exception innerException) : base (message, innerException)
- {}
-
- protected InvalidTimeZoneException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext context) : base (info, context)
- {}
- }
-}
+++ /dev/null
-//
-// System.LoaderOptimization.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.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.Runtime.InteropServices;
-
-namespace System
-{
- [ComVisible (true)]
- [Serializable]
- public enum LoaderOptimization
- {
- NotSpecified = 0,
- SingleDomain = 1,
- MultiDomain = 2,
- MultiDomainHost = 3,
-
- [Obsolete]
- DomainMask = 3,
-
- [Obsolete]
- DisallowBindings = 4
- }
-}
+++ /dev/null
-//
-// System.LoaderOptimizationAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Method)]
- [ComVisible (true)]
- public sealed class LoaderOptimizationAttribute : Attribute
- {
- private LoaderOptimization lo;
-
- // Constructors
- public LoaderOptimizationAttribute (byte value)
- {
- lo = (LoaderOptimization) value;
- }
-
- public LoaderOptimizationAttribute (LoaderOptimization value)
- {
- lo = value;
- }
-
- // Properties
- public LoaderOptimization Value {
- get { return lo; }
- }
- }
-}
+++ /dev/null
-//
-// System.MTAThreadAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Method)]
- [ComVisible (true)]
- public sealed class MTAThreadAttribute : Attribute
- {
- // Constructors
- public MTAThreadAttribute () : base ()
- {
- }
- }
-}
+++ /dev/null
-//
-// System.MulticastNotSupportedException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public sealed class MulticastNotSupportedException : SystemException
- {
- // Constructors
- public MulticastNotSupportedException ()
- : base (Locale.GetText ("This operation cannot be performed with the specified delagates."))
- {
- }
-
- public MulticastNotSupportedException (string message)
- : base (message)
- {
- }
-
- public MulticastNotSupportedException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- internal MulticastNotSupportedException (SerializationInfo info, StreamingContext context) : base(info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.NonSerializedAttribute.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- [ComVisible (true)]
- [AttributeUsage (AttributeTargets.Field, Inherited=false)]
- public sealed class NonSerializedAttribute : Attribute
- {
- public NonSerializedAttribute ()
- {
- }
- }
-}
+++ /dev/null
-//
-// System.NotCancelableException.cs
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-
-
-namespace System
-{
- [Serializable]
- public class NotCancelableException : SystemException
- {
- const int Result = unchecked ((int)0x8013153c);
-
- // Constructors
- public NotCancelableException ()
- : base (Locale.GetText (" The operation attempted to be canceled could not be because it was not in a cancelable region."))
- {
- HResult = Result;
- }
-
- public NotCancelableException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public NotCancelableException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected NotCancelableException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
-
+++ /dev/null
-//
-// System.NotFiniteNumberException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class NotFiniteNumberException : ArithmeticException
- {
- const int Result = unchecked ((int)0x80131528);
-
- double offending_number;
-
- // Constructors
- public NotFiniteNumberException ()
- : base (Locale.GetText ("The number encountered was not a finite quantity."))
- {
- HResult = Result;
- }
-
- public NotFiniteNumberException (double offendingNumber)
- {
- this.offending_number = offendingNumber;
- HResult = Result;
- }
-
- public NotFiniteNumberException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public NotFiniteNumberException (string message, double offendingNumber)
- : base (message)
- {
- this.offending_number = offendingNumber;
- HResult = Result;
- }
-
- public NotFiniteNumberException (string message, double offendingNumber, Exception innerException)
- : base (message, innerException)
- {
- this.offending_number = offendingNumber;
- HResult = Result;
- }
-
- protected NotFiniteNumberException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- offending_number = info.GetDouble ("OffendingNumber");
- }
-
- public NotFiniteNumberException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- // Properties
- public double OffendingNumber {
- get {
- return offending_number;
- }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("OffendingNumber", offending_number);
- }
- }
-}
+++ /dev/null
-//
-// System.NotImplementedException.cs
-//
-// Authors:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class NotImplementedException : SystemException
- {
- const int Result = unchecked ((int)0x80004001);
-
- // Constructors
- public NotImplementedException ()
- : base (Locale.GetText ("The requested feature is not implemented."))
- {
- HResult = Result;
- }
-
- public NotImplementedException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public NotImplementedException (string message, Exception inner)
- : base (message, inner)
- {
- HResult = Result;
- }
-
- protected NotImplementedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.NotSupportedException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class NotSupportedException : SystemException
- {
- const int Result = unchecked ((int)0x80131515);
-
- // Constructors
- public NotSupportedException ()
- : base (Locale.GetText ("Operation is not supported."))
- {
- HResult = Result;
- }
-
- public NotSupportedException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public NotSupportedException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected NotSupportedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
using System.Runtime.InteropServices;
using System.Text;
namespace System {
- class NullConsoleDriver : IConsoleDriver {
+ class NullConsoleDriver : IConsoleDriver
+ {
+ static readonly ConsoleKeyInfo EmptyConsoleKeyInfo = new ConsoleKeyInfo ('\0', 0, false, false, false);
+
public ConsoleColor BackgroundColor {
get { return ConsoleColor.Black; }
set {
public ConsoleKeyInfo ReadKey (bool intercept)
{
- return ConsoleKeyInfo.Empty;
+ return EmptyConsoleKeyInfo;
}
public void ResetColor ()
+++ /dev/null
-//
-// System.NullReferenceException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class NullReferenceException : SystemException
- {
- const int Result = unchecked ((int)0x80004003);
-
- // Constructors
- public NullReferenceException ()
- : base (Locale.GetText ("A null value was found where an object instance was required."))
- {
- HResult = Result;
- }
-
- public NullReferenceException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public NullReferenceException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected NullReferenceException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
}
}
- AppendIntegerStringWithGroupSeparator (nfi.RawCurrencyGroupSizes, nfi.CurrencyGroupSeparator);
+ AppendIntegerStringWithGroupSeparator (nfi.CurrencyGroupSizes, nfi.CurrencyGroupSeparator);
if (precision > 0) {
Append (nfi.CurrencyDecimalSeparator);
}
}
- AppendIntegerStringWithGroupSeparator (nfi.RawNumberGroupSizes, nfi.NumberGroupSeparator);
+ AppendIntegerStringWithGroupSeparator (nfi.NumberGroupSizes, nfi.NumberGroupSeparator);
if (precision > 0) {
Append (nfi.NumberDecimalSeparator);
}
}
- AppendIntegerStringWithGroupSeparator (nfi.RawPercentGroupSizes, nfi.PercentGroupSeparator);
+ AppendIntegerStringWithGroupSeparator (nfi.PercentGroupSizes, nfi.PercentGroupSeparator);
if (precision > 0) {
Append (nfi.PercentDecimalSeparator);
int sb_int_index = 0;
int sb_dec_index = 0;
- int[] groups = nfi.RawNumberGroupSizes;
+ int[] groups = nfi.NumberGroupSizes;
string groupSeparator = nfi.NumberGroupSeparator;
int intLen = 0, total = 0, groupIndex = 0, counter = 0, groupSize = 0;
if (UseGroup && groups.Length > 0) {
+++ /dev/null
-//
-// System.ObjectDisposedException.cs
-//
-// Authors:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class ObjectDisposedException : InvalidOperationException
- {
- // Does not override the HResult from InvalidOperationException
-
- private string obj_name;
- private string msg;
-
- // Constructors
- public ObjectDisposedException (string objectName)
- : base (Locale.GetText ("The object was used after being disposed."))
- {
- obj_name = objectName;
- msg = Locale.GetText ("The object was used after being disposed.");
- }
-
- public ObjectDisposedException (string objectName, string message)
- : base (message)
- {
- obj_name = objectName;
- msg = message;
- }
-
- public ObjectDisposedException (string message, Exception innerException)
- : base(message, innerException)
- {
- }
-
- protected ObjectDisposedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- obj_name = info.GetString ("ObjectName");
- }
-
- // Properties
- public override string Message {
- get { return msg; }
- }
-
- public string ObjectName {
- get { return obj_name; }
- }
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("ObjectName", obj_name);
- }
- }
-}
+++ /dev/null
-//
-// System.ObsoleteAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Enum | AttributeTargets.Constructor |
- AttributeTargets.Method | AttributeTargets.Property |
- AttributeTargets.Field | AttributeTargets.Event |
- AttributeTargets.Interface | AttributeTargets.Delegate,
- Inherited=false)]
- [Serializable]
- [ComVisible (true)]
- public sealed class ObsoleteAttribute : Attribute
- {
- private string _message;
- private bool _error;
-
- // Constructors
- public ObsoleteAttribute ()
- : base ()
- {
- }
-
- public ObsoleteAttribute (string message)
- {
- _message = message;
- }
-
- public ObsoleteAttribute (string message, bool error)
- {
- _message = message;
- _error = error;
- }
-
- // Properties
- public string Message {
- get { return _message; }
- }
-
- public bool IsError {
- get { return _error; }
- }
- }
-}
+++ /dev/null
-//
-// System.OperationCanceledException.cs
-//
-// Authors:
-// Zoltan Varga <vargaz@freemail.hu>
-// Jérémie Laval <jeremie.laval@gmail.com>
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.Threading;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class OperationCanceledException : SystemException
- {
- const int Result = unchecked ((int)0x8013153b);
- CancellationToken? token;
-
- // Constructors
- public OperationCanceledException ()
- : base (Locale.GetText ("The operation was canceled."))
- {
- HResult = Result;
- }
-
- public OperationCanceledException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public OperationCanceledException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected OperationCanceledException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public OperationCanceledException (CancellationToken token)
- : this ()
- {
- this.token = token;
- }
-
- public OperationCanceledException (string message, CancellationToken token)
- : this (message)
- {
- this.token = token;
- }
-
- public OperationCanceledException (string message, Exception innerException, CancellationToken token)
- : base (message, innerException)
- {
- this.token = token;
- }
-
- public CancellationToken CancellationToken {
- get {
- if (token == null)
- return CancellationToken.None;
- return token.Value;
- }
- }
- }
-}
+++ /dev/null
-//
-// System.OutOfMemoryException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class OutOfMemoryException : SystemException
- {
- const int Result = unchecked ((int)0x8007000E);
-
- // Constructors
- public OutOfMemoryException ()
- : base (Locale.GetText ("Out of memory."))
- {
- HResult = Result;
- }
-
- public OutOfMemoryException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public OutOfMemoryException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected OutOfMemoryException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.OverflowExceptionException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class OverflowException : ArithmeticException
- {
- const int Result = unchecked ((int)0x80131516);
-
- // Constructors
- public OverflowException ()
- : base (Locale.GetText ("Number overflow."))
- {
- HResult = Result;
- }
-
- public OverflowException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public OverflowException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected OverflowException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.ParamArrayAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- /// <summary>
- /// Used to flag that the method will take a variable number
- /// of arguments
- /// </summary>
- [AttributeUsage (AttributeTargets.Parameter)]
- [ComVisible (true)]
- public sealed class ParamArrayAttribute : Attribute
- {
- public ParamArrayAttribute ()
- {
- }
- }
-}
+++ /dev/null
-//
-// System.PlatformNotSupportedException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class PlatformNotSupportedException : NotSupportedException
- {
- const int Result = unchecked ((int)0x80131539);
-
- // Constructors
- public PlatformNotSupportedException ()
- : base (Locale.GetText ("This platform is not supported."))
- {
- HResult = Result;
- }
-
- public PlatformNotSupportedException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- protected PlatformNotSupportedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public PlatformNotSupportedException (string message, Exception inner)
- :base (message, inner)
- {
- HResult = Result;
- }
- }
-}
+++ /dev/null
-//
-// System.Predicate.cs
-//
-// Authors:
-// Ben Maurer (bmaurer@ximian.com)
-// Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2004 Novell
-//
-// 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
-{
- public delegate bool Predicate <in T> (T obj);
-}
-
+++ /dev/null
-//
-// System.RankException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class RankException : SystemException
- {
- const int Result = unchecked ((int)0x80131517);
-
- // Constructors
- public RankException ()
- : base (Locale.GetText ("Two arrays must have the same number of dimensions."))
- {
- HResult = Result;
- }
-
- public RankException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public RankException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected RankException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.STAThreadAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Method)]
- [ComVisible (true)]
- public sealed class STAThreadAttribute : Attribute
- {
- // Constructors
- public STAThreadAttribute ()
- : base ()
- {
- }
- }
-}
+++ /dev/null
-//
-// System.SerializableAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- /// <summary>
- /// Serialization Attribute for classes.
- /// </summary>
-
- /// <remarks>
- /// Use SerializableAttribute to mark classes that do not implement
- /// the ISerializable interface but that want to be serialized.
- ///
- /// Failing to do so will cause the system to throw an exception.
- ///
- /// When a class is market with the SerializableAttribute, all the
- /// fields are automatically serialized with the exception of those
- /// that are tagged with the NonSerializedAttribute.
- ///
- /// SerializableAttribute should only be used for classes that contain
- /// simple data types that can be serialized and deserialized by the
- /// runtime (typically you would use NonSerializedAttribute on data
- /// that can be reconstructed at any point: like caches or precomputed
- /// tables).
- /// </remarks>
-
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct
- | AttributeTargets.Enum | AttributeTargets.Delegate,
- Inherited=false)]
- [ComVisible (true)]
- public sealed class SerializableAttribute : Attribute
- {
- }
-}
+++ /dev/null
-//
-// System.StackOverflowException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public sealed class StackOverflowException : SystemException
- {
- // Constructors
- public StackOverflowException ()
- : base (Locale.GetText ("The requested operation caused a stack overflow."))
- {
- }
-
- public StackOverflowException (string message)
- : base (message)
- {
- }
-
- public StackOverflowException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- internal StackOverflowException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.SystemException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- [StructLayout (LayoutKind.Sequential)]
- public class SystemException : Exception
- {
- const int Result = unchecked ((int)0x80131501);
-
- // Constructors
- public SystemException ()
- : base (Locale.GetText ("A system exception has occurred."))
- {
- HResult = Result;
- }
-
- public SystemException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- protected SystemException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public SystemException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
- }
-}
length++;
byte [] result = new byte [length];
- Buffer.BlockCopyInternal (buffer, offset, result, 0, length);
+ Buffer.InternalBlockCopy (buffer, offset, result, 0, length);
return result;
}
+++ /dev/null
-//
-// System.ThreadStaticAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.InteropServices;
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Field, Inherited=false)]
- [Serializable]
- [ComVisible (true)]
- public class ThreadStaticAttribute : Attribute
- {
- // Constructors
- public ThreadStaticAttribute ()
- : base ()
- {
- }
- }
-}
+++ /dev/null
-/*
- * System.TimeZoneInfo.AdjustmentRule
- *
- * Author(s)
- * Stephane Delcroix <stephane@delcroix.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-
-namespace System
-{
- public
- sealed partial class TimeZoneInfo {
- [SerializableAttribute]
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public sealed class AdjustmentRule : IEquatable<TimeZoneInfo.AdjustmentRule>, ISerializable, IDeserializationCallback
- {
- DateTime dateEnd;
- public DateTime DateEnd {
- get { return dateEnd; }
- }
-
- DateTime dateStart;
- public DateTime DateStart {
- get { return dateStart; }
- }
-
- TimeSpan daylightDelta;
- public TimeSpan DaylightDelta {
- get { return daylightDelta; }
- }
-
- TransitionTime daylightTransitionEnd;
- public TransitionTime DaylightTransitionEnd {
- get { return daylightTransitionEnd; }
- }
-
- TransitionTime daylightTransitionStart;
- public TransitionTime DaylightTransitionStart {
- get { return daylightTransitionStart; }
- }
-
- public static AdjustmentRule CreateAdjustmentRule (
- DateTime dateStart,
- DateTime dateEnd,
- TimeSpan daylightDelta,
- TransitionTime daylightTransitionStart,
- TransitionTime daylightTransitionEnd)
- {
- return new AdjustmentRule (dateStart, dateEnd, daylightDelta, daylightTransitionStart, daylightTransitionEnd);
- }
-
- private AdjustmentRule (SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
- dateStart = (DateTime) info.GetValue ("DateStart", typeof (DateTime));
- dateEnd = (DateTime) info.GetValue ("DateEnd", typeof (DateTime));
- daylightDelta = (TimeSpan) info.GetValue ("DaylightDelta", typeof (TimeSpan));
- daylightTransitionStart = (TimeZoneInfo.TransitionTime) info.GetValue ("DaylightTransitionStart", typeof (TimeZoneInfo.TransitionTime));
- daylightTransitionEnd = (TimeZoneInfo.TransitionTime) info.GetValue ("DaylightTransitionEnd", typeof (TimeZoneInfo.TransitionTime));
- }
-
- private AdjustmentRule (
- DateTime dateStart,
- DateTime dateEnd,
- TimeSpan daylightDelta,
- TransitionTime daylightTransitionStart,
- TransitionTime daylightTransitionEnd)
- {
- if (dateStart.Kind != DateTimeKind.Unspecified || dateEnd.Kind != DateTimeKind.Unspecified)
- throw new ArgumentException ("the Kind property of dateStart or dateEnd parameter does not equal DateTimeKind.Unspecified");
-
- if (daylightTransitionStart == daylightTransitionEnd)
- throw new ArgumentException ("daylightTransitionStart parameter cannot equal daylightTransitionEnd parameter");
-
- if (dateStart.Ticks % TimeSpan.TicksPerDay != 0 || dateEnd.Ticks % TimeSpan.TicksPerDay != 0)
- throw new ArgumentException ("dateStart or dateEnd parameter includes a time of day value");
-
- if (dateEnd < dateStart)
- throw new ArgumentOutOfRangeException ("dateEnd is earlier than dateStart");
-
- if (daylightDelta > new TimeSpan (14, 0, 0) || daylightDelta < new TimeSpan (-14, 0, 0))
- throw new ArgumentOutOfRangeException ("daylightDelta is less than -14 or greater than 14 hours");
-
- if (daylightDelta.Ticks % TimeSpan.TicksPerSecond != 0)
- throw new ArgumentOutOfRangeException ("daylightDelta parameter does not represent a whole number of seconds");
-
- this.dateStart = dateStart;
- this.dateEnd = dateEnd;
- this.daylightDelta = daylightDelta;
- this.daylightTransitionStart = daylightTransitionStart;
- this.daylightTransitionEnd = daylightTransitionEnd;
- }
-
- public bool Equals (TimeZoneInfo.AdjustmentRule other)
- {
- return dateStart == other.dateStart &&
- dateEnd == other.dateEnd &&
- daylightDelta == other.daylightDelta &&
- daylightTransitionStart == other.daylightTransitionStart &&
- daylightTransitionEnd == other.daylightTransitionEnd;
- }
-
- public override int GetHashCode ()
- {
- return dateStart.GetHashCode () ^
- dateEnd.GetHashCode () ^
- daylightDelta.GetHashCode () ^
- daylightTransitionStart.GetHashCode () ^
- daylightTransitionEnd.GetHashCode ();
- }
-
- void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
- info.AddValue ("DateStart", DateStart);
- info.AddValue ("DateEnd", DateEnd);
- info.AddValue ("DaylightDelta", DaylightDelta);
- info.AddValue ("DaylightTransitionStart", DaylightTransitionStart);
- info.AddValue ("DaylightTransitionEnd", DaylightTransitionEnd);
- }
- void IDeserializationCallback.OnDeserialization (object sender)
- {
- try {
- TimeZoneInfo.AdjustmentRule.Validate (dateStart, dateEnd, daylightDelta,
- daylightTransitionStart, daylightTransitionEnd);
- } catch (ArgumentException ex) {
- throw new SerializationException ("invalid serialization data", ex);
- }
- }
-
- private static void Validate (
- DateTime dateStart,
- DateTime dateEnd,
- TimeSpan daylightDelta,
- TransitionTime daylightTransitionStart,
- TransitionTime daylightTransitionEnd)
- {
- if (dateStart.Kind != DateTimeKind.Unspecified || dateEnd.Kind != DateTimeKind.Unspecified)
- throw new ArgumentException ("the Kind property of dateStart or dateEnd parameter does not equal DateTimeKind.Unspecified");
-
- if (daylightTransitionStart == daylightTransitionEnd)
- throw new ArgumentException ("daylightTransitionStart parameter cannot equal daylightTransitionEnd parameter");
-
- if (dateStart.Ticks % TimeSpan.TicksPerDay != 0 || dateEnd.Ticks % TimeSpan.TicksPerDay != 0)
- throw new ArgumentException ("dateStart or dateEnd parameter includes a time of day value");
-
- if (dateEnd < dateStart)
- throw new ArgumentOutOfRangeException ("dateEnd is earlier than dateStart");
-
- if (daylightDelta > new TimeSpan (14, 0, 0) || daylightDelta < new TimeSpan (-14, 0, 0))
- throw new ArgumentOutOfRangeException ("daylightDelta is less than -14 or greater than 14 hours");
-
- if (daylightDelta.Ticks % TimeSpan.TicksPerSecond != 0)
- throw new ArgumentOutOfRangeException ("daylightDelta parameter does not represent a whole number of seconds");
- }
- }
- }
-}
+++ /dev/null
-/*
- * System.TimeZoneInfo.TransitionTime
- *
- * Author(s)
- * Stephane Delcroix <stephane@delcroix.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-
-namespace System
-{
- public
- sealed partial class TimeZoneInfo
- {
- [SerializableAttribute]
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public struct TransitionTime : IEquatable<TimeZoneInfo.TransitionTime>, ISerializable, IDeserializationCallback
- {
- DateTime timeOfDay;
- public DateTime TimeOfDay {
- get { return timeOfDay; }
- }
-
- int month;
- public int Month {
- get { return month; }
- }
-
- int day;
- public int Day {
- get {
-#if STRICT
- if (!isFixedDateRule)
- throw new Exception ("Day property is not valid for floating date rules");
-#endif
- return day;
- }
- }
-
- int week;
- public int Week {
- get {
-#if STRICT
- if (isFixedDateRule)
- throw new Exception ("Week property is not valid for fixed date rules");
-#endif
-
- return week;
- }
- }
-
- DayOfWeek dayOfWeek;
- public DayOfWeek DayOfWeek {
- get {
-#if STRICT
- if (isFixedDateRule)
- throw new Exception ("DayOfWeek property is not valid for fixed date rules");
-#endif
-
- return dayOfWeek;
- }
- }
-
- bool isFixedDateRule;
- public bool IsFixedDateRule {
- get { return isFixedDateRule; }
- }
-
- public static TransitionTime CreateFixedDateRule (
- DateTime timeOfDay,
- int month,
- int day)
- {
- return new TransitionTime (timeOfDay, month, day);
- }
-
- public static TransitionTime CreateFloatingDateRule (
- DateTime timeOfDay,
- int month,
- int week,
- DayOfWeek dayOfWeek)
- {
- return new TransitionTime (timeOfDay, month, week, dayOfWeek);
- }
-
- private TransitionTime (SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
- timeOfDay = (DateTime) info.GetValue ("TimeOfDay", typeof (DateTime));
- month = (byte) info.GetValue ("Month", typeof (byte));
- week = (byte) info.GetValue ("Week", typeof (byte));
- day = (byte) info.GetValue ("Day", typeof (byte));
- dayOfWeek = (DayOfWeek) info.GetValue ("DayOfWeek", typeof (DayOfWeek));
- isFixedDateRule = (bool) info.GetValue ("IsFixedDateRule", typeof (bool));
-
- if (isFixedDateRule)
- {
- week = -1;
- dayOfWeek = (DayOfWeek) (-1);
- }
- if (!isFixedDateRule)
- day = -1;
- }
-
- private TransitionTime (
- DateTime timeOfDay,
- int month,
- int day) : this (timeOfDay, month)
- {
- if (day < 1 || day > 31)
- throw new ArgumentOutOfRangeException ("day parameter is less than 1 or greater than 31");
-
- this.day = day;
- this.isFixedDateRule = true;
- }
-
- private TransitionTime (
- DateTime timeOfDay,
- int month,
- int week,
- DayOfWeek dayOfWeek) : this (timeOfDay, month)
- {
- if (week < 1 || week > 5)
- throw new ArgumentOutOfRangeException ("week parameter is less than 1 or greater than 5");
-
- if (dayOfWeek != DayOfWeek.Sunday &&
- dayOfWeek != DayOfWeek.Monday &&
- dayOfWeek != DayOfWeek.Tuesday &&
- dayOfWeek != DayOfWeek.Wednesday &&
- dayOfWeek != DayOfWeek.Thursday &&
- dayOfWeek != DayOfWeek.Friday &&
- dayOfWeek != DayOfWeek.Saturday)
- throw new ArgumentOutOfRangeException ("dayOfWeek parameter is not a member od DayOfWeek enumeration");
-
- this.week = week;
- this.dayOfWeek = dayOfWeek;
- this.isFixedDateRule = false;
- }
-
- private TransitionTime (
- DateTime timeOfDay,
- int month)
- {
- if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1)
- throw new ArgumentException ("timeOfDay parameter has a non-default date component");
-
- if (timeOfDay.Kind != DateTimeKind.Unspecified)
- throw new ArgumentException ("timeOfDay parameter Kind's property is not DateTimeKind.Unspecified");
-
- if (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0)
- throw new ArgumentException ("timeOfDay parameter does not represent a whole number of milliseconds");
-
- if (month < 1 || month > 12)
- throw new ArgumentOutOfRangeException ("month parameter is less than 1 or greater than 12");
-
- this.timeOfDay = timeOfDay;
- this.month = month;
-
- this.week = -1;
- this.dayOfWeek = (System.DayOfWeek)(-1);
- this.day = -1;
- this.isFixedDateRule = false;
- }
-
- public static bool operator == (TransitionTime t1, TransitionTime t2)
- {
- return ( t1.day == t2.day &&
- t1.dayOfWeek == t2.dayOfWeek &&
- t1.isFixedDateRule == t2.isFixedDateRule &&
- t1.month == t2.month &&
- t1.timeOfDay == t2.timeOfDay &&
- t1.week == t2.week);
- }
-
- public static bool operator != (TransitionTime t1, TransitionTime t2)
- {
- return !(t1 == t2);
- }
-
-
- void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
- info.AddValue ("TimeOfDay", TimeOfDay);
- info.AddValue ("Month", System.Convert.ToByte(Month));
- if (week > -1)
- info.AddValue ("Week", System.Convert.ToByte(week));
- else
- info.AddValue ("Week", (byte) 1);
- if (day > -1)
- info.AddValue ("Day", System.Convert.ToByte(day));
- else
- info.AddValue ("Day", (byte) 1);
- if (dayOfWeek != ((System.DayOfWeek) (-1)))
- info.AddValue ("DayOfWeek", dayOfWeek);
- else
- info.AddValue ("DayOfWeek", DayOfWeek.Sunday);
- info.AddValue ("IsFixedDateRule", IsFixedDateRule);
- }
-
- public override bool Equals (object obj)
- {
- if (obj is TransitionTime)
- return this == (TransitionTime) obj;
- return false;
- }
-
- public bool Equals (TimeZoneInfo.TransitionTime other)
- {
- return this == other;
- }
-
- public override int GetHashCode ()
- {
- return (day ^ (int)dayOfWeek ^ month ^ (int)timeOfDay.Ticks ^ week);
- }
-
- void IDeserializationCallback.OnDeserialization (object sender)
- {
- try {
- TimeZoneInfo.TransitionTime.Validate (timeOfDay, month, week, day, dayOfWeek, isFixedDateRule);
- } catch (ArgumentException ex) {
- throw new SerializationException ("invalid serialization data", ex);
- }
- }
-
- private static void Validate (DateTime timeOfDay, int month,int week, int day, DayOfWeek dayOfWeek, bool isFixedDateRule)
- {
- if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1)
- throw new ArgumentException ("timeOfDay parameter has a non-default date component");
-
- if (timeOfDay.Kind != DateTimeKind.Unspecified)
- throw new ArgumentException ("timeOfDay parameter Kind's property is not DateTimeKind.Unspecified");
-
- if (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0)
- throw new ArgumentException ("timeOfDay parameter does not represent a whole number of milliseconds");
-
- if (day < 1 || day > 31) {
- if (!(!isFixedDateRule && day == -1))
- throw new ArgumentOutOfRangeException ("day parameter is less than 1 or greater than 31");
- }
-
- if (week < 1 || week > 5) {
- if (!(isFixedDateRule && week == -1))
- throw new ArgumentOutOfRangeException ("week parameter is less than 1 or greater than 5");
- }
-
- if (month < 1 || month > 12)
- throw new ArgumentOutOfRangeException ("month parameter is less than 1 or greater than 12");
-
- if (dayOfWeek != DayOfWeek.Sunday &&
- dayOfWeek != DayOfWeek.Monday &&
- dayOfWeek != DayOfWeek.Tuesday &&
- dayOfWeek != DayOfWeek.Wednesday &&
- dayOfWeek != DayOfWeek.Thursday &&
- dayOfWeek != DayOfWeek.Friday &&
- dayOfWeek != DayOfWeek.Saturday) {
- if (!(isFixedDateRule && dayOfWeek == (DayOfWeek) (-1)))
- throw new ArgumentOutOfRangeException ("dayOfWeek parameter is not a member od DayOfWeek enumeration");
- }
- }
- }
- }
-}
namespace System
{
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- [SerializableAttribute]
- public
- sealed partial class TimeZoneInfo : IEquatable<TimeZoneInfo>, ISerializable, IDeserializationCallback
+ partial class TimeZoneInfo
{
TimeSpan baseUtcOffset;
public TimeSpan BaseUtcOffset {
}
#endif
+ private static bool TryAddTicks (DateTime date, long ticks, out DateTime result, DateTimeKind kind = DateTimeKind.Unspecified)
+ {
+ var resultTicks = date.Ticks + ticks;
+ if (resultTicks < DateTime.MinValue.Ticks || resultTicks > DateTime.MaxValue.Ticks) {
+ result = default (DateTime);
+ return false;
+ }
+
+ result = new DateTime (resultTicks, kind);
+ return true;
+ }
+
public static void ClearCachedData ()
{
local = null;
{
if (destinationTimeZone == null)
throw new ArgumentNullException("destinationTimeZone");
-
+
var utcDateTime = dateTimeOffset.UtcDateTime;
- AdjustmentRule rule = destinationTimeZone.GetApplicableRule (utcDateTime);
-
- if (rule != null && destinationTimeZone.IsDaylightSavingTime(utcDateTime)) {
- var offset = destinationTimeZone.BaseUtcOffset + rule.DaylightDelta;
- return new DateTimeOffset(DateTime.SpecifyKind(utcDateTime, DateTimeKind.Unspecified) + offset, offset);
- }
- else {
- return new DateTimeOffset(DateTime.SpecifyKind(utcDateTime, DateTimeKind.Unspecified) + destinationTimeZone.BaseUtcOffset, destinationTimeZone.BaseUtcOffset);
- }
+
+ bool isDst;
+ var utcOffset = destinationTimeZone.GetUtcOffset(utcDateTime, out isDst);
+
+ return new DateTimeOffset(DateTime.SpecifyKind(utcDateTime, DateTimeKind.Unspecified) + utcOffset, utcOffset);
}
public static DateTime ConvertTimeBySystemTimeZoneId (DateTime dateTime, string destinationTimeZoneId)
if (this == TimeZoneInfo.Utc)
return DateTime.SpecifyKind (dateTime, DateTimeKind.Utc);
-
- //FIXME: do not rely on DateTime implementation !
- if (this == TimeZoneInfo.Local)
- {
- return dateTime.ToLocalTime ();
- }
+ var utcOffset = GetUtcOffset (dateTime);
- AdjustmentRule rule = GetApplicableRule (dateTime);
- if (rule != null && IsDaylightSavingTime (DateTime.SpecifyKind (dateTime, DateTimeKind.Utc)))
- return DateTime.SpecifyKind (dateTime + BaseUtcOffset + rule.DaylightDelta , DateTimeKind.Unspecified);
- else
- return DateTime.SpecifyKind (dateTime + BaseUtcOffset, DateTimeKind.Unspecified);
+ var kind = (this == TimeZoneInfo.Local)? DateTimeKind.Local : DateTimeKind.Unspecified;
+
+ DateTime result;
+ if (!TryAddTicks (dateTime, utcOffset.Ticks, out result, kind))
+ return DateTime.SpecifyKind (DateTime.MaxValue, kind);
+
+ return result;
}
public static DateTime ConvertTimeFromUtc (DateTime dateTime, TimeZoneInfo destinationTimeZone)
if (dateTime.Kind == DateTimeKind.Utc)
return dateTime;
- if (sourceTimeZone.IsAmbiguousTime (dateTime) || !sourceTimeZone.IsDaylightSavingTime (dateTime)) {
- var ticks = dateTime.Ticks - sourceTimeZone.BaseUtcOffset.Ticks;
- if (ticks < DateTime.MinValue.Ticks)
- ticks = DateTime.MinValue.Ticks;
- else if (ticks > DateTime.MaxValue.Ticks)
- ticks = DateTime.MaxValue.Ticks;
+ bool isDst;
+ var utcOffset = sourceTimeZone.GetUtcOffset (dateTime, out isDst);
- return new DateTime (ticks, DateTimeKind.Utc);
- }
-
- AdjustmentRule rule = sourceTimeZone.GetApplicableRule (dateTime);
- if (rule != null)
- return DateTime.SpecifyKind (dateTime - sourceTimeZone.BaseUtcOffset - rule.DaylightDelta, DateTimeKind.Utc);
- else
- return DateTime.SpecifyKind (dateTime - sourceTimeZone.BaseUtcOffset, DateTimeKind.Utc);
-
+ DateTime utcDateTime;
+ if (!TryAddTicks (dateTime, -utcOffset.Ticks, out utcDateTime, DateTimeKind.Utc))
+ return DateTime.SpecifyKind (DateTime.MinValue, DateTimeKind.Utc);
+
+ return utcDateTime;
}
static internal TimeSpan GetDateTimeNowUtcOffsetFromUtc(DateTime time, out Boolean isAmbiguousLocalDst)
tz = TimeZoneInfo.Local;
bool isTzDst;
- var tzOffset = GetUtcOffset (dateTime, tz, out isTzDst);
+ var tzOffset = GetUtcOffsetHelper (dateTime, tz, out isTzDst);
if (tz == this) {
isDST = isTzDst;
return tzOffset;
}
- var utcTicks = dateTime.Ticks - tzOffset.Ticks;
- if (utcTicks < 0 || utcTicks > DateTime.MaxValue.Ticks)
+ DateTime utcDateTime;
+ if (!TryAddTicks (dateTime, -tzOffset.Ticks, out utcDateTime, DateTimeKind.Utc))
return BaseUtcOffset;
- var utcDateTime = new DateTime (utcTicks, DateTimeKind.Utc);
-
- return GetUtcOffset (utcDateTime, this, out isDST);
+ return GetUtcOffsetHelper (utcDateTime, this, out isDST);
}
- private static TimeSpan GetUtcOffset (DateTime dateTime, TimeZoneInfo tz, out bool isDST)
+ // This is an helper method used by the method above, do not use this on its own.
+ private static TimeSpan GetUtcOffsetHelper (DateTime dateTime, TimeZoneInfo tz, out bool isDST)
{
if (dateTime.Kind == DateTimeKind.Local && tz != TimeZoneInfo.Local)
throw new Exception ();
return tz.BaseUtcOffset;
}
- var stdTicks = dateTime.Ticks - tz.BaseUtcOffset.Ticks;
- if (stdTicks < 0 || stdTicks > DateTime.MaxValue.Ticks)
+ DateTime stdUtcDateTime;
+ if (!TryAddTicks (dateTime, -tz.BaseUtcOffset.Ticks, out stdUtcDateTime, DateTimeKind.Utc))
return tz.BaseUtcOffset;
- var stdUtcDateTime = new DateTime (stdTicks, DateTimeKind.Utc);
var tzRule = tz.GetApplicableRule (stdUtcDateTime);
DateTime dstUtcDateTime = DateTime.MinValue;
if (tzRule != null) {
- var dstTicks = stdUtcDateTime.Ticks - tzRule.DaylightDelta.Ticks;
- if (dstTicks < 0 || dstTicks > DateTime.MaxValue.Ticks)
+ if (!TryAddTicks (stdUtcDateTime, -tzRule.DaylightDelta.Ticks, out dstUtcDateTime, DateTimeKind.Utc))
return tz.BaseUtcOffset;
-
- dstUtcDateTime = new DateTime (dstTicks, DateTimeKind.Utc);
}
if (tzRule != null && tz.IsInDST (tzRule, stdUtcDateTime) && tz.IsInDST (tzRule, dstUtcDateTime)) {
throw new NotImplementedException ();
}
+ public bool IsInvalidTime (DateTime dateTime)
+ {
+ if (dateTime.Kind == DateTimeKind.Utc)
+ return false;
+ if (dateTime.Kind == DateTimeKind.Local && this != Local)
+ return false;
+
+ AdjustmentRule rule = GetApplicableRule (dateTime);
+ if (rule != null) {
+ DateTime tpoint = TransitionPoint (rule.DaylightTransitionStart, dateTime.Year);
+ if (dateTime >= tpoint && dateTime < tpoint + rule.DaylightDelta)
+ return true;
+ }
+
+ return false;
+ }
+
void IDeserializationCallback.OnDeserialization (object sender)
{
try {
//Applicable rules are in standard time
DateTime date = dateTime;
- if (dateTime.Kind == DateTimeKind.Local && this != TimeZoneInfo.Local)
- date = date.ToUniversalTime () + BaseUtcOffset;
- else if (dateTime.Kind == DateTimeKind.Utc && this != TimeZoneInfo.Utc)
- date = date + BaseUtcOffset;
+ if (dateTime.Kind == DateTimeKind.Local && this != TimeZoneInfo.Local) {
+ if (!TryAddTicks (date.ToUniversalTime (), BaseUtcOffset.Ticks, out date))
+ return null;
+ } else if (dateTime.Kind == DateTimeKind.Utc && this != TimeZoneInfo.Utc) {
+ if (!TryAddTicks (date, BaseUtcOffset.Ticks, out date))
+ return null;
+ }
// get the date component of the datetime
date = date.Date;
DateTime date = dateTime;
if (dateTime.Kind == DateTimeKind.Local && this != TimeZoneInfo.Local) {
- var ticks = date.ToUniversalTime ().Ticks + BaseUtcOffset.Ticks;
- if (ticks < DateTime.MinValue.Ticks || ticks > DateTime.MaxValue.Ticks)
+ if (!TryAddTicks (date.ToUniversalTime (), BaseUtcOffset.Ticks, out date, DateTimeKind.Utc))
return false;
-
- date = new DateTime (ticks, DateTimeKind.Utc);
}
if (dateTime.Kind != DateTimeKind.Utc) {
- var ticks = date.Ticks - BaseUtcOffset.Ticks;
- if (ticks < DateTime.MinValue.Ticks || ticks > DateTime.MaxValue.Ticks)
+ if (!TryAddTicks (date, -BaseUtcOffset.Ticks, out date, DateTimeKind.Utc))
return false;
-
- date = new DateTime (ticks, DateTimeKind.Utc);
}
for (var i = transitions.Count - 1; i >= 0; i--) {
if (dst_end.Date == new DateTime (dst_end.Year, 1, 1) && dst_end.Year > dst_start.Year)
dst_end -= new TimeSpan (24, 0, 0);
+ /*
+ * AdjustmentRule specifies a DST period that starts and ends within a year.
+ * When we have a DST period longer than a year, the generated AdjustmentRule may not be usable.
+ * Thus we fallback to the transitions.
+ */
+ if (dst_start.AddYears (1) < dst_end)
+ storeTransition = true;
+
DateTime dateStart, dateEnd;
if (dst_start.Month < 7)
dateStart = new DateTime (dst_start.Year, 1, 1);
}
#region reference sources
- // Shortcut for TimeZoneInfo.Local.GetUtcOffset
- internal static TimeSpan GetLocalUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags)
- {
- bool dst;
- return Local.GetUtcOffset (dateTime, out dst);
- }
-
- internal TimeSpan GetUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags)
- {
- bool dst;
- return GetUtcOffset (dateTime, out dst);
- }
-
- // used by GetUtcOffsetFromUtc (DateTime.Now, DateTime.ToLocalTime) for max/min whole-day range checks
- private static DateTime s_maxDateOnly = new DateTime(9999, 12, 31);
- private static DateTime s_minDateOnly = new DateTime(1, 1, 2);
-
- static internal TimeSpan GetUtcOffsetFromUtc (DateTime time, TimeZoneInfo zone, out Boolean isDaylightSavings, out Boolean isAmbiguousLocalDst)
- {
- isDaylightSavings = false;
- isAmbiguousLocalDst = false;
- TimeSpan baseOffset = zone.BaseUtcOffset;
- Int32 year;
- AdjustmentRule rule;
-
- if (time > s_maxDateOnly) {
- rule = zone.GetAdjustmentRuleForTime(DateTime.MaxValue);
- year = 9999;
- }
- else if (time < s_minDateOnly) {
- rule = zone.GetAdjustmentRuleForTime(DateTime.MinValue);
- year = 1;
- }
- else {
- DateTime targetTime = time + baseOffset;
- year = time.Year;
- rule = zone.GetAdjustmentRuleForTime(targetTime);
- }
-
- if (rule != null) {
- isDaylightSavings = GetIsDaylightSavingsFromUtc(time, year, zone.baseUtcOffset, rule, out isAmbiguousLocalDst);
- baseOffset += (isDaylightSavings ? rule.DaylightDelta : TimeSpan.Zero /* */);
- }
-
- return baseOffset;
- }
-
- // assumes dateTime is in the current time zone's time
- private AdjustmentRule GetAdjustmentRuleForTime(DateTime dateTime) {
- if (adjustmentRules == null || adjustmentRules.Length == 0) {
- return null;
- }
-
-#if WINXP_AND_WIN2K3_SUPPORT
- // On pre-Vista versions of Windows if you run "cmd /c date" or "cmd /c time" to update the system time
- // the operating system doesn't pick up the correct time zone adjustment rule (it stays on the currently loaded rule).
- // We need to use the OS API data in this scenario instead of the loaded adjustment rules from the registry for
- // consistency. Otherwise DateTime.Now might not match the time displayed in the system tray.
- if (!Environment.IsWindowsVistaOrAbove && s_cachedData.GetCorrespondingKind(this) == DateTimeKind.Local) {
- return s_cachedData.GetOneYearLocalFromLocal(dateTime.Year).rule;
- }
-#endif
- // Only check the whole-date portion of the dateTime -
- // This is because the AdjustmentRule DateStart & DateEnd are stored as
- // Date-only values {4/2/2006 - 10/28/2006} but actually represent the
- // time span {4/2/2006@00:00:00.00000 - 10/28/2006@23:59:59.99999}
- DateTime date = dateTime.Date;
-
- for (int i = 0; i < adjustmentRules.Length; i++) {
- if (adjustmentRules[i].DateStart <= date && adjustmentRules[i].DateEnd >= date) {
- return adjustmentRules[i];
- }
- }
-
- return null;
- }
-
- //
- // GetIsDaylightSavingsFromUtc -
- //
- // Helper function that checks if a given dateTime is in Daylight Saving Time (DST)
- // This function assumes the dateTime is in UTC and AdjustmentRule is in a different time zone
- //
- static private Boolean GetIsDaylightSavingsFromUtc(DateTime time, Int32 Year, TimeSpan utc, AdjustmentRule rule, out Boolean isAmbiguousLocalDst) {
- isAmbiguousLocalDst = false;
-
- if (rule == null) {
- return false;
- }
-
- // Get the daylight changes for the year of the specified time.
- TimeSpan offset = utc; /* */
- DaylightTime daylightTime = GetDaylightTime(Year, rule);
-
- // The start and end times represent the range of universal times that are in DST for that year.
- // Within that there is an ambiguous hour, usually right at the end, but at the beginning in
- // the unusual case of a negative daylight savings delta.
- DateTime startTime = daylightTime.Start - offset;
- DateTime endTime = daylightTime.End - offset - rule.DaylightDelta; /* */
- DateTime ambiguousStart;
- DateTime ambiguousEnd;
- if (daylightTime.Delta.Ticks > 0) {
- ambiguousStart = endTime - daylightTime.Delta;
- ambiguousEnd = endTime;
- } else {
- ambiguousStart = startTime;
- ambiguousEnd = startTime - daylightTime.Delta;
- }
-
- Boolean isDst = CheckIsDst(startTime, time, endTime);
-
- // See if the resulting local time becomes ambiguous. This must be captured here or the
- // DateTime will not be able to round-trip back to UTC accurately.
- if (isDst) {
- isAmbiguousLocalDst = (time >= ambiguousStart && time < ambiguousEnd);
-
- if (!isAmbiguousLocalDst && ambiguousStart.Year != ambiguousEnd.Year) {
- // there exists an extreme corner case where the start or end period is on a year boundary and
- // because of this the comparison above might have been performed for a year-early or a year-later
- // than it should have been.
- DateTime ambiguousStartModified;
- DateTime ambiguousEndModified;
- try {
- ambiguousStartModified = ambiguousStart.AddYears(1);
- ambiguousEndModified = ambiguousEnd.AddYears(1);
- isAmbiguousLocalDst = (time >= ambiguousStart && time < ambiguousEnd);
- }
- catch (ArgumentOutOfRangeException) {}
-
- if (!isAmbiguousLocalDst) {
- try {
- ambiguousStartModified = ambiguousStart.AddYears(-1);
- ambiguousEndModified = ambiguousEnd.AddYears(-1);
- isAmbiguousLocalDst = (time >= ambiguousStart && time < ambiguousEnd);
- }
- catch (ArgumentOutOfRangeException) {}
- }
-
- }
- }
-
- return isDst;
- }
-
-
- static private Boolean CheckIsDst(DateTime startTime, DateTime time, DateTime endTime) {
- Boolean isDst;
-
- int startTimeYear = startTime.Year;
- int endTimeYear = endTime.Year;
-
- if (startTimeYear != endTimeYear) {
- endTime = endTime.AddYears(startTimeYear - endTimeYear);
- }
-
- int timeYear = time.Year;
-
- if (startTimeYear != timeYear) {
- time = time.AddYears(startTimeYear - timeYear);
- }
-
- if (startTime > endTime) {
- // In southern hemisphere, the daylight saving time starts later in the year, and ends in the beginning of next year.
- // Note, the summer in the southern hemisphere begins late in the year.
- isDst = (time < endTime || time >= startTime);
- }
- else {
- // In northern hemisphere, the daylight saving time starts in the middle of the year.
- isDst = (time >= startTime && time < endTime);
- }
- return isDst;
- }
-
- //
- // GetDaylightTime -
- //
- // Helper function that returns a DaylightTime from a year and AdjustmentRule
- //
- static private DaylightTime GetDaylightTime(Int32 year, AdjustmentRule rule) {
- TimeSpan delta = rule.DaylightDelta;
- DateTime startTime = TransitionTimeToDateTime(year, rule.DaylightTransitionStart);
- DateTime endTime = TransitionTimeToDateTime(year, rule.DaylightTransitionEnd);
- return new DaylightTime(startTime, endTime, delta);
- }
-
- //
- // TransitionTimeToDateTime -
- //
- // Helper function that converts a year and TransitionTime into a DateTime
- //
- static private DateTime TransitionTimeToDateTime(Int32 year, TransitionTime transitionTime) {
- DateTime value;
- DateTime timeOfDay = transitionTime.TimeOfDay;
-
- if (transitionTime.IsFixedDateRule) {
- // create a DateTime from the passed in year and the properties on the transitionTime
-
- // if the day is out of range for the month then use the last day of the month
- Int32 day = DateTime.DaysInMonth(year, transitionTime.Month);
-
- value = new DateTime(year, transitionTime.Month, (day < transitionTime.Day) ? day : transitionTime.Day,
- timeOfDay.Hour, timeOfDay.Minute, timeOfDay.Second, timeOfDay.Millisecond);
- }
- else {
- if (transitionTime.Week <= 4) {
- //
- // Get the (transitionTime.Week)th Sunday.
- //
- value = new DateTime(year, transitionTime.Month, 1,
- timeOfDay.Hour, timeOfDay.Minute, timeOfDay.Second, timeOfDay.Millisecond);
-
- int dayOfWeek = (int)value.DayOfWeek;
- int delta = (int)transitionTime.DayOfWeek - dayOfWeek;
- if (delta < 0) {
- delta += 7;
- }
- delta += 7 * (transitionTime.Week - 1);
-
- if (delta > 0) {
- value = value.AddDays(delta);
- }
- }
- else {
- //
- // If TransitionWeek is greater than 4, we will get the last week.
- //
- Int32 daysInMonth = DateTime.DaysInMonth(year, transitionTime.Month);
- value = new DateTime(year, transitionTime.Month, daysInMonth,
- timeOfDay.Hour, timeOfDay.Minute, timeOfDay.Second, timeOfDay.Millisecond);
-
- // This is the day of week for the last day of the month.
- int dayOfWeek = (int)value.DayOfWeek;
- int delta = dayOfWeek - (int)transitionTime.DayOfWeek;
- if (delta < 0) {
- delta += 7;
- }
-
- if (delta > 0) {
- value = value.AddDays(-delta);
- }
- }
- }
- return value;
- }
-
- //
- // IsInvalidTime -
- //
- // returns true when dateTime falls into a "hole in time".
- //
- public Boolean IsInvalidTime(DateTime dateTime) {
- Boolean isInvalid = false;
-
- if ( (dateTime.Kind == DateTimeKind.Unspecified)
- || (dateTime.Kind == DateTimeKind.Local && this == Local) ) {
-
- // only check Unspecified and (Local when this TimeZoneInfo instance is Local)
- AdjustmentRule rule = GetAdjustmentRuleForTime(dateTime);
-
-
- if (rule != null) {
- DaylightTime daylightTime = GetDaylightTime(dateTime.Year, rule);
- isInvalid = GetIsInvalidTime(dateTime, rule, daylightTime);
- }
- else {
- isInvalid = false;
- }
- }
-
- return isInvalid;
- }
-
- //
- // GetIsInvalidTime -
- //
- // Helper function that checks if a given DateTime is in an invalid time ("time hole")
- // A "time hole" occurs at a DST transition point when time jumps forward;
- // For example, in Pacific Standard Time on Sunday, April 2, 2006 time jumps from
- // 1:59:59.9999999 to 3AM. The time range 2AM to 2:59:59.9999999AM is the "time hole".
- // A "time hole" is not limited to only occurring at the start of DST, and may occur at
- // the end of DST as well.
- //
- static private Boolean GetIsInvalidTime(DateTime time, AdjustmentRule rule, DaylightTime daylightTime) {
- Boolean isInvalid = false;
- if (rule == null || rule.DaylightDelta == TimeSpan.Zero) {
- return isInvalid;
- }
-
- DateTime startInvalidTime;
- DateTime endInvalidTime;
-
- // if at DST start we transition forward in time then there is an ambiguous time range at the DST end
- if (rule.DaylightDelta < TimeSpan.Zero) {
- startInvalidTime = daylightTime.End;
- endInvalidTime = daylightTime.End - rule.DaylightDelta; /* */
- }
- else {
- startInvalidTime = daylightTime.Start;
- endInvalidTime = daylightTime.Start + rule.DaylightDelta; /* */
- }
-
- isInvalid = (time >= startInvalidTime && time < endInvalidTime);
-
- if (!isInvalid && startInvalidTime.Year != endInvalidTime.Year) {
- // there exists an extreme corner case where the start or end period is on a year boundary and
- // because of this the comparison above might have been performed for a year-early or a year-later
- // than it should have been.
- DateTime startModifiedInvalidTime;
- DateTime endModifiedInvalidTime;
- try {
- startModifiedInvalidTime = startInvalidTime.AddYears(1);
- endModifiedInvalidTime = endInvalidTime.AddYears(1);
- isInvalid = (time >= startModifiedInvalidTime && time < endModifiedInvalidTime);
- }
- catch (ArgumentOutOfRangeException) {}
-
- if (!isInvalid) {
- try {
- startModifiedInvalidTime = startInvalidTime.AddYears(-1);
- endModifiedInvalidTime = endInvalidTime.AddYears(-1);
- isInvalid = (time >= startModifiedInvalidTime && time < endModifiedInvalidTime);
- }
- catch (ArgumentOutOfRangeException) {}
- }
- }
- return isInvalid;
- }
+ // Shortcut for TimeZoneInfo.Local.GetUtcOffset
+ internal static TimeSpan GetLocalUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags)
+ {
+ bool dst;
+ return Local.GetUtcOffset (dateTime, out dst);
+ }
+
+ internal TimeSpan GetUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags)
+ {
+ bool dst;
+ return GetUtcOffset (dateTime, out dst);
+ }
+
+ static internal TimeSpan GetUtcOffsetFromUtc (DateTime time, TimeZoneInfo zone, out Boolean isDaylightSavings, out Boolean isAmbiguousLocalDst)
+ {
+ isDaylightSavings = false;
+ isAmbiguousLocalDst = false;
+ TimeSpan baseOffset = zone.BaseUtcOffset;
+
+ if (zone.IsAmbiguousTime (time)) {
+ isAmbiguousLocalDst = true;
+ return baseOffset;
+ }
+
+ return zone.GetUtcOffset (time, out isDaylightSavings);
+ }
#endregion
}
+++ /dev/null
-/*
- * System.TimeZoneNotFoundException
- *
- * Author(s)
- * Stephane Delcroix <stephane@delcroix.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-using System.Runtime.CompilerServices;
-
-namespace System
-{
- [Serializable]
-#if MOBILE
- [TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#else
- [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
-#endif
- public
- class TimeZoneNotFoundException : Exception
- {
- public TimeZoneNotFoundException () : base ()
- {}
-
- public TimeZoneNotFoundException (string message) : base (message)
- {}
-
- public TimeZoneNotFoundException (string message, Exception innerException) : base (message, innerException)
- {}
-
- protected TimeZoneNotFoundException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext context) : base (info, context)
- {}
- }
-}
+++ /dev/null
-//
-// System.TimeoutException.cs
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class TimeoutException : SystemException
- {
- const int Result = unchecked ((int)0x80131505);
-
- // Constructors
- public TimeoutException ()
- : base (Locale.GetText ("The operation has timed-out."))
- {
- HResult = Result;
- }
-
- public TimeoutException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public TimeoutException (string message, Exception innerException)
- : base (message, innerException)
- {
- HResult = Result;
- }
-
- protected TimeoutException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.TypeAccessException.cs
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@novell.com)
-//
-// Copyright (c) 2010 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class TypeAccessException : TypeLoadException
- {
- const int Result = unchecked ((int)0x80131522); // FIXME: this code is probably wrong
-
- // Constructors
- public TypeAccessException ()
- : base (Locale.GetText ("Attempt to access the type failed."))
- {
- HResult = Result;
- }
-
- public TypeAccessException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public TypeAccessException (string message, Exception inner)
- : base (message, inner)
- {
- HResult = Result;
- }
-
- protected TypeAccessException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
-
+++ /dev/null
-//
-// System.TypeInitializationException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public sealed class TypeInitializationException : SystemException
- {
- string type_name;
-
- // Constructors
- public TypeInitializationException (string fullTypeName, Exception innerException)
- : base (Locale.GetText ("An exception was thrown by the type initializer for ") + fullTypeName, innerException)
- {
- this.type_name = fullTypeName;
- }
-
- internal TypeInitializationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- type_name = info.GetString ("TypeName");
- }
-
- // Properties
- public string TypeName {
- get {
- return type_name;
- }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("TypeName", type_name);
- }
- }
-}
+++ /dev/null
-//
-// System.TypeLoadException.cs
-//
-// Authors:
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- [StructLayout (LayoutKind.Sequential)]
- public class TypeLoadException : SystemException
- {
- const int Result = unchecked ((int)0x80131522);
-
- // Fields
- private string className, assemblyName;
-
- // Constructors
- public TypeLoadException ()
- : base (Locale.GetText ("A type load exception has occurred."))
- {
- HResult = Result;
- }
-
- public TypeLoadException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public TypeLoadException (string message, Exception inner)
- : base (message, inner)
- {
- HResult = Result;
- }
-
- internal TypeLoadException (string className, string assemblyName) : this ()
- {
- this.className = className;
- this.assemblyName = assemblyName;
- }
-
- protected TypeLoadException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
-
- className = info.GetString ("TypeLoadClassName");
- assemblyName = info.GetString ("TypeLoadAssemblyName");
- }
-
- // Properties
- public override string Message {
- get {
- if (className != null) {
- if ((assemblyName != null) && (assemblyName != String.Empty))
- return String.Format ("Could not load type '{0}' from assembly '{1}'.", className, assemblyName);
- else
- return String.Format ("Could not load type '{0}'.", className);
- }
- else
- return base.Message;
- }
- }
-
- public string TypeName {
- get {
- if (className == null)
- return String.Empty;
- else
- return className;
- }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
-
- base.GetObjectData (info, context);
- info.AddValue ("TypeLoadClassName", className, typeof (string));
- info.AddValue ("TypeLoadAssemblyName", assemblyName, typeof (string));
- info.AddValue ("TypeLoadMessageArg", "", typeof (string));
- info.AddValue ("TypeLoadResourceID", 0, typeof (int));
- }
- }
-}
+++ /dev/null
-//
-// System.TypeUnloadedException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class TypeUnloadedException : SystemException
- {
- // Constructors
- public TypeUnloadedException ()
- : base (Locale.GetText ("Cannot access an unloaded class."))
- {
- }
-
- public TypeUnloadedException (string message)
- : base (message)
- {
- }
-
- protected TypeUnloadedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public TypeUnloadedException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.UnauthorizedAccessException.cs
-//
-// Authors:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 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.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class UnauthorizedAccessException : SystemException
- {
- const int Result = unchecked ((int)0x80131500);
-
- // Constructors
- public UnauthorizedAccessException ()
- : base (Locale.GetText ("Access to the requested resource is not authorized."))
- {
- HResult = Result;
- }
-
- public UnauthorizedAccessException (string message)
- : base (message)
- {
- HResult = Result;
- }
-
- public UnauthorizedAccessException (string message, Exception inner)
- : base (message, inner)
- {
- HResult = Result;
- }
-
- protected UnauthorizedAccessException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.UnhandledExceptionEventArgs.cs
-//
-// Author:
-// Chris Hynes (chrish@assistedsolutions.com)
-//
-// (C) 2001 Chris Hynes
-//
-
-//
-// Copyright (C) 2004 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.Runtime.ConstrainedExecution;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [Serializable]
- [ComVisible (true)]
- public class UnhandledExceptionEventArgs : EventArgs
- {
- private object exception;
- private bool m_isTerminating;
-
- public UnhandledExceptionEventArgs (object exception, bool isTerminating)
- {
- this.exception = exception;
- this.m_isTerminating = isTerminating;
- }
-
- public object ExceptionObject {
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
- get {
- return exception;
- }
- }
-
- public bool IsTerminating {
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
- get {
- return m_isTerminating;
- }
- }
- }
-}
+++ /dev/null
-//
-// System.UnhandledExceptionEventHandler.cs
-//
-// Paolo Molaro
-//
-// (C) 2002 Ximian, Inc.
-//
-
-//
-// Copyright (C) 2004 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.
-//
-
-namespace System
-{
- [System.Runtime.InteropServices.ComVisible (true)]
- [Serializable]
- public delegate void UnhandledExceptionEventHandler (object sender, UnhandledExceptionEventArgs e);
-}
}
}
+#if !MONO
+ [Test]
+ public void SerializationCompatibilty ()
+ {
+ /* Serialization output from .net
+
+ var dict = new Dictionary<string, string> ();
+ dict.Add ("key", "value");
+
+ var dictSerializedStream = new MemoryStream ();
+ fmt.Serialize (dictSerializedStream, dict);
+
+ dictSerializedStream.Seek (0, SeekOrigin.Begin);
+ var res = Convert.ToBase64String (dictSerializedStream.ToArray (), Base64FormattingOptions.InsertLineBreaks);
+
+ */
+
+ var x = "AAEAAAD/////AQAAAAAAAAAEAQAAAOIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuRGljdGlv" +
+ "bmFyeWAyW1tTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJl" +
+ "PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5n" +
+ "LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRv" +
+ "a2VuPWI3N2E1YzU2MTkzNGUwODldXQQAAAAHVmVyc2lvbghDb21wYXJlcghIYXNoU2l6ZQ1LZXlW" +
+ "YWx1ZVBhaXJzAAMAAwiSAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkdlbmVyaWNFcXVhbGl0" +
+ "eUNvbXBhcmVyYDFbW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1" +
+ "bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCOYBU3lzdGVt" +
+ "LkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFsdWVQYWlyYDJbW1N5c3RlbS5TdHJpbmcsIG1zY29y" +
+ "bGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3" +
+ "YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAs" +
+ "IEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dW10BAAAA" +
+ "CQIAAAADAAAACQMAAAAEAgAAAJIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0Vx" +
+ "dWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAu" +
+ "MCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAA" +
+ "BwMAAAAAAQAAAAEAAAAD5AFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5LZXlWYWx1ZVBhaXJg" +
+ "MltbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0" +
+ "cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNj" +
+ "b3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1i" +
+ "NzdhNWM1NjE5MzRlMDg5XV0E/P///+QBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFs" +
+ "dWVQYWlyYDJbW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1" +
+ "cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5TdHJp" +
+ "bmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5" +
+ "VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAANrZXkFdmFsdWUBAQYFAAAAA2tleQYGAAAABXZh" +
+ "bHVlCw==";
+
+ var dict = new Dictionary<string, string> ();
+ dict.Add ("key", "value");
+
+ BinaryFormatter fmt = new BinaryFormatter ();
+ var mdict = (Dictionary<string, string>) fmt.Deserialize (new MemoryStream (Convert.FromBase64String (x)));
+
+ Assert.AreEqual (1, dict.Count);
+ Assert.AreEqual (dict.Comparer.GetType (), mdict.Comparer.GetType ());
+ }
+#endif
+
[Test]
public void ZeroCapacity ()
{
[TestFixture]
public class EqualityComparerTest {
+ enum E
+ {
+ A,
+ B
+ }
[Test]
public void Default_GetHashCode_Null ()
IEqualityComparer comparer = EqualityComparer<object>.Default;
Assert.IsTrue (comparer.Equals (null, null));
}
+
+ [Test]
+ public void EnumComparison ()
+ {
+ Assert.IsFalse (EqualityComparer<E>.Default.Equals (E.A, E.B));
+ Assert.IsFalse (EqualityComparer<object>.Default.Equals (E.A, E.B));
+ }
}
}
public class EncodingTest
{
[Test]
- [Category ("NotWorking")]
[ExpectedException (typeof (NotSupportedException))]
public void IsBrowserDisplay ()
{
}
[Test]
- [Category ("NotWorking")]
[ExpectedException (typeof (NotSupportedException))]
public void IsBrowserSave ()
{
}
[Test]
- [Category ("NotWorking")]
[ExpectedException (typeof (NotSupportedException))]
public void IsMailNewsDisplay ()
{
}
[Test]
- [Category ("NotWorking")]
[ExpectedException (typeof (NotSupportedException))]
public void IsMailNewsSave ()
{
{
Encoding.GetEncoding ((string) null);
}
+
+ [Test]
+ public void EncodingName ()
+ {
+ Assert.AreEqual ("Unicode (UTF-8)", Encoding.UTF8.EncodingName);
+ }
}
}
});
var onErrorTask = testTask.ContinueWith (x => continuationRan = true, TaskContinuationOptions.OnlyOnFaulted);
testTask.RunSynchronously ();
- onErrorTask.Wait (100);
+ onErrorTask.Wait (1000);
Assert.IsNotNull (e);
Assert.IsTrue (continuationRan);
}
public void Constructor_Defaults ()
{
Assert.IsFalse (mre.IsSet, "#1");
- Assert.AreEqual (10, mre.SpinCount, "#2");
+ Assert.AreEqual (Environment.ProcessorCount == 1 ? 1 : 10, mre.SpinCount, "#2");
}
[Test]
}
[Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
public void EndBeforeStart ()
{
- if (Environment.OSVersion.Platform != PlatformID.Unix)
- throw new ArgumentOutOfRangeException ();;
DateTime dateStart = new DateTime (2007,01,01);
DateTime dateEnd = new DateTime (2006,01,01);
TimeZoneInfo.TransitionTime daylightTransitionStart = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 03, 11);
TimeZoneInfo.TransitionTime daylightTransitionEnd = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 10, 11);
- TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (1,0,0), daylightTransitionStart, daylightTransitionEnd);
+ try {
+ TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (1,0,0), daylightTransitionStart, daylightTransitionEnd);
+ Assert.Fail ();
+ } catch (ArgumentException) {
+ }
}
[Test]
}
[Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
public void DeltaNotInSeconds ()
{
if (Environment.OSVersion.Platform != PlatformID.Unix)
DateTime dateEnd = new DateTime (2008,01,01);
TimeZoneInfo.TransitionTime daylightTransitionStart = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 03, 11);
TimeZoneInfo.TransitionTime daylightTransitionEnd = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 10, 11);
- TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (55), daylightTransitionStart, daylightTransitionEnd);
+ try {
+ TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (55), daylightTransitionStart, daylightTransitionEnd);
+ Assert.Fail ();
+ } catch (ArgumentException) {
+ }
}
}
../Mono.Security/Mono.Security.X509.Extensions/SubjectKeyIdentifierExtension.cs
Mono.Xml/SmallXmlParser.cs
Mono.Xml/SecurityParser.cs
-System/AccessViolationException.cs
System/ActivationContext.cs
System/AndroidPlatform.cs
System/AppDomain.cs
System/AppDomainInitializer.cs
System/AppDomainManager.cs
System/AppDomainSetup.cs
-System/AppDomainUnloadedException.cs
-System/ApplicationException.cs
-System/ApplicationId.cs
System/ApplicationIdentity.cs
System/ArgIterator.cs
-System/ArgumentException.cs
-System/ArgumentNullException.cs
-System/ArgumentOutOfRangeException.cs
-System/ArithmeticException.cs
System/Array.cs
-System/ArrayTypeMismatchException.cs
System/AssemblyLoadEventArgs.cs
System/AssemblyLoadEventHandler.cs
-System/AsyncCallback.cs
-System/AttributeTargets.cs
-System/BadImageFormatException.cs
-System/Buffer.cs
-System/CannotUnloadAppDomainException.cs
-System/CLSCompliantAttribute.cs
System/CStreamReader.cs
System/CStreamWriter.cs
System/Console.cs
System/Console.iOS.cs
-System/ConsoleCancelEventArgs.cs
-System/ConsoleCancelEventHandler.cs
-System/ConsoleColor.cs
System/ConsoleDriver.cs
-System/ConsoleKey.cs
-System/ConsoleKeyInfo.cs
-System/ConsoleModifiers.cs
-System/ConsoleSpecialKey.cs
-System/ContextBoundObject.cs
-System/ContextMarshalException.cs
-System/ContextStaticAttribute.cs
System/ControlCharacters.cs
System/CrossAppDomainDelegate.cs
-System/DataMisalignedException.cs
System/Delegate.cs
System/DelegateSerializationHolder.cs
-System/DivideByZeroException.cs
-System/DllNotFoundException.cs
System/DomainManagerInitializationFlags.cs
System/Double.cs
-System/DuplicateWaitObjectException.cs
System/EmptyArray.cs
-System/EntryPointNotFoundException.cs
System/Environment.cs
System/EnvironmentVariableTarget.cs
-System/EventArgs.cs
-System/EventHandler.cs
System/Exception.cs
-System/ExecutionEngineException.cs
-System/FieldAccessException.cs
-System/FlagsAttribute.cs
-System/FormatException.cs
-System/Funcs.cs
System/GC.cs
System/GCCollectionMode.cs
System/GCNotificationStatus.cs
System/Guid.cs
System/Guid.MonoTouch.cs
-System/IAppDomainSetup.cs
-System/IAsyncResult.cs
-System/IObservable.cs
-System/IObserver.cs
-System/ICloneable.cs
-System/IComparable.cs
-System/IEquatable.cs
System/IConsoleDriver.cs
-System/IConvertible.cs
-System/ICustomFormatter.cs
-System/IDisposable.cs
-System/IFormatProvider.cs
-System/IFormattable.cs
-System/IndexOutOfRangeException.cs
-System/InsufficientExecutionStackException.cs
-System/InsufficientMemoryException.cs
System/IntPtr.cs
-System/InvalidCastException.cs
-System/InvalidOperationException.cs
-System/InvalidProgramException.cs
-System/InvalidTimeZoneException.cs
-System/IProgress.cs
-System/IServiceProvider.cs
System/KnownTerminals.cs
-System/LoaderOptimization.cs
-System/LoaderOptimizationAttribute.cs
System/LocalDataStoreSlot.cs
System/MarshalByRefObject.cs
System/Math.cs
System/MonoListItem.cs
System/MonoType.cs
System/MonoTouchAOTHelper.cs
-System/MTAThreadAttribute.cs
System/MulticastDelegate.cs
-System/MulticastNotSupportedException.cs
-System/NonSerializedAttribute.cs
-System/NotFiniteNumberException.cs
-System/NotImplementedException.cs
-System/NotSupportedException.cs
System/NullConsoleDriver.cs
System/Nullable.cs
-System/NullReferenceException.cs
System/NumberFormatter.cs
System/Object.cs
-System/ObjectDisposedException.cs
-System/ObsoleteAttribute.cs
System/OperatingSystem.cs
-System/OperationCanceledException.cs
-System/OutOfMemoryException.cs
-System/OverflowException.cs
-System/ParamArrayAttribute.cs
System/PlatformID.cs
-System/PlatformNotSupportedException.cs
-System/RankException.cs
System/ResolveEventArgs.cs
System/ResolveEventHandler.cs
System/RuntimeArgumentHandle.cs
System/RuntimeMethodHandle.cs
System/RuntimeTypeHandle.cs
System/ModuleHandle.cs
-System/SerializableAttribute.cs
System/Single.cs
-System/StackOverflowException.cs
-System/STAThreadAttribute.cs
System/StringComparison.cs
-System/SystemException.cs
System/TermInfoBooleans.cs
System/TermInfoDriver.cs
System/TermInfoNumbers.cs
System/TermInfoReader.cs
System/TermInfoStrings.cs
-System/ThreadStaticAttribute.cs
System/TimeZone.cs
System/TimeZoneInfo.cs
-System/TimeZoneInfo.AdjustmentRule.cs
System/TimeZoneInfo.Android.cs
System/TimeZoneInfo.MonoTouch.cs
System/TimeZoneInfo.Serialization.cs
-System/TimeZoneInfo.TransitionTime.cs
-System/TimeZoneNotFoundException.cs
-System/TimeoutException.cs
../../build/common/MonoTODOAttribute.cs
System/TypeSpec.cs
-System/TypeAccessException.cs
System/TypeCode.cs
-System/TypeInitializationException.cs
-System/TypeLoadException.cs
-System/TypeUnloadedException.cs
System/UIntPtr.cs
-System/UnauthorizedAccessException.cs
-System/UnhandledExceptionEventArgs.cs
-System/UnhandledExceptionEventHandler.cs
System/ValueType.cs
System/Variant.cs
System/Void.cs
System/WeakReference.cs
System/WeakReference_T.cs
System/WindowsConsoleDriver.cs
-System/_AppDomain.cs
System/__ComObject.cs
System.Configuration.Assemblies/AssemblyHash.cs
System.Configuration.Assemblies/AssemblyHashAlgorithm.cs
System.Diagnostics.SymbolStore/SymDocumentType.cs
System.Diagnostics.SymbolStore/SymLanguageType.cs
System.Diagnostics.SymbolStore/SymLanguageVendor.cs
-System.Globalization/CalendarAlgorithmType.cs
-System.Globalization/CalendarWeekRule.cs
-System.Globalization/CompareInfo.cs
-System.Globalization/CompareOptions.cs
System.Globalization/CultureInfo.cs
-System.Globalization/CultureNotFoundException.cs
-System.Globalization/CultureTypes.cs
-System.Globalization/DateTimeFormatInfo.cs
-System.Globalization/DateTimeStyles.cs
-System.Globalization/DigitShapes.cs
-System.Globalization/GregorianCalendarTypes.cs
System.Globalization/IdnMapping.cs
-System.Globalization/NumberFormatInfo.cs
-System.Globalization/NumberStyles.cs
System.Globalization/RegionInfo.cs
System.Globalization/RegionInfo.MonoTouch.cs
-System.Globalization/SortVersion.cs
-System.Globalization/StringInfo.cs
-System.Globalization/TextElementEnumerator.cs
-System.Globalization/TextInfo.cs
-System.Globalization/UnicodeCategory.cs
System.IO/Directory.cs
System.IO/DirectoryInfo.cs
-System.IO/DirectoryNotFoundException.cs
System.IO/DriveInfo.cs
-System.IO/DriveNotFoundException.cs
System.IO/DriveType.cs
-System.IO/EndOfStreamException.cs
System.IO/File.cs
System.IO/FileAccess.cs
System.IO/FileAttributes.cs
System.IO/FileInfo.cs
-System.IO/FileLoadException.cs
System.IO/FileMode.cs
-System.IO/FileNotFoundException.cs
System.IO/FileOptions.cs
System.IO/FileShare.cs
System.IO/FileStream.cs
System.IO/FileStreamAsyncResult.cs
System.IO/FileSystemInfo.cs
System.IO/HGlobalUnmanagedMemoryStream.cs
-System.IO/IOException.cs
System.IO/LogcatTextWriter.cs
System.IO/MonoIO.cs
System.IO/MonoIOError.cs
System.IO/MonoFileType.cs
System.IO/MonoIOStat.cs
System.IO/Path.cs
-System.IO/PathTooLongException.cs
System.IO/SearchOption.cs
System.IO/SearchPattern.cs
System.IO/SeekOrigin.cs
System.Runtime/MemoryFailPoint.cs
System.Runtime.CompilerServices/ConditionalWeakTable.cs
System.Runtime.CompilerServices/RuntimeHelpers.cs
-System.Runtime.ConstrainedExecution/CriticialFinalizerObject.cs
-System.Runtime.ConstrainedExecution/CER.cs
-System.Runtime.ConstrainedExecution/Consistency.cs
-System.Runtime.ConstrainedExecution/PrePrepareMethodAttribute.cs
-System.Runtime.ConstrainedExecution/ReliabilityContractAttribute.cs
System.Runtime.Hosting/ActivationArguments.cs
System.Runtime.Hosting/ApplicationActivator.cs
System.Runtime.InteropServices/_Activator.cs
System.Runtime.InteropServices/VarEnum.cs
System.Runtime.InteropServices/VARFLAGS.cs
System.Runtime.InteropServices/VariantWrapper.cs
-System.Runtime.InteropServices.ComTypes/BINDPTR.cs
-System.Runtime.InteropServices.ComTypes/BIND_OPTS.cs
-System.Runtime.InteropServices.ComTypes/CALLCONV.cs
-System.Runtime.InteropServices.ComTypes/CONNECTDATA.cs
-System.Runtime.InteropServices.ComTypes/DESCKIND.cs
-System.Runtime.InteropServices.ComTypes/DISPPARAMS.cs
-System.Runtime.InteropServices.ComTypes/ELEMDESC.cs
-System.Runtime.InteropServices.ComTypes/EXCEPINFO.cs
-System.Runtime.InteropServices.ComTypes/FILETIME.cs
-System.Runtime.InteropServices.ComTypes/FUNCDESC.cs
-System.Runtime.InteropServices.ComTypes/FUNCFLAGS.cs
-System.Runtime.InteropServices.ComTypes/FUNCKIND.cs
-System.Runtime.InteropServices.ComTypes/IBindCtx.cs
-System.Runtime.InteropServices.ComTypes/IConnectionPoint.cs
-System.Runtime.InteropServices.ComTypes/IConnectionPointContainer.cs
-System.Runtime.InteropServices.ComTypes/IDLDESC.cs
-System.Runtime.InteropServices.ComTypes/IDLFLAG.cs
-System.Runtime.InteropServices.ComTypes/IEnumConnectionPoints.cs
-System.Runtime.InteropServices.ComTypes/IEnumConnections.cs
-System.Runtime.InteropServices.ComTypes/IEnumMoniker.cs
-System.Runtime.InteropServices.ComTypes/IEnumString.cs
-System.Runtime.InteropServices.ComTypes/IEnumVARIANT.cs
-System.Runtime.InteropServices.ComTypes/IMoniker.cs
-System.Runtime.InteropServices.ComTypes/IMPLTYPEFLAGS.cs
-System.Runtime.InteropServices.ComTypes/INVOKEKIND.cs
-System.Runtime.InteropServices.ComTypes/IPersistFile.cs
-System.Runtime.InteropServices.ComTypes/IRunningObjectTable.cs
-System.Runtime.InteropServices.ComTypes/IStream.cs
-System.Runtime.InteropServices.ComTypes/ITypeComp.cs
-System.Runtime.InteropServices.ComTypes/ITypeInfo.cs
-System.Runtime.InteropServices.ComTypes/ITypeInfo2.cs
-System.Runtime.InteropServices.ComTypes/ITypeLib.cs
-System.Runtime.InteropServices.ComTypes/ITypeLib2.cs
-System.Runtime.InteropServices.ComTypes/LIBFLAGS.cs
-System.Runtime.InteropServices.ComTypes/PARAMDESC.cs
-System.Runtime.InteropServices.ComTypes/PARAMFLAG.cs
-System.Runtime.InteropServices.ComTypes/STATSTG.cs
-System.Runtime.InteropServices.ComTypes/SYSKIND.cs
-System.Runtime.InteropServices.ComTypes/TYPEATTR.cs
-System.Runtime.InteropServices.ComTypes/TYPEDESC.cs
-System.Runtime.InteropServices.ComTypes/TYPEFLAGS.cs
-System.Runtime.InteropServices.ComTypes/TYPEKIND.cs
-System.Runtime.InteropServices.ComTypes/TYPELIBATTR.cs
-System.Runtime.InteropServices.ComTypes/VARDESC.cs
-System.Runtime.InteropServices.ComTypes/VARFLAGS.cs
-System.Runtime.InteropServices.ComTypes/VARKIND.cs
-System.Runtime.InteropServices.Expando/IExpando.cs
+
System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs
System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.cs
System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs
System.Threading/TimerCallback.cs
System.Threading/Volatile.cs
System.Threading/WaitHandle.cs
-System/Action.cs
-System/Comparison.cs
-System/Converter.cs
-System/Predicate.cs
-System.Collections.Generic/Comparer.cs
-System.Collections.Generic/EqualityComparer.cs
System.Threading.Tasks/DecoupledTask.cs
../Mono.Parallel/Mono.Threading/AtomicBoolean.cs
ReferenceSources/ExecutionContext.cs
ReferenceSources/HashHelpers.cs
ReferenceSources/ParseNumbers.cs
-ReferenceSources/TimeZoneInfoOptions.cs
ReferenceSources/AppDomain.cs
ReferenceSources/CLRConfig.cs
ReferenceSources/JitHelpers.cs
ReferenceSources/MonoRuntimeWorkItem.cs
ReferenceSources/MethodBase.cs
ReferenceSources/RuntimeHandles.cs
+ReferenceSources/CompareInfo.cs
+ReferenceSources/TypeBuilderInstantiation.cs
+ReferenceSources/Buffer.cs
+ReferenceSources/TextInfo.cs
../../../external/referencesource/mscorlib/system/__filters.cs
../../../external/referencesource/mscorlib/system/__hresults.cs
+../../../external/referencesource/mscorlib/system/accessviolationexception.cs
+../../../external/referencesource/mscorlib/system/action.cs
../../../external/referencesource/mscorlib/system/activator.cs
../../../external/referencesource/mscorlib/system/AggregateException.cs
+../../../external/referencesource/mscorlib/system/appdomainattributes.cs
+../../../external/referencesource/mscorlib/system/appdomainunloadedexception.cs
+../../../external/referencesource/mscorlib/system/applicationexception.cs
+../../../external/referencesource/mscorlib/system/applicationid.cs
+../../../external/referencesource/mscorlib/system/argumentexception.cs
+../../../external/referencesource/mscorlib/system/argumentnullexception.cs
+../../../external/referencesource/mscorlib/system/argumentoutofrangeexception.cs
+../../../external/referencesource/mscorlib/system/arithmeticexception.cs
../../../external/referencesource/mscorlib/system/arraysegment.cs
+../../../external/referencesource/mscorlib/system/arraytypemismatchexception.cs
+../../../external/referencesource/mscorlib/system/asynccallback.cs
../../../external/referencesource/mscorlib/system/attribute.cs
+../../../external/referencesource/mscorlib/system/attributetargets.cs
../../../external/referencesource/mscorlib/system/attributeusageattribute.cs
+../../../external/referencesource/mscorlib/system/badimageformatexception.cs
../../../external/referencesource/mscorlib/system/bitconverter.cs
../../../external/referencesource/mscorlib/system/boolean.cs
+../../../external/referencesource/mscorlib/system/buffer.cs
../../../external/referencesource/mscorlib/system/byte.cs
+../../../external/referencesource/mscorlib/system/cannotunloadappdomainexception.cs
../../../external/referencesource/mscorlib/system/char.cs
../../../external/referencesource/mscorlib/system/charenumerator.cs
+../../../external/referencesource/mscorlib/system/consolecanceleventargs.cs
+../../../external/referencesource/mscorlib/system/consolecolor.cs
+../../../external/referencesource/mscorlib/system/consolekey.cs
+../../../external/referencesource/mscorlib/system/consolekeyinfo.cs
+../../../external/referencesource/mscorlib/system/consolemodifiers.cs
+../../../external/referencesource/mscorlib/system/consolespecialkey.cs
+../../../external/referencesource/mscorlib/system/contextboundobject.cs
+../../../external/referencesource/mscorlib/system/contextstaticattribute.cs
+../../../external/referencesource/mscorlib/system/clscompliantattribute.cs
+../../../external/referencesource/mscorlib/system/contextmarshalexception.cs
../../../external/referencesource/mscorlib/system/convert.cs
+../../../external/referencesource/mscorlib/system/datamisalignedexception.cs
../../../external/referencesource/mscorlib/system/datetime.cs
../../../external/referencesource/mscorlib/system/datetimekind.cs
../../../external/referencesource/mscorlib/system/datetimeoffset.cs
../../../external/referencesource/mscorlib/system/decimal.cs
../../../external/referencesource/mscorlib/system/defaultbinder.cs
../../../external/referencesource/mscorlib/system/dbnull.cs
+../../../external/referencesource/mscorlib/system/dividebyzeroexception.cs
+../../../external/referencesource/mscorlib/system/dllnotfoundexception.cs
+../../../external/referencesource/mscorlib/system/duplicatewaitobjectexception.cs
../../../external/referencesource/mscorlib/system/empty.cs
../../../external/referencesource/mscorlib/system/enum.cs
+../../../external/referencesource/mscorlib/system/entrypointnotfoundexception.cs
+../../../external/referencesource/mscorlib/system/eventargs.cs
+../../../external/referencesource/mscorlib/system/eventhandler.cs
+../../../external/referencesource/mscorlib/system/executionengineexception.cs
+../../../external/referencesource/mscorlib/system/fieldaccessexception.cs
+../../../external/referencesource/mscorlib/system/flagsattribute.cs
+../../../external/referencesource/mscorlib/system/formatexception.cs
../../../external/referencesource/mscorlib/system/guid.cs
+../../../external/referencesource/mscorlib/system/iappdomain.cs
+../../../external/referencesource/mscorlib/system/iappdomainsetup.cs
+../../../external/referencesource/mscorlib/system/iasyncresult.cs
+../../../external/referencesource/mscorlib/system/icloneable.cs
+../../../external/referencesource/mscorlib/system/icomparable.cs
+../../../external/referencesource/mscorlib/system/iconvertible.cs
+../../../external/referencesource/mscorlib/system/icustomformatter.cs
+../../../external/referencesource/mscorlib/system/idisposable.cs
+../../../external/referencesource/mscorlib/system/iequatable.cs
+../../../external/referencesource/mscorlib/system/iformatprovider.cs
+../../../external/referencesource/mscorlib/system/iformattable.cs
+../../../external/referencesource/mscorlib/system/invalidcastexception.cs
+../../../external/referencesource/mscorlib/system/indexoutofrangeexception.cs
+../../../external/referencesource/mscorlib/system/invalidoperationexception.cs
+../../../external/referencesource/mscorlib/system/invalidprogramexception.cs
+../../../external/referencesource/mscorlib/system/insufficientexecutionstackexception.cs
+../../../external/referencesource/mscorlib/system/insufficientmemoryexception.cs
../../../external/referencesource/mscorlib/system/int16.cs
../../../external/referencesource/mscorlib/system/int32.cs
../../../external/referencesource/mscorlib/system/int64.cs
+../../../external/referencesource/mscorlib/system/iobservable.cs
+../../../external/referencesource/mscorlib/system/iobserver.cs
+../../../external/referencesource/mscorlib/system/iprogress.cs
+../../../external/referencesource/mscorlib/system/iserviceobjectprovider.cs
+../../../external/referencesource/mscorlib/system/invalidtimezoneexception.cs
../../../external/referencesource/mscorlib/system/Lazy.cs
../../../external/referencesource/mscorlib/system/memberaccessexception.cs
../../../external/referencesource/mscorlib/system/methodaccessexception.cs
../../../external/referencesource/mscorlib/system/missingfieldexception.cs
../../../external/referencesource/mscorlib/system/missingmemberexception.cs
../../../external/referencesource/mscorlib/system/missingmethodexception.cs
+../../../external/referencesource/mscorlib/system/multicastnotsupportedexception.cs
+../../../external/referencesource/mscorlib/system/nonserializedattribute.cs
+../../../external/referencesource/mscorlib/system/notfinitenumberexception.cs
+../../../external/referencesource/mscorlib/system/notimplementedexception.cs
+../../../external/referencesource/mscorlib/system/notsupportedexception.cs
+../../../external/referencesource/mscorlib/system/nullreferenceexception.cs
../../../external/referencesource/mscorlib/system/number.cs
+../../../external/referencesource/mscorlib/system/objectdisposedexception.cs
+../../../external/referencesource/mscorlib/system/obsoleteattribute.cs
+../../../external/referencesource/mscorlib/system/operationcanceledexception.cs
+../../../external/referencesource/mscorlib/system/outofmemoryexception.cs
+../../../external/referencesource/mscorlib/system/overflowexception.cs
+../../../external/referencesource/mscorlib/system/paramarrayattribute.cs
+../../../external/referencesource/mscorlib/system/platformnotsupportedexception.cs
../../../external/referencesource/mscorlib/system/progress.cs
../../../external/referencesource/mscorlib/system/random.cs
+../../../external/referencesource/mscorlib/system/rankexception.cs
../../../external/referencesource/mscorlib/system/resid.cs
+../../../external/referencesource/mscorlib/system/rttype.cs
../../../external/referencesource/mscorlib/system/sbyte.cs
+../../../external/referencesource/mscorlib/system/serializableattribute.cs
+../../../external/referencesource/mscorlib/system/stackoverflowexception.cs
../../../external/referencesource/mscorlib/system/string.cs
../../../external/referencesource/mscorlib/system/stringcomparer.cs
../../../external/referencesource/mscorlib/system/stringfreezingattribute.cs
-../../../external/referencesource/mscorlib/system/rttype.cs
+../../../external/referencesource/mscorlib/system/systemexception.cs
+../../../external/referencesource/mscorlib/system/timeoutexception.cs
../../../external/referencesource/mscorlib/system/timespan.cs
+../../../external/referencesource/mscorlib/system/threadattributes.cs
+../../../external/referencesource/mscorlib/system/threadstaticattribute.cs
../../../external/referencesource/mscorlib/system/throwhelper.cs
+../../../external/referencesource/mscorlib/system/timezoneinfo.cs
+../../../external/referencesource/mscorlib/system/timezonenotfoundexception.cs
../../../external/referencesource/mscorlib/system/tuple.cs
../../../external/referencesource/mscorlib/system/type.cs
+../../../external/referencesource/mscorlib/system/typeaccessexception.cs
+../../../external/referencesource/mscorlib/system/typeinitializationexception.cs
+../../../external/referencesource/mscorlib/system/typeloadexception.cs
../../../external/referencesource/mscorlib/system/typedreference.cs
+../../../external/referencesource/mscorlib/system/typeunloadedexception.cs
../../../external/referencesource/mscorlib/system/uint16.cs
../../../external/referencesource/mscorlib/system/uint32.cs
../../../external/referencesource/mscorlib/system/uint64.cs
+../../../external/referencesource/mscorlib/system/unauthorizedaccessexception.cs
+../../../external/referencesource/mscorlib/system/unhandledexceptioneventargs.cs
+../../../external/referencesource/mscorlib/system/unhandledexceptioneventhandler.cs
../../../external/referencesource/mscorlib/system/unityserializationholder.cs
../../../external/referencesource/mscorlib/system/unsafecharbuffer.cs
../../../external/referencesource/mscorlib/system/version.cs
../../../external/referencesource/mscorlib/system/collections/stack.cs
../../../external/referencesource/mscorlib/system/collections/structuralcomparisons.cs
+../../../external/referencesource/mscorlib/system/collections/generic/comparer.cs
../../../external/referencesource/mscorlib/system/collections/generic/debugview.cs
../../../external/referencesource/mscorlib/system/collections/generic/dictionary.cs
+../../../external/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs
../../../external/referencesource/mscorlib/system/collections/generic/icollection.cs
../../../external/referencesource/mscorlib/system/collections/generic/icomparer.cs
../../../external/referencesource/mscorlib/system/collections/generic/idictionary.cs
../../../external/referencesource/mscorlib/system/globalization/bidicategory.cs
../../../external/referencesource/mscorlib/system/globalization/calendar.cs
+../../../external/referencesource/mscorlib/system/globalization/calendaralgorithmtype.cs
../../../external/referencesource/mscorlib/system/globalization/calendardata.cs
+../../../external/referencesource/mscorlib/system/globalization/calendarweekrule.cs
../../../external/referencesource/mscorlib/system/globalization/charunicodeinfo.cs
../../../external/referencesource/mscorlib/system/globalization/chineselunisolarcalendar.cs
+../../../external/referencesource/mscorlib/system/globalization/compareinfo.cs
+../../../external/referencesource/mscorlib/system/globalization/culturenotfoundexception.cs
+../../../external/referencesource/mscorlib/system/globalization/culturetypes.cs
../../../external/referencesource/mscorlib/system/globalization/daylighttime.cs
../../../external/referencesource/mscorlib/system/globalization/datetimeformat.cs
../../../external/referencesource/mscorlib/system/globalization/datetimeformatinfo.cs
../../../external/referencesource/mscorlib/system/globalization/datetimeformatinfoscanner.cs
../../../external/referencesource/mscorlib/system/globalization/datetimeparse.cs
+../../../external/referencesource/mscorlib/system/globalization/datetimestyles.cs
+../../../external/referencesource/mscorlib/system/globalization/daylighttime.cs
+../../../external/referencesource/mscorlib/system/globalization/digitshapes.cs
../../../external/referencesource/mscorlib/system/globalization/eastasianlunisolarcalendar.cs
../../../external/referencesource/mscorlib/system/globalization/globalizationassembly.cs
../../../external/referencesource/mscorlib/system/globalization/gregoriancalendar.cs
../../../external/referencesource/mscorlib/system/globalization/gregoriancalendarhelper.cs
+../../../external/referencesource/mscorlib/system/globalization/gregoriancalendartypes.cs
../../../external/referencesource/mscorlib/system/globalization/hebrewcalendar.cs
../../../external/referencesource/mscorlib/system/globalization/hebrewnumber.cs
../../../external/referencesource/mscorlib/system/globalization/hijricalendar.cs
../../../external/referencesource/mscorlib/system/globalization/juliancalendar.cs
../../../external/referencesource/mscorlib/system/globalization/koreancalendar.cs
../../../external/referencesource/mscorlib/system/globalization/koreanlunisolarcalendar.cs
+../../../external/referencesource/mscorlib/system/globalization/numberstyles.cs
+../../../external/referencesource/mscorlib/system/globalization/numberformatinfo.cs
../../../external/referencesource/mscorlib/system/globalization/Persiancalendar.cs
+../../../external/referencesource/mscorlib/system/globalization/sortversion.cs
+../../../external/referencesource/mscorlib/system/globalization/stringinfo.cs
../../../external/referencesource/mscorlib/system/globalization/taiwancalendar.cs
../../../external/referencesource/mscorlib/system/globalization/taiwanlunisolarcalendar.cs
+../../../external/referencesource/mscorlib/system/globalization/textelementenumerator.cs
../../../external/referencesource/mscorlib/system/globalization/timespanformat.cs
../../../external/referencesource/mscorlib/system/globalization/timespanparse.cs
+../../../external/referencesource/mscorlib/system/globalization/textinfo.cs
../../../external/referencesource/mscorlib/system/globalization/thaibuddhistcalendar.cs
../../../external/referencesource/mscorlib/system/globalization/umalquracalendar.cs
+../../../external/referencesource/mscorlib/system/globalization/unicodecategory.cs
../../../external/referencesource/mscorlib/system/io/__error.cs
+../../../external/referencesource/mscorlib/system/io/__hresults.cs
../../../external/referencesource/mscorlib/system/io/binaryreader.cs
../../../external/referencesource/mscorlib/system/io/binarywriter.cs
../../../external/referencesource/mscorlib/system/io/bufferedstream.cs
+../../../external/referencesource/mscorlib/system/io/directorynotfoundexception.cs
+../../../external/referencesource/mscorlib/system/io/drivenotfoundexception.cs
+../../../external/referencesource/mscorlib/system/io/endofstreamexception.cs
+../../../external/referencesource/mscorlib/system/io/ioexception.cs
+../../../external/referencesource/mscorlib/system/io/fileloadexception.cs
+../../../external/referencesource/mscorlib/system/io/filenotfoundexception.cs
../../../external/referencesource/mscorlib/system/io/memorystream.cs
+../../../external/referencesource/mscorlib/system/io/pathtoolongexception.cs
../../../external/referencesource/mscorlib/system/io/pinnedbuffermemorystream.cs
../../../external/referencesource/mscorlib/system/io/stream.cs
../../../external/referencesource/mscorlib/system/io/streamreader.cs
../../../external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionnotification.cs
../../../external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ibindctx.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/iconnectionpoint.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/iconnectionpointcontainer.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumconnectionpoints.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumconnections.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumerable.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumerator.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienummoniker.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumstring.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ienumvariant.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/iexpando.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/imoniker.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ipersistfile.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/ireflect.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/irunningobjecttable.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/istream.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/itypecomp.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/itypeinfo.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/itypeinfo2.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/itypelib.cs
+../../../external/referencesource/mscorlib/system/runtime/interopservices/ComTypes/itypelib2.cs
+
+../../../external/referencesource/mscorlib/system/runtime/interopservices/expando/iexpando.cs
+
+../../../external/referencesource/mscorlib//system/runtime/reliability/criticalfinalizerobject.cs
+../../../external/referencesource/mscorlib//system/runtime/reliability/prepreparemethodattribute.cs
+../../../external/referencesource/mscorlib//system/runtime/reliability/reliabilitycontractattribute.cs
+
../../../external/referencesource/mscorlib/system/runtime/versioning/binarycompatibility.cs
../../../external/referencesource/mscorlib/system/runtime/versioning/multitargetinghelpers.cs
../../../external/referencesource/mscorlib/system/runtime/versioning/targetframeworkid.cs
../../../external/referencesource/mscorlib/system/runtime/compilerservices/unsafevaluetypeattribute.cs
../../../external/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs
+../../../external/referencesource/mscorlib/system/security/util/hex.cs
+
../../../external/referencesource/mscorlib/system/text/asciiencoding.cs
../../../external/referencesource/mscorlib/system/text/codepageencoding.cs
../../../external/referencesource/mscorlib/system/text/decoderbestfitfallback.cs
all-local:
+PROFILE_DIR=$(DESTDIR)$(mono_libdir)/mono/
+
install-local:
- $(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
- $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.0/* $(DESTDIR)$(LIBRARY_INSTALL_DIR)
+ $(MKINSTALLDIRS) $(PROFILE_DIR)/2.0
+ $(MKINSTALLDIRS) $(PROFILE_DIR)/3.5
+ $(MKINSTALLDIRS) $(PROFILE_DIR)/4.0
+ $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v2.0/* $(PROFILE_DIR)/2.0
+ $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v3.5/* $(PROFILE_DIR)/3.5
+ $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.0/* $(PROFILE_DIR)/4.0
-DISTFILES = $(wildcard ../../../external/binary-reference-assemblies/v4.0/*) Makefile
+DISTFILES = $(wildcard ../../../external/binary-reference-assemblies/v4.0/*) $(wildcard ../../../external/binary-reference-assemblies/v3.5/*) $(wildcard ../../../external/binary-reference-assemblies/v2.0/*) Makefile
dist-local: dist-default
--- /dev/null
+// CS9030: The left-hand side of an assignment cannot contain a null propagating operator
+// Line: 11
+
+using System;
+
+class MainClass
+{
+ public static void Main ()
+ {
+ System.AppDomain a = null;
+ a?.AssemblyLoad += (sender, args) => Console.Write (args);
+ }
+}
\ No newline at end of file
fc.ParametersBlock = Block;
var da_ontrue = fc.DefiniteAssignmentOnTrue;
var da_onfalse = fc.DefiniteAssignmentOnFalse;
+ var prev_tf = fc.TryFinally;
fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = null;
+ fc.TryFinally = null;
block.FlowAnalysis (fc);
fc.ParametersBlock = prev_pb;
fc.DefiniteAssignment = das;
fc.DefiniteAssignmentOnTrue = da_ontrue;
fc.DefiniteAssignmentOnFalse = da_onfalse;
+ fc.TryFinally = prev_tf;
}
public override void MarkReachable (Reachability rc)
var delegate_method = method.Spec;
if (storey != null && storey.MemberName.IsGeneric) {
- TypeSpec t = storey.Instance.Type;
-
//
// Mutate anonymous method instance type if we are in nested
// hoisted generic anonymous method storey
//
if (ec.IsAnonymousStoreyMutateRequired) {
- t = storey.Mutator.Mutate (t);
+ ec.Emit (OpCodes.Ldftn, delegate_method);
+ } else {
+ TypeSpec t = storey.Instance.Type;
+ ec.Emit (OpCodes.Ldftn, TypeBuilder.GetMethod (t.GetMetaInfo (), (MethodInfo) delegate_method.GetMetaInfo ()));
}
-
- ec.Emit (OpCodes.Ldftn, TypeBuilder.GetMethod (t.GetMetaInfo (), (MethodInfo) delegate_method.GetMetaInfo ()));
} else {
if (delegate_method.IsGeneric) {
TypeParameterSpec[] tparams;
// protected type then the type is accessible
//
while (mc.Parent != null && mc.Parent.PartialContainer != null) {
- if (mc.Parent.PartialContainer.IsBaseTypeDefinition (p_parent))
+ if (mc.Parent.PartialContainer.IsBaseTypeDefinition (p_parent)) {
same_access_restrictions = true;
+ break;
+ }
+
mc = mc.Parent;
}
}
same_access_restrictions = p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly);
else if (al == (Modifiers.PROTECTED | Modifiers.INTERNAL))
same_access_restrictions = mc.Parent.PartialContainer.IsBaseTypeDefinition (p_parent) && p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly);
- else
+ else if (al == Modifiers.PROTECTED)
goto case Modifiers.PROTECTED;
+ else if (al == Modifiers.PRIVATE) {
+ if (p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly)) {
+ same_access_restrictions = true;
+ } else {
+ goto case Modifiers.PROTECTED;
+ }
+ }
break;
if (!TypeSpecComparer.Override.IsEqual (candidate.Parameters, method.Parameters))
continue;
+ if (!AParametersCollection.HasSameParameterDefaults (candidate.Parameters, method.Parameters))
+ continue;
+
if (!copied) {
copied = true;
members = new List<MemberSpec> (members);
rc.Report.Error (8072, loc, "An expression tree cannot contain a null propagating operator");
}
+ protected void Error_NullPropagatingLValue (ResolveContext rc)
+ {
+ rc.Report.Error (-1030, loc, "The left-hand side of an assignment cannot contain a null propagating operator");
+ }
+
public virtual void FlowAnalysis (FlowAnalysisContext fc)
{
}
return mc.LookupNamespaceOrType (Name, Arity, LookupMode.Probing, loc) != null;
}
+ public bool IsPossibleType (IMemberContext mc)
+ {
+ return mc.LookupNamespaceOrType (Name, Arity, LookupMode.Probing, loc) is TypeExpr;
+ }
+
public override Expression LookupNameExpression (ResolveContext rc, MemberLookupRestrictions restrictions)
{
int lookup_arity = Arity;
var cand_param = candidate_pd.FixedParameters [j];
var best_param = best_pd.FixedParameters [j];
+ if (cand_param.HasDefaultValue != best_param.HasDefaultValue)
+ return cand_param.HasDefaultValue;
+
if (candidate_pd.Count == best_pd.Count) {
//
// LAMESPEC:
// void Foo (int i = 0) is better than void Foo (params int[]) for Foo ()
// void Foo (string[] s, string value = null) is better than Foo (string s, params string[]) for Foo (null) or Foo ()
//
- if (cand_param.HasDefaultValue != best_param.HasDefaultValue)
- return cand_param.HasDefaultValue;
if (cand_param.HasDefaultValue) {
++j;
// void Foo (string s, int i = 0) <-> Foo (string s, byte i = 0)
// void Foo (string s, params int[]) <-> Foo (string s, params byte[])
//
- if (cand_param.HasDefaultValue && best_param.HasDefaultValue)
- return false;
+ return false;
}
break;
//
// LAMESPEC: No idea what the exact rules are for System.Reflection.Missing.Value instead of null
//
- if (e == EmptyExpression.MissingValue && ptype.BuiltinType == BuiltinTypeSpec.Type.Object || ptype.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
+ if (e == EmptyExpression.MissingValue && (ptype.BuiltinType == BuiltinTypeSpec.Type.Object || ptype.BuiltinType == BuiltinTypeSpec.Type.Dynamic)) {
e = new MemberAccess (new MemberAccess (new MemberAccess (
new QualifiedAliasMember (QualifiedAliasMember.GlobalAlias, "System", loc), "Reflection", loc), "Missing", loc), "Value", loc);
} else if (e is Constant) {
Arguments candidate_args = args;
bool error_mode = false;
MemberSpec invocable_member = null;
+ int applicable_candidates = 0;
while (true) {
best_candidate = null;
if (candidate_rate < 0)
return null;
+ applicable_candidates = 1;
if ((restrictions & Restrictions.GetEnumeratorLookup) != 0 && candidate_args.Count != 0) {
// Only parameterless methods are considered
} else {
continue;
}
+ ++applicable_candidates;
bool is_better;
if (best_candidate.DeclaringType.IsInterface && member.DeclaringType.ImplementsInterface (best_candidate.DeclaringType, false)) {
//
//
// Check type constraints only when explicit type arguments are used
//
- if (best_candidate.IsGeneric && type_arguments != null) {
+ if (applicable_candidates == 1 && best_candidate.IsGeneric && type_arguments != null) {
MethodSpec bc = best_candidate as MethodSpec;
if (bc != null && TypeParameterSpec.HasAnyTypeParameterConstrained (bc.GenericDefinition)) {
ConstraintChecker cc = new ConstraintChecker (rc);
public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
{
if (ConditionalAccess)
- throw new NotSupportedException ("null propagating operator assignment");
+ Error_NullPropagatingLValue (ec);
if (spec is FixedFieldSpec) {
// It could be much better error message but we want to be error compatible
public override Expression DoResolveLValue (ResolveContext rc, Expression right_side)
{
if (ConditionalAccess)
- throw new NotSupportedException ("null propagating operator assignment");
+ Error_NullPropagatingLValue (rc);
if (right_side == EmptyExpression.OutAccess) {
// TODO: best_candidate can be null at this point
return null;
}
+ if (ConditionalAccess)
+ Error_NullPropagatingLValue (ec);
+
op = CandidateToBaseOverride (ec, op);
return this;
}
{
return visitor.Visit (this);
}
+
+ public override bool HasConditionalAccess ()
+ {
+ return expr.HasConditionalAccess ();
+ }
}
//
public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
{
if (ConditionalAccess)
- throw new NotSupportedException ("null propagating operator assignment");
+ Error_NullPropagatingLValue (ec);
return DoResolve (ec);
}
//
public class StackAlloc : Expression {
TypeSpec otype;
- Expression t;
+ Expression texpr;
Expression count;
public StackAlloc (Expression type, Expression count, Location l)
{
- t = type;
+ texpr = type;
this.count = count;
loc = l;
}
public Expression TypeExpression {
get {
- return this.t;
+ return texpr;
}
}
ec.Report.Error (255, loc, "Cannot use stackalloc in finally or catch");
}
- otype = t.ResolveAsType (ec);
+ otype = texpr.ResolveAsType (ec);
if (otype == null)
return null;
{
StackAlloc target = (StackAlloc) t;
target.count = count.Clone (clonectx);
- target.t = t.Clone (clonectx);
+ target.texpr = texpr.Clone (clonectx);
}
public override object Accept (StructuralVisitor visitor)
public TypeInfo[] SubStructInfo;
readonly StructInfo struct_info;
- private static Dictionary<TypeSpec, TypeInfo> type_hash;
static readonly TypeInfo simple_type = new TypeInfo (1);
-
+
static TypeInfo ()
{
Reset ();
public static void Reset ()
{
- type_hash = new Dictionary<TypeSpec, TypeInfo> ();
StructInfo.field_type_hash = new Dictionary<TypeSpec, StructInfo> ();
}
return simple_type;
TypeInfo info;
- if (type_hash.TryGetValue (type, out info))
- return info;
+ Dictionary<TypeSpec, TypeInfo> type_hash;
+ if (type.BuiltinType > 0) {
+ // Don't cache built-in types, they are null in most cases except for
+ // corlib compilation when we need to distinguish between declaration
+ // and referencing
+ type_hash = null;
+ } else {
+ type_hash = context.Module.TypeInfoCache;
+ if (type_hash.TryGetValue (type, out info))
+ return info;
+ }
var struct_info = StructInfo.GetStructInfo (type, context);
if (struct_info != null) {
info = simple_type;
}
- type_hash.Add (type, info);
+ if (type_hash != null)
+ type_hash.Add (type, info);
+
return info;
}
public static StructInfo GetStructInfo (TypeSpec type, IMemberContext context)
{
- if (type.BuiltinType > 0)
+ if (type.BuiltinType > 0 && type != context.CurrentType)
return null;
StructInfo info;
//
static bool AddInterfaceMember (MemberSpec member, ref IList<MemberSpec> existing)
{
- var member_param = member is IParametersMember ? ((IParametersMember) member).Parameters : ParametersCompiled.EmptyReadOnlyParameters;
+ var member_param = member is IParametersMember ? ((IParametersMember) member).Parameters : null;
//
// interface IA : IB { int Prop { set; } }
if (entry.Arity != member.Arity)
continue;
- if (entry is IParametersMember) {
- var entry_param = ((IParametersMember) entry).Parameters;
- if (!TypeSpecComparer.Override.IsEqual (entry_param, member_param))
- continue;
+ AParametersCollection entry_param = null;
+ if (member_param != null) {
+ var entry_pm = entry as IParametersMember;
+ if (entry_pm != null) {
+ entry_param = entry_pm.Parameters;
+ if (!TypeSpecComparer.Override.IsEqual (entry_param, member_param))
+ continue;
+ }
}
if (member.DeclaringType.ImplementsInterface (entry.DeclaringType, false)) {
continue;
}
- if ((entry.DeclaringType == member.DeclaringType && entry.IsAccessor == member.IsAccessor) ||
- entry.DeclaringType.ImplementsInterface (member.DeclaringType, false))
+ if ((entry.DeclaringType == member.DeclaringType && entry.IsAccessor == member.IsAccessor))
+ return false;
+
+ if (entry.DeclaringType.ImplementsInterface (member.DeclaringType, false) && AParametersCollection.HasSameParameterDefaults (entry_param, member_param))
return false;
}
readonly Dictionary<TypeSpec, ReferenceContainer> reference_types;
readonly Dictionary<TypeSpec, MethodSpec> attrs_cache;
readonly Dictionary<TypeSpec, AwaiterDefinition> awaiters;
+ readonly Dictionary<TypeSpec, TypeInfo> type_info_cache;
AssemblyDefinition assembly;
readonly CompilerContext context;
reference_types = new Dictionary<TypeSpec, ReferenceContainer> ();
attrs_cache = new Dictionary<TypeSpec, MethodSpec> ();
awaiters = new Dictionary<TypeSpec, AwaiterDefinition> ();
+ type_info_cache = new Dictionary<TypeSpec, TypeInfo> ();
}
#region Properties
}
}
+ internal Dictionary<TypeSpec, TypeInfo> TypeInfoCache {
+ get {
+ return type_info_cache;
+ }
+ }
+
public override string[] ValidAttributeTargets {
get {
return attribute_targets;
if (TypeSpecComparer.IsEqual (default_expr.Type, parameter_type) ||
(default_expr is NullConstant && TypeSpec.IsReferenceType (parameter_type) && !parameter_type.IsGenericParameter) ||
- parameter_type.BuiltinType == BuiltinTypeSpec.Type.Object) {
+ parameter_type.BuiltinType == BuiltinTypeSpec.Type.Object ||
+ parameter_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
return;
}
return sb.ToString ();
}
+ public static bool HasSameParameterDefaults (AParametersCollection a, AParametersCollection b)
+ {
+ if (a == null)
+ return b == null;
+
+ for (int i = 0; i < a.Count; ++i) {
+ if (a.FixedParameters [i].HasDefaultValue != b.FixedParameters [i].HasDefaultValue)
+ return false;
+ }
+
+ return true;
+ }
+
public bool HasArglist {
get { return has_arglist; }
}
}
if (Set == null) {
- if ((ModFlags & Modifiers.SEALED) != 0 && base_prop.HasSet && !base_prop.Set.IsAccessible (this)) {
- // TODO: Should be different error code but csc uses for some reason same
- Report.SymbolRelatedToPreviousError (base_prop);
- Report.Error (546, Location,
- "`{0}': cannot override because `{1}' does not have accessible set accessor",
- GetSignatureForError (), base_prop.GetSignatureForError ());
- ok = false;
- }
+ if (base_prop.HasSet) {
+ if ((ModFlags & Modifiers.SEALED) != 0 && !base_prop.Set.IsAccessible (this)) {
+ // TODO: Should be different error code but csc uses for some reason same
+ Report.SymbolRelatedToPreviousError (base_prop);
+ Report.Error (546, Location,
+ "`{0}': cannot override because `{1}' does not have accessible set accessor",
+ GetSignatureForError (), base_prop.GetSignatureForError ());
+ ok = false;
+ }
- if ((ModFlags & Modifiers.AutoProperty) != 0) {
- Report.Error (8080, Location, "`{0}': Auto-implemented properties must override all accessors of the overridden property",
- GetSignatureForError ());
- ok = false;
+ if ((ModFlags & Modifiers.AutoProperty) != 0) {
+ Report.Error (8080, Location, "`{0}': Auto-implemented properties must override all accessors of the overridden property",
+ GetSignatureForError ());
+ ok = false;
+ }
}
} else {
if (!base_prop.HasSet) {
// C# 3.0 introduced contextual keywords (var) which behaves like a type if type with
// same name exists or as a keyword when no type was found
//
- if (vexpr != null && !vexpr.IsPossibleTypeOrNamespace (bc)) {
+ if (vexpr != null && !vexpr.IsPossibleType (bc)) {
if (bc.Module.Compiler.Settings.Version < LanguageVersion.V_3)
bc.Report.FeatureIsNotAvailable (bc.Module.Compiler, loc, "implicitly typed local variable");
--- /dev/null
+namespace Test
+{
+ public class Program
+ {
+ public static int Main ()
+ {
+ dynamic d = 0L;
+ return C.M<Program> (d);
+ }
+ }
+
+ public class C
+ {
+ public static int M<T> (int i) where T : C
+ {
+ return 1;
+ }
+
+ public static int M<T> (long l)
+ {
+ return 0;
+ }
+ }
+}
--- /dev/null
+using System.Runtime.InteropServices;
+
+public class Test
+{
+ public static object Foo ([Optional, DefaultParameterValue (1)] dynamic i)
+ {
+ return i;
+ }
+
+ public static int Main ()
+ {
+ var res = (int) Foo ();
+ if (res != 1)
+ return 1;
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+public interface IA
+{
+ int Foo (int x = 0);
+}
+
+public class A : IA
+{
+ public int Foo (int x)
+ {
+ return x;
+ }
+
+ private static int Bar<T> (T x) where T : A, IA
+ {
+ return x.Foo ();
+ }
+
+ public static int Main ()
+ {
+ if (Bar (new A ()) != 0)
+ return 1;
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+class MainClass
+{
+ abstract public class Bar
+ {
+ abstract public bool Condition { get; }
+ }
+
+ class Baz: Bar
+ {
+ public override bool Condition { get; } = true;
+ }
+
+ public static void Main (string[] args)
+ {
+ }
+}
static int Test_6 (params object[] o)
{
- return 0;
+ return 1;
}
static int Test_6 (int i = 1, params object[] a)
{
- return 1;
+ return 0;
}
static int Test_7 (bool b, params object[] o)
{
- return 0;
+ return 1;
}
static int Test_7 (bool b, int i = 1, params object[] a)
+ {
+ return 0;
+ }
+
+ static int Test_8 (Type t, bool b = false, int x = 0)
+ {
+ return 0;
+ }
+
+ static int Test_8 (Type t, params int[] x)
{
return 1;
}
if (Test_7 (false) != 0)
return 7;
+ if (Test_8 (typeof (bool)) != 0)
+ return 8;
+
Console.WriteLine ("ok");
return 0;
}
public struct UInt64 {}
public struct IntPtr {}
public struct UIntPtr {}
- public struct Decimal { }
public class String { }
public class Delegate {}
public class MulticastDelegate {}
public interface IDisposable {}
+ public struct Decimal {
+
+ private int flags;
+
+ public Decimal(int[] bits) {
+ flags = 0;
+ SetBits(bits);
+ }
+
+ public Decimal (int i)
+ {
+ flags = 0;
+ }
+
+ private void SetBits(int[] bits) {
+ }
+ }
+
partial class Type
{
public static bool operator == (Type left, Type right)
{
return true;
}
+
+ void Foo ()
+ {
+ Decimal d = 0;
+ var d2 = d;
+ }
}
}
{
public class DefaultMemberAttribute {}
}
-
--- /dev/null
+// Compiler options: -t:library
+
+namespace Reference
+{
+ public interface IB
+ {
+ }
+
+ public interface IA : IHide
+ {
+ new IB Equals { get; }
+ }
+
+ public interface IHide
+ {
+ bool Equals(object o);
+ }
+}
\ No newline at end of file
--- /dev/null
+// Compiler options: -r:test-921-lib.dll
+
+using Reference;
+
+class A
+{
+ void Foo (IA a)
+ {
+ IB b = a.Equals;
+ }
+
+ public static void Main ()
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+public class A
+{
+ protected internal struct C { }
+}
+
+class B
+{
+ class D : A
+ {
+ public A.C Property { get; set; }
+ }
+
+ public static void Main ()
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+namespace TestDelegateFinallyOut
+{
+ class Test
+ {
+ static void CallDelegate (Action test)
+ {
+ throw new Exception ("test");
+ }
+
+ private static bool TestMethod (out int test)
+ {
+ try {
+ CallDelegate (delegate {
+ return;
+ });
+ } catch (Exception) {
+ Console.WriteLine ("caught exception");
+ } finally {
+ }
+ test = 1;
+ return false;
+ }
+
+ static int Main ()
+ {
+ int t;
+ TestMethod (out t);
+ if (t != 1)
+ return 1;
+
+ return 0;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Linq;
+using System.Collections.Generic;
+
+class X
+{
+ public static void Execute<TArg>(TArg args)
+ {
+ Action a = () => {
+ List<string> s = new List<string> () {
+ "test"
+ };
+
+ object res = null;
+ var res2 = s.Select(acrl => acrl.Select(acr => res)).ToArray ();
+ };
+
+ a ();
+ }
+
+ public static void Main ()
+ {
+ Execute<string> (null);
+ }
+}
\ No newline at end of file
Test (delegate () {
int i = *v.GetUnsafeValue ();
});
+
+ Test (delegate () {
+ byte* buffer = stackalloc byte[8192];
+ });
}
-
public static void Main ()
{
Exception diffException;
--- /dev/null
+static class Crash
+{
+ static string GetFoo ()
+ {
+ return null;
+ }
+
+ static void Main ()
+ {
+ (GetFoo ()?.ToLower ()).ToUpper ();
+ }
+}
--- /dev/null
+namespace Test
+{
+ public class A
+ {
+ public static int Main ()
+ {
+ var x = 1;
+ return 0;
+ }
+ }
+
+ namespace var
+ {
+ }
+}
\ No newline at end of file
</method>
</type>
</test>
+ <test name="dtest-060.cs">
+ <type name="Test.Program">
+ <method name="Int32 Main()" attrs="150">
+ <size>201</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="Test.C">
+ <method name="Int32 M[T](Int32)" attrs="150">
+ <size>10</size>
+ </method>
+ <method name="Int32 M[T](Int64)" attrs="150">
+ <size>10</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="dtest-anontype-01.cs">
<type name="C">
<method name="Void Main()" attrs="150">
</method>
</type>
</test>
+ <test name="dtest-optional-02.cs">
+ <type name="Test">
+ <method name="System.Object Foo(System.Object)" attrs="150">
+ <size>10</size>
+ </method>
+ <method name="Int32 Main()" attrs="150">
+ <size>41</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-001.cs">
<type name="Stack`1[type]">
<method name="Void .ctor()" attrs="6278">
</method>
</type>
</test>
+ <test name="gtest-630.cs">
+ <type name="A">
+ <method name="Int32 Foo(Int32)" attrs="486">
+ <size>10</size>
+ </method>
+ <method name="Int32 Bar[T](T)" attrs="145">
+ <size>23</size>
+ </method>
+ <method name="Int32 Main()" attrs="150">
+ <size>32</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-anontype-01.cs">
<type name="Test">
<method name="Int32 Main()" attrs="150">
</method>
</type>
</test>
+ <test name="gtest-autoproperty-17.cs">
+ <type name="MainClass">
+ <method name="Void Main(System.String[])" attrs="150">
+ <size>2</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="MainClass+Bar">
+ <method name="Boolean get_Condition()" attrs="3526">
+ <size>0</size>
+ </method>
+ <method name="Void .ctor()" attrs="6276">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="MainClass+Baz">
+ <method name="Boolean get_Condition()" attrs="2246">
+ <size>14</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>14</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-collectioninit-01.cs">
<type name="Test">
<method name="Void TestList(System.Collections.Generic.List`1[System.Int32], Int32)" attrs="145">
<size>10</size>
</method>
<method name="Int32 Main()" attrs="150">
- <size>161</size>
+ <size>192</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</method>
+ <method name="Int32 Test_8(System.Type, Boolean, Int32)" attrs="145">
+ <size>10</size>
+ </method>
+ <method name="Int32 Test_8(System.Type, Int32[])" attrs="145">
+ <size>10</size>
+ </method>
</type>
</test>
<test name="gtest-optional-10.cs">
</method>
</type>
</test>
+ <test name="test-921.cs">
+ <type name="A">
+ <method name="Void Foo(Reference.IA)" attrs="129">
+ <size>9</size>
+ </method>
+ <method name="Void Main()" attrs="150">
+ <size>2</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
+ <test name="test-922.cs">
+ <type name="A">
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="B">
+ <method name="Void Main()" attrs="150">
+ <size>2</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="B+D">
+ <method name="C get_Property()" attrs="2182">
+ <size>14</size>
+ </method>
+ <method name="Void set_Property(C)" attrs="2182">
+ <size>8</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-93.cs">
<type name="N1.C">
<method name="Void .ctor()" attrs="6278">
</method>
</type>
</test>
+ <test name="test-anon-176.cs">
+ <type name="TestDelegateFinallyOut.Test">
+ <method name="Void CallDelegate(System.Action)" attrs="145">
+ <size>12</size>
+ </method>
+ <method name="Boolean TestMethod(Int32 ByRef)" attrs="145">
+ <size>75</size>
+ </method>
+ <method name="Int32 Main()" attrs="145">
+ <size>32</size>
+ </method>
+ <method name="Void <TestMethod>m__0()" attrs="145">
+ <size>7</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
+ <test name="test-anon-177.cs">
+ <type name="X">
+ <method name="Void Execute[TArg](TArg)" attrs="150">
+ <size>21</size>
+ </method>
+ <method name="Void Main()" attrs="150">
+ <size>8</size>
+ </method>
+ <method name="Void <Execute`1>m__0[TArg]()" attrs="145">
+ <size>58</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="X+<Execute>c__AnonStorey0`1[TArg]">
+ <method name="System.Collections.Generic.IEnumerable`1[System.Object] <>m__0(System.String)" attrs="131">
+ <size>26</size>
+ </method>
+ <method name="System.Object <>m__1(Char)" attrs="131">
+ <size>14</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-anon-18.cs">
<type name="A">
<method name="Void Invoke()" attrs="454">
</type>
<type name="C">
<method name="Void UnsafeTests()" attrs="145">
- <size>36</size>
+ <size>70</size>
</method>
<method name="Void Main()" attrs="150">
<size>99</size>
</method>
</type>
<type name="C">
- <method name="Void <Main>m__0()" attrs="145">
+ <method name="Void <UnsafeTests>m__0()" attrs="145">
+ <size>12</size>
+ </method>
+ <method name="Void <Main>m__1()" attrs="145">
<size>17</size>
</method>
</type>
</method>
</type>
</test>
+ <test name="test-null-operator-011.cs">
+ <type name="Crash">
+ <method name="System.String GetFoo()" attrs="145">
+ <size>10</size>
+ </method>
+ <method name="Void Main()" attrs="145">
+ <size>27</size>
+ </method>
+ </type>
+ </test>
<test name="test-null-operator-02.cs">
<type name="CI">
<method name="Int32 get_Prop()" attrs="2182">
</method>
</type>
</test>
+ <test name="test-var-04.cs">
+ <type name="Test.A">
+ <method name="Int32 Main()" attrs="150">
+ <size>12</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-var-05.cs">
<type name="MyClass">
<method name="Void Dispose()" attrs="486">
//
using System;
-using System.IO;
using System.Reflection;
using Mono.Cecil;
class Program {
- static void Main (string [] args)
+ static int Main (string [] args)
{
Header ();
Console.WriteLine ("Assembly {0} stripped out into {1}", file, output);
else
Console.WriteLine ("Assembly {0} stripped", file);
+ return 0;
} catch (TargetInvocationException tie) {
Console.WriteLine ("Error: {0}", tie.InnerException);
} catch (Exception e) {
Console.WriteLine ("Error: {0}", e);
}
+ return 1;
}
static void StripAssembly (AssemblyDefinition assembly, string output)
// even if we (just before saving) will resolve all type references (bug #26752)
void MarkWithResolvedScope (TypeReference type)
{
- // we cannot set the Scope of a TypeSpecification so there's no point in resolving it
- if ((type == null) || (type is TypeSpecification))
+ if (type == null)
+ return;
+
+ // a GenericInstanceType can could contains generic arguments with scope that
+ // needs to be updated out of the PCL facade (bug #28823)
+ var git = (type as GenericInstanceType);
+ if ((git != null) && git.HasGenericArguments) {
+ foreach (var ga in git.GenericArguments)
+ MarkWithResolvedScope (ga);
return;
+ }
+ // we cannot set the Scope of a TypeSpecification but it's element type can be set
+ // e.g. System.String[] -> System.String
+ var ts = (type as TypeSpecification);
+ if (ts != null) {
+ MarkWithResolvedScope (ts.GetElementType ());
+ return;
+ }
+
var td = type.Resolve ();
if (td != null)
type.Scope = td.Scope;
scope = assembly.MainModule.Import (td).Scope;
hash.Add (tr, scope);
}
+ if (assembly.MainModule.HasExportedTypes) {
+ foreach (var et in assembly.MainModule.ExportedTypes) {
+ var td = et.Resolve ();
+ IMetadataScope scope = et.Scope;
+ if ((td != null) && Annotations.IsMarked (td)) {
+ scope = assembly.MainModule.Import (td).Scope;
+ hash.Add (td, scope);
+ }
+ }
+ }
// Resolve everything first before updating scopes.
// If we set the scope to null, then calling Resolve() on any of its
using System;
using System.IO;
using System.Linq;
+using System.Text;
using System.Reflection;
using System.Diagnostics;
using System.Collections.Generic;
class LocationProvider {
class AssemblyLocationProvider {
- AssemblyDefinition assembly;
+ Assembly assembly;
MonoSymbolFile symbolFile;
string seqPointDataPath;
- public AssemblyLocationProvider (AssemblyDefinition assembly, MonoSymbolFile symbolFile, string seqPointDataPath)
+ public AssemblyLocationProvider (Assembly assembly, MonoSymbolFile symbolFile, string seqPointDataPath)
{
this.assembly = assembly;
this.symbolFile = symbolFile;
this.seqPointDataPath = seqPointDataPath;
}
- public bool TryGetLocation (string methodFullName, string[] methodParamsTypes, int offset, bool isOffsetIL, out Location location)
+ public bool TryGetLocation (string methodStr, string typeFullName, int offset, bool isOffsetIL, uint methodIndex, out Location location)
{
location = default (Location);
if (symbolFile == null)
return false;
- var typeNameEnd = methodFullName.LastIndexOf (".");
- var typeName = methodFullName.Substring (0, typeNameEnd);
- var methodName = methodFullName.Substring (typeNameEnd + 1, methodFullName.Length - typeNameEnd - 1);
-
- var type = assembly.MainModule.Types.FirstOrDefault (t => t.FullName == typeName);
+ var type = assembly.GetTypes().FirstOrDefault (t => t.FullName == typeFullName);
if (type == null)
return false;
- var method = type.Methods.FirstOrDefault (m => {
- if (m.Name != methodName)
- return false;
-
- if (m.Parameters.Count != methodParamsTypes.Length)
- return false;
-
- for (var i = 0; i < methodParamsTypes.Length; i++) {
- var paramType = m.Parameters[i].ParameterType;
- if (paramType.Name != methodParamsTypes[i])
- return false;
- }
-
- return true;
- });
-
+ var bindingflags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
+ var method = type.GetMethods(bindingflags).FirstOrDefault (m => GetMethodFullName (m) == methodStr);
if (method == null)
return false;
- int ilOffset = (isOffsetIL)? offset : GetILOffsetFromFile (method.MetadataToken.ToInt32 (), offset);
+ int ilOffset = (isOffsetIL)? offset : GetILOffsetFromFile (method.MetadataToken, methodIndex, offset);
if (ilOffset < 0)
return false;
- var methodSymbol = symbolFile.Methods [method.MetadataToken.RID-1];
+ var methodSymbol = symbolFile.Methods [(method.MetadataToken & 0x00ffffff) - 1];
- foreach (var lineNumber in methodSymbol.GetLineNumberTable ().LineNumbers) {
- if (lineNumber.Offset < ilOffset)
- continue;
-
- location.FileName = symbolFile.Sources [lineNumber.File-1].FileName;
- location.Line = lineNumber.Row;
- return true;
- }
+ var lineNumbers = methodSymbol.GetLineNumberTable ().LineNumbers;
+ var lineNumber = lineNumbers.FirstOrDefault (l => l.Offset >= ilOffset) ?? lineNumbers.Last ();
- return false;
+ location.FileName = symbolFile.Sources [lineNumber.File-1].FileName;
+ location.Line = lineNumber.Row;
+ return true;
}
static MethodInfo methodGetIL;
- private int GetILOffsetFromFile (int methodToken, int nativeOffset)
+ private int GetILOffsetFromFile (int methodToken, uint methodIndex, int nativeOffset)
{
if (string.IsNullOrEmpty (seqPointDataPath))
return -1;
if (methodGetIL == null)
throw new Exception ("System.Diagnostics.StackFrame.GetILOffsetFromFile could not be found, make sure you have an updated mono installed.");
- return (int) methodGetIL.Invoke (null, new object[] {seqPointDataPath, methodToken, nativeOffset});
+ return (int) methodGetIL.Invoke (null, new object[] {seqPointDataPath, methodToken, methodIndex, nativeOffset});
+ }
+
+ static MethodInfo methodGetMethodFullName;
+ private string GetMethodFullName (MethodBase m)
+ {
+
+ if (methodGetMethodFullName == null)
+ methodGetMethodFullName = typeof (Exception).GetMethod ("GetFullNameForStackTrace", BindingFlags.NonPublic | BindingFlags.Static);
+
+ if (methodGetMethodFullName == null)
+ throw new Exception ("System.Exception.GetFullNameForStackTrace could not be found, make sure you have an updated mono installed.");
+
+ StringBuilder sb = new StringBuilder ();
+ methodGetMethodFullName.Invoke (null, new object[] {sb, m});
+
+ return sb.ToString ();
}
}
if (!File.Exists (assemblyPath))
throw new ArgumentException ("assemblyPath does not exist: "+ assemblyPath);
- var assembly = AssemblyDefinition.ReadAssembly (assemblyPath);
+ var assembly = Assembly.LoadFrom (assemblyPath);
MonoSymbolFile symbolFile = null;
var symbolPath = assemblyPath + ".mdb";
directories.Add (Path.GetDirectoryName (assemblyPath));
- foreach (var assemblyRef in assembly.MainModule.AssemblyReferences) {
+ foreach (var assemblyRef in assembly.GetReferencedAssemblies ()) {
string refPath = null;
foreach (var dir in directories) {
refPath = Path.Combine (dir, assemblyRef.Name);
directories.Add (directory);
}
- public bool TryGetLocation (string methodName, string[] methodParams, int offset, bool isOffsetIL, out Location location)
+ public bool TryGetLocation (string method, string typeFullName, int offset, bool isOffsetIL, uint methodIndex, out Location location)
{
location = default (Location);
foreach (var assembly in assemblies.Values) {
- if (assembly.TryGetLocation (methodName, methodParams, offset, isOffsetIL, out location))
+ if (assembly.TryGetLocation (method, typeFullName, offset, isOffsetIL, methodIndex, out location))
return true;
}
LIB_PATH = $(topdir)/class/lib/$(PROFILE)
-MONO = MONO_PATH=$(LIB_PATH)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH $(RUNTIME)
+MONO = MONO_PATH=$(LIB_PATH)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH $(RUNTIME) -O=-inline
OUT_DIR = Test/out
TEST_CS = Test/StackTraceDumper.cs
using System;
+using System.Collections.Generic;
class StackTraceDumper {
- public static void Main () {
- // Stacktrace with no depth
+
+ public static void Main ()
+ {
+ try {
+ throw new Exception ("Stacktrace with 1 frame");
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+
+ try {
+ ThrowException ("Stacktrace with 2 frames");
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+
try {
- throw new Exception ();
+ ThrowException ("Stacktrace with 3 frames", 2);
} catch (Exception e) {
Console.WriteLine (e);
}
- // Stacktrace with depth of 1
+
+ try {
+ var message = "Stack frame with method overload using ref parameter";
+ ThrowException (ref message);
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+
+ try {
+ int i;
+ ThrowException ("Stack frame with method overload using out parameter", out i);
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+
try {
- ThrowException ();
+ ThrowExceptionGeneric<double> ("Stack frame with 1 generic parameter");
} catch (Exception e) {
Console.WriteLine (e);
}
- // Stacktrace with depth of 2
+
+ try {
+ ThrowExceptionGeneric<double,string> ("Stack frame with 2 generic parameters");
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+
+ try {
+ ThrowExceptionGeneric (12);
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+
+ try {
+ InnerClass.ThrowException ("Stack trace with inner class");
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+
+ try {
+ InnerGenericClass<string>.ThrowException ("Stack trace with inner generic class");
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+
try {
- ThrowException2 ();
+ InnerGenericClass<string>.ThrowException ("Stack trace with inner generic class and method generic parameter", "string");
} catch (Exception e) {
Console.WriteLine (e);
}
+
+ try {
+ InnerGenericClass<string>.ThrowException<string> ("Stack trace with inner generic class and generic overload", "string");
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+
+ try {
+ InnerGenericClass<string>.InnerInnerGenericClass<int>.ThrowException ("Stack trace with 2 inner generic class and generic overload");
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+
+ try {
+ InnerGenericClass<int>.InnerInnerGenericClass<string>.ThrowException ("Stack trace with 2 inner generic class and generic overload");
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+ }
+
+ public static void ThrowException (string message)
+ {
+ throw new Exception (message);
+ }
+
+ public static void ThrowException (ref string message)
+ {
+ throw new Exception (message);
+ }
+
+ public static void ThrowException (string message, int i)
+ {
+ if (i > 1)
+ ThrowException (message, --i);
+
+ throw new Exception (message);
+ }
+
+ public static void ThrowException (string message, out int o)
+ {
+ throw new Exception (message);
}
- public static void ThrowException () {
- Console.WriteLine ("Exception is not in the first line!");
- throw new Exception ();
+ public static void ThrowExceptionGeneric<T> (string message)
+ {
+ throw new Exception (message);
}
- public static void ThrowException2 () {
- ThrowException ();
+ public static void ThrowExceptionGeneric<T> (T a1)
+ {
+ throw new Exception ("Stack frame with generic method overload");
}
+ public static void ThrowExceptionGeneric<T> (List<string> a1)
+ {
+ throw new Exception ("Stack frame with generic method overload");
+ }
+
+ public static void ThrowExceptionGeneric<T> (List<T> a1)
+ {
+ throw new Exception ("Stack frame with generic method overload");
+ }
+
+ public static void ThrowExceptionGeneric<T1,T2> (string message)
+ {
+ throw new Exception (message);
+ }
+
+ class InnerClass {
+ public static void ThrowException (string message)
+ {
+ throw new Exception (message);
+ }
+ }
+
+ class InnerGenericClass<T> {
+ public static void ThrowException (string message)
+ {
+ throw new Exception (message);
+ }
+
+ public static void ThrowException (string message, T arg)
+ {
+ Console.WriteLine ("Generic to string:" + arg.ToString());
+ throw new Exception (message);
+ }
+
+ public static void ThrowException<T1> (string message, T1 arg)
+ {
+ throw new Exception (message);
+ }
+
+ public class InnerInnerGenericClass<T2> {
+ public static void ThrowException (T message)
+ {
+ throw new Exception (message as string);
+ }
+
+ public static void ThrowException (T2 message)
+ {
+ throw new Exception (message as string);
+ }
+ }
+ }
}
\ No newline at end of file
-System.Exception: Exception of type 'System.Exception' was thrown.
- at StackTraceDumper.Main () in StackTraceDumper.cs:7
-Exception is not in the first line!
-System.Exception: Exception of type 'System.Exception' was thrown.
- at StackTraceDumper.ThrowException () in StackTraceDumper.cs:27
- at StackTraceDumper.Main () in StackTraceDumper.cs:13
-Exception is not in the first line!
-System.Exception: Exception of type 'System.Exception' was thrown.
- at StackTraceDumper.ThrowException () in StackTraceDumper.cs:27
- at StackTraceDumper.ThrowException2 () in StackTraceDumper.cs:31
- at StackTraceDumper.Main () in StackTraceDumper.cs:19
+System.Exception: Stacktrace with 1 frame
+ at StackTraceDumper.Main () in StackTraceDumper.cs:9
+System.Exception: Stacktrace with 2 frames
+ at StackTraceDumper.ThrowException (System.String message) in StackTraceDumper.cs:97
+ at StackTraceDumper.Main () in StackTraceDumper.cs:15
+System.Exception: Stacktrace with 3 frames
+ at StackTraceDumper.ThrowException (System.String message, Int32 i) in StackTraceDumper.cs:110
+ at StackTraceDumper.ThrowException (System.String message, Int32 i) in StackTraceDumper.cs:108
+ at StackTraceDumper.Main () in StackTraceDumper.cs:21
+System.Exception: Stack frame with method overload using ref parameter
+ at StackTraceDumper.ThrowException (System.String& message) in StackTraceDumper.cs:102
+ at StackTraceDumper.Main () in StackTraceDumper.cs:28
+System.Exception: Stack frame with method overload using out parameter
+ at StackTraceDumper.ThrowException (System.String message, System.Int32& o) in StackTraceDumper.cs:115
+ at StackTraceDumper.Main () in StackTraceDumper.cs:35
+System.Exception: Stack frame with 1 generic parameter
+ at StackTraceDumper.ThrowExceptionGeneric[T] (System.String message) in StackTraceDumper.cs:120
+ at StackTraceDumper.Main () in StackTraceDumper.cs:41
+System.Exception: Stack frame with 2 generic parameters
+ at StackTraceDumper.ThrowExceptionGeneric[T1,T2] (System.String message) in StackTraceDumper.cs:140
+ at StackTraceDumper.Main () in StackTraceDumper.cs:47
+System.Exception: Stack frame with generic method overload
+ at StackTraceDumper.ThrowExceptionGeneric[T] (T a1) in StackTraceDumper.cs:125
+ at StackTraceDumper.Main () in StackTraceDumper.cs:53
+System.Exception: Stack trace with inner class
+ at StackTraceDumper+InnerClass.ThrowException (System.String message) in StackTraceDumper.cs:146
+ at StackTraceDumper.Main () in StackTraceDumper.cs:59
+System.Exception: Stack trace with inner generic class
+ at StackTraceDumper+InnerGenericClass`1[T].ThrowException (System.String message) in StackTraceDumper.cs:153
+ at StackTraceDumper.Main () in StackTraceDumper.cs:65
+Generic to string:string
+System.Exception: Stack trace with inner generic class and method generic parameter
+ at StackTraceDumper+InnerGenericClass`1[T].ThrowException (System.String message, T arg) in StackTraceDumper.cs:159
+ at StackTraceDumper.Main () in StackTraceDumper.cs:71
+System.Exception: Stack trace with inner generic class and generic overload
+ at StackTraceDumper+InnerGenericClass`1[T].ThrowException[T1] (System.String message, T1 arg) in StackTraceDumper.cs:164
+ at StackTraceDumper.Main () in StackTraceDumper.cs:77
+System.Exception: Stack trace with 2 inner generic class and generic overload
+ at StackTraceDumper+InnerGenericClass`1+InnerInnerGenericClass`1[T,T2].ThrowException (T message) in StackTraceDumper.cs:170
+ at StackTraceDumper.Main () in StackTraceDumper.cs:83
+System.Exception: Stack trace with 2 inner generic class and generic overload
+ at StackTraceDumper+InnerGenericClass`1+InnerInnerGenericClass`1[T,T2].ThrowException (T2 message) in StackTraceDumper.cs:175
+ at StackTraceDumper.Main () in StackTraceDumper.cs:89
{
public class Program
{
- static Regex regex = new Regex (@"\w*at (?<MethodName>.+) \((?<MethodParams>.*)\) *(\[0x(?<IL>.+)\]|<0x.* \+ 0x(?<NativeOffset>.+)>) in <filename unknown>:0");
+ static Regex regex = new Regex (@"\w*at (?<Method>.+) *(\[0x(?<IL>.+)\]|<0x.+ \+ 0x(?<NativeOffset>.+)>( (?<MethodIndex>\d+)|)) in <filename unknown>:0");
public static int Main (String[] args)
{
if (!match.Success)
return line;
- var methodName = match.Groups ["MethodName"].Value;
- var methodParams = ParseParametersTypes (match.Groups ["MethodParams"].Value);
+ string typeFullName;
+ var methodStr = match.Groups ["Method"].Value.Trim ();
+ if (!TryParseMethodType (methodStr, out typeFullName))
+ return line;
var isOffsetIL = !string.IsNullOrEmpty (match.Groups ["IL"].Value);
var offsetVarName = (isOffsetIL)? "IL" : "NativeOffset";
var offset = int.Parse (match.Groups [offsetVarName].Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture);
+ uint methodIndex = 0xffffff;
+ if (!string.IsNullOrEmpty (match.Groups ["MethodIndex"].Value))
+ methodIndex = uint.Parse (match.Groups ["MethodIndex"].Value, CultureInfo.InvariantCulture);
+
Location location;
- if (!locProvider.TryGetLocation (methodName, methodParams, offset, isOffsetIL, out location))
+ if (!locProvider.TryGetLocation (methodStr, typeFullName, offset, isOffsetIL, methodIndex, out location))
return line;
return line.Replace ("<filename unknown>:0", string.Format ("{0}:{1}", location.FileName, location.Line));
}
- static string[] ParseParametersTypes (string parameters)
+ static bool TryParseMethodType (string str, out string typeFullName)
{
- if (string.IsNullOrEmpty (parameters))
- return new string [0];
+ typeFullName = null;
+
+ var methodNameEnd = str.IndexOf ("(");
+ if (methodNameEnd == -1)
+ return false;
+
+ // Remove parameters
+ str = str.Substring (0, methodNameEnd);
+
+ // Remove generic parameters
+ str = Regex.Replace (str, @"\[[^\[\]]*\]", "");
+
+ var typeNameEnd = str.LastIndexOf (".");
+ if (methodNameEnd == -1 || typeNameEnd == -1)
+ return false;
- var paramsArray = parameters.Split (',');
- var paramsTypes = new string [paramsArray.Length];
- for (var i = 0; i < paramsArray.Length; i++)
- paramsTypes [i] = paramsArray [i].Trim ().Split (new char[]{' '}, 2)[0];
+ // Remove method name
+ typeFullName = str.Substring (0, typeNameEnd);
- return paramsTypes;
+ return true;
}
}
}
\ No newline at end of file
install-frameworks:
$(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v$(FRAMEWORK_VERSION)/RedistList
$(INSTALL_DATA) frameworks/net_$(FRAMEWORK_VERSION).xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v$(FRAMEWORK_VERSION)/RedistList/FrameworkList.xml
+ $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v2.0/RedistList
+ $(INSTALL_DATA) frameworks/net_2.0.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v2.0/RedistList/FrameworkList.xml
$(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.0/RedistList
$(INSTALL_DATA) frameworks/net_3.0.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.0/RedistList/FrameworkList.xml
+ $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.5/RedistList
+ $(INSTALL_DATA) frameworks/net_3.5.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.5/RedistList/FrameworkList.xml
$(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.0/RedistList
$(INSTALL_DATA) frameworks/net_4.0.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.0/RedistList/FrameworkList.xml
$(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.0/Profile/Client/RedistList
+++ /dev/null
-%{!?ext_man: %define ext_man .gz}
-%define llvm no
-%define sgen yes
-
-%ifnarch %ix86 x86_64
-%define llvm no
-%endif
-
-%ifnarch %ix86 x86_64 s390x
-%define sgen no
-%endif
-
-Name: mono-core
-License: LGPL v2.1 only
-Group: Development/Languages/Mono
-Summary: A .NET Runtime Environment
-Url: http://www.mono-project.com
-Version: @VERSION@
-Release: 0
-Source0: mono-%{version}.tar.bz2
-BuildRequires: bison
-%if 0%{?suse_version}
-BuildRequires: fdupes
-BuildRequires: xorg-x11-libX11-devel
-%else
-BuildRequires: libX11-devel
-%endif
-BuildRequires: gcc-c++
-BuildRequires: pkgconfig
-BuildRequires: zlib-devel
-%ifnarch ia64
-BuildRequires: valgrind-devel
-%endif
-%if %llvm == yes
-BuildRequires: llvm-mono-devel
-%endif
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Obsoletes: mono
-Obsoletes: mono-cairo
-Obsoletes: mono-drawing
-Obsoletes: mono-ikvm
-Obsoletes: mono-posix
-Obsoletes: mono-xml-relaxng
-Obsoletes: mono-ziplib
-Provides: mono = %{version}-%{release}
-Provides: mono-cairo
-Provides: mono-drawing
-Provides: mono-ikvm
-Provides: mono-posix
-Provides: mono-xml-relaxng
-Provides: mono-ziplib
-# This version of mono has issues with the following versions of apps:
-# (not because of regressions, but because bugfixes in mono uncover bugs in the apps)
-Conflicts: banshee < 1.0
-Conflicts: f-spot < 0.4
-Conflicts: helix-banshee < 1.0
-Conflicts: mono-addins < 0.3.1
-%if 0%{?suse_version}
-Recommends: libgdiplus0 >= 2.6
-%endif
-%if %llvm == yes
-Recommends: libmono-llvm0 = %{version}-%{release}
-%endif
-Provides: mono(Commons.Xml.Relaxng) = 1.0.5000.0
-Provides: mono(CustomMarshalers) = 1.0.5000.0
-Provides: mono(I18N) = 1.0.5000.0
-Provides: mono(I18N.West) = 1.0.5000.0
-Provides: mono(ICSharpCode.SharpZipLib) = 0.6.0.0
-Provides: mono(ICSharpCode.SharpZipLib) = 0.84.0.0
-Provides: mono(Mono.Cairo) = 1.0.5000.0
-Provides: mono(Mono.CompilerServices.SymbolWriter) = 1.0.5000.0
-Provides: mono(Mono.Posix) = 1.0.5000.0
-Provides: mono(Mono.Security) = 1.0.5000.0
-Provides: mono(System) = 1.0.5000.0
-Provides: mono(System.Security) = 1.0.5000.0
-Provides: mono(System.Xml) = 1.0.5000.0
-Provides: mono(mscorlib) = 1.0.5000.0
-
-%define _use_internal_dependency_generator 0
-%define __find_provides env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/find-provides && printf "%s\\n" "${filelist[@]}" | prefix=%{buildroot}%{_prefix} %{buildroot}%{_bindir}/mono-find-provides ; } | sort | uniq'
-%define __find_requires env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/find-requires && printf "%s\\n" "${filelist[@]}" | prefix=%{buildroot}%{_prefix} %{buildroot}%{_bindir}/mono-find-requires ; } | sort | uniq'
-
-%description
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-%prep
-%setup -q -n mono-%{version}
-
-%build
-# These are only needed if there are patches to the runtime
-#rm -f libgc/libtool.m4
-#autoreconf --force --install
-#autoreconf --force --install libgc
-export CFLAGS=" $RPM_OPT_FLAGS -fno-strict-aliasing"
-# distro specific configure options
-%if %llvm == yes
-export PATH=/opt/novell/llvm-mono/bin:$PATH
-%endif
-%configure \
- --target=%{_host} \
- --with-sgen=%{sgen} \
-%if %llvm == yes
- --enable-loadedllvm \
- --disable-system-aot \
-%endif
-%ifnarch %ix86 x86_64
- --disable-system-aot \
-%endif
- --with-ikvm=yes \
- --with-moonlight=no
-#make # We are not -jN safe! %{?jobs:-j%jobs}
-# We are now !
-make get-monolite-latest
-make %{?_smp_mflags}
-
-%install
-make install DESTDIR=%buildroot
-# remove .la files (they are generally bad news)
-rm -f %buildroot%_libdir/*.la
-# remove Windows-only stuff
-rm -rf %buildroot%_prefix/lib/mono/*/Mono.Security.Win32*
-rm -f %buildroot%_libdir/libMonoSupportW.*
-# remove .a files for libraries that are really only for us
-rm -f %buildroot%_libdir/libMonoPosixHelper.a
-rm -f %buildroot%_libdir/libikvm-native.a
-rm -f %buildroot%_libdir/libmono-llvm.a
-# remove libgc cruft
-rm -rf %buildroot%_datadir/libgc-mono
-# remove stuff that we don't package
-rm -f %buildroot%_bindir/cilc
-rm -f %buildroot%_mandir/man1/cilc.1*
-rm -f %buildroot%_prefix/lib/mono/*/browsercaps-updater.exe*
-rm -f %buildroot%_prefix/lib/mono/*/culevel.exe*
-rm -f %buildroot%_prefix/lib/mono/2.0/cilc.exe*
-# brp-compress doesn't search _mandir
-# so we cheat it
-ln -s . %buildroot%_prefix%_prefix
-RPM_BUILD_ROOT=%buildroot%_prefix /usr/lib/rpm/brp-compress
-rm %buildroot%_prefix%_prefix
-%if 0%{?suse_version}
-%fdupes %buildroot%_prefix
-%endif
-%find_lang mcs
-
-%clean
-rm -rf %buildroot
-
-%files -f mcs.lang
-%defattr(-, root, root)
-%doc AUTHORS COPYING.LIB ChangeLog NEWS README.md
-%config %_sysconfdir/mono/2.0/machine.config
-%config %_sysconfdir/mono/2.0/settings.map
-%config %_sysconfdir/mono/4.0/machine.config
-%config %_sysconfdir/mono/4.0/settings.map
-%config %_sysconfdir/mono/4.5/machine.config
-%config %_sysconfdir/mono/4.5/settings.map
-%config %_sysconfdir/mono/config
-%dir %_prefix/lib/mono
-%dir %_prefix/lib/mono/2.0
-%dir %_prefix/lib/mono/3.5
-%dir %_prefix/lib/mono/4.0
-%dir %_prefix/lib/mono/4.5
-%dir %_prefix/lib/mono/compat-2.0
-%dir %_prefix/lib/mono/gac
-%dir %_sysconfdir/mono
-%dir %_sysconfdir/mono/2.0
-%dir %_sysconfdir/mono/4.0
-%dir %_sysconfdir/mono/4.5
-%_bindir/al
-%_bindir/al2
-%_bindir/certmgr
-%_bindir/chktrust
-%_bindir/crlupdate
-%_bindir/csharp
-%_bindir/dmcs
-%_bindir/gacutil
-%_bindir/gacutil2
-%_bindir/ikdasm
-%_bindir/mcs
-%_bindir/mono
-%_bindir/mono-configuration-crypto
-%if %sgen == yes
-%_bindir/mono-sgen
-%endif
-%_bindir/mono-boehm
-%_bindir/mono-test-install
-%_bindir/mozroots
-%_bindir/peverify
-%_bindir/setreg
-%_bindir/sn
-%_libdir/libMonoPosixHelper.so*
-%_libdir/libikvm-native.so
-%_mandir/man1/certmgr.1%ext_man
-%_mandir/man1/chktrust.1%ext_man
-%_mandir/man1/crlupdate.1%ext_man
-%_mandir/man1/csharp.1%ext_man
-%_mandir/man1/gacutil.1%ext_man
-%_mandir/man1/mcs.1%ext_man
-%_mandir/man1/mono-configuration-crypto.1%ext_man
-%_mandir/man1/mono.1%ext_man
-%_mandir/man1/mozroots.1%ext_man
-%_mandir/man1/setreg.1%ext_man
-%_mandir/man1/sn.1%ext_man
-%_mandir/man5/mono-config.5%ext_man
-%_prefix/lib/mono/2.0/Commons.Xml.Relaxng.dll
-%_prefix/lib/mono/2.0/CustomMarshalers.dll
-%_prefix/lib/mono/2.0/I18N.West.dll
-%_prefix/lib/mono/2.0/I18N.dll
-%_prefix/lib/mono/2.0/ICSharpCode.SharpZipLib.dll
-%_prefix/lib/mono/2.0/Microsoft.VisualC.dll
-%_prefix/lib/mono/2.0/Mono.C5.dll
-%_prefix/lib/mono/2.0/Mono.CSharp.dll
-%_prefix/lib/mono/2.0/Mono.Cairo.dll
-%_prefix/lib/mono/2.0/Mono.CompilerServices.SymbolWriter.dll
-%_prefix/lib/mono/2.0/Mono.Management.dll
-%_prefix/lib/mono/2.0/Mono.Posix.dll
-%_prefix/lib/mono/2.0/Mono.Security.dll
-%_prefix/lib/mono/2.0/Mono.Simd.dll
-%_prefix/lib/mono/2.0/Mono.Tasklets.dll
-%_prefix/lib/mono/2.0/System.Configuration.dll
-%_prefix/lib/mono/2.0/System.Core.dll
-%_prefix/lib/mono/2.0/System.Drawing.dll
-%_prefix/lib/mono/2.0/System.Net.dll
-%_prefix/lib/mono/2.0/System.Security.dll
-%_prefix/lib/mono/2.0/System.Xml.Linq.dll
-%_prefix/lib/mono/2.0/System.Xml.dll
-%_prefix/lib/mono/2.0/System.dll
-%_prefix/lib/mono/2.0/System.Json.dll
-%_prefix/lib/mono/2.0/al.exe*
-%_prefix/lib/mono/2.0/cscompmgd.dll
-%_prefix/lib/mono/2.0/gacutil.exe*
-%_prefix/lib/mono/2.0/mscorlib.dll*
-%_prefix/lib/mono/4.0/Commons.Xml.Relaxng.dll
-%_prefix/lib/mono/4.0/CustomMarshalers.dll
-%_prefix/lib/mono/4.0/I18N.West.dll
-%_prefix/lib/mono/4.0/I18N.dll
-%_prefix/lib/mono/4.0/ICSharpCode.SharpZipLib.dll
-%_prefix/lib/mono/4.0/Microsoft.CSharp.dll
-%_prefix/lib/mono/4.0/Microsoft.VisualC.dll
-%_prefix/lib/mono/4.0/Mono.C5.dll
-%_prefix/lib/mono/4.0/Mono.CSharp.dll
-%_prefix/lib/mono/4.0/Mono.Cairo.dll
-%_prefix/lib/mono/4.0/Mono.CompilerServices.SymbolWriter.dll
-%_prefix/lib/mono/4.0/Mono.Management.dll
-%_prefix/lib/mono/4.0/Mono.Parallel.dll
-%_prefix/lib/mono/4.0/Mono.Posix.dll
-%_prefix/lib/mono/4.0/Mono.Security.dll
-%_prefix/lib/mono/4.0/Mono.Simd.dll
-%_prefix/lib/mono/4.0/Mono.Tasklets.dll
-%_prefix/lib/mono/4.0/System.Configuration.dll
-%_prefix/lib/mono/4.0/System.Core.dll
-%_prefix/lib/mono/4.0/System.Drawing.dll
-%_prefix/lib/mono/4.0/System.Dynamic.dll
-%_prefix/lib/mono/4.0/System.Json.dll
-%_prefix/lib/mono/4.0/System.Json.Microsoft.dll
-%_prefix/lib/mono/4.0/System.Net.dll
-%_prefix/lib/mono/4.0/System.Numerics.dll
-%_prefix/lib/mono/4.0/System.Security.dll
-%_prefix/lib/mono/4.0/System.Xml.Linq.dll
-%_prefix/lib/mono/4.0/System.Xml.dll
-%_prefix/lib/mono/4.0/System.dll
-%_prefix/lib/mono/4.5/al.exe*
-%_prefix/lib/mono/4.5/certmgr.exe*
-%_prefix/lib/mono/4.5/chktrust.exe*
-%_prefix/lib/mono/4.5/crlupdate.exe*
-%_prefix/lib/mono/4.0/cscompmgd.dll
-%_prefix/lib/mono/4.5/csharp.exe*
-%_prefix/lib/mono/4.5/gacutil.exe*
-%_prefix/lib/mono/4.5/ikdasm.exe*
-%_prefix/lib/mono/4.5/mcs.exe*
-%_prefix/lib/mono/4.5/mozroots.exe*
-%_prefix/lib/mono/4.0/mscorlib.dll*
-%_prefix/lib/mono/4.5/setreg.exe*
-%_prefix/lib/mono/4.5/sn.exe*
-%_prefix/lib/mono/4.5/Commons.Xml.Relaxng.dll
-%_prefix/lib/mono/4.5/CustomMarshalers.dll
-%_prefix/lib/mono/4.5/I18N.CJK.dll
-%_prefix/lib/mono/4.5/I18N.MidEast.dll
-%_prefix/lib/mono/4.5/I18N.Other.dll
-%_prefix/lib/mono/4.5/I18N.Rare.dll
-%_prefix/lib/mono/4.5/I18N.West.dll
-%_prefix/lib/mono/4.5/I18N.dll
-%_prefix/lib/mono/4.5/IBM.Data.DB2.dll
-%_prefix/lib/mono/4.5/ICSharpCode.SharpZipLib.dll
-%_prefix/lib/mono/4.5/Microsoft.CSharp.dll
-%_prefix/lib/mono/4.5/Microsoft.VisualC.dll
-%_prefix/lib/mono/4.5/Mono.C5.dll
-%_prefix/lib/mono/4.5/Mono.CSharp.dll
-%_prefix/lib/mono/4.5/Mono.Cairo.dll
-%_prefix/lib/mono/4.5/Mono.CompilerServices.SymbolWriter.dll
-%_prefix/lib/mono/4.5/Mono.Management.dll
-%_prefix/lib/mono/4.5/Mono.Parallel.dll
-%_prefix/lib/mono/4.5/Mono.Posix.dll
-%_prefix/lib/mono/4.5/Mono.Security.dll
-%_prefix/lib/mono/4.5/Mono.Simd.dll
-%_prefix/lib/mono/4.5/Mono.Tasklets.dll
-%_prefix/lib/mono/4.5/System.Configuration.dll
-%_prefix/lib/mono/4.5/System.Core.dll
-%_prefix/lib/mono/4.5/System.Drawing.dll
-%_prefix/lib/mono/4.5/System.Dynamic.dll
-%_prefix/lib/mono/4.5/System.IO.Compression.dll
-%_prefix/lib/mono/4.5/System.IO.Compression.FileSystem.dll
-%_prefix/lib/mono/4.5/System.Json.dll
-%_prefix/lib/mono/4.5/System.Json.Microsoft.dll
-%_prefix/lib/mono/4.5/System.Net.dll
-%_prefix/lib/mono/4.5/System.Net.Http.dll
-%_prefix/lib/mono/4.5/System.Net.Http.WebRequest.dll
-%_prefix/lib/mono/4.5/System.Numerics.dll
-%_prefix/lib/mono/4.5/System.Security.dll
-%_prefix/lib/mono/4.5/System.Threading.Tasks.Dataflow.dll
-%_prefix/lib/mono/4.5/System.Xml.Linq.dll
-%_prefix/lib/mono/4.5/System.Xml.dll
-%_prefix/lib/mono/4.5/System.dll
-%_prefix/lib/mono/4.5/cscompmgd.dll
-%_prefix/lib/mono/4.5/mscorlib.dll*
-%_prefix/lib/mono/4.5/System.Windows.dll
-%_prefix/lib/mono/4.5/System.Xml.Serialization.dll
-%_prefix/lib/mono/4.5/Facades/*.dll
-%_prefix/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll
-%_prefix/lib/mono/gac/Commons.Xml.Relaxng
-%_prefix/lib/mono/gac/CustomMarshalers
-%_prefix/lib/mono/gac/I18N
-%_prefix/lib/mono/gac/I18N.West
-%_prefix/lib/mono/gac/ICSharpCode.SharpZipLib
-%_prefix/lib/mono/gac/Microsoft.CSharp
-%_prefix/lib/mono/gac/Microsoft.VisualC
-%_prefix/lib/mono/gac/Mono.C5
-%_prefix/lib/mono/gac/Mono.CSharp
-%_prefix/lib/mono/gac/Mono.Cairo
-%_prefix/lib/mono/gac/Mono.Cecil
-%_prefix/lib/mono/gac/Mono.Cecil.Mdb
-%_prefix/lib/mono/gac/Mono.CompilerServices.SymbolWriter
-%_prefix/lib/mono/gac/Mono.Management
-%_prefix/lib/mono/gac/Mono.Parallel
-%_prefix/lib/mono/gac/Mono.Posix
-%_prefix/lib/mono/gac/Mono.Security
-%_prefix/lib/mono/gac/Mono.Simd
-%_prefix/lib/mono/gac/Mono.Tasklets
-%_prefix/lib/mono/gac/System
-%_prefix/lib/mono/gac/System.Configuration
-%_prefix/lib/mono/gac/System.Core
-%_prefix/lib/mono/gac/System.Drawing
-%_prefix/lib/mono/gac/System.Dynamic
-%_prefix/lib/mono/gac/System.IO.Compression
-%_prefix/lib/mono/gac/System.IO.Compression.FileSystem
-%_prefix/lib/mono/gac/System.Net
-%_prefix/lib/mono/gac/System.Net.Http
-%_prefix/lib/mono/gac/System.Net.Http.WebRequest
-%_prefix/lib/mono/gac/System.Numerics
-%_prefix/lib/mono/gac/System.Security
-%_prefix/lib/mono/gac/System.Threading.Tasks.Dataflow
-%_prefix/lib/mono/gac/System.Xml
-%_prefix/lib/mono/gac/System.Xml.Linq
-%_prefix/lib/mono/gac/System.Json
-%_prefix/lib/mono/gac/System.Json.Microsoft
-%_prefix/lib/mono/gac/System.Windows
-%_prefix/lib/mono/gac/System.Xml.Serialization
-%_prefix/lib/mono/gac/cscompmgd
-%_prefix/lib/mono/mono-configuration-crypto
-
-%package -n libmono-2_0-1
-License: LGPL v2.1 only
-Summary: A Library for embedding Mono in your Application
-Group: Development/Libraries/C and C++
-
-%description -n libmono-2_0-1
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-A Library for embedding Mono in your Application.
-
-%files -n libmono-2_0-1
-%defattr(-, root, root)
-%_libdir/libmono-2.0.so.1*
-
-%post -n libmono-2_0-1 -p /sbin/ldconfig
-
-%postun -n libmono-2_0-1 -p /sbin/ldconfig
-
-%package -n libmono-2_0-devel
-License: LGPL v2.1 only
-Summary: Development files for libmono
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-
-%description -n libmono-2_0-devel
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Development files for libmono.
-
-%files -n libmono-2_0-devel
-%defattr(-, root, root)
-%_bindir/mono-gdb.py
-%_includedir/mono-2.0
-%_libdir/libmono-2.0.a
-%_libdir/libmono-2.0.so
-%_libdir/pkgconfig/mono-2.pc
-
-%if %sgen == yes
-%package -n libmonosgen-2_0-1
-License: LGPL v2.1 only
-Summary: A Library for embedding Mono in your Application (sgen version)
-Group: Development/Libraries/C and C++
-
-%description -n libmonosgen-2_0-1
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-A Library for embedding Mono in your Application (sgen version).
-
-%files -n libmonosgen-2_0-1
-%defattr(-, root, root)
-%_libdir/libmonosgen-2.0.so.1*
-
-%post -n libmonosgen-2_0-1 -p /sbin/ldconfig
-
-%postun -n libmonosgen-2_0-1 -p /sbin/ldconfig
-
-%package -n libmonosgen-2_0-devel
-License: LGPL v2.1 only
-Summary: Development files for libmonosgen
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Requires: libmono-2_0-devel
-
-%description -n libmonosgen-2_0-devel
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Development files for libmonosgen.
-
-%files -n libmonosgen-2_0-devel
-%defattr(-, root, root)
-%_bindir/mono-sgen-gdb.py
-%_libdir/libmonosgen-2.0.a
-%_libdir/libmonosgen-2.0.so
-%_libdir/pkgconfig/monosgen-2.pc
-%endif
-
-%package -n libmonoboehm-2_0-1
-License: LGPL v2.1 only
-Summary: A Library for embedding Mono in your Application (boehm version)
-Group: Development/Libraries/C and C++
-
-%description -n libmonoboehm-2_0-1
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-A Library for embedding Mono in your Application (boehm version).
-
-%files -n libmonoboehm-2_0-1
-%defattr(-, root, root)
-%_libdir/libmonoboehm-2.0.so.1*
-
-%post -n libmonoboehm-2_0-1 -p /sbin/ldconfig
-
-%postun -n libmonoboehm-2_0-1 -p /sbin/ldconfig
-
-%package -n libmonoboehm-2_0-devel
-License: LGPL v2.1 only
-Summary: Development files for libmonosgen
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Requires: libmono-2_0-devel
-
-%description -n libmonoboehm-2_0-devel
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Development files for libmonoboehm.
-
-%files -n libmonoboehm-2_0-devel
-%defattr(-, root, root)
-%_libdir/libmonoboehm-2.0.a
-%_libdir/libmonoboehm-2.0.so
-
-%if %llvm == yes
-%package -n libmono-llvm0
-License: LGPL v2.1 only
-Summary: Loadable LLVM libary for mono
-Group: Development/Libraries/C and C++
-
-%description -n libmono-llvm0
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Loadable LLVM libary for mono.
-
-%files -n libmono-llvm0
-%defattr(-, root, root)
-%_libdir/libmono-llvm.so*
-
-%post -n libmono-llvm0 -p /sbin/ldconfig
-
-%postun -n libmono-llvm0 -p /sbin/ldconfig
-%endif
-
-%package -n mono-locale-extras
-License: LGPL v2.1 only
-Summary: Extra locale information
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Provides: mono(I18N.CJK) = 1.0.5000.0
-Provides: mono(I18N.MidEast) = 1.0.5000.0
-Provides: mono(I18N.Other) = 1.0.5000.0
-Provides: mono(I18N.Rare) = 1.0.5000.0
-
-%description -n mono-locale-extras
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Extra locale information.
-
-%files -n mono-locale-extras
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/I18N.CJK.dll
-%_prefix/lib/mono/2.0/I18N.MidEast.dll
-%_prefix/lib/mono/2.0/I18N.Other.dll
-%_prefix/lib/mono/2.0/I18N.Rare.dll
-%_prefix/lib/mono/4.0/I18N.CJK.dll
-%_prefix/lib/mono/4.0/I18N.MidEast.dll
-%_prefix/lib/mono/4.0/I18N.Other.dll
-%_prefix/lib/mono/4.0/I18N.Rare.dll
-%_prefix/lib/mono/4.5/I18N.CJK.dll
-%_prefix/lib/mono/4.5/I18N.MidEast.dll
-%_prefix/lib/mono/4.5/I18N.Other.dll
-%_prefix/lib/mono/4.5/I18N.Rare.dll
-%_prefix/lib/mono/gac/I18N.CJK
-%_prefix/lib/mono/gac/I18N.MidEast
-%_prefix/lib/mono/gac/I18N.Other
-%_prefix/lib/mono/gac/I18N.Rare
-
-%package -n mono-data
-License: LGPL v2.1 only
-Summary: Database connectivity for Mono
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Obsoletes: mono-directory
-Obsoletes: mono-ms-enterprise
-Obsoletes: mono-novell-directory
-Provides: mono-directory
-Provides: mono-ms-enterprise
-Provides: mono-novell-directory
-Provides: mono(Mono.Data.Tds) = 1.0.5000.0
-Provides: mono(Novell.Directory.Ldap) = 1.0.5000.0
-Provides: mono(System.Data) = 1.0.5000.0
-Provides: mono(System.DirectoryServices) = 1.0.5000.0
-Provides: mono(System.DirectoryServices.Protocols) = 1.0.5000.0
-Provides: mono(System.EnterpriseServices) = 1.0.5000.0
-
-%description -n mono-data
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Database connectivity for Mono.
-
-%files -n mono-data
-%defattr(-, root, root)
-%_bindir/sqlmetal
-%_bindir/sqlsharp
-%_mandir/man1/sqlsharp.1%ext_man
-%_prefix/lib/mono/2.0/Mono.Data.Tds.dll
-%_prefix/lib/mono/2.0/Novell.Directory.Ldap.dll
-%_prefix/lib/mono/2.0/System.Data.DataSetExtensions.dll
-%_prefix/lib/mono/2.0/System.Data.Linq.dll
-%_prefix/lib/mono/2.0/System.Data.dll
-%_prefix/lib/mono/2.0/System.DirectoryServices.dll
-%_prefix/lib/mono/2.0/System.DirectoryServices.Protocols.dll
-%_prefix/lib/mono/2.0/System.EnterpriseServices.dll
-%_prefix/lib/mono/2.0/System.Runtime.Serialization.dll
-%_prefix/lib/mono/2.0/System.Transactions.dll
-%_prefix/lib/mono/4.0/Mono.Data.Tds.dll
-%_prefix/lib/mono/4.0/Novell.Directory.Ldap.dll
-%_prefix/lib/mono/4.0/System.Data.DataSetExtensions.dll
-%_prefix/lib/mono/4.0/System.Data.Linq.dll
-%_prefix/lib/mono/4.0/System.Data.dll
-%_prefix/lib/mono/4.0/System.DirectoryServices.dll
-%_prefix/lib/mono/4.0/System.DirectoryServices.Protocols.dll
-%_prefix/lib/mono/4.0/System.EnterpriseServices.dll
-%_prefix/lib/mono/4.0/System.Runtime.Serialization.dll
-%_prefix/lib/mono/4.0/System.Transactions.dll
-%_prefix/lib/mono/4.0/WebMatrix.Data.dll
-%_prefix/lib/mono/4.5/Mono.Data.Tds.dll
-%_prefix/lib/mono/4.5/Novell.Directory.Ldap.dll
-%_prefix/lib/mono/4.5/System.Data.DataSetExtensions.dll
-%_prefix/lib/mono/4.5/System.Data.Linq.dll
-%_prefix/lib/mono/4.5/System.Data.dll
-%_prefix/lib/mono/4.5/System.DirectoryServices.dll
-%_prefix/lib/mono/4.5/System.DirectoryServices.Protocols.dll
-%_prefix/lib/mono/4.5/System.EnterpriseServices.dll
-%_prefix/lib/mono/4.5/System.Runtime.Serialization.dll
-%_prefix/lib/mono/4.5/System.Transactions.dll
-%_prefix/lib/mono/4.5/WebMatrix.Data.dll
-%_prefix/lib/mono/4.5/EntityFramework.dll
-%_prefix/lib/mono/4.5/EntityFramework.SqlServer.dll
-%_prefix/lib/mono/4.5/sqlmetal.exe*
-%_prefix/lib/mono/4.5/sqlsharp.exe*
-%_prefix/lib/mono/gac/Mono.Data.Tds
-%_prefix/lib/mono/gac/Novell.Directory.Ldap
-%_prefix/lib/mono/gac/System.Data
-%_prefix/lib/mono/gac/System.Data.DataSetExtensions
-%_prefix/lib/mono/gac/System.Data.Linq
-%_prefix/lib/mono/gac/System.DirectoryServices
-%_prefix/lib/mono/gac/System.DirectoryServices.Protocols
-%_prefix/lib/mono/gac/System.EnterpriseServices
-%_prefix/lib/mono/gac/System.Runtime.Serialization
-%_prefix/lib/mono/gac/System.Transactions
-%_prefix/lib/mono/gac/WebMatrix.Data
-%_prefix/lib/mono/gac/EntityFramework
-%_prefix/lib/mono/gac/EntityFramework.SqlServer
-
-%package -n mono-winforms
-License: LGPL v2.1 only
-Summary: Mono's Windows Forms implementation
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Provides: mono-window-forms
-Obsoletes: mono-window-forms
-Provides: mono(Accessibility) = 1.0.5000.0
-Provides: mono(System.Design) = 1.0.5000.0
-Provides: mono(System.Drawing) = 1.0.5000.0
-Provides: mono(System.Drawing.Design) = 1.0.5000.0
-Provides: mono(System.Windows.Forms) = 1.0.5000.0
-
-%description -n mono-winforms
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Mono's Windows Forms implementation.
-
-%files -n mono-winforms
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/Accessibility.dll
-%_prefix/lib/mono/2.0/Mono.WebBrowser.dll
-%_prefix/lib/mono/2.0/System.Design.dll
-%_prefix/lib/mono/2.0/System.Drawing.Design.dll
-%_prefix/lib/mono/2.0/System.Windows.Forms.dll
-%_prefix/lib/mono/4.0/Accessibility.dll
-%_prefix/lib/mono/4.0/Mono.WebBrowser.dll
-%_prefix/lib/mono/4.0/System.Design.dll
-%_prefix/lib/mono/4.0/System.Drawing.Design.dll
-%_prefix/lib/mono/4.0/System.Windows.Forms.DataVisualization.dll
-%_prefix/lib/mono/4.0/System.Windows.Forms.dll
-%_prefix/lib/mono/4.5/Accessibility.dll
-%_prefix/lib/mono/4.5/Mono.WebBrowser.dll
-%_prefix/lib/mono/4.5/System.Design.dll
-%_prefix/lib/mono/4.5/System.Drawing.Design.dll
-%_prefix/lib/mono/4.5/System.Windows.Forms.DataVisualization.dll
-%_prefix/lib/mono/4.5/System.Windows.Forms.dll
-%_prefix/lib/mono/gac/Accessibility
-%_prefix/lib/mono/gac/Mono.WebBrowser
-%_prefix/lib/mono/gac/System.Design
-%_prefix/lib/mono/gac/System.Drawing.Design
-%_prefix/lib/mono/gac/System.Windows.Forms
-%_prefix/lib/mono/gac/System.Windows.Forms.DataVisualization
-
-%package -n ibm-data-db2
-License: LGPL v2.1 only
-Summary: Database connectivity for DB2
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-
-%description -n ibm-data-db2
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Database connectivity for DB2.
-
-%files -n ibm-data-db2
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/IBM.Data.DB2.dll
-%_prefix/lib/mono/4.0/IBM.Data.DB2.dll
-%_prefix/lib/mono/4.5/IBM.Data.DB2.dll
-%_prefix/lib/mono/gac/IBM.Data.DB2
-
-%package -n mono-extras
-License: LGPL v2.1 only
-Summary: Extra packages
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Obsoletes: mono-ms-extras
-Provides: mono-ms-extras
-Provides: mono(Mono.Messaging) = 1.0.5000.0
-Provides: mono(Mono.Messaging.RabbitMQ) = 1.0.5000.0
-Provides: mono(RabbitMQ.Client) = 1.0.5000.0
-Provides: mono(System.Configuration.Install) = 1.0.5000.0
-Provides: mono(System.Management) = 1.0.5000.0
-Provides: mono(System.Messaging) = 1.0.5000.0
-Provides: mono(System.ServiceProcess) = 1.0.5000.0
-Provides: mono(mono-service) = 1.0.5000.0
-
-%description -n mono-extras
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Extra packages.
-
-%files -n mono-extras
-%defattr(-, root, root)
-%_bindir/mono-service
-%_bindir/mono-service2
-%_mandir/man1/mono-service.1%ext_man
-%_prefix/lib/mono/2.0/Mono.Messaging.RabbitMQ.dll
-%_prefix/lib/mono/2.0/Mono.Messaging.dll
-%_prefix/lib/mono/2.0/RabbitMQ.Client.Apigen.exe*
-%_prefix/lib/mono/2.0/RabbitMQ.Client.dll
-%_prefix/lib/mono/2.0/System.Configuration.Install.dll
-%_prefix/lib/mono/2.0/System.Management.dll
-%_prefix/lib/mono/2.0/System.Messaging.dll
-%_prefix/lib/mono/2.0/System.ServiceProcess.dll
-%_prefix/lib/mono/2.0/mono-service.exe*
-%_prefix/lib/mono/4.0/Mono.Messaging.RabbitMQ.dll
-%_prefix/lib/mono/4.0/Mono.Messaging.dll
-%_prefix/lib/mono/4.0/RabbitMQ.Client.Apigen.exe*
-%_prefix/lib/mono/4.0/RabbitMQ.Client.dll
-%_prefix/lib/mono/4.0/System.Configuration.Install.dll
-%_prefix/lib/mono/4.0/System.Management.dll
-%_prefix/lib/mono/4.0/System.Messaging.dll
-%_prefix/lib/mono/4.0/System.Runtime.Caching.dll
-%_prefix/lib/mono/4.0/System.ServiceProcess.dll
-%_prefix/lib/mono/4.0/System.Xaml.dll
-%_prefix/lib/mono/4.5/installutil.exe*
-%_prefix/lib/mono/4.5/mono-service.exe*
-%_prefix/lib/mono/4.5/Mono.Messaging.RabbitMQ.dll
-%_prefix/lib/mono/4.5/Mono.Messaging.dll
-%_prefix/lib/mono/4.5/RabbitMQ.Client.Apigen.exe*
-%_prefix/lib/mono/4.5/RabbitMQ.Client.dll
-%_prefix/lib/mono/4.5/System.Configuration.Install.dll
-%_prefix/lib/mono/4.5/System.Management.dll
-%_prefix/lib/mono/4.5/System.Messaging.dll
-%_prefix/lib/mono/4.5/System.Runtime.Caching.dll
-%_prefix/lib/mono/4.5/System.ServiceProcess.dll
-%_prefix/lib/mono/4.5/System.Xaml.dll
-%_prefix/lib/mono/gac/Mono.Messaging
-%_prefix/lib/mono/gac/Mono.Messaging.RabbitMQ
-%_prefix/lib/mono/gac/RabbitMQ.Client
-%_prefix/lib/mono/gac/System.Configuration.Install
-%_prefix/lib/mono/gac/System.Management
-%_prefix/lib/mono/gac/System.Messaging
-%_prefix/lib/mono/gac/System.Runtime.Caching
-%_prefix/lib/mono/gac/System.ServiceProcess
-%_prefix/lib/mono/gac/System.Xaml
-%_prefix/lib/mono/gac/mono-service
-
-%package -n mono-data-sqlite
-License: LGPL v2.1 only
-Summary: Database connectivity for Mono
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Requires: mono-data == %version-%release
-Provides: mono(Mono.Data.Sqlite) = 1.0.5000.0
-
-%description -n mono-data-sqlite
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Database connectivity for Mono.
-
-%files -n mono-data-sqlite
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/Mono.Data.Sqlite.dll
-%_prefix/lib/mono/4.0/Mono.Data.Sqlite.dll
-%_prefix/lib/mono/4.5/Mono.Data.Sqlite.dll
-%_prefix/lib/mono/gac/Mono.Data.Sqlite
-
-%package -n mono-wcf
-License: MIT License (or similar) ; Ms-Pl
-Summary: Mono implementation of WCF, Windows Communication Foundation
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-
-%description -n mono-wcf
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Mono implementation of WCF, Windows Communication Foundation
-
-%files -n mono-wcf
-%defattr(-, root, root)
-%_bindir/svcutil
-%_libdir/pkgconfig/wcf.pc
-%_prefix/lib/mono/2.0/System.Data.Services.dll
-%_prefix/lib/mono/2.0/System.IdentityModel.Selectors.dll
-%_prefix/lib/mono/2.0/System.IdentityModel.dll
-%_prefix/lib/mono/2.0/System.ServiceModel.Web.dll
-%_prefix/lib/mono/2.0/System.ServiceModel.dll
-%_prefix/lib/mono/4.0/System.Data.Services.dll
-%_prefix/lib/mono/4.0/System.IdentityModel.Selectors.dll
-%_prefix/lib/mono/4.0/System.IdentityModel.dll
-%_prefix/lib/mono/4.0/System.Runtime.DurableInstancing.dll
-%_prefix/lib/mono/4.0/System.ServiceModel.Activation.dll
-%_prefix/lib/mono/4.0/System.ServiceModel.Discovery.dll
-%_prefix/lib/mono/4.0/System.ServiceModel.Routing.dll
-%_prefix/lib/mono/4.0/System.ServiceModel.Web.dll
-%_prefix/lib/mono/4.0/System.ServiceModel.dll
-%_prefix/lib/mono/4.5/System.Data.Services.dll
-%_prefix/lib/mono/4.5/System.IdentityModel.Selectors.dll
-%_prefix/lib/mono/4.5/System.IdentityModel.dll
-%_prefix/lib/mono/4.5/System.Runtime.DurableInstancing.dll
-%_prefix/lib/mono/4.5/System.ServiceModel.Activation.dll
-%_prefix/lib/mono/4.5/System.ServiceModel.Discovery.dll
-%_prefix/lib/mono/4.5/System.ServiceModel.Routing.dll
-%_prefix/lib/mono/4.5/System.ServiceModel.Web.dll
-%_prefix/lib/mono/4.5/System.ServiceModel.dll
-%_prefix/lib/mono/4.5/svcutil.exe*
-%_prefix/lib/mono/gac/System.Data.Services
-%_prefix/lib/mono/gac/System.IdentityModel
-%_prefix/lib/mono/gac/System.IdentityModel.Selectors
-%_prefix/lib/mono/gac/System.Runtime.DurableInstancing
-%_prefix/lib/mono/gac/System.ServiceModel
-%_prefix/lib/mono/gac/System.ServiceModel.Activation
-%_prefix/lib/mono/gac/System.ServiceModel.Discovery
-%_prefix/lib/mono/gac/System.ServiceModel.Routing
-%_prefix/lib/mono/gac/System.ServiceModel.Web
-
-%package -n mono-winfxcore
-License: MIT License (or similar) ; Ms-Pl
-Summary: Mono implementation of core WinFX APIs
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-
-%description -n mono-winfxcore
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Mono implementation of core WinFX APIs
-
-%files -n mono-winfxcore
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/System.Data.Services.Client.dll*
-%_prefix/lib/mono/2.0/WindowsBase.dll*
-%_prefix/lib/mono/4.0/System.Data.Services.Client.dll*
-%_prefix/lib/mono/4.0/WindowsBase.dll*
-%_prefix/lib/mono/4.5/System.Data.Services.Client.dll*
-%_prefix/lib/mono/4.5/WindowsBase.dll*
-%_prefix/lib/mono/gac/System.Data.Services.Client
-%_prefix/lib/mono/gac/WindowsBase
-
-%package -n mono-web
-License: MIT License (or similar) ; Ms-Pl
-Summary: Mono implementation of ASP.NET, Remoting and Web Services
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Obsoletes: mono-remoting
-Obsoletes: mono-web-forms
-Obsoletes: mono-web-services
-Provides: mono-remoting
-Provides: mono-web-forms
-Provides: mono-web-services
-Provides: mono(Mono.Http) = 1.0.5000.0
-Provides: mono(System.Runtime.Remoting) = 1.0.5000.0
-Provides: mono(System.Runtime.Serialization.Formatters.Soap) = 1.0.5000.0
-Provides: mono(System.Web) = 1.0.5000.0
-Provides: mono(System.Web.Services) = 1.0.5000.0
-
-%description -n mono-web
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Mono implementation of ASP.NET, Remoting and Web Services.
-
-%files -n mono-web
-%defattr(-, root, root)
-%config %_sysconfdir/mono/2.0/Browsers
-%config %_sysconfdir/mono/2.0/DefaultWsdlHelpGenerator.aspx
-%config %_sysconfdir/mono/2.0/web.config
-%config %_sysconfdir/mono/4.0/Browsers
-%config %_sysconfdir/mono/4.0/DefaultWsdlHelpGenerator.aspx
-%config %_sysconfdir/mono/4.0/web.config
-%config %_sysconfdir/mono/4.5/Browsers
-%config %_sysconfdir/mono/4.5/DefaultWsdlHelpGenerator.aspx
-%config %_sysconfdir/mono/4.5/web.config
-%config %_sysconfdir/mono/browscap.ini
-%config %_sysconfdir/mono/mconfig/config.xml
-%dir %_sysconfdir/mono/mconfig
-%_bindir/disco
-%_bindir/mconfig
-%_bindir/soapsuds
-%_bindir/wsdl
-%_bindir/wsdl2
-%_bindir/xsd
-%_libdir/pkgconfig/aspnetwebstack.pc
-%_mandir/man1/disco.1%ext_man
-%_mandir/man1/mconfig.1%ext_man
-%_mandir/man1/soapsuds.1%ext_man
-%_mandir/man1/wsdl.1%ext_man
-%_mandir/man1/xsd.1%ext_man
-%_prefix/lib/mono/2.0/Mono.Http.dll
-%_prefix/lib/mono/2.0/System.ComponentModel.DataAnnotations.dll
-%_prefix/lib/mono/2.0/System.Runtime.Remoting.dll
-%_prefix/lib/mono/2.0/System.Runtime.Serialization.Formatters.Soap.dll
-%_prefix/lib/mono/2.0/System.Web.Abstractions.dll
-%_prefix/lib/mono/2.0/System.Web.Routing.dll
-%_prefix/lib/mono/2.0/System.Web.Services.dll
-%_prefix/lib/mono/2.0/System.Web.dll
-%_prefix/lib/mono/2.0/wsdl.exe*
-%_prefix/lib/mono/2.0/xsd.exe*
-%_prefix/lib/mono/4.0/Microsoft.Web.Infrastructure.dll
-%_prefix/lib/mono/4.0/Mono.Http.dll
-%_prefix/lib/mono/4.0/System.ComponentModel.Composition.dll
-%_prefix/lib/mono/4.0/System.ComponentModel.DataAnnotations.dll
-%_prefix/lib/mono/4.0/System.Runtime.Remoting.dll
-%_prefix/lib/mono/4.0/System.Runtime.Serialization.Formatters.Soap.dll
-%_prefix/lib/mono/4.0/System.Web.Abstractions.dll
-%_prefix/lib/mono/4.0/System.Web.ApplicationServices.dll
-%_prefix/lib/mono/4.0/System.Web.Routing.dll
-%_prefix/lib/mono/4.0/System.Web.Services.dll
-%_prefix/lib/mono/4.0/System.Web.dll
-%_prefix/lib/mono/4.5/Mono.Http.dll
-%_prefix/lib/mono/4.5/System.ComponentModel.Composition.dll
-%_prefix/lib/mono/4.5/System.ComponentModel.DataAnnotations.dll
-%_prefix/lib/mono/4.5/System.Net.Http.Formatting.dll
-%_prefix/lib/mono/4.5/System.Runtime.Remoting.dll
-%_prefix/lib/mono/4.5/System.Runtime.Serialization.Formatters.Soap.dll
-%_prefix/lib/mono/4.5/System.Web.Abstractions.dll
-%_prefix/lib/mono/4.5/System.Web.ApplicationServices.dll
-%_prefix/lib/mono/4.5/System.Web.Http.dll
-%_prefix/lib/mono/4.5/System.Web.Http.SelfHost.dll
-%_prefix/lib/mono/4.5/System.Web.Http.WebHost.dll
-%_prefix/lib/mono/4.5/System.Web.Routing.dll
-%_prefix/lib/mono/4.5/System.Web.Razor.dll
-%_prefix/lib/mono/4.5/System.Web.Services.dll
-%_prefix/lib/mono/4.5/System.Web.WebPages.Deployment.dll
-%_prefix/lib/mono/4.5/System.Web.WebPages.Razor.dll
-%_prefix/lib/mono/4.5/System.Web.WebPages.dll
-%_prefix/lib/mono/4.5/System.Web.dll
-%_prefix/lib/mono/4.5/disco.exe*
-%_prefix/lib/mono/4.5/mconfig.exe*
-%_prefix/lib/mono/4.5/soapsuds.exe*
-%_prefix/lib/mono/4.5/wsdl.exe*
-%_prefix/lib/mono/4.5/xsd.exe*
-%_prefix/lib/mono/4.5/Microsoft.Web.Infrastructure.dll
-%_prefix/lib/mono/gac/Microsoft.Web.Infrastructure
-%_prefix/lib/mono/gac/Mono.Http
-%_prefix/lib/mono/gac/System.ComponentModel.Composition
-%_prefix/lib/mono/gac/System.ComponentModel.DataAnnotations
-%_prefix/lib/mono/gac/System.Net.Http.Formatting
-%_prefix/lib/mono/gac/System.Runtime.Remoting
-%_prefix/lib/mono/gac/System.Runtime.Serialization.Formatters.Soap
-%_prefix/lib/mono/gac/System.Web
-%_prefix/lib/mono/gac/System.Web.Abstractions
-%_prefix/lib/mono/gac/System.Web.ApplicationServices
-%_prefix/lib/mono/gac/System.Web.Http
-%_prefix/lib/mono/gac/System.Web.Http.SelfHost
-%_prefix/lib/mono/gac/System.Web.Http.WebHost
-%_prefix/lib/mono/gac/System.Web.Routing
-%_prefix/lib/mono/gac/System.Web.Razor
-%_prefix/lib/mono/gac/System.Web.Services
-%_prefix/lib/mono/gac/System.Web.WebPages.Deployment
-%_prefix/lib/mono/gac/System.Web.WebPages.Razor
-%_prefix/lib/mono/gac/System.Web.WebPages
-
-%package -n mono-mvc
-License: MIT License (or similar) ; Ms-Pl
-Summary: Mono implementation of ASP.NET MVC
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-
-%description -n mono-mvc
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Mono implementation of ASP.NET MVC.
-
-%files -n mono-mvc
-%defattr(-, root, root)
-%_libdir/pkgconfig/system.web.extensions.design_1.0.pc
-%_libdir/pkgconfig/system.web.extensions_1.0.pc
-%_libdir/pkgconfig/system.web.mvc.pc
-%_libdir/pkgconfig/system.web.mvc2.pc
-%_libdir/pkgconfig/system.web.mvc3.pc
-%_prefix/lib/mono/2.0/System.Web.DynamicData.dll
-%_prefix/lib/mono/2.0/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/2.0/System.Web.Extensions.dll
-%_prefix/lib/mono/2.0/System.Web.Mvc.dll
-%_prefix/lib/mono/4.0/System.Web.DynamicData.dll
-%_prefix/lib/mono/4.0/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/4.0/System.Web.Extensions.dll
-%_prefix/lib/mono/4.5/System.Web.DynamicData.dll
-%_prefix/lib/mono/4.5/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/4.5/System.Web.Extensions.dll
-%_prefix/lib/mono/4.5/System.Web.Mvc.dll
-%_prefix/lib/mono/compat-2.0/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/compat-2.0/System.Web.Extensions.dll
-%_prefix/lib/mono/compat-2.0/System.Web.Mvc.dll
-%_prefix/lib/mono/gac/System.Web.DynamicData
-%_prefix/lib/mono/gac/System.Web.Extensions
-%_prefix/lib/mono/gac/System.Web.Extensions.Design
-%_prefix/lib/mono/gac/System.Web.Mvc
-
-%package -n mono-data-oracle
-License: LGPL v2.1 only
-Summary: Database connectivity for Mono
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Requires: mono-data == %version-%release
-Provides: mono(System.Data.OracleClient) = 1.0.5000.0
-
-%description -n mono-data-oracle
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Database connectivity for Mono.
-
-%files -n mono-data-oracle
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/System.Data.OracleClient.dll
-%_prefix/lib/mono/4.0/System.Data.OracleClient.dll
-%_prefix/lib/mono/4.5/System.Data.OracleClient.dll
-%_prefix/lib/mono/gac/System.Data.OracleClient
-
-%package -n mono-data-postgresql
-License: LGPL v2.1 only
-Summary: Database connectivity for Mono
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Requires: mono-data == %version-%release
-Provides: mono(Npgsql) = 1.0.5000.0
-
-%description -n mono-data-postgresql
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Database connectivity for Mono.
-
-%files -n mono-data-postgresql
-%defattr(-, root, root)
-%_prefix/lib/mono/2.0/Npgsql.dll
-%_prefix/lib/mono/4.0/Npgsql.dll
-%_prefix/lib/mono/4.5/Npgsql.dll
-%_prefix/lib/mono/gac/Npgsql
-
-%package -n mono-rx-core
-License: MIT License (or similar) ; Apache License 2.0
-Summary: Reactive Extensions for Mono core libraries
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Provides: mono(System.Reactive.Interfaces) = 1.0.5000.0
-
-%description -n mono-rx-core
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Reactive Extensions for Mono, core packages, which don't depend on
-desktop-specific features.
-
-%files -n mono-rx-core
-%defattr(-, root, root)
-%_libdir/pkgconfig/reactive.pc
-%_prefix/lib/mono/4.5/System.Reactive.Core.dll
-%_prefix/lib/mono/4.5/System.Reactive.Debugger.dll
-%_prefix/lib/mono/4.5/System.Reactive.Experimental.dll
-%_prefix/lib/mono/4.5/System.Reactive.Interfaces.dll
-%_prefix/lib/mono/4.5/System.Reactive.Linq.dll
-%_prefix/lib/mono/4.5/System.Reactive.Observable.Aliases.dll
-%_prefix/lib/mono/4.5/System.Reactive.PlatformServices.dll
-%_prefix/lib/mono/4.5/System.Reactive.Providers.dll
-%_prefix/lib/mono/4.5/System.Reactive.Runtime.Remoting.dll
-%_prefix/lib/mono/gac/System.Reactive.Core
-%_prefix/lib/mono/gac/System.Reactive.Debugger
-%_prefix/lib/mono/gac/System.Reactive.Experimental
-%_prefix/lib/mono/gac/System.Reactive.Interfaces
-%_prefix/lib/mono/gac/System.Reactive.Linq
-%_prefix/lib/mono/gac/System.Reactive.Observable.Aliases
-%_prefix/lib/mono/gac/System.Reactive.PlatformServices
-%_prefix/lib/mono/gac/System.Reactive.Providers
-%_prefix/lib/mono/gac/System.Reactive.Runtime.Remoting
-
-%package -n mono-rx-desktop
-License: MIT License (or similar) ; Apache License 2.0
-Summary: Reactive Extensions for Mono desktop-specific libraries
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Requires: mono-rx-core == %version-%release
-Provides: mono(System.Reactive.Interfaces) = 1.0.5000.0
-
-%description -n mono-rx-desktop
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Reactive Extensions for Mono, desktop-specific packages (winforms,
-windows threading).
-
-%files -n mono-rx-desktop
-%defattr(-, root, root)
-%_prefix/lib/mono/4.5/System.Reactive.Windows.Forms.dll
-%_prefix/lib/mono/4.5/System.Reactive.Windows.Threading.dll
-%_prefix/lib/mono/gac/System.Reactive.Windows.Forms
-%_prefix/lib/mono/gac/System.Reactive.Windows.Threading
-
-%package -n mono-nunit
-License: LGPL v2.1 only
-Summary: NUnit Testing Framework
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-
-%description -n mono-nunit
-NUnit is a unit-testing framework for all .Net languages. Initially
-ported from JUnit, the current release, version 2.2, is the fourth
-major release of this Unit based unit testing tool for Microsoft .NET.
-It is written entirely in C# and has been completely redesigned to
-take advantage of many .NET language features, for example
-custom attributes and other reflection related capabilities. NUnit
-brings xUnit to all .NET languages.
-
-%files -n mono-nunit
-%defattr(-, root, root)
-%_libdir/pkgconfig/mono-nunit.pc
-%_prefix/bin/nunit-console
-%_prefix/bin/nunit-console2
-%_prefix/bin/nunit-console4
-%_prefix/lib/mono/2.0/nunit-console-runner.dll
-%_prefix/lib/mono/2.0/nunit-console.exe*
-%_prefix/lib/mono/2.0/nunit.core.dll
-%_prefix/lib/mono/2.0/nunit.core.extensions.dll
-%_prefix/lib/mono/2.0/nunit.core.interfaces.dll
-%_prefix/lib/mono/2.0/nunit.framework.dll
-%_prefix/lib/mono/2.0/nunit.framework.extensions.dll
-%_prefix/lib/mono/2.0/nunit.mocks.dll
-%_prefix/lib/mono/2.0/nunit.util.dll
-%_prefix/lib/mono/4.5/nunit-console-runner.dll
-%_prefix/lib/mono/4.5/nunit-console.exe*
-%_prefix/lib/mono/4.5/nunit.core.dll
-%_prefix/lib/mono/4.5/nunit.core.extensions.dll
-%_prefix/lib/mono/4.5/nunit.core.interfaces.dll
-%_prefix/lib/mono/4.5/nunit.framework.dll
-%_prefix/lib/mono/4.5/nunit.framework.extensions.dll
-%_prefix/lib/mono/4.5/nunit.mocks.dll
-%_prefix/lib/mono/4.5/nunit.util.dll
-%_prefix/lib/mono/gac/nunit-console-runner
-%_prefix/lib/mono/gac/nunit.core
-%_prefix/lib/mono/gac/nunit.core.extensions
-%_prefix/lib/mono/gac/nunit.core.interfaces
-%_prefix/lib/mono/gac/nunit.framework
-%_prefix/lib/mono/gac/nunit.framework.extensions
-%_prefix/lib/mono/gac/nunit.mocks
-%_prefix/lib/mono/gac/nunit.util
-
-%package -n mono-devel
-License: LGPL v2.1 only
-Summary: Mono development tools
-Group: Development/Languages/Mono
-Requires: mono-core == %version-%release
-Requires: libgdiplus0
-Requires: pkgconfig
-Provides: mono-xbuild
-# Required because they are referenced by .pc files
-Requires: mono-data == %version-%release
-Requires: mono-data-oracle == %version-%release
-Requires: mono-extras == %version-%release
-Requires: mono-web == %version-%release
-Requires: mono-winforms == %version-%release
-# We build natively on ppc64 now
-%ifarch ppc64
-Provides: mono-biarchcompat
-Obsoletes: mono-biarchcompat
-%endif
-Provides: mono(PEAPI) = 1.0.5000.0
-Provides: mono(resgen) = 1.0.5000.0
-
-%description -n mono-devel
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. This package contains compilers and
-other tools needed to develop .NET applications.
-
-Mono development tools.
-
-%post -n mono-devel -p /sbin/ldconfig
-
-%postun -n mono-devel -p /sbin/ldconfig
-
-%files -n mono-devel
-%defattr(-, root, root)
-%_bindir/caspol
-%_bindir/ccrewrite
-%_bindir/cccheck
-%_bindir/cert2spc
-%_bindir/dtd2rng
-%_bindir/dtd2xsd
-%_bindir/genxs
-%_bindir/httpcfg
-%_bindir/ilasm
-%_bindir/installvst
-%_bindir/lc
-%_bindir/macpack
-%_bindir/makecert
-%_bindir/mkbundle
-%_bindir/mono-api-info
-%_bindir/mono-cil-strip
-%_bindir/mono-find-provides
-%_bindir/mono-find-requires
-%_bindir/mono-heapviz
-%_bindir/mono-shlib-cop
-%_bindir/mono-xmltool
-%_bindir/monodis
-%_bindir/monograph
-%_bindir/monolinker
-%_bindir/monop
-%_bindir/monop2
-%_bindir/mprof-report
-%_bindir/pdb2mdb
-%_bindir/pedump
-%_bindir/permview
-%_bindir/prj2make
-%_bindir/resgen
-%_bindir/resgen2
-%_bindir/secutil
-%_bindir/sgen
-%_bindir/signcode
-%_bindir/xbuild
-%_bindir/mdbrebase
-%dir %_datadir/mono-2.0
-%dir %_datadir/mono-2.0/mono
-%dir %_datadir/mono-2.0/mono/cil
-%_datadir/mono-2.0/mono/cil/cil-opcodes.xml
-%_libdir/libmono-profiler-*.*
-%_libdir/pkgconfig/cecil.pc
-%_libdir/pkgconfig/dotnet.pc
-%_libdir/pkgconfig/dotnet35.pc
-%_libdir/pkgconfig/mono-cairo.pc
-%_libdir/pkgconfig/mono-lineeditor.pc
-%_libdir/pkgconfig/mono-options.pc
-%_libdir/pkgconfig/mono.pc
-%_libdir/pkgconfig/xbuild12.pc
-%_mandir/man1/al.1%ext_man
-%_mandir/man1/ccrewrite.1%ext_man
-%_mandir/man1/cccheck.1%ext_man
-%_mandir/man1/cert2spc.1%ext_man
-%_mandir/man1/dtd2xsd.1%ext_man
-%_mandir/man1/genxs.1%ext_man
-%_mandir/man1/httpcfg.1%ext_man
-%_mandir/man1/ilasm.1%ext_man
-%_mandir/man1/lc.1%ext_man
-%_mandir/man1/macpack.1%ext_man
-%_mandir/man1/makecert.1%ext_man
-%_mandir/man1/mkbundle.1%ext_man
-%_mandir/man1/mono-api-info.1%ext_man
-%_mandir/man1/mono-cil-strip.1%ext_man
-%_mandir/man1/mono-shlib-cop.1%ext_man
-%_mandir/man1/mono-xmltool.1%ext_man
-%_mandir/man1/monodis.1%ext_man
-%_mandir/man1/monolinker.1%ext_man
-%_mandir/man1/monop.1%ext_man
-%_mandir/man1/mprof-report.1%ext_man
-%_mandir/man1/pdb2mdb.1%ext_man
-%_mandir/man1/permview.1%ext_man
-%_mandir/man1/prj2make.1%ext_man
-%_mandir/man1/resgen.1%ext_man
-%_mandir/man1/secutil.1%ext_man
-%_mandir/man1/sgen.1%ext_man
-%_mandir/man1/signcode.1%ext_man
-%_mandir/man1/xbuild.1%ext_man
-%_prefix/lib/mono-source-libs
-%_prefix/lib/mono/2.0/MSBuild
-%_prefix/lib/mono/2.0/Microsoft.Build.Engine.dll
-%_prefix/lib/mono/2.0/Microsoft.Build.Framework.dll
-%_prefix/lib/mono/2.0/Microsoft.Build.Tasks.dll
-%_prefix/lib/mono/2.0/Microsoft.Build.Utilities.dll
-%_prefix/lib/mono/2.0/Microsoft.Build.xsd
-%_prefix/lib/mono/2.0/Microsoft.CSharp.targets
-%_prefix/lib/mono/2.0/Microsoft.Common.targets
-%_prefix/lib/mono/2.0/Microsoft.Common.tasks
-%_prefix/lib/mono/2.0/Microsoft.VisualBasic.targets
-%_prefix/lib/mono/2.0/Mono.Debugger.Soft.dll
-%_prefix/lib/mono/2.0/Mono.XBuild.Tasks.dll
-%_prefix/lib/mono/2.0/PEAPI.dll
-%_prefix/lib/mono/2.0/genxs.exe*
-%_prefix/lib/mono/2.0/ilasm.exe*
-%_prefix/lib/mono/2.0/mkbundle.exe*
-%_prefix/lib/mono/2.0/monolinker.*
-%_prefix/lib/mono/2.0/monop.exe*
-%_prefix/lib/mono/2.0/resgen.exe*
-%_prefix/lib/mono/2.0/xbuild.exe*
-%_prefix/lib/mono/2.0/xbuild.rsp
-%_prefix/lib/mono/3.5/MSBuild
-%_prefix/lib/mono/3.5/Microsoft.Build.Engine.dll
-%_prefix/lib/mono/3.5/Microsoft.Build.Framework.dll
-%_prefix/lib/mono/3.5/Microsoft.Build.Tasks.v3.5.dll
-%_prefix/lib/mono/3.5/Microsoft.Build.Utilities.v3.5.dll
-%_prefix/lib/mono/3.5/Microsoft.Build.xsd
-%_prefix/lib/mono/3.5/Microsoft.CSharp.targets
-%_prefix/lib/mono/3.5/Microsoft.Common.targets
-%_prefix/lib/mono/3.5/Microsoft.Common.tasks
-%_prefix/lib/mono/3.5/Microsoft.VisualBasic.targets
-%_prefix/lib/mono/3.5/Mono.XBuild.Tasks.dll
-%_prefix/lib/mono/3.5/xbuild.exe*
-%_prefix/lib/mono/3.5/xbuild.rsp
-%_prefix/lib/mono/4.0/Microsoft.Build.dll
-%_prefix/lib/mono/4.0/Microsoft.Build.Engine.dll
-%_prefix/lib/mono/4.0/Microsoft.Build.Framework.dll
-%_prefix/lib/mono/4.0/Microsoft.Build.Tasks.v4.0.dll
-%_prefix/lib/mono/4.0/Microsoft.Build.Utilities.v4.0.dll
-%_prefix/lib/mono/4.0/Mono.Debugger.Soft.dll
-%_prefix/lib/mono/4.0/Mono.XBuild.Tasks.dll
-%_prefix/lib/mono/4.0/PEAPI.dll
-%_prefix/lib/mono/4.5/MSBuild
-%_prefix/lib/mono/4.5/Microsoft.Build.dll
-%_prefix/lib/mono/4.5/Microsoft.Build.Engine.dll
-%_prefix/lib/mono/4.5/Microsoft.Build.Framework.dll
-%_prefix/lib/mono/4.5/Microsoft.Build.Tasks.v4.0.dll
-%_prefix/lib/mono/4.5/Microsoft.Build.Utilities.v4.0.dll
-%_prefix/lib/mono/4.5/Microsoft.Build.xsd
-%_prefix/lib/mono/4.5/Microsoft.CSharp.targets
-%_prefix/lib/mono/4.5/Microsoft.Common.targets
-%_prefix/lib/mono/4.5/Microsoft.Common.tasks
-%_prefix/lib/mono/4.5/Microsoft.VisualBasic.targets
-%_prefix/lib/mono/4.5/Mono.Debugger.Soft.dll
-%_prefix/lib/mono/4.5/Mono.CodeContracts.dll
-%_prefix/lib/mono/4.5/Mono.XBuild.Tasks.dll
-%_prefix/lib/mono/4.5/PEAPI.dll
-%_prefix/lib/mono/4.5/caspol.exe*
-%_prefix/lib/mono/4.5/cccheck.exe*
-%_prefix/lib/mono/4.5/ccrewrite.exe*
-%_prefix/lib/mono/4.5/cert2spc.exe*
-%_prefix/lib/mono/4.5/dtd2rng.exe*
-%_prefix/lib/mono/4.5/dtd2xsd.exe*
-%_prefix/lib/mono/4.5/genxs.exe*
-%_prefix/lib/mono/4.5/httpcfg.exe*
-%_prefix/lib/mono/4.5/ictool.exe*
-%_prefix/lib/mono/4.5/ilasm.exe*
-%_prefix/lib/mono/4.5/installvst.exe*
-%_prefix/lib/mono/4.5/lc.exe*
-%_prefix/lib/mono/4.5/macpack.exe*
-%_prefix/lib/mono/4.5/makecert.exe*
-%_prefix/lib/mono/4.5/mkbundle.exe*
-%_prefix/lib/mono/4.5/mono-api-info.exe*
-%_prefix/lib/mono/4.5/mono-cil-strip.exe*
-%_prefix/lib/mono/4.5/mono-shlib-cop.exe*
-%_prefix/lib/mono/4.5/mono-xmltool.exe*
-%_prefix/lib/mono/4.5/monolinker.*
-%_prefix/lib/mono/4.5/monop.exe*
-%_prefix/lib/mono/4.5/pdb2mdb.exe*
-%_prefix/lib/mono/4.5/permview.exe*
-%_prefix/lib/mono/4.5/resgen.exe*
-%_prefix/lib/mono/4.5/secutil.exe*
-%_prefix/lib/mono/4.5/sgen.exe*
-%_prefix/lib/mono/4.5/signcode.exe*
-%_prefix/lib/mono/4.5/xbuild.exe*
-%_prefix/lib/mono/4.5/xbuild.rsp
-%_prefix/lib/mono/4.5/mdbrebase.exe*
-%_prefix/lib/mono/gac/Microsoft.Build
-%_prefix/lib/mono/gac/Microsoft.Build.Engine
-%_prefix/lib/mono/gac/Microsoft.Build.Framework
-%_prefix/lib/mono/gac/Microsoft.Build.Tasks
-%_prefix/lib/mono/gac/Microsoft.Build.Tasks.v3.5
-%_prefix/lib/mono/gac/Microsoft.Build.Tasks.v4.0
-%_prefix/lib/mono/gac/Microsoft.Build.Tasks.v12.0
-%_prefix/lib/mono/gac/Microsoft.Build.Utilities
-%_prefix/lib/mono/gac/Microsoft.Build.Utilities.v3.5
-%_prefix/lib/mono/gac/Microsoft.Build.Utilities.v4.0
-%_prefix/lib/mono/gac/Microsoft.Build.Utilities.v12.0
-%_prefix/lib/mono/gac/Mono.CodeContracts
-%_prefix/lib/mono/gac/Mono.Debugger.Soft
-%_prefix/lib/mono/gac/Mono.XBuild.Tasks
-%_prefix/lib/mono/gac/PEAPI
-%_prefix/lib/mono/xbuild
-%_prefix/lib/mono/xbuild-frameworks
-
-%package -n monodoc-core
-License: LGPL v2.1 only
-Summary: Monodoc - Documentation tools for C# code
-Group: Development/Tools/Other
-Requires: mono-core == %version-%release
-Obsoletes: monodoc
-Provides: monodoc
-# Added to uncompress and compare documentation used by build-compare
-Requires: unzip
-
-%description -n monodoc-core
-Monodoc-core contains documentation tools for C#.
-
-%files -n monodoc-core
-%defattr(-, root, root)
-%_bindir/mdassembler
-%_bindir/mdoc
-%_bindir/mdoc-assemble
-%_bindir/mdoc-export-html
-%_bindir/mdoc-export-msxdoc
-%_bindir/mdoc-update
-%_bindir/mdoc-validate
-%_bindir/mdvalidater
-%_bindir/mod
-%_bindir/monodocer
-%_bindir/monodocs2html
-%_bindir/monodocs2slashdoc
-%_libdir/pkgconfig/monodoc.pc
-%_mandir/man1/mdassembler.1%ext_man
-%_mandir/man1/mdoc-assemble.1%ext_man
-%_mandir/man1/mdoc-export-html.1%ext_man
-%_mandir/man1/mdoc-export-msxdoc.1%ext_man
-%_mandir/man1/mdoc-update.1%ext_man
-%_mandir/man1/mdoc-validate.1%ext_man
-%_mandir/man1/mdoc.1%ext_man
-%_mandir/man1/mdvalidater.1%ext_man
-%_mandir/man1/monodocer.1%ext_man
-%_mandir/man1/monodocs2html.1%ext_man
-%_mandir/man5/mdoc.5%ext_man
-%_prefix/lib/mono/4.5/mdoc.exe*
-%_prefix/lib/mono/4.5/mod.exe*
-%_prefix/lib/mono/4.0/monodoc.dll*
-%_prefix/lib/mono/gac/monodoc
-%_prefix/lib/mono/monodoc
-%_prefix/lib/monodoc
-
-%package -n mono-complete
-License: LGPL v2.1 only
-Summary: Install everything built from the mono source tree
-Group: Development/Languages/Mono
-Requires: mono-core = %version-%release
-Requires: ibm-data-db2 = %version-%release
-Requires: libmono-2_0-1 = %version-%release
-Requires: libmono-2_0-devel = %version-%release
-%if %llvm == yes
-Requires: libmono-llvm0 = %version-%release
-%endif
-%if %sgen == yes
-Requires: libmonosgen-2_0-1 = %version-%release
-Requires: libmonosgen-2_0-devel = %version-%release
-%endif
-Requires: mono-data = %version-%release
-Requires: mono-data-oracle = %version-%release
-Requires: mono-data-postgresql = %version-%release
-Requires: mono-data-sqlite = %version-%release
-Requires: mono-devel = %version-%release
-Requires: mono-extras = %version-%release
-Requires: mono-locale-extras = %version-%release
-Requires: mono-nunit = %version-%release
-Requires: mono-wcf = %version-%release
-Requires: mono-web = %version-%release
-Requires: mono-winforms = %version-%release
-Requires: mono-winfxcore = %version-%release
-Requires: monodoc-core = %version-%release
-
-%description -n mono-complete
-The Mono Project is an open development initiative that is working to
-develop an open source, Unix version of the .NET development platform.
-Its objective is to enable Unix developers to build and deploy
-cross-platform .NET applications. The project will implement various
-technologies that have been submitted to the ECMA for standardization.
-
-Install everything built from the mono source tree. Note that this does
-not install anything from outside the mono source (XSP, mono-basic, etc.).
-
-%files -n mono-complete
-%defattr(-, root, root)
-%dir %_prefix/lib/mono/compat-2.0
-
-%changelog
+++ /dev/null
-* Write test cases
-
- Write test cases to stress test TypeSpec. This is done by
- creating arrays of various dimensions, sizes, and lower
- bounds.
semaphores.h \
sockets.h \
status.h \
- system.h \
threads.h \
timefuncs.h \
types.h \
socket-private.h \
socket-wrappers.h \
status.h \
- system.c \
- system.h \
threads.h \
thread-private.h \
timefuncs.c \
#include <mono/utils/mono-membar.h>
#include <mono/utils/mono-mutex.h>
#include <mono/utils/mono-signal-handler.h>
+#include <mono/utils/mono-proclib.h>
/* The process' environment strings */
#if defined(__APPLE__) && !defined (__arm__) && !defined (__aarch64__)
/* Not sure if w32 allows NULLs here or not */
return FALSE;
- if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process))
- /* This is a pseudo handle, so just fail for now
- */
- return FALSE;
-
+ if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
+ gpointer pid = GINT_TO_POINTER (WAPI_HANDLE_TO_PID(process));
+ gint64 start_ticks, user_ticks, kernel_ticks;
+
+ mono_process_get_times (pid, &start_ticks, &user_ticks, &kernel_ticks);
+
+ _wapi_guint64_to_filetime (start_ticks, create_time);
+ _wapi_guint64_to_filetime (user_ticks, kernel_time);
+ _wapi_guint64_to_filetime (kernel_ticks, user_time);
+
+ return TRUE;
+ }
+
process_handle = lookup_process_handle (process);
if (!process_handle) {
DEBUG ("%s: Can't find process %p", __func__, process);
+++ /dev/null
-/*
- * system.c: System information
- *
- * Author:
- * Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include <glib.h>
-#include <sys/time.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "mono/io-layer/wapi.h"
-
-void GetSystemInfo(WapiSystemInfo *info)
-{
- info->dwPageSize=getpagesize();
-
- /* Fill in the rest of this junk. Maybe with libgtop */
-#ifdef _SC_NPROCESSORS_ONLN
- info->dwNumberOfProcessors = sysconf (_SC_NPROCESSORS_ONLN);
- if (info->dwNumberOfProcessors <= 0)
- info->dwNumberOfProcessors = 1;
-#else
- info->dwNumberOfProcessors = 1;
-#endif
-}
-
-
+++ /dev/null
-/*
- * system.h: System information
- *
- * Author:
- * Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _WAPI_SYSTEM_H_
-#define _WAPI_SYSTEM_H_
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-typedef struct _WapiSystemInfo WapiSystemInfo;
-
-struct _WapiSystemInfo
-{
- union _anon_union
- {
- guint32 dwOemId;
- struct _anon_struct
- {
- guint16 wProcessorArchitecture;
- guint16 wReserved;
- } _anon_struct;
- } _anon_union;
-
- guint32 dwPageSize;
- gpointer lpMinimumApplicationAddress;
- gpointer lpMaximumApplicationAddress;
- guint32 /*_PTR?*/ dwActiveProcessorMask;
- guint32 dwNumberOfProcessors;
- guint32 dwProcessorType;
- guint32 dwAllocationGranularity;
- guint16 wProcessorLevel;
- guint16 wProcessorRevision;
-};
-
-extern void GetSystemInfo(WapiSystemInfo *info);
-
-G_END_DECLS
-#endif /* _WAPI_SYSTEM_H_ */
extern void Sleep(guint32 ms);
extern guint32 SleepEx(guint32 ms, gboolean alertable);
-void wapi_interrupt_thread (gpointer handle);
void wapi_clear_interruption (void);
gboolean wapi_thread_set_wait_handle (gpointer handle);
void wapi_thread_clear_wait_handle (gpointer handle);
typedef WapiLargeInteger *PLARGE_INTEGER;
typedef WapiULargeInteger ULARGE_INTEGER;
typedef WapiULargeInteger *PULARGE_INTEGER;
-typedef WapiSystemInfo SYSTEM_INFO;
-typedef WapiSystemInfo *LPSYSTEM_INFO;
typedef WapiFloatingSaveArea FLOATING_SAVE_AREA;
typedef WapiFloatingSaveArea *PFLOATING_SAVE_AREA;
typedef WapiContext CONTEXT;
#include <mono/io-layer/semaphores.h>
#include <mono/io-layer/sockets.h>
#include <mono/io-layer/status.h>
-#include <mono/io-layer/system.h>
#include <mono/io-layer/threads.h>
#include <mono/io-layer/timefuncs.h>
#include <mono/io-layer/versioninfo.h>
* call the wait function again. This essentially means that the target thread will
* busy wait until it is ready to process the interruption.
*/
-void
-wapi_interrupt_thread (gpointer thread_handle)
-{
- gpointer wait_handle;
-
- wait_handle = wapi_prepare_interrupt_thread (thread_handle);
- wapi_finish_interrupt_thread (wait_handle);
-}
-
gpointer
wapi_prepare_interrupt_thread (gpointer thread_handle)
{
platform_sources = $(unix_sources)
endif
+if PLATFORM_ANDROID
+platform_sources += ../../support/libm/complex.c
+endif
+
if SHARED_MONO
if SUPPORT_BOEHM
bin_PROGRAMS = pedump
threadpool.c \
threadpool.h \
threadpool-internals.h \
- threadpool-microsoft.c \
- threadpool-microsoft.h \
+ threadpool-ms.c \
+ threadpool-ms.h \
+ threadpool-ms-io.c \
+ threadpool-ms-io.h \
tpool-poll.c \
verify.c \
verify-internals.h \
sgen-layout-stats.h \
sgen-qsort.c \
sgen-qsort.h \
+ sgen-thread-pool.c \
+ sgen-thread-pool.h \
sgen-tagged-pointer.h
libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
endif
endif
-EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
+EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
tpool-poll.c tpool-epoll.c tpool-kqueue.c
+++ /dev/null
-
-* Uniform names
-
- We have a mess of names in the icall.c file, we need to sort that out.
* Changes which are already detected at runtime, like the addition
* of icalls, do not require an increment.
*/
-#define MONO_CORLIB_VERSION 123
+#define MONO_CORLIB_VERSION 127
typedef struct
{
string_vt = mono_class_vtable (domain, mono_defaults.string_class);
string_empty_fld = mono_class_get_field_from_name (mono_defaults.string_class, "Empty");
g_assert (string_empty_fld);
- mono_field_static_set_value (string_vt, string_empty_fld, mono_string_new (domain, ""));
+ mono_field_static_set_value (string_vt, string_empty_fld, mono_string_intern (mono_string_new (domain, "")));
/*
* Create an instance early since we can't do it when there is no memory.
MonoClass *methodhandle_class;
MonoClass *systemtype_class;
MonoClass *monotype_class;
+ MonoClass *runtimetype_class;
MonoClass *exception_class;
MonoClass *threadabortexception_class;
MonoClass *thread_class;
find_interface_offset (int num_ifaces, MonoClass **interfaces_full, int *interface_offsets_full, MonoClass *ic)
{
int i = find_interface (num_ifaces, interfaces_full, ic);
- if (ic >= 0)
+ if (i >= 0)
return interface_offsets_full [i];
return -1;
}
mono_generic_class_setup_parent (klass, gklass);
if (gclass->is_dynamic) {
- klass->inited = 1;
+ /*
+ * We don't need to do any init workf with unbaked typebuilders. Generic instances created at this point will be later unregistered and/or fixed.
+ * This is to avoid work that would probably give wrong results as fields change as we build the TypeBuilder.
+ * See remove_instantiations_of_and_ensure_contents in reflection.c and its usage in reflection.c to understand the fixup stage of SRE banking.
+ */
+ if (!gklass->wastypebuilder)
+ klass->inited = 1;
mono_class_setup_supertypes (klass);
static const NumberFormatEntry number_format_entries [] = {
- {691, 37441, 37443, 37446, 37443, 37446, 37449, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37507, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37529, 37538, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37546, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 2, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37546, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 2, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37549, 37513, 37515, 37519, 37553, 37565, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37577, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37580, 37591, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37602, 37616, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 37504, 37441, 37504, 37525, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 8, 3, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37650, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37515, 37519, 37659, 37667, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37675, 37513, 37515, 37519, 37679, 37490, 37692, 37697, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37702, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37577, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37631, 37705, 2566, 37523, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37715, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 1, 1, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37719, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37723, 37733, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 0, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37742, 37513, 37515, 37519, 37746, 37765, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37784, 37513, 37515, 37519, 37631, 37705, 2566, 37523, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37787, 691, 37789, 691, 37789, 37793, 37513, 37515, 37519, 37797, 37806, 2566, 37523, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 0, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37815, 37513, 37823, 37519, 37840, 37868, 2566, 37523, 5, 1, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37895, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 2, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37515, 37519, 37553, 37565, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 37504, 37441, 37504, 37898, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 5, 1, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 37504, 37441, 37504, 37577, 37513, 37904, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37911, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37915, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37919, 37513, 37922, 37519, 37945, 37490, 37961, 37969, 3, 0, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37977, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37980, 37513, 37984, 37519, 37480, 37490, 2566, 37523, 5, 1, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 38001, 37513, 0, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 38005, 38019, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 38032, 37519, 38046, 38058, 2566, 37523, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 37504, 37441, 37504, 38069, 37513, 37515, 37519, 38072, 38083, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {38093, 37504, 37441, 37441, 37441, 37441, 0, 37513, 0, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, 0}, {3, 0}, {3, 0}},
- {185, 37441, 37443, 37446, 37443, 37446, 38095, 37459, 38104, 37477, 38115, 37490, 38130, 37969, 3, 2, 0, 0, 3, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38137, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 691, 37441, 691, 38141, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 691, 37441, 691, 0, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 38147, 38157, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38166, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37504, 37441, 37504, 10836, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37504, 37441, 37504, 10836, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 10836, 37513, 38173, 37519, 37480, 37490, 2566, 37523, 2, 2, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37504, 37441, 37504, 10836, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 0, 37513, 38179, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37577, 37513, 37904, 37519, 37480, 37490, 2566, 37523, 12, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 37525, 37513, 0, 37519, 37480, 37490, 2566, 37523, 1, 0, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37904, 37519, 37480, 37490, 2566, 37523, 12, 2, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37525, 37513, 0, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38224, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {2566, 37504, 37441, 37504, 37441, 37504, 0, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {2566, 37504, 37441, 37504, 37441, 37504, 0, 37513, 38227, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38244, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37443, 37446, 37443, 37446, 0, 37459, 37515, 37477, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37441, 37441, 37441, 38248, 37513, 38255, 37519, 37480, 37490, 2566, 37523, 12, 2, 2, 2, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 37443, 37441, 37443, 37441, 0, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 0, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 2, 2, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 37441, 37441, 37441, 37441, 38220, 37513, 0, 37519, 37480, 37490, 2566, 37523, 12, 1, 1, 1, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {37441, 37504, 691, 37441, 691, 37441, 0, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 5, 1, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37546, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 2, 0, 1, 1, 1, 2, 2, 2, {3, 0}, {3, 0}, {3, 0}},
- {691, 37441, 691, 37441, 691, 37441, 38282, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 691, 37441, 691, 38285, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 5, 1, 1, 1, 2, 2, 2, 2, {3, -1}, {3, 0}, {3, 0}},
- {691, 37441, 37441, 691, 37441, 691, 38289, 37513, 38293, 37519, 37480, 37490, 2566, 37523, 4, 1, 0, 0, 0, 0, 2, 2, {3, 0}, {3, 0}, {3, 0}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37441, 37441, 37441, 38220, 37513, 0, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38330, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 14, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38338, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 1, 1, 1, 2, 1, 1, {3, 0}, {3, 0}, {3, 0}},
- {691, 37441, 37441, 37504, 37441, 37504, 0, 37513, 0, 37519, 37659, 37667, 2566, 37523, 8, 3, 0, 0, 3, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38345, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, 2}, {3, 2}},
- {37443, 37446, 37443, 37446, 37443, 37446, 38358, 37459, 0, 37519, 37480, 37490, 2566, 37523, 3, 0, 4, 2, 3, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38361, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 0, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37441, 37441, 37441, 38365, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37504, 37441, 37504, 10836, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37577, 37513, 37904, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 0}, {3, 0}, {3, 0}},
- {691, 37441, 37441, 37441, 37441, 37441, 38365, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37546, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, 0}, {3, 0}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 0, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 691, 37789, 691, 37789, 0, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37441, 37441, 37441, 37815, 37513, 0, 37519, 37480, 37490, 2566, 37523, 5, 1, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 691, 37441, 691, 38369, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38282, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 37449, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37507, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37529, 37538, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38372, 37513, 38376, 37519, 37480, 37490, 2566, 37523, 1, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37549, 37513, 37515, 37519, 37553, 37565, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37577, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37580, 37591, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37602, 37616, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37650, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37515, 37519, 37659, 37667, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37675, 37513, 37515, 37519, 37679, 37490, 37692, 37697, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37702, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37577, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37631, 37705, 2566, 37523, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37715, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 1, 1, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37719, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37723, 37733, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37577, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37742, 37513, 37515, 37519, 37746, 37765, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37784, 37513, 37515, 37519, 37631, 37705, 2566, 37523, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37787, 691, 37789, 691, 37789, 37793, 37513, 37515, 37519, 37797, 37806, 2566, 37523, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 0, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37815, 37513, 37823, 37519, 37840, 37868, 2566, 37523, 5, 1, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37895, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 2, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37515, 37519, 37553, 37565, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 37504, 37441, 37504, 37898, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 5, 1, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 37504, 37441, 37504, 37577, 37513, 37904, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37911, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37915, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37919, 37513, 37922, 37519, 37945, 37490, 37961, 37969, 3, 0, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37977, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37980, 37513, 37984, 37519, 37480, 37490, 2566, 37523, 5, 1, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 38001, 37513, 0, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 38005, 38019, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 38032, 37519, 38046, 38058, 2566, 37523, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 37504, 37441, 37504, 38069, 37513, 37515, 37519, 38072, 38083, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {38093, 37504, 37441, 37441, 37441, 37441, 38386, 37513, 0, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, 0}, {3, 0}, {3, 0}},
- {185, 37441, 37443, 37446, 37443, 37446, 38095, 37459, 38104, 37477, 38115, 37490, 38130, 37969, 3, 2, 0, 0, 3, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38137, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 691, 37441, 691, 38141, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 691, 37441, 691, 38393, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 38147, 38157, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38166, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37504, 37441, 37504, 10836, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37504, 37441, 37504, 10836, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 10836, 37513, 38173, 37519, 37480, 37490, 2566, 37523, 2, 2, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37504, 37441, 37504, 10836, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 0, 37513, 38179, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37577, 37513, 37904, 37519, 37480, 37490, 2566, 37523, 12, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 37525, 37513, 0, 37519, 37480, 37490, 2566, 37523, 1, 0, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37577, 37513, 37904, 37519, 37480, 37490, 2566, 37523, 12, 2, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38244, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37443, 37446, 37443, 37446, 38398, 37459, 37515, 37477, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37441, 37441, 37441, 38220, 37513, 38255, 37519, 37480, 37490, 2566, 37523, 12, 2, 2, 2, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 0, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 2, 2, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 37441, 37441, 37441, 37441, 38220, 37513, 0, 37519, 37480, 37490, 2566, 37523, 12, 1, 1, 1, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 37546, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 2, 0, 1, 1, 1, 2, 2, 2, {3, 0}, {3, 0}, {3, 0}},
- {691, 37441, 691, 37441, 691, 37441, 38282, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 691, 37441, 691, 38285, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 5, 1, 1, 1, 2, 2, 2, 2, {3, -1}, {3, 0}, {3, 0}},
- {691, 37441, 37441, 691, 37441, 691, 38289, 37513, 38293, 37519, 37480, 37490, 2566, 37523, 4, 1, 0, 0, 0, 0, 2, 2, {3, 0}, {3, 0}, {3, 0}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37441, 37441, 37441, 38220, 37513, 0, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38330, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 14, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, 2}, {3, 2}},
- {691, 37441, 691, 37441, 691, 37441, 38338, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 1, 1, 1, 2, 1, 1, {3, 0}, {3, 0}, {3, 0}},
- {691, 37441, 691, 37441, 691, 37441, 38345, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, 2}, {3, 2}},
- {37443, 37446, 37443, 37446, 37443, 37446, 38358, 37459, 0, 37519, 37480, 37490, 2566, 37523, 3, 0, 4, 2, 3, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38361, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38365, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37441, 37441, 37441, 38365, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37504, 37441, 37504, 10836, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 2, 2, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37577, 37513, 37904, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 0}, {3, 0}, {3, 0}},
- {691, 37441, 37441, 37441, 37441, 37441, 38365, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37546, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, 0}, {3, 0}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 0, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37441, 37441, 37441, 37815, 37513, 0, 37519, 37480, 37490, 2566, 37523, 5, 1, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 691, 37441, 691, 38369, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38282, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38404, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37715, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 2, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37787, 691, 37787, 691, 37787, 37793, 37513, 37515, 37519, 37580, 37591, 2566, 37523, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38282, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37659, 37667, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37787, 691, 37787, 691, 37787, 37793, 37513, 37515, 37519, 37631, 37705, 2566, 37523, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37723, 37733, 2566, 37523, 12, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37577, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 37504, 37441, 37504, 37525, 37513, 37515, 37519, 37631, 37705, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37904, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 691, 37441, 691, 38414, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37525, 37513, 0, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37443, 37446, 37443, 37446, 38422, 37459, 37515, 37477, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37441, 37441, 37441, 38429, 37513, 38255, 37519, 37480, 37490, 2566, 37523, 12, 2, 2, 2, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {691, 37441, 37443, 37446, 37443, 37446, 38433, 37459, 37515, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 38376, 37519, 37480, 37490, 2566, 37523, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37580, 37591, 2566, 37523, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37629, 37513, 37515, 37519, 37659, 37667, 2566, 37523, 15, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37904, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 691, 37441, 691, 38443, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 0, 0, 0, 3, 3, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37580, 37591, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 8056, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37787, 691, 37787, 691, 37787, 37793, 37513, 37515, 37519, 37659, 37667, 2566, 37523, 2, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38453, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 2, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38456, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38466, 37513, 38376, 37519, 37480, 37490, 2566, 37523, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37787, 691, 37787, 691, 37787, 0, 37513, 37515, 37519, 37580, 37591, 2566, 37523, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38471, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 0, 0, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37659, 37667, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38453, 37513, 0, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38475, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37525, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38485, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 14, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37525, 37513, 37515, 37519, 37659, 37667, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38453, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 691, 37441, 691, 38489, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 3, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 10836, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38499, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38504, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 3, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 1, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38514, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38499, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38518, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37629, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 14, 2, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38528, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38533, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38543, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38547, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38555, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 3, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37629, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 2, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 691, 37441, 691, 38565, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37629, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 14, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37525, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38575, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 3, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38361, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37629, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 9, 2, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38585, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 37629, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 14, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38595, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 3, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38605, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 14, 2, 0, 0, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37443, 37446, 37443, 37446, 38609, 37459, 37462, 37477, 37480, 37490, 2566, 37499, 3, 2, 0, 0, 3, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38220, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, 2}, {3, 2}, {3, 2}},
- {37441, 691, 37441, 691, 37441, 691, 38619, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 14, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 2436, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38622, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 14, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 14, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37629, 37513, 37515, 37519, 37631, 37641, 2566, 37523, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1}, {3, 0}, {3, 0}},
- {37441, 691, 37441, 691, 37441, 691, 38499, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38453, 37513, 0, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38625, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38633, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 691, 37441, 691, 38414, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 37546, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 2, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37577, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38453, 37513, 0, 37519, 37480, 37490, 2566, 37523, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 691, 37441, 691, 38393, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37443, 37446, 37443, 37446, 38422, 37459, 37515, 37477, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 691, 37441, 691, 37441, 0, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 5, 1, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38638, 37513, 38376, 37519, 37480, 37490, 2566, 37523, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38638, 37513, 38376, 37519, 37480, 37490, 2566, 37523, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 37504, 37441, 37504, 37441, 37504, 37577, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 12, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {37441, 691, 37441, 691, 37441, 691, 38633, 37513, 37515, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {38093, 37504, 37441, 37441, 37441, 37441, 38386, 37513, 0, 37519, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 2, 2, 2, {3, 0}, {3, 0}, {3, 0}},
- {37441, 37504, 37443, 37446, 37443, 37446, 38398, 37459, 37515, 37477, 37480, 37490, 2566, 37523, 8, 3, 1, 1, 1, 0, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 37441, 37504, 37441, 37504, 0, 37513, 0, 37519, 37659, 37667, 2566, 37523, 8, 3, 0, 0, 3, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}},
- {691, 37441, 691, 37441, 691, 37441, 38365, 37513, 0, 37519, 37480, 37490, 2566, 37523, 2, 2, 0, 0, 1, 2, 2, 2, {3, -1}, {3, -1}, {3, -1}}
+ {691, 37441, 691, 37443, 37446, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37504, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37526, 37535, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37543, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37543, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37546, 37510, 37512, 37516, 37550, 37562, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37574, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37577, 37588, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37599, 37613, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 37501, 37522, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37647, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37512, 37516, 37656, 37664, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37672, 37510, 37512, 37516, 37676, 37487, 37689, 37694, 2, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37699, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37574, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37628, 37702, 2566, 37520, 9, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37712, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37716, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37720, 37730, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 0, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37739, 37510, 37512, 37516, 37743, 37762, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37781, 37510, 37512, 37516, 37628, 37702, 2566, 37520, 9, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37501, 691, 37784, 37788, 37510, 37512, 37516, 37792, 37801, 2566, 37520, 2, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 0, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37810, 37510, 37818, 37516, 37835, 37863, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37890, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 2, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37512, 37516, 37550, 37562, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 37501, 37893, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 37501, 37574, 37510, 37899, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37906, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37910, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37914, 37510, 37917, 37516, 37940, 37487, 37956, 37964, 3, 0, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37972, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37975, 37510, 37979, 37516, 37477, 37487, 2566, 37520, 5, 1, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37996, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 38000, 38014, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37501, 37441, 37501, 37522, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 38027, 37516, 38041, 38053, 2566, 37520, 9, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 38064, 37441, 37501, 38066, 37510, 37512, 37516, 38069, 38080, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37441, 0, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {185, 37441, 185, 37443, 38090, 37456, 38099, 37474, 38110, 37487, 38125, 37964, 3, 0, 0, 0, 3, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38132, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 691, 38136, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 691, 0, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 38142, 38152, 2566, 37520, 8, 3, 10, 3, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38161, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37501, 10836, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37501, 10836, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 10836, 37510, 38168, 37516, 37477, 37487, 2566, 37520, 2, 2, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 38064, 37441, 37501, 10836, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 2, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 0, 37510, 38174, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37574, 37510, 37899, 37516, 37477, 37487, 2566, 37520, 12, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 37522, 37510, 0, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37899, 37516, 37477, 37487, 2566, 37520, 12, 2, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37522, 37510, 0, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38219, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {2566, 37501, 37441, 37501, 0, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 0, 37510, 38222, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38239, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37443, 0, 37456, 37512, 37474, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38243, 37510, 38250, 37516, 37477, 37487, 2566, 37520, 12, 2, 1, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 0, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 0, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 2, 2, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 0, 37516, 37477, 37487, 2566, 37520, 12, 2, 1, 1, 1, 2, 2, {3, 2}, {3, 2}},
+ {38277, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {37441, 37501, 37441, 37441, 0, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37543, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 2, 0, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {691, 37441, 691, 37441, 38279, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 691, 38282, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 5, 1, 1, 1, 2, 2, 2, {3, -1}, {3, 0}},
+ {691, 37441, 691, 691, 38286, 37510, 38290, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, 0}, {3, 0}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38215, 37510, 0, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38327, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 14, 2, 0, 0, 1, 2, 2, {3, -1}, {3, 2}},
+ {691, 37441, 691, 37441, 38335, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 1, {3, 0}, {3, 0}},
+ {37441, 38064, 37441, 37501, 0, 37510, 0, 37516, 37656, 37664, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38342, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 2}},
+ {691, 37441, 691, 37443, 38355, 37456, 0, 37516, 37477, 37487, 2566, 37520, 3, 0, 4, 2, 3, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38358, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 0, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38362, 37510, 0, 37516, 37477, 37487, 2566, 37520, 9, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37501, 10836, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37574, 37510, 37899, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 0}, {3, 0}},
+ {691, 37441, 691, 37441, 38362, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37543, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 0}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37784, 0, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37441, 37810, 37510, 0, 37516, 37477, 37487, 2566, 37520, 5, 1, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 691, 38366, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38279, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 37446, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37504, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37526, 37535, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38369, 37510, 38373, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37546, 37510, 37512, 37516, 37550, 37562, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37574, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37577, 37588, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37599, 37613, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37647, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37512, 37516, 37656, 37664, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37672, 37510, 37512, 37516, 37676, 37487, 37689, 37694, 2, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37699, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37574, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37628, 37702, 2566, 37520, 9, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37712, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37716, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37720, 37730, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37574, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37739, 37510, 37512, 37516, 37743, 37762, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37781, 37510, 37512, 37516, 37628, 37702, 2566, 37520, 9, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37501, 691, 37784, 37788, 37510, 37512, 37516, 37792, 37801, 2566, 37520, 2, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 0, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37810, 37510, 37818, 37516, 37835, 37863, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37890, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 2, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37512, 37516, 37550, 37562, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 37501, 37893, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 37501, 37574, 37510, 37899, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37906, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37910, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37914, 37510, 37917, 37516, 37940, 37487, 37956, 37964, 3, 0, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37972, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37975, 37510, 37979, 37516, 37477, 37487, 2566, 37520, 5, 1, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37996, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 38000, 38014, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37501, 37441, 37501, 37522, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 38027, 37516, 38041, 38053, 2566, 37520, 9, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 38064, 37441, 37501, 38066, 37510, 37512, 37516, 38069, 38080, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37441, 38383, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {185, 37441, 185, 37443, 38090, 37456, 38099, 37474, 38110, 37487, 38125, 37964, 3, 0, 0, 0, 3, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38132, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 691, 38136, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 691, 38390, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 38142, 38152, 2566, 37520, 8, 3, 10, 3, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38161, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37501, 10836, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37501, 10836, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 10836, 37510, 38168, 37516, 37477, 37487, 2566, 37520, 2, 2, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 38064, 37441, 37501, 10836, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 2, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 0, 37510, 38174, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37574, 37510, 37899, 37516, 37477, 37487, 2566, 37520, 12, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 37522, 37510, 0, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37574, 37510, 37899, 37516, 37477, 37487, 2566, 37520, 12, 2, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38239, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37443, 38395, 37456, 37512, 37474, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38215, 37510, 38250, 37516, 37477, 37487, 2566, 37520, 12, 2, 1, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 0, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 2, 2, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38215, 37510, 0, 37516, 37477, 37487, 2566, 37520, 12, 2, 1, 1, 1, 2, 2, {3, 2}, {3, 2}},
+ {38277, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 37543, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 2, 0, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {691, 37441, 691, 37441, 38279, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 691, 38282, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 5, 1, 1, 1, 2, 2, 2, {3, -1}, {3, 0}},
+ {691, 37441, 691, 691, 38286, 37510, 38290, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, 0}, {3, 0}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38215, 37510, 0, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37441, 38327, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 14, 2, 0, 0, 1, 2, 2, {3, -1}, {3, 2}},
+ {691, 37441, 691, 37441, 38335, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 1, {3, 0}, {3, 0}},
+ {691, 37441, 691, 37441, 38342, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 2}},
+ {691, 37441, 691, 37443, 38355, 37456, 0, 37516, 37477, 37487, 2566, 37520, 3, 0, 4, 2, 3, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38358, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38362, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38362, 37510, 0, 37516, 37477, 37487, 2566, 37520, 9, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37501, 10836, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 2, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37574, 37510, 37899, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, 0}, {3, 0}},
+ {691, 37441, 691, 37441, 38362, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37543, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 0}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37441, 37810, 37510, 0, 37516, 37477, 37487, 2566, 37520, 5, 1, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 691, 38366, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38279, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38401, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37712, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37501, 37441, 38411, 37788, 37510, 37512, 37516, 37577, 37588, 2566, 37520, 2, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38279, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37656, 37664, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37501, 37441, 38411, 37788, 37510, 37512, 37516, 37628, 37702, 2566, 37520, 2, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37720, 37730, 2566, 37520, 12, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37574, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37512, 37516, 37628, 37702, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37899, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 691, 38413, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37522, 37510, 0, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37443, 38421, 37456, 37512, 37474, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38428, 37510, 38250, 37516, 37477, 37487, 2566, 37520, 12, 2, 1, 0, 1, 2, 2, {3, 2}, {3, 2}},
+ {691, 37441, 691, 37443, 38432, 37456, 37512, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 38373, 37516, 37477, 37487, 2566, 37520, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37577, 37588, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37626, 37510, 37512, 37516, 37656, 37664, 2566, 37520, 15, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37899, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 691, 38442, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 0, 0, 0, 3, 3, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37577, 37588, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 8056, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37501, 37441, 38411, 37788, 37510, 37512, 37516, 37656, 37664, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38452, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 2, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38455, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38465, 37510, 38373, 37516, 37477, 37487, 2566, 37520, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 38411, 0, 37510, 37512, 37516, 37577, 37588, 2566, 37520, 2, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38470, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 0, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 691, 37522, 37510, 37512, 37516, 37656, 37664, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38452, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38474, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37522, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38484, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 14, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37522, 37510, 37512, 37516, 37656, 37664, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38452, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 691, 38488, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 3, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 10836, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 2, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38498, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38503, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 3, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38513, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38498, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38517, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37626, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 1, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38527, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38532, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38542, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38546, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38554, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 3, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37626, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 2, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 691, 38564, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37626, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 14, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37522, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38574, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 3, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38358, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37626, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 9, 2, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38584, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 37626, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 9, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38594, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 3, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38604, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 14, 2, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37443, 38608, 37456, 37459, 37474, 37477, 37487, 2566, 37496, 3, 2, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38215, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 1, 1, 1, 2, 2, {3, 2}, {3, 2}},
+ {37441, 691, 37441, 691, 38618, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 14, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 0, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 2436, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 12, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38621, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37626, 37510, 37512, 37516, 37628, 37638, 2566, 37520, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 0}},
+ {37441, 691, 37441, 691, 38498, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38452, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38624, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38632, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 691, 38413, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 37543, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37574, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38452, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 691, 38390, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37443, 38421, 37456, 37512, 37474, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37441, 0, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38637, 37510, 38373, 37516, 37477, 37487, 2566, 37520, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38637, 37510, 38373, 37516, 37477, 37487, 2566, 37520, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37501, 37574, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 12, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 691, 37441, 691, 38632, 37510, 37512, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {37441, 37501, 37441, 37441, 38383, 37510, 0, 37516, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {37441, 37501, 37441, 37443, 38395, 37456, 37512, 37474, 37477, 37487, 2566, 37520, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
+ {37441, 38064, 37441, 37501, 0, 37510, 0, 37516, 37656, 37664, 2566, 37520, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
+ {691, 37441, 691, 37441, 38362, 37510, 0, 37516, 37477, 37487, 2566, 37520, 2, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}}
};
static const CultureInfoEntry culture_entries [] = {
- {0x0001, 0x007F, 768, -1, 38642, 38645, 38652, 38667, 38671, 38642, 0, {0, 0, 38675, 0}, 0, 0, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x0002, 0x007F, 257, -1, 38703, 38706, 38716, 38735, 38739, 38703, 0, {38743, 0, 0, 0}, 1, 1, { 1251, 21025, 10007, 866, 0, ';' }},
- {0x0003, 0x007F, 257, -1, 38785, 38788, 38796, 38804, 38808, 38785, 0, {38812, 0, 0, 0}, 2, 2, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0004, 0x0004, 257, -1, 38832, 38839, 38867, 38874, 38878, 38882, 0, {38885, 0, 0, 0}, 3, 3, { 936, 500, 10008, 936, 0, ',' }},
- {0x0004, 0x7804, 257, -1, 38892, 38900, 38867, 38874, 38878, 38882, 0, {38885, 0, 0, 0}, 4, 4, { 936, 500, 10008, 936, 0, ',' }},
- {0x0005, 0x007F, 257, -1, 38921, 38924, 38930, 38940, 38944, 38921, 0, {38948, 0, 0, 0}, 5, 5, { 1250, 500, 10029, 852, 0, ';' }},
- {0x0006, 0x007F, 257, -1, 38974, 38977, 38984, 38990, 38994, 38974, 0, {38998, 0, 0, 0}, 6, 6, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x0007, 0x007F, 257, -1, 39019, 39022, 39029, 39037, 39041, 39019, 0, {39045, 0, 0, 0}, 7, 7, { 1252, 20273, 10000, 850, 0, ';' }},
- {0x0008, 0x007F, 257, -1, 39070, 39073, 39079, 39096, 39100, 39070, 0, {39104, 0, 0, 0}, 8, 8, { 1253, 20273, 10006, 737, 0, ';' }},
- {0x0009, 0x007F, 257, -1, 39146, 39149, 39149, 39157, 39161, 39146, 0, {39165, 0, 0, 0}, 9, 9, { 1252, 37, 10000, 437, 0, ',' }},
- {0x000A, 0x007F, 257, -1, 39184, 39187, 39195, 39204, 39208, 39184, 0, {39212, 0, 0, 0}, 10, 10, { 1252, 20284, 10000, 850, 0, ';' }},
- {0x000B, 0x007F, 257, -1, 39234, 39237, 39245, 39251, 39255, 39234, 0, {39259, 0, 0, 0}, 11, 11, { 1252, 20278, 10000, 850, 0, ';' }},
- {0x000C, 0x007F, 257, -1, 39284, 39287, 39294, 39304, 39308, 39284, 0, {39312, 0, 0, 0}, 12, 12, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x000D, 0x007F, 257, -1, 39334, 39337, 39344, 39355, 39359, 39334, 0, {39363, 0, 0, 0}, 13, 13, { 1255, 500, 10005, 862, 1, ',' }},
- {0x000E, 0x007F, 257, -1, 39396, 39399, 39409, 39416, 39420, 39396, 0, {39424, 0, 0, 0}, 14, 14, { 1250, 500, 10029, 852, 0, ';' }},
- {0x000F, 0x007F, 257, -1, 39440, 39443, 39453, 39463, 39467, 39440, 0, {39471, 0, 0, 0}, 15, 15, { 1252, 20871, 10079, 850, 0, ';' }},
- {0x0010, 0x007F, 257, -1, 39491, 39494, 39502, 39511, 39515, 39491, 0, {39519, 0, 0, 0}, 16, 16, { 1252, 20280, 10000, 850, 0, ';' }},
- {0x0011, 0x007F, 257, -1, 39541, 39544, 39553, 39563, 39567, 39541, 0, {39571, 0, 0, 0}, 17, 17, { 932, 20290, 10001, 932, 0, ',' }},
- {0x0012, 0x007F, 257, -1, 39598, 39601, 39608, 39618, 39622, 39598, 0, {39626, 0, 0, 0}, 18, 18, { 949, 20833, 10003, 949, 0, ',' }},
- {0x0013, 0x007F, 257, -1, 39636, 39639, 39645, 39656, 39660, 39636, 0, {39664, 0, 0, 0}, 19, 19, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0014, 0x007F, 257, -1, 39686, 39689, 39699, 39705, 39709, 39713, 0, {38998, 0, 0, 0}, 20, 20, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x0015, 0x007F, 257, -1, 39716, 39719, 39726, 39733, 39737, 39716, 0, {39741, 0, 0, 0}, 21, 21, { 1250, 20880, 10029, 852, 0, ';' }},
- {0x0016, 0x007F, 257, -1, 39765, 39768, 39779, 39790, 39794, 39765, 0, {39798, 0, 0, 0}, 22, 22, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0017, 0x007F, 257, -1, 39821, 39824, 39832, 39842, 39846, 39821, 0, {39850, 0, 0, 0}, 23, 23, { 1252, 20273, 10000, 850, 0, ';' }},
- {0x0018, 0x007F, 257, -1, 39870, 39873, 39882, 39891, 39895, 39870, 0, {39899, 0, 0, 0}, 24, 24, { 1250, 20880, 10029, 852, 0, ';' }},
- {0x0019, 0x007F, 257, -1, 39918, 39921, 39929, 39944, 39948, 39918, 0, {39952, 0, 0, 0}, 25, 25, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x001A, 0x007F, 257, -1, 39998, 40001, 40010, 40019, 40023, 39998, 0, {40027, 0, 0, 0}, 26, 26, { 1250, 500, 10082, 852, 0, ';' }},
- {0x001B, 0x007F, 257, -1, 12824, 40050, 40057, 40069, 40073, 12824, 0, {40077, 0, 0, 0}, 27, 27, { 1250, 20880, 10029, 852, 0, ';' }},
- {0x001C, 0x007F, 257, -1, 40101, 40104, 40113, 40119, 40123, 40101, 0, {40127, 0, 0, 0}, 28, 28, { 1250, 20880, 10029, 852, 0, ';' }},
- {0x001D, 0x007F, 257, -1, 40147, 40150, 40158, 40166, 40170, 40147, 0, {38998, 0, 0, 0}, 29, 29, { 1252, 20278, 10000, 850, 0, ';' }},
- {0x001E, 0x007F, 512, -1, 40174, 40177, 40182, 40192, 40196, 40174, 0, {0, 40200, 0, 0}, 30, 30, { 874, 20838, 10021, 874, 0, ',' }},
- {0x001F, 0x007F, 257, -1, 12833, 40231, 40239, 40248, 40252, 12833, 0, {40256, 0, 0, 0}, 31, 31, { 1254, 20905, 10081, 857, 0, ';' }},
- {0x0020, 0x007F, 257, -1, 40270, 40273, 40278, 40287, 40291, 40270, 0, {40295, 0, 0, 0}, 32, 32, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x0021, 0x007F, 257, -1, 40325, 40328, 40339, 40356, 40360, 40325, 0, {40364, 0, 0, 0}, 33, 33, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0022, 0x007F, 257, -1, 40383, 40386, 40396, 40417, 40421, 40383, 0, {40425, 0, 0, 0}, 34, 34, { 1251, 500, 10017, 866, 0, ';' }},
- {0x0023, 0x007F, 257, -1, 40471, 40474, 40485, 40506, 40510, 40471, 0, {40514, 0, 0, 0}, 35, 35, { 1251, 500, 10007, 866, 0, ';' }},
- {0x0024, 0x007F, 257, -1, 40556, 40559, 40569, 40583, 40587, 40556, 0, {40591, 0, 0, 0}, 36, 36, { 1250, 20880, 10029, 852, 0, ';' }},
- {0x0025, 0x007F, 257, -1, 40613, 40616, 40625, 40631, 40635, 40613, 0, {40639, 0, 0, 0}, 37, 37, { 1257, 500, 10029, 775, 0, ';' }},
- {0x0026, 0x007F, 257, -1, 40659, 40662, 40670, 40680, 40684, 40659, 0, {40688, 0, 0, 0}, 38, 38, { 1257, 500, 10029, 775, 0, ';' }},
- {0x0027, 0x007F, 257, -1, 40707, 40710, 40721, 40731, 40735, 40707, 0, {40739, 0, 0, 0}, 39, 39, { 1257, 500, 10029, 775, 0, ';' }},
- {0x0028, 0x007F, 257, -1, 40762, 40765, 40771, 40784, 40788, 40762, 0, {0, 0, 0, 0}, 40, 40, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x0029, 0x007F, 257, -1, 40792, 40795, 40803, 40814, 40818, 40792, 0, {40822, 0, 0, 0}, 41, 41, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x002A, 0x007F, 257, -1, 40846, 40849, 40860, 40875, 35722, 40846, 0, {40879, 0, 0, 0}, 42, 42, { 1258, 500, 10000, 1258, 0, ',' }},
- {0x002B, 0x007F, 257, -1, 40894, 40897, 40906, 40921, 40925, 40894, 0, {40929, 0, 0, 0}, 43, 43, { 0, 500, 2, 1, 0, ',' }},
- {0x002C, 0x007F, 257, -1, 40959, 40962, 40974, 40986, 40990, 40959, 0, {40994, 0, 0, 0}, 44, 44, { 1254, 20905, 10081, 857, 0, ';' }},
- {0x002D, 0x007F, 257, -1, 41013, 41016, 41023, 41031, 41035, 41013, 0, {41039, 0, 0, 0}, 45, 45, { 1252, 500, 10000, 850, 0, ';' }},
- {0x002F, 0x007F, 257, -1, 41059, 41062, 41073, 41094, 41098, 41059, 0, {41102, 0, 0, 0}, 46, 46, { 1251, 500, 10007, 866, 0, ';' }},
- {0x0032, 0x007F, 257, -1, 41146, 41149, 41156, 41165, 41169, 41146, 0, {0, 0, 0, 0}, 47, 47, { 1252, 500, 10000, 850, 0, ',' }},
- {0x0034, 0x007F, 257, -1, 41173, 41176, 41182, 41191, 41195, 41173, 0, {0, 0, 0, 0}, 48, 48, { 1252, 500, 10000, 850, 0, ',' }},
- {0x0035, 0x007F, 257, -1, 41199, 41202, 41207, 41215, 41219, 41199, 0, {41223, 0, 0, 0}, 49, 49, { 1252, 500, 10000, 850, 0, ',' }},
- {0x0036, 0x007F, 257, -1, 41244, 41247, 41247, 41257, 41261, 41244, 0, {41265, 0, 0, 0}, 50, 50, { 1252, 500, 10000, 850, 0, ',' }},
- {0x0037, 0x007F, 257, -1, 41285, 41288, 41297, 41319, 41323, 41285, 0, {41327, 0, 0, 0}, 51, 51, { 0, 500, 2, 1, 0, ';' }},
- {0x0038, 0x007F, 257, -1, 41392, 41395, 41403, 41413, 41417, 41392, 0, {0, 0, 0, 0}, 52, 52, { 1252, 20277, 10079, 850, 0, ';' }},
- {0x0039, 0x007F, 257, -1, 41421, 41424, 41430, 41446, 41450, 41421, 0, {41454, 0, 0, 0}, 53, 53, { 0, 500, 2, 1, 0, ',' }},
- {0x003A, 0x007F, 257, -1, 41507, 41510, 41518, 41524, 41528, 41507, 0, {41532, 0, 0, 0}, 54, 54, { 0, 500, 2, 1, 0, ',' }},
- {0x003B, 0x007F, 257, -1, 41553, 41556, 41570, 41587, 41591, 41553, 0, {41595, 0, 0, 0}, 55, 55, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x003C, 0x007F, 257, -1, 41614, 41617, 41623, 41631, 41635, 41614, 0, {41639, 0, 0, 0}, 56, 56, { 1252, 500, 10000, 850, 0, ',' }},
- {0x003E, 0x007F, 257, -1, 41660, 41663, 41669, 41683, 41687, 41660, 0, {41691, 0, 0, 0}, 57, 57, { 1252, 500, 10000, 850, 0, ';' }},
- {0x003F, 0x007F, 257, -1, 41708, 41711, 41718, 41738, 41742, 41708, 0, {41746, 0, 0, 0}, 58, 58, { 0, 500, 2, 1, 0, ';' }},
- {0x0040, 0x007F, 257, -1, 41788, 41791, 41798, 41815, 41819, 41788, 0, {41823, 0, 0, 0}, 59, 59, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x0041, 0x007F, 257, -1, 41861, 41864, 41872, 41882, 41886, 41861, 0, {41890, 0, 0, 0}, 60, 60, { 1252, 500, 10000, 437, 0, ',' }},
- {0x0043, 0x007F, 257, -1, 41911, 41914, 41920, 41931, 41935, 41911, 0, {41939, 0, 0, 0}, 61, 61, { 1254, 500, 10029, 857, 0, ';' }},
- {0x0045, 0x007F, 257, -1, 41959, 41962, 41970, 41986, 41990, 41959, 0, {41994, 0, 0, 0}, 62, 62, { 0, 500, 2, 1, 0, ',' }},
- {0x0046, 0x007F, 257, -1, 42059, 42062, 42070, 42089, 42093, 42059, 0, {42097, 0, 0, 0}, 63, 63, { 0, 500, 2, 1, 0, ',' }},
- {0x0047, 0x007F, 257, -1, 42144, 42147, 42156, 42178, 42182, 42144, 0, {42186, 0, 0, 0}, 64, 64, { 0, 500, 2, 1, 0, ',' }},
- {0x0048, 0x007F, 257, -1, 42242, 42245, 42251, 42267, 42271, 42242, 0, {0, 0, 0, 0}, 65, 65, { 0, 500, 2, 1, 0, ',' }},
- {0x0049, 0x007F, 257, -1, 42275, 42278, 42284, 42300, 42304, 42275, 0, {42308, 0, 0, 0}, 66, 66, { 0, 500, 2, 1, 0, ',' }},
- {0x004A, 0x007F, 257, -1, 42373, 42376, 42383, 42402, 42406, 42373, 0, {42410, 0, 0, 0}, 67, 67, { 0, 500, 2, 1, 0, ',' }},
- {0x004B, 0x007F, 257, -1, 37895, 42475, 42483, 42499, 42503, 37895, 0, {42507, 0, 0, 0}, 68, 68, { 0, 500, 2, 1, 0, ',' }},
- {0x004C, 0x007F, 257, -1, 42572, 42575, 42585, 42604, 42608, 42572, 0, {42612, 0, 0, 0}, 69, 69, { 0, 500, 2, 1, 0, ',' }},
- {0x004D, 0x007F, 257, -1, 42656, 42659, 42668, 42690, 42694, 42656, 0, {42698, 0, 0, 0}, 70, 70, { 0, 500, 2, 1, 0, ',' }},
- {0x004E, 0x007F, 257, -1, 42751, 42754, 42762, 42778, 2530, 42751, 0, {42782, 0, 0, 0}, 71, 71, { 0, 500, 2, 1, 0, ',' }},
- {0x0050, 0x007F, 257, -1, 42844, 42847, 42857, 42870, 42874, 42844, 0, {42878, 0, 0, 0}, 72, 72, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x0051, 0x007F, 257, -1, 42910, 42913, 42921, 42946, 42950, 42910, 0, {0, 0, 0, 0}, 73, 73, { 0, 500, 2, 1, 0, ',' }},
- {0x0052, 0x007F, 257, -1, 42954, 42957, 42963, 42971, 42975, 42954, 0, {42979, 0, 0, 0}, 74, 74, { 1252, 20285, 10000, 850, 0, ',' }},
- {0x0053, 0x007F, 257, -1, 42995, 42998, 43004, 43020, 43024, 42995, 0, {43028, 0, 0, 0}, 75, 75, { 0, 500, 2, 1, 0, ',' }},
- {0x0054, 0x007F, 257, -1, 43083, 43086, 43090, 43100, 43104, 43083, 0, {43108, 0, 0, 0}, 76, 76, { 0, 500, 2, 1, 0, ',' }},
- {0x0056, 0x007F, 257, -1, 43154, 43157, 43166, 43173, 43177, 43154, 0, {39519, 0, 0, 0}, 77, 77, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0057, 0x007F, 257, -1, 43181, 43185, 43193, 43212, 43181, 43181, 0, {0, 0, 0, 0}, 78, 78, { 0, 500, 2, 1, 0, ',' }},
- {0x005B, 0x007F, 257, -1, 43216, 43219, 43227, 43243, 43247, 43216, 0, {43251, 0, 0, 0}, 79, 79, { 0, 500, 2, 1, 0, ',' }},
- {0x005E, 0x007F, 257, -1, 8151, 43310, 43318, 43331, 43335, 8151, 0, {43339, 0, 0, 0}, 80, 80, { 0, 500, 2, 1, 0, ';' }},
- {0x005F, 0x007F, 257, -1, 43384, 43388, 43412, 43422, 43384, 43384, 0, {0, 0, 0, 0}, 81, 81, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x0061, 0x007F, 257, -1, 1992, 43426, 43433, 43452, 43456, 1992, 0, {43460, 0, 0, 0}, 82, 82, { 0, 500, 2, 1, 0, ',' }},
- {0x0063, 0x007F, 1024, -1, 43510, 43513, 43520, 43529, 43533, 43510, 0, {0, 0, 0, 0}, 83, 83, { 0, 500, 2, 1, 1, ';' }},
- {0x0064, 0x007F, 257, -1, 43537, 43541, 43541, 43550, 43537, 43537, 0, {43554, 0, 0, 0}, 84, 84, { 1252, 500, 10000, 437, 0, ',' }},
- {0x0068, 0x007F, 257, -1, 43577, 43580, 43580, 43586, 43590, 43577, 0, {0, 0, 0, 0}, 85, 85, { 1252, 37, 10000, 437, 0, ',' }},
- {0x006A, 0x007F, 257, -1, 43594, 43597, 43604, 43619, 43623, 43594, 0, {0, 0, 0, 0}, 86, 86, { 1252, 37, 10000, 437, 0, ',' }},
- {0x006C, 0x007F, 257, -1, 43627, 43631, 43646, 43663, 43627, 43627, 0, {0, 0, 0, 0}, 87, 87, { 1252, 500, 10000, 850, 0, ',' }},
- {0x006F, 0x007F, 257, -1, 43667, 43670, 43682, 43694, 43698, 43667, 0, {43702, 0, 0, 0}, 88, 88, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x0070, 0x007F, 257, -1, 43729, 43732, 43732, 43737, 43741, 43729, 0, {0, 0, 0, 0}, 89, 89, { 1252, 37, 10000, 437, 0, ',' }},
- {0x0078, 0x007F, 257, -1, 43745, 43748, 43759, 43769, 43773, 43745, 0, {43777, 0, 0, 0}, 90, 90, { 0, 500, 2, 1, 0, ',' }},
- {0x007E, 0x007F, 257, -1, 43790, 43793, 43800, 43810, 43814, 43790, 0, {43818, 0, 0, 0}, 91, 91, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x0084, 0x007F, 257, -1, 43838, 43842, 43855, 43874, 43838, 43838, 0, {43878, 0, 0, 0}, 92, 92, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x0085, 0x007F, 257, -1, 43903, 43907, 43913, 43931, 43903, 43903, 0, {0, 0, 0, 0}, 93, 93, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x0087, 0x007F, 257, -1, 43935, 43938, 43938, 43950, 43954, 43935, 0, {0, 0, 0, 0}, 94, 94, { 1252, 37, 10000, 437, 0, ';' }},
- {0x0091, 0x007F, 257, -1, 43958, 43961, 43977, 43987, 43991, 43958, 0, {43995, 0, 0, 0}, 95, 95, { 1252, 20285, 10000, 850, 0, ',' }},
- {0x0401, 0x0001, 768, 95, 44020, 44026, 44048, 38667, 38671, 38642, 13775, {0, 0, 38675, 0}, 96, 96, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x0402, 0x0002, 257, 11, 44112, 44118, 44139, 38735, 38739, 38703, 44177, {38743, 0, 0, 0}, 97, 97, { 1251, 21025, 10007, 866, 0, ';' }},
- {0x0403, 0x0003, 257, 31, 44180, 44186, 44202, 38804, 38808, 38785, 44220, {38812, 0, 0, 0}, 98, 98, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0404, 0x7C04, 257, 107, 44223, 44229, 44251, 44267, 38878, 38882, 44271, {44274, 0, 0, 0}, 99, 99, { 950, 500, 10002, 950, 0, ',' }},
- {0x0405, 0x0005, 257, 23, 44281, 44287, 44310, 38940, 38944, 38921, 44340, {38948, 0, 0, 0}, 100, 100, { 1250, 500, 10029, 852, 0, ';' }},
- {0x0406, 0x0006, 257, 25, 44343, 44349, 44366, 38990, 38994, 38974, 44382, {38998, 0, 0, 0}, 101, 101, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x0407, 0x0007, 257, 24, 44385, 44391, 44408, 39037, 39041, 39019, 44430, {39045, 0, 0, 0}, 102, 102, { 1252, 20273, 10000, 850, 0, ';' }},
- {0x0408, 0x0008, 257, 39, 44433, 44439, 44454, 39096, 39100, 39070, 44486, {39104, 0, 0, 0}, 103, 103, { 1253, 20273, 10006, 737, 0, ';' }},
- {0x0409, 0x0009, 257, 109, 44489, 44495, 44495, 39157, 39161, 39146, 44519, {39165, 0, 0, 0}, 104, 104, { 1252, 37, 10000, 437, 0, ',' }},
- {0x040B, 0x000B, 257, 33, 44522, 44528, 44546, 39251, 39255, 39234, 44560, {39259, 0, 0, 0}, 105, 105, { 1252, 20278, 10000, 850, 0, ';' }},
- {0x040C, 0x000C, 257, 35, 44563, 44569, 44585, 39304, 39308, 39284, 44604, {39312, 0, 0, 0}, 106, 106, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x040D, 0x000D, 257, 47, 44607, 44613, 44629, 39355, 39359, 39334, 44653, {39363, 0, 0, 0}, 107, 107, { 1255, 500, 10005, 862, 1, ',' }},
- {0x040E, 0x000E, 257, 44, 44656, 44662, 44682, 39416, 39420, 39396, 44705, {39424, 0, 0, 0}, 108, 108, { 1250, 500, 10029, 852, 0, ';' }},
- {0x040F, 0x000F, 257, 51, 44708, 44714, 44734, 39463, 39467, 39440, 44754, {39471, 0, 0, 0}, 109, 109, { 1252, 20871, 10079, 850, 0, ';' }},
- {0x0410, 0x0010, 257, 52, 44757, 44763, 44779, 39511, 39515, 39491, 44797, {39519, 0, 0, 0}, 110, 110, { 1252, 20280, 10000, 850, 0, ';' }},
- {0x0411, 0x0011, 257, 55, 44800, 44806, 44823, 39563, 39567, 39541, 44842, {39571, 0, 0, 0}, 111, 111, { 932, 20290, 10001, 932, 0, ',' }},
- {0x0412, 0x0012, 257, 58, 44845, 44851, 44872, 39618, 39622, 39598, 44897, {39626, 0, 0, 0}, 112, 112, { 949, 20833, 10003, 949, 0, ',' }},
- {0x0413, 0x0013, 257, 77, 44900, 44906, 44926, 39656, 39660, 39636, 44949, {39664, 0, 0, 0}, 113, 113, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0414, 0x7C14, 257, 78, 44952, 44958, 44985, 39705, 39709, 39713, 45007, {38998, 0, 0, 0}, 114, 114, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x0415, 0x0015, 257, 86, 45010, 45016, 45032, 39733, 39737, 39716, 45048, {39741, 0, 0, 0}, 115, 115, { 1250, 20880, 10029, 852, 0, ';' }},
- {0x0416, 0x0016, 257, 14, 45051, 45057, 45077, 39790, 39794, 39765, 45097, {39798, 0, 0, 0}, 116, 116, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0417, 0x0017, 257, 18, 45100, 45106, 45128, 39842, 39846, 39821, 13778, {39850, 0, 0, 0}, 117, 117, { 1252, 20273, 10000, 850, 0, ';' }},
- {0x0418, 0x0018, 257, 91, 45147, 45153, 45172, 39891, 39895, 39870, 45192, {39899, 0, 0, 0}, 118, 118, { 1250, 20880, 10029, 852, 0, ';' }},
- {0x0419, 0x0019, 257, 93, 45195, 45201, 45218, 39944, 39948, 39918, 45248, {39952, 0, 0, 0}, 119, 119, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x041A, 0x001A, 257, 43, 45251, 45257, 45276, 40019, 40023, 39998, 45296, {40027, 0, 0, 0}, 120, 120, { 1250, 500, 10082, 852, 0, ';' }},
- {0x041B, 0x001B, 257, 99, 45299, 45305, 45323, 40069, 40073, 12824, 45347, {40077, 0, 0, 0}, 121, 121, { 1250, 20880, 10029, 852, 0, ';' }},
- {0x041C, 0x001C, 257, 2, 45350, 45356, 45375, 40119, 40123, 40101, 45393, {40127, 0, 0, 0}, 122, 122, { 1250, 20880, 10029, 852, 0, ';' }},
- {0x041D, 0x001D, 257, 96, 45396, 45402, 45419, 40166, 40170, 40147, 45437, {38998, 0, 0, 0}, 123, 123, { 1252, 20278, 10000, 850, 0, ';' }},
- {0x041E, 0x001E, 512, 102, 45440, 45446, 45462, 40192, 40196, 40174, 45484, {0, 40200, 0, 0}, 124, 124, { 874, 20838, 10021, 874, 0, ',' }},
- {0x041F, 0x001F, 257, 105, 45487, 45493, 45510, 40248, 40252, 12833, 45530, {40256, 0, 0, 0}, 125, 125, { 1254, 20905, 10081, 857, 0, ';' }},
- {0x0420, 0x0020, 257, 85, 45533, 45539, 45555, 40287, 40291, 40270, 45581, {40295, 0, 0, 0}, 126, 126, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x0421, 0x0021, 257, 45, 45584, 45590, 45613, 40356, 40360, 40325, 45642, {40364, 0, 0, 0}, 127, 127, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0422, 0x0022, 257, 108, 45645, 45651, 45671, 40417, 40421, 40383, 45709, {40425, 0, 0, 0}, 128, 128, { 1251, 500, 10017, 866, 0, ';' }},
- {0x0423, 0x0023, 257, 15, 45712, 45718, 45739, 40506, 40510, 40471, 45779, {40514, 0, 0, 0}, 129, 129, { 1251, 500, 10007, 866, 0, ';' }},
- {0x0424, 0x0024, 257, 98, 45782, 45788, 45809, 40583, 40587, 40556, 45835, {40591, 0, 0, 0}, 130, 130, { 1250, 20880, 10029, 852, 0, ';' }},
- {0x0425, 0x0025, 257, 29, 45838, 45844, 45863, 40631, 40635, 40613, 45877, {40639, 0, 0, 0}, 131, 131, { 1257, 500, 10029, 775, 0, ';' }},
- {0x0426, 0x0026, 257, 66, 45880, 45886, 45903, 40680, 40684, 40659, 45923, {40688, 0, 0, 0}, 132, 132, { 1257, 500, 10029, 775, 0, ';' }},
- {0x0427, 0x0027, 257, 64, 45926, 45932, 45955, 40731, 40735, 40707, 45975, {40739, 0, 0, 0}, 133, 133, { 1257, 500, 10029, 775, 0, ';' }},
- {0x0428, 0x7C28, 257, 103, 45978, 45989, 46018, 40784, 40788, 40762, 46054, {0, 0, 0, 0}, 134, 134, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x0429, 0x0029, 257, 50, 46057, 46063, 46078, 40814, 40818, 40792, 46102, {40822, 0, 0, 0}, 135, 135, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x042A, 0x002A, 257, 113, 46105, 46111, 46132, 40875, 35722, 40846, 46160, {40879, 0, 0, 0}, 136, 136, { 1258, 500, 10000, 1258, 0, ',' }},
- {0x042B, 0x002B, 257, 3, 46163, 46169, 46188, 40921, 40925, 40894, 1929, {40929, 0, 0, 0}, 137, 137, { 0, 500, 2, 1, 0, ',' }},
- {0x042C, 0x782C, 257, 7, 46222, 46233, 46265, 40986, 40990, 40959, 46291, {40994, 0, 0, 0}, 138, 138, { 1254, 20905, 10081, 857, 0, ';' }},
- {0x042D, 0x002D, 257, 31, 46294, 46300, 46315, 41031, 41035, 41013, 44220, {41039, 0, 0, 0}, 139, 139, { 1252, 500, 10000, 850, 0, ';' }},
- {0x042F, 0x002F, 257, 71, 46334, 46340, 46363, 41094, 41098, 41059, 46407, {41102, 0, 0, 0}, 140, 140, { 1251, 500, 10007, 866, 0, ';' }},
- {0x0432, 0x0032, 257, 115, 46410, 46416, 41156, 41165, 41169, 41146, 46438, {0, 0, 0, 0}, 141, 141, { 1252, 500, 10000, 850, 0, ',' }},
- {0x0434, 0x0034, 257, 115, 46441, 46447, 41182, 41191, 41195, 41173, 46438, {0, 0, 0, 0}, 142, 142, { 1252, 500, 10000, 850, 0, ',' }},
- {0x0435, 0x0035, 257, 115, 46468, 46474, 46494, 41215, 41219, 41199, 46438, {41223, 0, 0, 0}, 143, 143, { 1252, 500, 10000, 850, 0, ',' }},
- {0x0436, 0x0036, 257, 115, 46519, 46525, 46550, 41257, 41261, 41244, 46438, {41265, 0, 0, 0}, 144, 144, { 1252, 500, 10000, 850, 0, ',' }},
- {0x0437, 0x0037, 257, 37, 46574, 46580, 46599, 41319, 41323, 41285, 46654, {41327, 0, 0, 0}, 145, 145, { 0, 500, 2, 1, 0, ';' }},
- {0x0438, 0x0038, 257, 34, 46657, 46663, 46687, 41413, 41417, 41392, 46708, {0, 0, 0, 0}, 146, 146, { 1252, 20277, 10079, 850, 0, ';' }},
- {0x0439, 0x0039, 257, 48, 46711, 46717, 46731, 41446, 41450, 41421, 46762, {41454, 0, 0, 0}, 147, 147, { 0, 500, 2, 1, 0, ',' }},
- {0x043A, 0x003A, 257, 73, 46765, 46771, 46787, 41524, 41528, 41507, 46801, {41532, 0, 0, 0}, 148, 148, { 0, 500, 2, 1, 0, ',' }},
- {0x043B, 0x003B, 257, 78, 46804, 46810, 46833, 41587, 41591, 41553, 45007, {41595, 0, 0, 0}, 149, 149, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x0441, 0x0041, 257, 56, 46858, 46864, 46880, 41882, 41886, 41861, 46898, {41890, 0, 0, 0}, 150, 150, { 1252, 500, 10000, 437, 0, ',' }},
- {0x0443, 0x7C43, 257, 111, 46901, 46912, 46938, 41931, 41935, 41911, 46964, {41939, 0, 0, 0}, 151, 151, { 1254, 500, 10029, 857, 0, ';' }},
- {0x0445, 0x0045, 257, 48, 46967, 46973, 46989, 41986, 41990, 41959, 46762, {41994, 0, 0, 0}, 152, 152, { 0, 500, 2, 1, 0, ',' }},
- {0x0447, 0x0047, 257, 48, 47020, 47026, 47043, 42178, 42182, 42144, 46762, {42186, 0, 0, 0}, 153, 153, { 0, 500, 2, 1, 0, ',' }},
- {0x0448, 0x0048, 257, 48, 47080, 47086, 47100, 42267, 42271, 42242, 46762, {0, 0, 0, 0}, 154, 154, { 0, 500, 2, 1, 0, ',' }},
- {0x0449, 0x0049, 257, 48, 47131, 47137, 47151, 42300, 42304, 42275, 46762, {42308, 0, 0, 0}, 155, 155, { 0, 500, 2, 1, 0, ',' }},
- {0x044A, 0x004A, 257, 48, 47191, 47197, 47212, 42402, 42406, 42373, 46762, {42410, 0, 0, 0}, 156, 156, { 0, 500, 2, 1, 0, ',' }},
- {0x044B, 0x004B, 257, 48, 47259, 47265, 47281, 42499, 42503, 37895, 46762, {42507, 0, 0, 0}, 157, 157, { 0, 500, 2, 1, 0, ',' }},
- {0x044C, 0x004C, 257, 48, 47312, 47318, 47336, 42604, 42608, 42572, 46762, {42612, 0, 0, 0}, 158, 158, { 0, 500, 2, 1, 0, ',' }},
- {0x044D, 0x004D, 257, 48, 47376, 47382, 47399, 42690, 42694, 42656, 46762, {42698, 0, 0, 0}, 159, 159, { 0, 500, 2, 1, 0, ',' }},
- {0x044E, 0x004E, 257, 48, 47436, 47442, 47458, 42778, 2530, 42751, 46762, {42782, 0, 0, 0}, 160, 160, { 0, 500, 2, 1, 0, ',' }},
- {0x0451, 0x0051, 257, 20, 47489, 47495, 47511, 42946, 42950, 42910, 13857, {0, 0, 0, 0}, 161, 161, { 0, 500, 2, 1, 0, ',' }},
- {0x0452, 0x0052, 257, 36, 47557, 47563, 47586, 42971, 42975, 42954, 47613, {42979, 0, 0, 0}, 162, 162, { 1252, 20285, 10000, 850, 0, ',' }},
- {0x0453, 0x0053, 257, 57, 47616, 47622, 47639, 43020, 43024, 42995, 47679, {43028, 0, 0, 0}, 163, 163, { 0, 500, 2, 1, 0, ',' }},
- {0x0454, 0x0054, 257, 60, 47682, 47688, 47699, 43100, 43104, 43083, 47721, {43108, 0, 0, 0}, 164, 164, { 0, 500, 2, 1, 0, ',' }},
- {0x0456, 0x0056, 257, 31, 47724, 47730, 47747, 43173, 43177, 43154, 44220, {39519, 0, 0, 0}, 165, 165, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0457, 0x0057, 257, 48, 47764, 47771, 47787, 43212, 43181, 43181, 46762, {0, 0, 0, 0}, 166, 166, { 0, 500, 2, 1, 0, ',' }},
- {0x045B, 0x005B, 257, 63, 47821, 47827, 47847, 43243, 43247, 43216, 47897, {43251, 0, 0, 0}, 167, 167, { 0, 500, 2, 1, 0, ',' }},
- {0x045E, 0x005E, 257, 32, 47900, 47906, 47925, 43331, 43335, 8151, 47956, {43339, 0, 0, 0}, 168, 168, { 0, 500, 2, 1, 0, ';' }},
- {0x0461, 0x0061, 257, 79, 47959, 47965, 47980, 43452, 43456, 1992, 48017, {43460, 0, 0, 0}, 169, 169, { 0, 500, 2, 1, 0, ',' }},
- {0x0463, 0x0063, 1024, 1, 48020, 48026, 48047, 43529, 43533, 43510, 48077, {0, 0, 0, 0}, 170, 170, { 0, 500, 2, 1, 1, ';' }},
- {0x0464, 0x0064, 257, 84, 48080, 48087, 48110, 43550, 43537, 43537, 48131, {43554, 0, 0, 0}, 171, 171, { 1252, 500, 10000, 437, 0, ',' }},
- {0x0468, 0x7C68, 257, 75, 48134, 48145, 48168, 43586, 43590, 43577, 48185, {0, 0, 0, 0}, 172, 172, { 1252, 37, 10000, 437, 0, ',' }},
- {0x046A, 0x006A, 257, 75, 48188, 48194, 48211, 43619, 43623, 43594, 48185, {0, 0, 0, 0}, 173, 173, { 1252, 37, 10000, 437, 0, ',' }},
- {0x046C, 0x006C, 257, 115, 48257, 48264, 43646, 43663, 43627, 43627, 46438, {0, 0, 0, 0}, 174, 174, { 1252, 500, 10000, 850, 0, ',' }},
- {0x046F, 0x006F, 257, 38, 48294, 48300, 48324, 43694, 43698, 43667, 48355, {43702, 0, 0, 0}, 175, 175, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x0470, 0x0070, 257, 75, 48358, 48364, 48364, 43737, 43741, 43729, 48185, {0, 0, 0, 0}, 176, 176, { 1252, 37, 10000, 437, 0, ',' }},
- {0x0478, 0x0078, 257, 20, 48379, 48385, 48404, 43769, 43773, 43745, 13857, {43777, 0, 0, 0}, 177, 177, { 0, 500, 2, 1, 0, ',' }},
- {0x047E, 0x007E, 257, 35, 48423, 48429, 48445, 43810, 43814, 43790, 44604, {43818, 0, 0, 0}, 178, 178, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x0485, 0x0085, 257, 93, 48464, 48471, 43913, 43931, 43903, 43903, 45248, {0, 0, 0, 0}, 179, 179, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x0487, 0x0087, 257, 94, 48486, 48492, 48492, 43950, 43954, 43935, 48513, {0, 0, 0, 0}, 180, 180, { 1252, 37, 10000, 437, 0, ';' }},
- {0x0491, 0x0091, 257, 36, 48516, 48522, 48555, 43987, 43991, 43958, 47613, {43995, 0, 0, 0}, 181, 181, { 1252, 20285, 10000, 850, 0, ',' }},
- {0x0801, 0x0001, 257, 49, 48591, 48597, 48611, 48641, 38671, 38642, 48645, {48648, 0, 0, 0}, 182, 182, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x0804, 0x0004, 257, 20, 48680, 38900, 48686, 38874, 38878, 38882, 13857, {38885, 0, 0, 0}, 183, 183, { 936, 500, 10008, 936, 0, ',' }},
- {0x0807, 0x0007, 257, 18, 48702, 48708, 48729, 48747, 39041, 39019, 13778, {39045, 0, 0, 0}, 184, 184, { 1252, 20273, 10000, 850, 0, ';' }},
- {0x0809, 0x0009, 257, 36, 48751, 48757, 48757, 48782, 39161, 39146, 47613, {39165, 0, 0, 0}, 185, 185, { 1252, 20285, 10000, 850, 0, ',' }},
- {0x080A, 0x000A, 257, 74, 48786, 48792, 48809, 48828, 39208, 39184, 48832, {39519, 0, 0, 0}, 186, 186, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x080C, 0x000C, 257, 10, 48835, 48841, 48858, 48879, 39308, 39284, 48883, {39312, 0, 0, 0}, 187, 187, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x0810, 0x0010, 257, 18, 48886, 48892, 48914, 48934, 39515, 39491, 13778, {39519, 0, 0, 0}, 188, 188, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0813, 0x0013, 257, 10, 48938, 48944, 48960, 48981, 39660, 39636, 48883, {39664, 0, 0, 0}, 189, 189, { 1252, 500, 10000, 850, 0, ';' }},
- {0x0814, 0x7814, 257, 78, 48985, 48991, 49018, 49034, 49038, 49042, 45007, {38998, 0, 0, 0}, 190, 190, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x0816, 0x0016, 257, 88, 49045, 49051, 49073, 49095, 39794, 39765, 49099, {39798, 0, 0, 0}, 191, 191, { 1252, 500, 10000, 850, 0, ';' }},
- {0x081D, 0x001D, 257, 33, 49102, 49108, 49126, 49144, 40170, 40147, 44560, {38998, 0, 0, 0}, 192, 192, { 1252, 20278, 10000, 850, 0, ';' }},
- {0x082C, 0x742C, 257, 7, 49148, 49159, 46265, 49194, 40990, 40959, 46291, {40994, 0, 0, 0}, 193, 193, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x083C, 0x003C, 257, 46, 49198, 49204, 49220, 41631, 41635, 41614, 49236, {41639, 0, 0, 0}, 194, 194, { 1252, 500, 10000, 850, 0, ',' }},
- {0x0843, 0x7843, 257, 111, 49239, 49250, 46938, 41931, 41935, 41911, 46964, {49279, 0, 0, 0}, 195, 195, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x0845, 0x0045, 257, 9, 49317, 49323, 49344, 49387, 41990, 41959, 49391, {41994, 0, 0, 0}, 196, 196, { 0, 500, 2, 1, 0, ',' }},
- {0x0C01, 0x0001, 257, 30, 49394, 49400, 49415, 49439, 38671, 38642, 49443, {48648, 0, 0, 0}, 197, 197, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x0C04, 0x7C04, 257, 41, 49446, 49452, 49495, 49532, 38878, 38882, 49536, {44274, 0, 0, 0}, 198, 198, { 950, 500, 10002, 950, 0, ',' }},
- {0x0C07, 0x0007, 257, 5, 49539, 49545, 49562, 49584, 39041, 39019, 49588, {39045, 0, 0, 0}, 199, 199, { 1252, 20273, 10000, 850, 0, ';' }},
- {0x0C09, 0x0009, 257, 6, 49591, 49597, 49597, 49617, 39161, 39146, 49621, {39165, 0, 0, 0}, 200, 200, { 1252, 500, 10000, 850, 0, ',' }},
- {0x0C0A, 0x000A, 257, 31, 49624, 49630, 49646, 49665, 39208, 39184, 44220, {39212, 0, 0, 0}, 201, 201, { 1252, 20284, 10000, 850, 0, ';' }},
- {0x0C0C, 0x000C, 257, 17, 49669, 49675, 49691, 49710, 39308, 39284, 49714, {49717, 0, 0, 0}, 202, 202, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x0C3B, 0x003B, 257, 33, 49739, 49745, 49769, 49795, 49799, 41553, 44560, {41595, 0, 0, 0}, 203, 203, { 1252, 20278, 10000, 850, 0, ';' }},
- {0x1001, 0x0001, 257, 67, 49803, 49809, 49824, 49852, 38671, 38642, 49856, {48648, 0, 0, 0}, 204, 204, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x1004, 0x0004, 257, 97, 49859, 49865, 49897, 49916, 38878, 38882, 49920, {38885, 0, 0, 0}, 205, 205, { 936, 500, 10008, 936, 0, ',' }},
- {0x1007, 0x0007, 257, 65, 49923, 49929, 49949, 49969, 39041, 39019, 49973, {39045, 0, 0, 0}, 206, 206, { 1252, 20273, 10000, 850, 0, ';' }},
- {0x1009, 0x0009, 257, 17, 49976, 49982, 49982, 49999, 39161, 39146, 49714, {39165, 0, 0, 0}, 207, 207, { 1252, 37, 10000, 850, 0, ',' }},
- {0x100A, 0x000A, 257, 40, 50003, 50009, 50029, 50050, 39208, 39184, 50054, {39212, 0, 0, 0}, 208, 208, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x100C, 0x000C, 257, 18, 50057, 50063, 50084, 50103, 39308, 39284, 13778, {39312, 0, 0, 0}, 209, 209, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x101A, 0x001A, 257, 8, 50107, 50113, 50147, 50178, 50182, 39998, 50186, {40027, 0, 0, 0}, 210, 210, { 1250, 870, 10082, 852, 0, ';' }},
- {0x1401, 0x0001, 257, 27, 50189, 50195, 50212, 50244, 38671, 38642, 50248, {48648, 0, 0, 0}, 211, 211, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x1404, 0x7C04, 257, 72, 50251, 50257, 50296, 50333, 38878, 38882, 50337, {44274, 0, 0, 0}, 212, 212, { 950, 500, 10002, 950, 0, ',' }},
- {0x1407, 0x0007, 257, 62, 50340, 50346, 50369, 50393, 39041, 39019, 50397, {39045, 0, 0, 0}, 213, 213, { 1252, 20273, 10000, 850, 0, ';' }},
- {0x1409, 0x0009, 257, 80, 50400, 50406, 50406, 50428, 39161, 39146, 50432, {39165, 0, 0, 0}, 214, 214, { 1252, 500, 10000, 850, 0, ',' }},
- {0x140A, 0x000A, 257, 22, 50435, 50441, 50462, 50484, 39208, 39184, 50488, {39212, 0, 0, 0}, 215, 215, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x140C, 0x000C, 257, 65, 50491, 50497, 50517, 50540, 39308, 39284, 49973, {39312, 0, 0, 0}, 216, 216, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x141A, 0x681A, 257, 8, 50544, 50555, 50595, 50626, 50630, 50634, 50186, {50637, 0, 0, 0}, 217, 217, { 1250, 870, 10082, 852, 0, ';' }},
- {0x1801, 0x0001, 257, 68, 50660, 50666, 50683, 50713, 38671, 38642, 50717, {48648, 0, 0, 0}, 218, 218, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x1809, 0x0009, 257, 46, 50720, 50726, 50726, 50744, 39161, 39146, 49236, {39165, 0, 0, 0}, 219, 219, { 1252, 500, 10000, 850, 0, ',' }},
- {0x180A, 0x000A, 257, 82, 50748, 50754, 50771, 50790, 39208, 39184, 50794, {39212, 0, 0, 0}, 220, 220, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x180C, 0x000C, 257, 69, 50797, 50803, 50819, 50838, 39308, 39284, 50842, {39312, 0, 0, 0}, 221, 221, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x181A, 0x701A, 257, 8, 50845, 50856, 50896, 50948, 50952, 50956, 50186, {50637, 0, 0, 0}, 222, 222, { 1250, 870, 10082, 852, 0, ';' }},
- {0x1C01, 0x0001, 257, 104, 50959, 50965, 50982, 51008, 38671, 38642, 51012, {48648, 0, 0, 0}, 223, 223, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x1C09, 0x0009, 257, 115, 51015, 51021, 51021, 51044, 39161, 39146, 46438, {39165, 0, 0, 0}, 224, 224, { 1252, 500, 10000, 437, 0, ',' }},
- {0x1C0A, 0x000A, 257, 26, 51048, 51054, 51083, 51116, 39208, 39184, 51120, {39212, 0, 0, 0}, 225, 225, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x1C1A, 0x6C1A, 257, 8, 51123, 51134, 50896, 51177, 51181, 50956, 50186, {41102, 0, 0, 0}, 226, 226, { 1251, 21025, 10007, 855, 0, ';' }},
- {0x2001, 0x0001, 257, 81, 51185, 51191, 51205, 51233, 38671, 38642, 51237, {48648, 0, 0, 0}, 227, 227, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x2009, 0x0009, 257, 53, 51240, 51246, 51246, 51264, 39161, 39146, 51268, {39165, 0, 0, 0}, 228, 228, { 1252, 500, 10000, 850, 0, ',' }},
- {0x200A, 0x000A, 257, 112, 51271, 51277, 51297, 51318, 39208, 39184, 51322, {39212, 0, 0, 0}, 229, 229, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x201A, 0x641A, 257, 8, 51325, 51336, 50595, 51379, 51383, 50634, 50186, {41102, 0, 0, 0}, 230, 230, { 1251, 870, 10082, 855, 0, ';' }},
- {0x2401, 0x0001, 257, 114, 51387, 51393, 51408, 51436, 38671, 38642, 51440, {48648, 0, 0, 0}, 231, 231, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x240A, 0x000A, 257, 21, 51443, 51449, 51468, 51488, 39208, 39184, 51492, {39212, 0, 0, 0}, 232, 232, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x241A, 0x701A, 257, 92, 51495, 51506, 51530, 51558, 2239, 50956, 51562, {50637, 0, 0, 0}, 233, 233, { 1250, 500, 10029, 852, 0, ';' }},
- {0x2801, 0x0001, 257, 101, 51565, 51571, 51586, 51614, 38671, 38642, 51618, {48648, 0, 0, 0}, 234, 234, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x2809, 0x0009, 257, 16, 51621, 51627, 51627, 51644, 39161, 39146, 51648, {39165, 0, 0, 0}, 235, 235, { 1252, 500, 10000, 850, 0, ';' }},
- {0x280A, 0x000A, 257, 83, 51651, 51657, 51672, 51689, 39208, 39184, 51693, {39212, 0, 0, 0}, 236, 236, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x281A, 0x6C1A, 257, 92, 51696, 51707, 51530, 51734, 2239, 50956, 51562, {41102, 0, 0, 0}, 237, 237, { 1251, 21025, 10007, 855, 0, ';' }},
- {0x2C01, 0x0001, 257, 54, 51738, 51744, 51760, 51790, 38671, 38642, 51794, {48648, 0, 0, 0}, 238, 238, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x2C09, 0x0009, 257, 106, 51797, 51803, 51803, 51833, 39161, 39146, 51837, {39165, 0, 0, 0}, 239, 239, { 1252, 500, 10000, 850, 0, ';' }},
- {0x2C0A, 0x000A, 257, 4, 51840, 51846, 51866, 51887, 39208, 39184, 51891, {39212, 0, 0, 0}, 240, 240, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x2C1A, 0x701A, 257, 70, 51894, 51905, 51933, 51966, 2239, 50956, 51970, {50637, 0, 0, 0}, 241, 241, { 1250, 500, 10029, 852, 0, ';' }},
- {0x3001, 0x0001, 257, 61, 51973, 51979, 51996, 52024, 38671, 38642, 52028, {48648, 0, 0, 0}, 242, 242, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x3009, 0x0009, 257, 116, 52031, 52037, 52037, 52056, 39161, 39146, 52060, {39165, 0, 0, 0}, 243, 243, { 1252, 500, 10000, 437, 0, ',' }},
- {0x300A, 0x000A, 257, 28, 52063, 52069, 52087, 52106, 39208, 39184, 52110, {39212, 0, 0, 0}, 244, 244, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x301A, 0x6C1A, 257, 70, 52113, 52124, 51933, 52155, 2239, 50956, 51970, {41102, 0, 0, 0}, 245, 245, { 1251, 21025, 10007, 855, 0, ';' }},
- {0x3401, 0x0001, 257, 59, 52159, 52165, 52181, 52211, 38671, 38642, 52215, {48648, 0, 0, 0}, 246, 246, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x3409, 0x0009, 257, 84, 52218, 52224, 52224, 52246, 39161, 39146, 48131, {39165, 0, 0, 0}, 247, 247, { 1252, 500, 10000, 437, 0, ',' }},
- {0x340A, 0x000A, 257, 19, 52250, 52256, 52272, 52289, 39208, 39184, 52293, {39212, 0, 0, 0}, 248, 248, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x3801, 0x0001, 257, 0, 52296, 52302, 52332, 52396, 38671, 38642, 52400, {48648, 0, 0, 0}, 249, 249, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x380A, 0x000A, 257, 110, 52403, 52409, 52427, 52446, 39208, 39184, 52450, {39212, 0, 0, 0}, 250, 250, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x3C01, 0x0001, 257, 12, 52453, 52459, 52476, 52508, 38671, 38642, 52512, {48648, 0, 0, 0}, 251, 251, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x3C0A, 0x000A, 257, 89, 52515, 52521, 52540, 52560, 39208, 39184, 52564, {39212, 0, 0, 0}, 252, 252, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x4001, 0x0001, 257, 90, 52567, 52573, 52588, 52612, 38671, 38642, 52616, {48648, 0, 0, 0}, 253, 253, { 1256, 20420, 10004, 720, 1, ';' }},
- {0x4009, 0x0009, 257, 48, 52619, 52625, 52625, 52641, 39161, 39146, 46762, {39165, 0, 0, 0}, 254, 254, { 1252, 37, 10000, 437, 0, ',' }},
- {0x400A, 0x000A, 257, 13, 52645, 52651, 52669, 52688, 39208, 39184, 52692, {39212, 0, 0, 0}, 255, 255, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x440A, 0x000A, 257, 100, 52695, 52701, 52723, 52746, 39208, 39184, 52750, {39212, 0, 0, 0}, 256, 256, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x4809, 0x0009, 257, 97, 52753, 52759, 52759, 52779, 39161, 39146, 49920, {39165, 0, 0, 0}, 257, 257, { 1252, 37, 10000, 437, 0, ',' }},
- {0x480A, 0x000A, 257, 42, 52783, 52789, 52808, 52828, 39208, 39184, 52832, {39212, 0, 0, 0}, 258, 258, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x4C0A, 0x000A, 257, 76, 52835, 52841, 52861, 52882, 39208, 39184, 52886, {39212, 0, 0, 0}, 259, 259, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x500A, 0x000A, 257, 87, 52889, 52895, 52917, 52940, 39208, 39184, 52944, {39212, 0, 0, 0}, 260, 260, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x540A, 0x000A, 257, 109, 52947, 52953, 52977, 53003, 39208, 39184, 44519, {39212, 0, 0, 0}, 261, 261, { 1252, 20284, 10000, 850, 0, ',' }},
- {0x641A, 0x781A, 257, -1, 53007, 53015, 53034, 51379, 51383, 50634, 0, {41102, 0, 0, 0}, 262, 262, { 1251, 870, 10082, 855, 0, ';' }},
- {0x681A, 0x781A, 257, -1, 53043, 53051, 53034, 50626, 50630, 50634, 0, {50637, 0, 0, 0}, 263, 263, { 1250, 870, 10082, 852, 0, ';' }},
- {0x6C1A, 0x7C1A, 257, -1, 53067, 53075, 53094, 51734, 2239, 50956, 0, {41102, 0, 0, 0}, 264, 264, { 1251, 21025, 10007, 855, 0, ';' }},
- {0x701A, 0x7C1A, 257, -1, 53107, 53115, 53094, 51558, 2239, 50956, 0, {50637, 0, 0, 0}, 265, 265, { 1250, 500, 10029, 852, 0, ';' }},
- {0x742C, 0x002C, 257, -1, 53131, 53139, 40974, 49194, 40990, 40959, 0, {40994, 0, 0, 0}, 266, 266, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x7804, 0x007F, 257, -1, 38882, 38900, 38867, 38874, 38878, 38882, 0, {38885, 0, 0, 0}, 267, 267, { 936, 500, 10008, 936, 0, ',' }},
- {0x7814, 0x0014, 257, -1, 49042, 53162, 53180, 49034, 49038, 49042, 0, {38998, 0, 0, 0}, 268, 268, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x781A, 0x007F, 257, -1, 50634, 53188, 53034, 50626, 50630, 50634, 0, {50637, 0, 0, 0}, 269, 269, { 1250, 870, 10082, 852, 0, ';' }},
- {0x782C, 0x002C, 257, -1, 53196, 53204, 40974, 40986, 40990, 40959, 0, {40994, 0, 0, 0}, 270, 270, { 1254, 20905, 10081, 857, 0, ';' }},
- {0x7843, 0x0043, 257, -1, 53224, 53232, 41920, 41931, 41935, 41911, 0, {49279, 0, 0, 0}, 271, 271, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x7850, 0x0050, 257, -1, 53249, 53257, 42857, 53278, 42874, 42844, 0, {42878, 0, 0, 0}, 272, 272, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x7C04, 0x7804, 257, -1, 53282, 44229, 38867, 44267, 38878, 38882, 0, {44274, 0, 0, 0}, 273, 273, { 950, 500, 10002, 950, 0, ',' }},
- {0x7C04, 0x7C04, 257, -1, 53290, 53297, 38867, 44267, 38878, 38882, 0, {44274, 0, 0, 0}, 274, 274, { 950, 500, 10002, 950, 0, ',' }},
- {0x7C14, 0x0014, 257, -1, 39713, 53326, 53344, 39705, 39709, 39713, 0, {38998, 0, 0, 0}, 275, 275, { 1252, 20277, 10000, 850, 0, ';' }},
- {0x7C1A, 0x007F, 257, -1, 50956, 53358, 53094, 53366, 2239, 50956, 0, {41102, 0, 0, 0}, 276, 276, { 1250, 500, 10029, 852, 0, ';' }},
- {0x7C28, 0x0028, 257, -1, 53370, 53378, 40771, 40784, 40788, 40762, 0, {0, 0, 0, 0}, 277, 277, { 1251, 20880, 10007, 866, 0, ';' }},
- {0x7C43, 0x0043, 257, -1, 53395, 53403, 41920, 41931, 41935, 41911, 0, {41939, 0, 0, 0}, 278, 278, { 1254, 500, 10029, 857, 0, ';' }},
- {0x7C5F, 0x005F, 257, -1, 53417, 53426, 43412, 43422, 43384, 43384, 0, {0, 0, 0, 0}, 279, 279, { 1252, 20297, 10000, 850, 0, ';' }},
- {0x7C68, 0x0068, 257, -1, 53458, 53466, 43580, 43586, 43590, 43577, 0, {0, 0, 0, 0}, 280, 280, { 1252, 37, 10000, 437, 0, ',' }}
+ {0x0001, 0x007F, 768, -1, 38641, 38644, 38651, 38666, 38670, 38641, 0, {0, 0, 38674, 0}, 0, 0, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x0002, 0x007F, 257, -1, 38702, 38705, 38715, 38734, 38738, 38702, 0, {38742, 0, 0, 0}, 1, 1, { 1251, 21025, 10007, 866, 0, ';' }},
+ {0x0003, 0x007F, 257, -1, 38784, 38787, 38795, 38803, 38807, 38784, 0, {38811, 0, 0, 0}, 2, 2, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0004, 0x0004, 257, -1, 38831, 38838, 38866, 38873, 38877, 38881, 0, {38884, 0, 0, 0}, 3, 3, { 936, 500, 10008, 936, 0, ',' }},
+ {0x0004, 0x7804, 257, -1, 38891, 38899, 38866, 38873, 38877, 38881, 0, {38884, 0, 0, 0}, 4, 4, { 936, 500, 10008, 936, 0, ',' }},
+ {0x0005, 0x007F, 257, -1, 38920, 38923, 38929, 38939, 38943, 38920, 0, {38947, 0, 0, 0}, 5, 5, { 1250, 500, 10029, 852, 0, ';' }},
+ {0x0006, 0x007F, 257, -1, 38973, 38976, 38983, 38989, 38993, 38973, 0, {38997, 0, 0, 0}, 6, 6, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x0007, 0x007F, 257, -1, 39018, 39021, 39028, 39036, 39040, 39018, 0, {39044, 0, 0, 0}, 7, 7, { 1252, 20273, 10000, 850, 0, ';' }},
+ {0x0008, 0x007F, 257, -1, 39069, 39072, 39078, 39095, 39099, 39069, 0, {39103, 0, 0, 0}, 8, 8, { 1253, 20273, 10006, 737, 0, ';' }},
+ {0x0009, 0x007F, 257, -1, 39145, 39148, 39148, 39156, 39160, 39145, 0, {39164, 0, 0, 0}, 9, 9, { 1252, 37, 10000, 437, 0, ',' }},
+ {0x000A, 0x007F, 257, -1, 39183, 39186, 39194, 39203, 39207, 39183, 0, {39211, 0, 0, 0}, 10, 10, { 1252, 20284, 10000, 850, 0, ';' }},
+ {0x000B, 0x007F, 257, -1, 39233, 39236, 39244, 39250, 39254, 39233, 0, {39258, 0, 0, 0}, 11, 11, { 1252, 20278, 10000, 850, 0, ';' }},
+ {0x000C, 0x007F, 257, -1, 39283, 39286, 39293, 39303, 39307, 39283, 0, {39311, 0, 0, 0}, 12, 12, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x000D, 0x007F, 257, -1, 39333, 39336, 39343, 39354, 39358, 39333, 0, {39362, 0, 0, 0}, 13, 13, { 1255, 500, 10005, 862, 1, ',' }},
+ {0x000E, 0x007F, 257, -1, 39395, 39398, 39408, 39415, 39419, 39395, 0, {39423, 0, 0, 0}, 14, 14, { 1250, 500, 10029, 852, 0, ';' }},
+ {0x000F, 0x007F, 257, -1, 39439, 39442, 39452, 39462, 39466, 39439, 0, {39470, 0, 0, 0}, 15, 15, { 1252, 20871, 10079, 850, 0, ';' }},
+ {0x0010, 0x007F, 257, -1, 39490, 39493, 39501, 39510, 39514, 39490, 0, {39518, 0, 0, 0}, 16, 16, { 1252, 20280, 10000, 850, 0, ';' }},
+ {0x0011, 0x007F, 257, -1, 39540, 39543, 39552, 39562, 39566, 39540, 0, {39570, 0, 0, 0}, 17, 17, { 932, 20290, 10001, 932, 0, ',' }},
+ {0x0012, 0x007F, 257, -1, 39597, 39600, 39607, 39617, 39621, 39597, 0, {39625, 0, 0, 0}, 18, 18, { 949, 20833, 10003, 949, 0, ',' }},
+ {0x0013, 0x007F, 257, -1, 39635, 39638, 39644, 39655, 39659, 39635, 0, {39663, 0, 0, 0}, 19, 19, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0014, 0x007F, 257, -1, 39685, 39688, 39698, 39704, 39708, 39712, 0, {38997, 0, 0, 0}, 20, 20, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x0015, 0x007F, 257, -1, 39715, 39718, 39725, 39732, 39736, 39715, 0, {39740, 0, 0, 0}, 21, 21, { 1250, 20880, 10029, 852, 0, ';' }},
+ {0x0016, 0x007F, 257, -1, 39764, 39767, 39778, 39789, 39793, 39764, 0, {39797, 0, 0, 0}, 22, 22, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0017, 0x007F, 257, -1, 39820, 39823, 39831, 39841, 39845, 39820, 0, {39849, 0, 0, 0}, 23, 23, { 1252, 20273, 10000, 850, 0, ';' }},
+ {0x0018, 0x007F, 257, -1, 39869, 39872, 39881, 39890, 39894, 39869, 0, {39898, 0, 0, 0}, 24, 24, { 1250, 20880, 10029, 852, 0, ';' }},
+ {0x0019, 0x007F, 257, -1, 39917, 39920, 39928, 39943, 39947, 39917, 0, {39951, 0, 0, 0}, 25, 25, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x001A, 0x007F, 257, -1, 39997, 40000, 40009, 40018, 40022, 39997, 0, {40026, 0, 0, 0}, 26, 26, { 1250, 500, 10082, 852, 0, ';' }},
+ {0x001B, 0x007F, 257, -1, 12824, 40049, 40056, 40068, 40072, 12824, 0, {40076, 0, 0, 0}, 27, 27, { 1250, 20880, 10029, 852, 0, ';' }},
+ {0x001C, 0x007F, 257, -1, 40100, 40103, 40112, 40118, 40122, 40100, 0, {40126, 0, 0, 0}, 28, 28, { 1250, 20880, 10029, 852, 0, ';' }},
+ {0x001D, 0x007F, 257, -1, 40146, 40149, 40157, 40165, 40169, 40146, 0, {38997, 0, 0, 0}, 29, 29, { 1252, 20278, 10000, 850, 0, ';' }},
+ {0x001E, 0x007F, 512, -1, 40173, 40176, 40181, 40191, 40195, 40173, 0, {0, 40199, 0, 0}, 30, 30, { 874, 20838, 10021, 874, 0, ',' }},
+ {0x001F, 0x007F, 257, -1, 12833, 40230, 40238, 40247, 40251, 12833, 0, {40255, 0, 0, 0}, 31, 31, { 1254, 20905, 10081, 857, 0, ';' }},
+ {0x0020, 0x007F, 257, -1, 40269, 40272, 40277, 40286, 40290, 40269, 0, {40294, 0, 0, 0}, 32, 32, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x0021, 0x007F, 257, -1, 40324, 40327, 40338, 40355, 40359, 40324, 0, {40363, 0, 0, 0}, 33, 33, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0022, 0x007F, 257, -1, 40382, 40385, 40395, 40416, 40420, 40382, 0, {40424, 0, 0, 0}, 34, 34, { 1251, 500, 10017, 866, 0, ';' }},
+ {0x0023, 0x007F, 257, -1, 40470, 40473, 40484, 40505, 40509, 40470, 0, {40513, 0, 0, 0}, 35, 35, { 1251, 500, 10007, 866, 0, ';' }},
+ {0x0024, 0x007F, 257, -1, 40555, 40558, 40568, 40582, 40586, 40555, 0, {40590, 0, 0, 0}, 36, 36, { 1250, 20880, 10029, 852, 0, ';' }},
+ {0x0025, 0x007F, 257, -1, 40612, 40615, 40624, 40630, 40634, 40612, 0, {40638, 0, 0, 0}, 37, 37, { 1257, 500, 10029, 775, 0, ';' }},
+ {0x0026, 0x007F, 257, -1, 40658, 40661, 40669, 40679, 40683, 40658, 0, {40687, 0, 0, 0}, 38, 38, { 1257, 500, 10029, 775, 0, ';' }},
+ {0x0027, 0x007F, 257, -1, 40706, 40709, 40720, 40730, 40734, 40706, 0, {40738, 0, 0, 0}, 39, 39, { 1257, 500, 10029, 775, 0, ';' }},
+ {0x0028, 0x007F, 257, -1, 40761, 40764, 40770, 40783, 40787, 40761, 0, {0, 0, 0, 0}, 40, 40, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x0029, 0x007F, 257, -1, 40791, 40794, 40802, 40813, 40817, 40791, 0, {40821, 0, 0, 0}, 41, 41, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x002A, 0x007F, 257, -1, 40845, 40848, 40859, 40874, 35722, 40845, 0, {40878, 0, 0, 0}, 42, 42, { 1258, 500, 10000, 1258, 0, ',' }},
+ {0x002B, 0x007F, 257, -1, 40893, 40896, 40905, 40920, 40924, 40893, 0, {40928, 0, 0, 0}, 43, 43, { 0, 500, 2, 1, 0, ',' }},
+ {0x002C, 0x007F, 257, -1, 40958, 40961, 40973, 40985, 40989, 40958, 0, {40993, 0, 0, 0}, 44, 44, { 1254, 20905, 10081, 857, 0, ';' }},
+ {0x002D, 0x007F, 257, -1, 41012, 41015, 41022, 41030, 41034, 41012, 0, {41038, 0, 0, 0}, 45, 45, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x002F, 0x007F, 257, -1, 41058, 41061, 41072, 41093, 41097, 41058, 0, {41101, 0, 0, 0}, 46, 46, { 1251, 500, 10007, 866, 0, ';' }},
+ {0x0032, 0x007F, 257, -1, 41145, 41148, 41155, 41164, 41168, 41145, 0, {0, 0, 0, 0}, 47, 47, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x0034, 0x007F, 257, -1, 41172, 41175, 41181, 41190, 41194, 41172, 0, {0, 0, 0, 0}, 48, 48, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x0035, 0x007F, 257, -1, 41198, 41201, 41206, 41214, 41218, 41198, 0, {41222, 0, 0, 0}, 49, 49, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x0036, 0x007F, 257, -1, 41243, 41246, 41246, 41256, 41260, 41243, 0, {41264, 0, 0, 0}, 50, 50, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x0037, 0x007F, 257, -1, 41284, 41287, 41296, 41318, 41322, 41284, 0, {41326, 0, 0, 0}, 51, 51, { 0, 500, 2, 1, 0, ';' }},
+ {0x0038, 0x007F, 257, -1, 41391, 41394, 41402, 41412, 41416, 41391, 0, {0, 0, 0, 0}, 52, 52, { 1252, 20277, 10079, 850, 0, ';' }},
+ {0x0039, 0x007F, 257, -1, 41420, 41423, 41429, 41445, 41449, 41420, 0, {41453, 0, 0, 0}, 53, 53, { 0, 500, 2, 1, 0, ',' }},
+ {0x003A, 0x007F, 257, -1, 41506, 41509, 41517, 41523, 41527, 41506, 0, {41531, 0, 0, 0}, 54, 54, { 0, 500, 2, 1, 0, ',' }},
+ {0x003B, 0x007F, 257, -1, 41552, 41555, 41569, 41586, 41590, 41552, 0, {41594, 0, 0, 0}, 55, 55, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x003C, 0x007F, 257, -1, 41613, 41616, 41622, 41630, 41634, 41613, 0, {41638, 0, 0, 0}, 56, 56, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x003E, 0x007F, 257, -1, 41659, 41662, 41668, 41682, 41686, 41659, 0, {41690, 0, 0, 0}, 57, 57, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x003F, 0x007F, 257, -1, 41707, 41710, 41717, 41737, 41741, 41707, 0, {41745, 0, 0, 0}, 58, 58, { 0, 500, 2, 1, 0, ';' }},
+ {0x0040, 0x007F, 257, -1, 41787, 41790, 41797, 41814, 41818, 41787, 0, {41822, 0, 0, 0}, 59, 59, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x0041, 0x007F, 257, -1, 41860, 41863, 41871, 41881, 41885, 41860, 0, {41889, 0, 0, 0}, 60, 60, { 1252, 500, 10000, 437, 0, ',' }},
+ {0x0043, 0x007F, 257, -1, 41910, 41913, 41919, 41930, 41934, 41910, 0, {41938, 0, 0, 0}, 61, 61, { 1254, 500, 10029, 857, 0, ';' }},
+ {0x0045, 0x007F, 257, -1, 41958, 41961, 41969, 41985, 41989, 41958, 0, {41993, 0, 0, 0}, 62, 62, { 0, 500, 2, 1, 0, ',' }},
+ {0x0046, 0x007F, 257, -1, 42058, 42061, 42069, 42088, 42092, 42058, 0, {42096, 0, 0, 0}, 63, 63, { 0, 500, 2, 1, 0, ',' }},
+ {0x0047, 0x007F, 257, -1, 42143, 42146, 42155, 42177, 42181, 42143, 0, {42185, 0, 0, 0}, 64, 64, { 0, 500, 2, 1, 0, ',' }},
+ {0x0048, 0x007F, 257, -1, 42241, 42244, 42250, 42266, 42270, 42241, 0, {0, 0, 0, 0}, 65, 65, { 0, 500, 2, 1, 0, ',' }},
+ {0x0049, 0x007F, 257, -1, 42274, 42277, 42283, 42299, 42303, 42274, 0, {42307, 0, 0, 0}, 66, 66, { 0, 500, 2, 1, 0, ',' }},
+ {0x004A, 0x007F, 257, -1, 42372, 42375, 42382, 42401, 42405, 42372, 0, {42409, 0, 0, 0}, 67, 67, { 0, 500, 2, 1, 0, ',' }},
+ {0x004B, 0x007F, 257, -1, 37890, 42474, 42482, 42498, 42502, 37890, 0, {42506, 0, 0, 0}, 68, 68, { 0, 500, 2, 1, 0, ',' }},
+ {0x004C, 0x007F, 257, -1, 42571, 42574, 42584, 42603, 42607, 42571, 0, {42611, 0, 0, 0}, 69, 69, { 0, 500, 2, 1, 0, ',' }},
+ {0x004D, 0x007F, 257, -1, 42655, 42658, 42667, 42689, 42693, 42655, 0, {42697, 0, 0, 0}, 70, 70, { 0, 500, 2, 1, 0, ',' }},
+ {0x004E, 0x007F, 257, -1, 42750, 42753, 42761, 42777, 2530, 42750, 0, {42781, 0, 0, 0}, 71, 71, { 0, 500, 2, 1, 0, ',' }},
+ {0x0050, 0x007F, 257, -1, 42843, 42846, 42856, 42869, 42873, 42843, 0, {42877, 0, 0, 0}, 72, 72, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x0051, 0x007F, 257, -1, 42909, 42912, 42920, 42945, 42949, 42909, 0, {0, 0, 0, 0}, 73, 73, { 0, 500, 2, 1, 0, ',' }},
+ {0x0052, 0x007F, 257, -1, 42953, 42956, 42962, 42970, 42974, 42953, 0, {42978, 0, 0, 0}, 74, 74, { 1252, 20285, 10000, 850, 0, ',' }},
+ {0x0053, 0x007F, 257, -1, 42994, 42997, 43003, 43019, 43023, 42994, 0, {43027, 0, 0, 0}, 75, 75, { 0, 500, 2, 1, 0, ',' }},
+ {0x0054, 0x007F, 257, -1, 43082, 43085, 43089, 43099, 43103, 43082, 0, {43107, 0, 0, 0}, 76, 76, { 0, 500, 2, 1, 0, ',' }},
+ {0x0056, 0x007F, 257, -1, 43153, 43156, 43165, 43172, 43176, 43153, 0, {39518, 0, 0, 0}, 77, 77, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0057, 0x007F, 257, -1, 43180, 43184, 43192, 43211, 43180, 43180, 0, {0, 0, 0, 0}, 78, 78, { 0, 500, 2, 1, 0, ',' }},
+ {0x005B, 0x007F, 257, -1, 43215, 43218, 43226, 43242, 43246, 43215, 0, {43250, 0, 0, 0}, 79, 79, { 0, 500, 2, 1, 0, ',' }},
+ {0x005E, 0x007F, 257, -1, 8151, 43309, 43317, 43330, 43334, 8151, 0, {43338, 0, 0, 0}, 80, 80, { 0, 500, 2, 1, 0, ';' }},
+ {0x005F, 0x007F, 257, -1, 43383, 43387, 43411, 43421, 43383, 43383, 0, {0, 0, 0, 0}, 81, 81, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x0061, 0x007F, 257, -1, 1992, 43425, 43432, 43451, 43455, 1992, 0, {43459, 0, 0, 0}, 82, 82, { 0, 500, 2, 1, 0, ',' }},
+ {0x0063, 0x007F, 1024, -1, 43509, 43512, 43519, 43528, 43532, 43509, 0, {0, 0, 0, 0}, 83, 83, { 0, 500, 2, 1, 1, ';' }},
+ {0x0064, 0x007F, 257, -1, 43536, 43540, 43540, 43549, 43536, 43536, 0, {43553, 0, 0, 0}, 84, 84, { 1252, 500, 10000, 437, 0, ',' }},
+ {0x0068, 0x007F, 257, -1, 43576, 43579, 43579, 43585, 43589, 43576, 0, {0, 0, 0, 0}, 85, 85, { 1252, 37, 10000, 437, 0, ',' }},
+ {0x006A, 0x007F, 257, -1, 43593, 43596, 43603, 43618, 43622, 43593, 0, {0, 0, 0, 0}, 86, 86, { 1252, 37, 10000, 437, 0, ',' }},
+ {0x006C, 0x007F, 257, -1, 43626, 43630, 43645, 43662, 43626, 43626, 0, {0, 0, 0, 0}, 87, 87, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x006F, 0x007F, 257, -1, 43666, 43669, 43681, 43693, 43697, 43666, 0, {43701, 0, 0, 0}, 88, 88, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x0070, 0x007F, 257, -1, 43728, 43731, 43731, 43736, 43740, 43728, 0, {0, 0, 0, 0}, 89, 89, { 1252, 37, 10000, 437, 0, ',' }},
+ {0x0078, 0x007F, 257, -1, 43744, 43747, 43758, 43768, 43772, 43744, 0, {43776, 0, 0, 0}, 90, 90, { 0, 500, 2, 1, 0, ',' }},
+ {0x007E, 0x007F, 257, -1, 43789, 43792, 43799, 43809, 43813, 43789, 0, {43817, 0, 0, 0}, 91, 91, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x0084, 0x007F, 257, -1, 43837, 43841, 43854, 43873, 43837, 43837, 0, {43877, 0, 0, 0}, 92, 92, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x0085, 0x007F, 257, -1, 43902, 43906, 43912, 43930, 43902, 43902, 0, {0, 0, 0, 0}, 93, 93, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x0087, 0x007F, 257, -1, 43934, 43937, 43937, 43949, 43953, 43934, 0, {0, 0, 0, 0}, 94, 94, { 1252, 37, 10000, 437, 0, ';' }},
+ {0x0091, 0x007F, 257, -1, 43957, 43960, 43976, 43986, 43990, 43957, 0, {43994, 0, 0, 0}, 95, 95, { 1252, 20285, 10000, 850, 0, ',' }},
+ {0x0401, 0x0001, 768, 95, 44019, 44025, 44047, 38666, 38670, 38641, 13775, {0, 0, 38674, 0}, 96, 96, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x0402, 0x0002, 257, 11, 44111, 44117, 44138, 38734, 38738, 38702, 44176, {38742, 0, 0, 0}, 97, 97, { 1251, 21025, 10007, 866, 0, ';' }},
+ {0x0403, 0x0003, 257, 31, 44179, 44185, 44201, 38803, 38807, 38784, 44219, {38811, 0, 0, 0}, 98, 98, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0404, 0x7C04, 257, 107, 44222, 44228, 44250, 44266, 38877, 38881, 44270, {44273, 0, 0, 0}, 99, 99, { 950, 500, 10002, 950, 0, ',' }},
+ {0x0405, 0x0005, 257, 23, 44280, 44286, 44309, 38939, 38943, 38920, 44339, {38947, 0, 0, 0}, 100, 100, { 1250, 500, 10029, 852, 0, ';' }},
+ {0x0406, 0x0006, 257, 25, 44342, 44348, 44365, 38989, 38993, 38973, 44381, {38997, 0, 0, 0}, 101, 101, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x0407, 0x0007, 257, 24, 44384, 44390, 44407, 39036, 39040, 39018, 44429, {39044, 0, 0, 0}, 102, 102, { 1252, 20273, 10000, 850, 0, ';' }},
+ {0x0408, 0x0008, 257, 39, 44432, 44438, 44453, 39095, 39099, 39069, 44485, {39103, 0, 0, 0}, 103, 103, { 1253, 20273, 10006, 737, 0, ';' }},
+ {0x0409, 0x0009, 257, 109, 44488, 44494, 44494, 39156, 39160, 39145, 44518, {39164, 0, 0, 0}, 104, 104, { 1252, 37, 10000, 437, 0, ',' }},
+ {0x040B, 0x000B, 257, 33, 44521, 44527, 44545, 39250, 39254, 39233, 44559, {39258, 0, 0, 0}, 105, 105, { 1252, 20278, 10000, 850, 0, ';' }},
+ {0x040C, 0x000C, 257, 35, 44562, 44568, 44584, 39303, 39307, 39283, 44603, {39311, 0, 0, 0}, 106, 106, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x040D, 0x000D, 257, 47, 44606, 44612, 44628, 39354, 39358, 39333, 44652, {39362, 0, 0, 0}, 107, 107, { 1255, 500, 10005, 862, 1, ',' }},
+ {0x040E, 0x000E, 257, 44, 44655, 44661, 44681, 39415, 39419, 39395, 44704, {39423, 0, 0, 0}, 108, 108, { 1250, 500, 10029, 852, 0, ';' }},
+ {0x040F, 0x000F, 257, 51, 44707, 44713, 44733, 39462, 39466, 39439, 44753, {39470, 0, 0, 0}, 109, 109, { 1252, 20871, 10079, 850, 0, ';' }},
+ {0x0410, 0x0010, 257, 52, 44756, 44762, 44778, 39510, 39514, 39490, 44796, {39518, 0, 0, 0}, 110, 110, { 1252, 20280, 10000, 850, 0, ';' }},
+ {0x0411, 0x0011, 257, 55, 44799, 44805, 44822, 39562, 39566, 39540, 44841, {39570, 0, 0, 0}, 111, 111, { 932, 20290, 10001, 932, 0, ',' }},
+ {0x0412, 0x0012, 257, 58, 44844, 44850, 44871, 39617, 39621, 39597, 44896, {39625, 0, 0, 0}, 112, 112, { 949, 20833, 10003, 949, 0, ',' }},
+ {0x0413, 0x0013, 257, 77, 44899, 44905, 44925, 39655, 39659, 39635, 44948, {39663, 0, 0, 0}, 113, 113, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0414, 0x7C14, 257, 78, 44951, 44957, 44984, 39704, 39708, 39712, 45006, {38997, 0, 0, 0}, 114, 114, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x0415, 0x0015, 257, 86, 45009, 45015, 45031, 39732, 39736, 39715, 45047, {39740, 0, 0, 0}, 115, 115, { 1250, 20880, 10029, 852, 0, ';' }},
+ {0x0416, 0x0016, 257, 14, 45050, 45056, 45076, 39789, 39793, 39764, 45096, {39797, 0, 0, 0}, 116, 116, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0417, 0x0017, 257, 18, 45099, 45105, 45127, 39841, 39845, 39820, 13778, {39849, 0, 0, 0}, 117, 117, { 1252, 20273, 10000, 850, 0, ';' }},
+ {0x0418, 0x0018, 257, 91, 45146, 45152, 45171, 39890, 39894, 39869, 45191, {39898, 0, 0, 0}, 118, 118, { 1250, 20880, 10029, 852, 0, ';' }},
+ {0x0419, 0x0019, 257, 93, 45194, 45200, 45217, 39943, 39947, 39917, 45247, {39951, 0, 0, 0}, 119, 119, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x041A, 0x001A, 257, 43, 45250, 45256, 45275, 40018, 40022, 39997, 45295, {40026, 0, 0, 0}, 120, 120, { 1250, 500, 10082, 852, 0, ';' }},
+ {0x041B, 0x001B, 257, 99, 45298, 45304, 45322, 40068, 40072, 12824, 45346, {40076, 0, 0, 0}, 121, 121, { 1250, 20880, 10029, 852, 0, ';' }},
+ {0x041C, 0x001C, 257, 2, 45349, 45355, 45374, 40118, 40122, 40100, 45392, {40126, 0, 0, 0}, 122, 122, { 1250, 20880, 10029, 852, 0, ';' }},
+ {0x041D, 0x001D, 257, 96, 45395, 45401, 45418, 40165, 40169, 40146, 45436, {38997, 0, 0, 0}, 123, 123, { 1252, 20278, 10000, 850, 0, ';' }},
+ {0x041E, 0x001E, 512, 102, 45439, 45445, 45461, 40191, 40195, 40173, 45483, {0, 40199, 0, 0}, 124, 124, { 874, 20838, 10021, 874, 0, ',' }},
+ {0x041F, 0x001F, 257, 105, 45486, 45492, 45509, 40247, 40251, 12833, 45529, {40255, 0, 0, 0}, 125, 125, { 1254, 20905, 10081, 857, 0, ';' }},
+ {0x0420, 0x0020, 257, 85, 45532, 45538, 45554, 40286, 40290, 40269, 45580, {40294, 0, 0, 0}, 126, 126, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x0421, 0x0021, 257, 45, 45583, 45589, 45612, 40355, 40359, 40324, 45641, {40363, 0, 0, 0}, 127, 127, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0422, 0x0022, 257, 108, 45644, 45650, 45670, 40416, 40420, 40382, 45708, {40424, 0, 0, 0}, 128, 128, { 1251, 500, 10017, 866, 0, ';' }},
+ {0x0423, 0x0023, 257, 15, 45711, 45717, 45738, 40505, 40509, 40470, 45778, {40513, 0, 0, 0}, 129, 129, { 1251, 500, 10007, 866, 0, ';' }},
+ {0x0424, 0x0024, 257, 98, 45781, 45787, 45808, 40582, 40586, 40555, 45834, {40590, 0, 0, 0}, 130, 130, { 1250, 20880, 10029, 852, 0, ';' }},
+ {0x0425, 0x0025, 257, 29, 45837, 45843, 45862, 40630, 40634, 40612, 45876, {40638, 0, 0, 0}, 131, 131, { 1257, 500, 10029, 775, 0, ';' }},
+ {0x0426, 0x0026, 257, 66, 45879, 45885, 45902, 40679, 40683, 40658, 45922, {40687, 0, 0, 0}, 132, 132, { 1257, 500, 10029, 775, 0, ';' }},
+ {0x0427, 0x0027, 257, 64, 45925, 45931, 45954, 40730, 40734, 40706, 45974, {40738, 0, 0, 0}, 133, 133, { 1257, 500, 10029, 775, 0, ';' }},
+ {0x0428, 0x7C28, 257, 103, 45977, 45988, 46017, 40783, 40787, 40761, 46053, {0, 0, 0, 0}, 134, 134, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x0429, 0x0029, 257, 50, 46056, 46062, 46077, 40813, 40817, 40791, 46101, {40821, 0, 0, 0}, 135, 135, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x042A, 0x002A, 257, 113, 46104, 46110, 46131, 40874, 35722, 40845, 46159, {40878, 0, 0, 0}, 136, 136, { 1258, 500, 10000, 1258, 0, ',' }},
+ {0x042B, 0x002B, 257, 3, 46162, 46168, 46187, 40920, 40924, 40893, 1929, {40928, 0, 0, 0}, 137, 137, { 0, 500, 2, 1, 0, ',' }},
+ {0x042C, 0x782C, 257, 7, 46221, 46232, 46264, 40985, 40989, 40958, 46290, {40993, 0, 0, 0}, 138, 138, { 1254, 20905, 10081, 857, 0, ';' }},
+ {0x042D, 0x002D, 257, 31, 46293, 46299, 46314, 41030, 41034, 41012, 44219, {41038, 0, 0, 0}, 139, 139, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x042F, 0x002F, 257, 71, 46333, 46339, 46362, 41093, 41097, 41058, 46406, {41101, 0, 0, 0}, 140, 140, { 1251, 500, 10007, 866, 0, ';' }},
+ {0x0432, 0x0032, 257, 115, 46409, 46415, 41155, 41164, 41168, 41145, 46437, {0, 0, 0, 0}, 141, 141, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x0434, 0x0034, 257, 115, 46440, 46446, 41181, 41190, 41194, 41172, 46437, {0, 0, 0, 0}, 142, 142, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x0435, 0x0035, 257, 115, 46467, 46473, 46493, 41214, 41218, 41198, 46437, {41222, 0, 0, 0}, 143, 143, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x0436, 0x0036, 257, 115, 46518, 46524, 46549, 41256, 41260, 41243, 46437, {41264, 0, 0, 0}, 144, 144, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x0437, 0x0037, 257, 37, 46573, 46579, 46598, 41318, 41322, 41284, 46653, {41326, 0, 0, 0}, 145, 145, { 0, 500, 2, 1, 0, ';' }},
+ {0x0438, 0x0038, 257, 34, 46656, 46662, 46686, 41412, 41416, 41391, 46707, {0, 0, 0, 0}, 146, 146, { 1252, 20277, 10079, 850, 0, ';' }},
+ {0x0439, 0x0039, 257, 48, 46710, 46716, 46730, 41445, 41449, 41420, 46761, {41453, 0, 0, 0}, 147, 147, { 0, 500, 2, 1, 0, ',' }},
+ {0x043A, 0x003A, 257, 73, 46764, 46770, 46786, 41523, 41527, 41506, 46800, {41531, 0, 0, 0}, 148, 148, { 0, 500, 2, 1, 0, ',' }},
+ {0x043B, 0x003B, 257, 78, 46803, 46809, 46832, 41586, 41590, 41552, 45006, {41594, 0, 0, 0}, 149, 149, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x0441, 0x0041, 257, 56, 46857, 46863, 46879, 41881, 41885, 41860, 46897, {41889, 0, 0, 0}, 150, 150, { 1252, 500, 10000, 437, 0, ',' }},
+ {0x0443, 0x7C43, 257, 111, 46900, 46911, 46937, 41930, 41934, 41910, 46963, {41938, 0, 0, 0}, 151, 151, { 1254, 500, 10029, 857, 0, ';' }},
+ {0x0445, 0x0045, 257, 48, 46966, 46972, 46988, 41985, 41989, 41958, 46761, {41993, 0, 0, 0}, 152, 152, { 0, 500, 2, 1, 0, ',' }},
+ {0x0447, 0x0047, 257, 48, 47019, 47025, 47042, 42177, 42181, 42143, 46761, {42185, 0, 0, 0}, 153, 153, { 0, 500, 2, 1, 0, ',' }},
+ {0x0448, 0x0048, 257, 48, 47079, 47085, 47099, 42266, 42270, 42241, 46761, {0, 0, 0, 0}, 154, 154, { 0, 500, 2, 1, 0, ',' }},
+ {0x0449, 0x0049, 257, 48, 47130, 47136, 47150, 42299, 42303, 42274, 46761, {42307, 0, 0, 0}, 155, 155, { 0, 500, 2, 1, 0, ',' }},
+ {0x044A, 0x004A, 257, 48, 47190, 47196, 47211, 42401, 42405, 42372, 46761, {42409, 0, 0, 0}, 156, 156, { 0, 500, 2, 1, 0, ',' }},
+ {0x044B, 0x004B, 257, 48, 47258, 47264, 47280, 42498, 42502, 37890, 46761, {42506, 0, 0, 0}, 157, 157, { 0, 500, 2, 1, 0, ',' }},
+ {0x044C, 0x004C, 257, 48, 47311, 47317, 47335, 42603, 42607, 42571, 46761, {42611, 0, 0, 0}, 158, 158, { 0, 500, 2, 1, 0, ',' }},
+ {0x044D, 0x004D, 257, 48, 47375, 47381, 47398, 42689, 42693, 42655, 46761, {42697, 0, 0, 0}, 159, 159, { 0, 500, 2, 1, 0, ',' }},
+ {0x044E, 0x004E, 257, 48, 47435, 47441, 47457, 42777, 2530, 42750, 46761, {42781, 0, 0, 0}, 160, 160, { 0, 500, 2, 1, 0, ',' }},
+ {0x0451, 0x0051, 257, 20, 47488, 47494, 47510, 42945, 42949, 42909, 13857, {0, 0, 0, 0}, 161, 161, { 0, 500, 2, 1, 0, ',' }},
+ {0x0452, 0x0052, 257, 36, 47556, 47562, 47585, 42970, 42974, 42953, 47612, {42978, 0, 0, 0}, 162, 162, { 1252, 20285, 10000, 850, 0, ',' }},
+ {0x0453, 0x0053, 257, 57, 47615, 47621, 47638, 43019, 43023, 42994, 47678, {43027, 0, 0, 0}, 163, 163, { 0, 500, 2, 1, 0, ',' }},
+ {0x0454, 0x0054, 257, 60, 47681, 47687, 47698, 43099, 43103, 43082, 47720, {43107, 0, 0, 0}, 164, 164, { 0, 500, 2, 1, 0, ',' }},
+ {0x0456, 0x0056, 257, 31, 47723, 47729, 47746, 43172, 43176, 43153, 44219, {39518, 0, 0, 0}, 165, 165, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0457, 0x0057, 257, 48, 47763, 47770, 47786, 43211, 43180, 43180, 46761, {0, 0, 0, 0}, 166, 166, { 0, 500, 2, 1, 0, ',' }},
+ {0x045B, 0x005B, 257, 63, 47820, 47826, 47846, 43242, 43246, 43215, 47896, {43250, 0, 0, 0}, 167, 167, { 0, 500, 2, 1, 0, ',' }},
+ {0x045E, 0x005E, 257, 32, 47899, 47905, 47924, 43330, 43334, 8151, 47955, {43338, 0, 0, 0}, 168, 168, { 0, 500, 2, 1, 0, ';' }},
+ {0x0461, 0x0061, 257, 79, 47958, 47964, 47979, 43451, 43455, 1992, 48016, {43459, 0, 0, 0}, 169, 169, { 0, 500, 2, 1, 0, ',' }},
+ {0x0463, 0x0063, 1024, 1, 48019, 48025, 48046, 43528, 43532, 43509, 48076, {0, 0, 0, 0}, 170, 170, { 0, 500, 2, 1, 1, ';' }},
+ {0x0464, 0x0064, 257, 84, 48079, 48086, 48109, 43549, 43536, 43536, 48130, {43553, 0, 0, 0}, 171, 171, { 1252, 500, 10000, 437, 0, ',' }},
+ {0x0468, 0x7C68, 257, 75, 48133, 48144, 48167, 43585, 43589, 43576, 48184, {0, 0, 0, 0}, 172, 172, { 1252, 37, 10000, 437, 0, ',' }},
+ {0x046A, 0x006A, 257, 75, 48187, 48193, 48210, 43618, 43622, 43593, 48184, {0, 0, 0, 0}, 173, 173, { 1252, 37, 10000, 437, 0, ',' }},
+ {0x046C, 0x006C, 257, 115, 48256, 48263, 43645, 43662, 43626, 43626, 46437, {0, 0, 0, 0}, 174, 174, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x046F, 0x006F, 257, 38, 48293, 48299, 48323, 43693, 43697, 43666, 48354, {43701, 0, 0, 0}, 175, 175, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x0470, 0x0070, 257, 75, 48357, 48363, 48363, 43736, 43740, 43728, 48184, {0, 0, 0, 0}, 176, 176, { 1252, 37, 10000, 437, 0, ',' }},
+ {0x0478, 0x0078, 257, 20, 48378, 48384, 48403, 43768, 43772, 43744, 13857, {43776, 0, 0, 0}, 177, 177, { 0, 500, 2, 1, 0, ',' }},
+ {0x047E, 0x007E, 257, 35, 48422, 48428, 48444, 43809, 43813, 43789, 44603, {43817, 0, 0, 0}, 178, 178, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x0485, 0x0085, 257, 93, 48463, 48470, 43912, 43930, 43902, 43902, 45247, {0, 0, 0, 0}, 179, 179, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x0487, 0x0087, 257, 94, 48485, 48491, 48491, 43949, 43953, 43934, 48512, {0, 0, 0, 0}, 180, 180, { 1252, 37, 10000, 437, 0, ';' }},
+ {0x0491, 0x0091, 257, 36, 48515, 48521, 48554, 43986, 43990, 43957, 47612, {43994, 0, 0, 0}, 181, 181, { 1252, 20285, 10000, 850, 0, ',' }},
+ {0x0801, 0x0001, 257, 49, 48590, 48596, 48610, 48640, 38670, 38641, 48644, {48647, 0, 0, 0}, 182, 182, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x0804, 0x0004, 257, 20, 48679, 38899, 48685, 38873, 38877, 38881, 13857, {38884, 0, 0, 0}, 183, 183, { 936, 500, 10008, 936, 0, ',' }},
+ {0x0807, 0x0007, 257, 18, 48701, 48707, 48728, 48746, 39040, 39018, 13778, {39044, 0, 0, 0}, 184, 184, { 1252, 20273, 10000, 850, 0, ';' }},
+ {0x0809, 0x0009, 257, 36, 48750, 48756, 48756, 48781, 39160, 39145, 47612, {39164, 0, 0, 0}, 185, 185, { 1252, 20285, 10000, 850, 0, ',' }},
+ {0x080A, 0x000A, 257, 74, 48785, 48791, 48808, 48827, 39207, 39183, 48831, {39518, 0, 0, 0}, 186, 186, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x080C, 0x000C, 257, 10, 48834, 48840, 48857, 48878, 39307, 39283, 48882, {39311, 0, 0, 0}, 187, 187, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x0810, 0x0010, 257, 18, 48885, 48891, 48913, 48933, 39514, 39490, 13778, {39518, 0, 0, 0}, 188, 188, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0813, 0x0013, 257, 10, 48937, 48943, 48959, 48980, 39659, 39635, 48882, {39663, 0, 0, 0}, 189, 189, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x0814, 0x7814, 257, 78, 48984, 48990, 49017, 49033, 49037, 49041, 45006, {38997, 0, 0, 0}, 190, 190, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x0816, 0x0016, 257, 88, 49044, 49050, 49072, 49094, 39793, 39764, 49098, {39797, 0, 0, 0}, 191, 191, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x081D, 0x001D, 257, 33, 49101, 49107, 49125, 49143, 40169, 40146, 44559, {38997, 0, 0, 0}, 192, 192, { 1252, 20278, 10000, 850, 0, ';' }},
+ {0x082C, 0x742C, 257, 7, 49147, 49158, 46264, 49193, 40989, 40958, 46290, {40993, 0, 0, 0}, 193, 193, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x083C, 0x003C, 257, 46, 49197, 49203, 49219, 41630, 41634, 41613, 49235, {41638, 0, 0, 0}, 194, 194, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x0843, 0x7843, 257, 111, 49238, 49249, 46937, 41930, 41934, 41910, 46963, {49278, 0, 0, 0}, 195, 195, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x0845, 0x0045, 257, 9, 49316, 49322, 49343, 49386, 41989, 41958, 49390, {41993, 0, 0, 0}, 196, 196, { 0, 500, 2, 1, 0, ',' }},
+ {0x0C01, 0x0001, 257, 30, 49393, 49399, 49414, 49438, 38670, 38641, 49442, {48647, 0, 0, 0}, 197, 197, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x0C04, 0x7C04, 257, 41, 49445, 49451, 49494, 49531, 38877, 38881, 49535, {44273, 0, 0, 0}, 198, 198, { 950, 500, 10002, 950, 0, ',' }},
+ {0x0C07, 0x0007, 257, 5, 49538, 49544, 49561, 49583, 39040, 39018, 49587, {39044, 0, 0, 0}, 199, 199, { 1252, 20273, 10000, 850, 0, ';' }},
+ {0x0C09, 0x0009, 257, 6, 49590, 49596, 49596, 49616, 39160, 39145, 49620, {39164, 0, 0, 0}, 200, 200, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x0C0A, 0x000A, 257, 31, 49623, 49629, 49645, 49664, 39207, 39183, 44219, {39211, 0, 0, 0}, 201, 201, { 1252, 20284, 10000, 850, 0, ';' }},
+ {0x0C0C, 0x000C, 257, 17, 49668, 49674, 49690, 49709, 39307, 39283, 49713, {49716, 0, 0, 0}, 202, 202, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x0C3B, 0x003B, 257, 33, 49738, 49744, 49768, 49794, 49798, 41552, 44559, {41594, 0, 0, 0}, 203, 203, { 1252, 20278, 10000, 850, 0, ';' }},
+ {0x1001, 0x0001, 257, 67, 49802, 49808, 49823, 49851, 38670, 38641, 49855, {48647, 0, 0, 0}, 204, 204, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x1004, 0x0004, 257, 97, 49858, 49864, 49896, 49915, 38877, 38881, 49919, {38884, 0, 0, 0}, 205, 205, { 936, 500, 10008, 936, 0, ',' }},
+ {0x1007, 0x0007, 257, 65, 49922, 49928, 49948, 49968, 39040, 39018, 49972, {39044, 0, 0, 0}, 206, 206, { 1252, 20273, 10000, 850, 0, ';' }},
+ {0x1009, 0x0009, 257, 17, 49975, 49981, 49981, 49998, 39160, 39145, 49713, {39164, 0, 0, 0}, 207, 207, { 1252, 37, 10000, 850, 0, ',' }},
+ {0x100A, 0x000A, 257, 40, 50002, 50008, 50028, 50049, 39207, 39183, 50053, {39211, 0, 0, 0}, 208, 208, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x100C, 0x000C, 257, 18, 50056, 50062, 50083, 50102, 39307, 39283, 13778, {39311, 0, 0, 0}, 209, 209, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x101A, 0x001A, 257, 8, 50106, 50112, 50146, 50177, 50181, 39997, 50185, {40026, 0, 0, 0}, 210, 210, { 1250, 870, 10082, 852, 0, ';' }},
+ {0x1401, 0x0001, 257, 27, 50188, 50194, 50211, 50243, 38670, 38641, 50247, {48647, 0, 0, 0}, 211, 211, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x1404, 0x7C04, 257, 72, 50250, 50256, 50295, 50332, 38877, 38881, 50336, {44273, 0, 0, 0}, 212, 212, { 950, 500, 10002, 950, 0, ',' }},
+ {0x1407, 0x0007, 257, 62, 50339, 50345, 50368, 50392, 39040, 39018, 50396, {39044, 0, 0, 0}, 213, 213, { 1252, 20273, 10000, 850, 0, ';' }},
+ {0x1409, 0x0009, 257, 80, 50399, 50405, 50405, 50427, 39160, 39145, 50431, {39164, 0, 0, 0}, 214, 214, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x140A, 0x000A, 257, 22, 50434, 50440, 50461, 50483, 39207, 39183, 50487, {39211, 0, 0, 0}, 215, 215, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x140C, 0x000C, 257, 65, 50490, 50496, 50516, 50539, 39307, 39283, 49972, {39311, 0, 0, 0}, 216, 216, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x141A, 0x681A, 257, 8, 50543, 50554, 50594, 50625, 50629, 50633, 50185, {50636, 0, 0, 0}, 217, 217, { 1250, 870, 10082, 852, 0, ';' }},
+ {0x1801, 0x0001, 257, 68, 50659, 50665, 50682, 50712, 38670, 38641, 50716, {48647, 0, 0, 0}, 218, 218, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x1809, 0x0009, 257, 46, 50719, 50725, 50725, 50743, 39160, 39145, 49235, {39164, 0, 0, 0}, 219, 219, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x180A, 0x000A, 257, 82, 50747, 50753, 50770, 50789, 39207, 39183, 50793, {39211, 0, 0, 0}, 220, 220, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x180C, 0x000C, 257, 69, 50796, 50802, 50818, 50837, 39307, 39283, 50841, {39311, 0, 0, 0}, 221, 221, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x181A, 0x701A, 257, 8, 50844, 50855, 50895, 50947, 50951, 50955, 50185, {50636, 0, 0, 0}, 222, 222, { 1250, 870, 10082, 852, 0, ';' }},
+ {0x1C01, 0x0001, 257, 104, 50958, 50964, 50981, 51007, 38670, 38641, 51011, {48647, 0, 0, 0}, 223, 223, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x1C09, 0x0009, 257, 115, 51014, 51020, 51020, 51043, 39160, 39145, 46437, {39164, 0, 0, 0}, 224, 224, { 1252, 500, 10000, 437, 0, ',' }},
+ {0x1C0A, 0x000A, 257, 26, 51047, 51053, 51082, 51115, 39207, 39183, 51119, {39211, 0, 0, 0}, 225, 225, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x1C1A, 0x6C1A, 257, 8, 51122, 51133, 50895, 51176, 51180, 50955, 50185, {41101, 0, 0, 0}, 226, 226, { 1251, 21025, 10007, 855, 0, ';' }},
+ {0x2001, 0x0001, 257, 81, 51184, 51190, 51204, 51232, 38670, 38641, 51236, {48647, 0, 0, 0}, 227, 227, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x2009, 0x0009, 257, 53, 51239, 51245, 51245, 51263, 39160, 39145, 51267, {39164, 0, 0, 0}, 228, 228, { 1252, 500, 10000, 850, 0, ',' }},
+ {0x200A, 0x000A, 257, 112, 51270, 51276, 51296, 51317, 39207, 39183, 51321, {39211, 0, 0, 0}, 229, 229, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x201A, 0x641A, 257, 8, 51324, 51335, 50594, 51378, 51382, 50633, 50185, {41101, 0, 0, 0}, 230, 230, { 1251, 870, 10082, 855, 0, ';' }},
+ {0x2401, 0x0001, 257, 114, 51386, 51392, 51407, 51435, 38670, 38641, 51439, {48647, 0, 0, 0}, 231, 231, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x240A, 0x000A, 257, 21, 51442, 51448, 51467, 51487, 39207, 39183, 51491, {39211, 0, 0, 0}, 232, 232, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x241A, 0x701A, 257, 92, 51494, 51505, 51529, 51557, 2239, 50955, 51561, {50636, 0, 0, 0}, 233, 233, { 1250, 500, 10029, 852, 0, ';' }},
+ {0x2801, 0x0001, 257, 101, 51564, 51570, 51585, 51613, 38670, 38641, 51617, {48647, 0, 0, 0}, 234, 234, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x2809, 0x0009, 257, 16, 51620, 51626, 51626, 51643, 39160, 39145, 51647, {39164, 0, 0, 0}, 235, 235, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x280A, 0x000A, 257, 83, 51650, 51656, 51671, 51688, 39207, 39183, 51692, {39211, 0, 0, 0}, 236, 236, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x281A, 0x6C1A, 257, 92, 51695, 51706, 51529, 51733, 2239, 50955, 51561, {41101, 0, 0, 0}, 237, 237, { 1251, 21025, 10007, 855, 0, ';' }},
+ {0x2C01, 0x0001, 257, 54, 51737, 51743, 51759, 51789, 38670, 38641, 51793, {48647, 0, 0, 0}, 238, 238, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x2C09, 0x0009, 257, 106, 51796, 51802, 51802, 51832, 39160, 39145, 51836, {39164, 0, 0, 0}, 239, 239, { 1252, 500, 10000, 850, 0, ';' }},
+ {0x2C0A, 0x000A, 257, 4, 51839, 51845, 51865, 51886, 39207, 39183, 51890, {39211, 0, 0, 0}, 240, 240, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x2C1A, 0x701A, 257, 70, 51893, 51904, 51932, 51965, 2239, 50955, 51969, {50636, 0, 0, 0}, 241, 241, { 1250, 500, 10029, 852, 0, ';' }},
+ {0x3001, 0x0001, 257, 61, 51972, 51978, 51995, 52023, 38670, 38641, 52027, {48647, 0, 0, 0}, 242, 242, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x3009, 0x0009, 257, 116, 52030, 52036, 52036, 52055, 39160, 39145, 52059, {39164, 0, 0, 0}, 243, 243, { 1252, 500, 10000, 437, 0, ',' }},
+ {0x300A, 0x000A, 257, 28, 52062, 52068, 52086, 52105, 39207, 39183, 52109, {39211, 0, 0, 0}, 244, 244, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x301A, 0x6C1A, 257, 70, 52112, 52123, 51932, 52154, 2239, 50955, 51969, {41101, 0, 0, 0}, 245, 245, { 1251, 21025, 10007, 855, 0, ';' }},
+ {0x3401, 0x0001, 257, 59, 52158, 52164, 52180, 52210, 38670, 38641, 52214, {48647, 0, 0, 0}, 246, 246, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x3409, 0x0009, 257, 84, 52217, 52223, 52223, 52245, 39160, 39145, 48130, {39164, 0, 0, 0}, 247, 247, { 1252, 500, 10000, 437, 0, ',' }},
+ {0x340A, 0x000A, 257, 19, 52249, 52255, 52271, 52288, 39207, 39183, 52292, {39211, 0, 0, 0}, 248, 248, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x3801, 0x0001, 257, 0, 52295, 52301, 52331, 52395, 38670, 38641, 52399, {48647, 0, 0, 0}, 249, 249, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x380A, 0x000A, 257, 110, 52402, 52408, 52426, 52445, 39207, 39183, 52449, {39211, 0, 0, 0}, 250, 250, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x3C01, 0x0001, 257, 12, 52452, 52458, 52475, 52507, 38670, 38641, 52511, {48647, 0, 0, 0}, 251, 251, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x3C0A, 0x000A, 257, 89, 52514, 52520, 52539, 52559, 39207, 39183, 52563, {39211, 0, 0, 0}, 252, 252, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x4001, 0x0001, 257, 90, 52566, 52572, 52587, 52611, 38670, 38641, 52615, {48647, 0, 0, 0}, 253, 253, { 1256, 20420, 10004, 720, 1, ';' }},
+ {0x4009, 0x0009, 257, 48, 52618, 52624, 52624, 52640, 39160, 39145, 46761, {39164, 0, 0, 0}, 254, 254, { 1252, 37, 10000, 437, 0, ',' }},
+ {0x400A, 0x000A, 257, 13, 52644, 52650, 52668, 52687, 39207, 39183, 52691, {39211, 0, 0, 0}, 255, 255, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x440A, 0x000A, 257, 100, 52694, 52700, 52722, 52745, 39207, 39183, 52749, {39211, 0, 0, 0}, 256, 256, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x4809, 0x0009, 257, 97, 52752, 52758, 52758, 52778, 39160, 39145, 49919, {39164, 0, 0, 0}, 257, 257, { 1252, 37, 10000, 437, 0, ',' }},
+ {0x480A, 0x000A, 257, 42, 52782, 52788, 52807, 52827, 39207, 39183, 52831, {39211, 0, 0, 0}, 258, 258, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x4C0A, 0x000A, 257, 76, 52834, 52840, 52860, 52881, 39207, 39183, 52885, {39211, 0, 0, 0}, 259, 259, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x500A, 0x000A, 257, 87, 52888, 52894, 52916, 52939, 39207, 39183, 52943, {39211, 0, 0, 0}, 260, 260, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x540A, 0x000A, 257, 109, 52946, 52952, 52976, 53002, 39207, 39183, 44518, {39211, 0, 0, 0}, 261, 261, { 1252, 20284, 10000, 850, 0, ',' }},
+ {0x641A, 0x781A, 257, -1, 53006, 53014, 53033, 51378, 51382, 50633, 0, {41101, 0, 0, 0}, 262, 262, { 1251, 870, 10082, 855, 0, ';' }},
+ {0x681A, 0x781A, 257, -1, 53042, 53050, 53033, 50625, 50629, 50633, 0, {50636, 0, 0, 0}, 263, 263, { 1250, 870, 10082, 852, 0, ';' }},
+ {0x6C1A, 0x7C1A, 257, -1, 53066, 53074, 53093, 51733, 2239, 50955, 0, {41101, 0, 0, 0}, 264, 264, { 1251, 21025, 10007, 855, 0, ';' }},
+ {0x701A, 0x7C1A, 257, -1, 53106, 53114, 53093, 51557, 2239, 50955, 0, {50636, 0, 0, 0}, 265, 265, { 1250, 500, 10029, 852, 0, ';' }},
+ {0x742C, 0x002C, 257, -1, 53130, 53138, 40973, 49193, 40989, 40958, 0, {40993, 0, 0, 0}, 266, 266, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x7804, 0x007F, 257, -1, 38881, 38899, 38866, 38873, 38877, 38881, 0, {38884, 0, 0, 0}, 267, 267, { 936, 500, 10008, 936, 0, ',' }},
+ {0x7814, 0x0014, 257, -1, 49041, 53161, 53179, 49033, 49037, 49041, 0, {38997, 0, 0, 0}, 268, 268, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x781A, 0x007F, 257, -1, 50633, 53187, 53033, 50625, 50629, 50633, 0, {50636, 0, 0, 0}, 269, 269, { 1250, 870, 10082, 852, 0, ';' }},
+ {0x782C, 0x002C, 257, -1, 53195, 53203, 40973, 40985, 40989, 40958, 0, {40993, 0, 0, 0}, 270, 270, { 1254, 20905, 10081, 857, 0, ';' }},
+ {0x7843, 0x0043, 257, -1, 53223, 53231, 41919, 41930, 41934, 41910, 0, {49278, 0, 0, 0}, 271, 271, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x7850, 0x0050, 257, -1, 53248, 53256, 42856, 53277, 42873, 42843, 0, {42877, 0, 0, 0}, 272, 272, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x7C04, 0x7804, 257, -1, 53281, 44228, 38866, 44266, 38877, 38881, 0, {44273, 0, 0, 0}, 273, 273, { 950, 500, 10002, 950, 0, ',' }},
+ {0x7C04, 0x7C04, 257, -1, 53289, 53296, 38866, 44266, 38877, 38881, 0, {44273, 0, 0, 0}, 274, 274, { 950, 500, 10002, 950, 0, ',' }},
+ {0x7C14, 0x0014, 257, -1, 39712, 53325, 53343, 39704, 39708, 39712, 0, {38997, 0, 0, 0}, 275, 275, { 1252, 20277, 10000, 850, 0, ';' }},
+ {0x7C1A, 0x007F, 257, -1, 50955, 53357, 53093, 53365, 2239, 50955, 0, {41101, 0, 0, 0}, 276, 276, { 1250, 500, 10029, 852, 0, ';' }},
+ {0x7C28, 0x0028, 257, -1, 53369, 53377, 40770, 40783, 40787, 40761, 0, {0, 0, 0, 0}, 277, 277, { 1251, 20880, 10007, 866, 0, ';' }},
+ {0x7C43, 0x0043, 257, -1, 53394, 53402, 41919, 41930, 41934, 41910, 0, {41938, 0, 0, 0}, 278, 278, { 1254, 500, 10029, 857, 0, ';' }},
+ {0x7C5F, 0x005F, 257, -1, 53416, 53425, 43411, 43421, 43383, 43383, 0, {0, 0, 0, 0}, 279, 279, { 1252, 20297, 10000, 850, 0, ';' }},
+ {0x7C68, 0x0068, 257, -1, 53457, 53465, 43579, 43585, 43589, 43576, 0, {0, 0, 0, 0}, 280, 280, { 1252, 37, 10000, 437, 0, ',' }}
};
static const CultureInfoNameEntry culture_name_entries [] = {
- {41244, 50}, /* af */
- {53480, 144}, /* af-za */
+ {41243, 50}, /* af */
+ {53479, 144}, /* af-za */
{8151, 80}, /* am */
- {53486, 168}, /* am-et */
- {38642, 0}, /* ar */
- {53492, 249}, /* ar-ae */
- {53498, 251}, /* ar-bh */
- {53504, 211}, /* ar-dz */
- {53510, 197}, /* ar-eg */
- {53516, 182}, /* ar-iq */
- {53522, 238}, /* ar-jo */
- {53528, 246}, /* ar-kw */
- {53534, 242}, /* ar-lb */
- {53540, 204}, /* ar-ly */
- {53546, 218}, /* ar-ma */
- {53552, 227}, /* ar-om */
- {53558, 253}, /* ar-qa */
- {53564, 96}, /* ar-sa */
- {53570, 234}, /* ar-sy */
- {53576, 223}, /* ar-tn */
- {53582, 231}, /* ar-ye */
- {42656, 70}, /* as */
- {53588, 159}, /* as-in */
- {40959, 44}, /* az */
- {53594, 266}, /* az-cyrl */
- {53602, 193}, /* az-cyrl-az */
- {53613, 270}, /* az-latn */
- {53621, 138}, /* az-latn-az */
- {40471, 35}, /* be */
- {53632, 129}, /* be-by */
- {38703, 1}, /* bg */
- {53638, 97}, /* bg-bg */
- {41959, 62}, /* bn */
- {53644, 196}, /* bn-bd */
- {53650, 152}, /* bn-in */
- {42910, 73}, /* bo */
- {53656, 161}, /* bo-cn */
- {43790, 91}, /* br */
- {53662, 178}, /* br-fr */
- {50634, 269}, /* bs */
- {53668, 262}, /* bs-cyrl */
- {53676, 230}, /* bs-cyrl-ba */
- {53687, 263}, /* bs-latn */
- {53695, 217}, /* bs-latn-ba */
- {38785, 2}, /* ca */
- {53706, 98}, /* ca-es */
- {38921, 5}, /* cs */
- {53712, 100}, /* cs-cz */
- {42954, 74}, /* cy */
- {53718, 162}, /* cy-gb */
- {38974, 6}, /* da */
- {53724, 101}, /* da-dk */
- {39019, 7}, /* de */
- {53730, 199}, /* de-at */
- {53736, 184}, /* de-ch */
- {53742, 102}, /* de-de */
- {53748, 213}, /* de-li */
- {53754, 206}, /* de-lu */
- {39070, 8}, /* el */
- {53760, 103}, /* el-gr */
- {39146, 9}, /* en */
- {53766, 200}, /* en-au */
- {53772, 235}, /* en-bz */
- {53778, 207}, /* en-ca */
- {53784, 185}, /* en-gb */
- {53790, 219}, /* en-ie */
- {53796, 254}, /* en-in */
- {53802, 228}, /* en-jm */
- {53808, 214}, /* en-nz */
- {53814, 247}, /* en-ph */
- {53820, 257}, /* en-sg */
- {53826, 239}, /* en-tt */
- {53832, 104}, /* en-us */
- {53838, 224}, /* en-za */
- {53844, 243}, /* en-zw */
- {39184, 10}, /* es */
- {53850, 240}, /* es-ar */
- {53856, 255}, /* es-bo */
- {53862, 248}, /* es-cl */
- {53868, 232}, /* es-co */
- {53874, 215}, /* es-cr */
- {53880, 225}, /* es-do */
- {53886, 244}, /* es-ec */
- {53892, 201}, /* es-es */
- {53898, 208}, /* es-gt */
- {53904, 258}, /* es-hn */
- {53910, 186}, /* es-mx */
- {53916, 259}, /* es-ni */
- {53922, 220}, /* es-pa */
- {53928, 236}, /* es-pe */
- {53934, 260}, /* es-pr */
- {53940, 252}, /* es-py */
- {53946, 256}, /* es-sv */
- {53952, 261}, /* es-us */
- {53958, 250}, /* es-uy */
- {53964, 229}, /* es-ve */
- {40613, 37}, /* et */
- {53970, 131}, /* et-ee */
- {41013, 45}, /* eu */
- {53976, 139}, /* eu-es */
- {40792, 41}, /* fa */
- {53982, 135}, /* fa-ir */
- {39234, 11}, /* fi */
- {53988, 105}, /* fi-fi */
- {43537, 84}, /* fil */
- {53994, 171}, /* fil-ph */
- {41392, 52}, /* fo */
- {54001, 146}, /* fo-fo */
- {39284, 12}, /* fr */
- {54007, 187}, /* fr-be */
- {54013, 202}, /* fr-ca */
- {54019, 209}, /* fr-ch */
- {54025, 106}, /* fr-fr */
- {54031, 216}, /* fr-lu */
- {54037, 221}, /* fr-mc */
- {41614, 56}, /* ga */
- {54043, 194}, /* ga-ie */
- {43958, 95}, /* gd */
- {54049, 181}, /* gd-gb */
- {43154, 77}, /* gl */
- {54055, 165}, /* gl-es */
- {43838, 92}, /* gsw */
- {42144, 64}, /* gu */
- {54061, 153}, /* gu-in */
- {43577, 85}, /* ha */
- {54067, 280}, /* ha-latn */
- {54075, 172}, /* ha-latn-ng */
- {39334, 13}, /* he */
- {54086, 107}, /* he-il */
- {41421, 53}, /* hi */
- {54092, 147}, /* hi-in */
- {39998, 26}, /* hr */
- {54098, 210}, /* hr-ba */
- {54104, 120}, /* hr-hr */
- {39396, 14}, /* hu */
- {54110, 108}, /* hu-hu */
- {40894, 43}, /* hy */
- {54116, 137}, /* hy-am */
- {40325, 33}, /* id */
- {54122, 127}, /* id-id */
- {43729, 89}, /* ig */
- {54128, 176}, /* ig-ng */
- {43745, 90}, /* ii */
- {54134, 177}, /* ii-cn */
- {39440, 15}, /* is */
- {54140, 109}, /* is-is */
- {39491, 16}, /* it */
- {54146, 188}, /* it-ch */
- {54152, 110}, /* it-it */
- {39541, 17}, /* ja */
- {54158, 111}, /* ja-jp */
- {41285, 51}, /* ka */
- {54164, 145}, /* ka-ge */
- {41708, 58}, /* kk */
- {43667, 88}, /* kl */
- {54170, 175}, /* kl-gl */
- {42995, 75}, /* km */
- {54176, 163}, /* km-kh */
- {37895, 68}, /* kn */
- {54182, 157}, /* kn-in */
- {39598, 18}, /* ko */
- {54188, 112}, /* ko-kr */
- {43181, 78}, /* kok */
- {54194, 166}, /* kok-in */
- {41788, 59}, /* ky */
- {43083, 76}, /* lo */
- {54201, 164}, /* lo-la */
- {40707, 39}, /* lt */
- {54207, 133}, /* lt-lt */
- {40659, 38}, /* lv */
- {54213, 132}, /* lv-lv */
- {41059, 46}, /* mk */
- {54219, 140}, /* mk-mk */
- {42572, 69}, /* ml */
- {54225, 158}, /* ml-in */
- {42844, 72}, /* mn */
- {54231, 272}, /* mn-cyrl */
- {42751, 71}, /* mr */
- {54239, 160}, /* mr-in */
- {41660, 57}, /* ms */
- {41507, 54}, /* mt */
- {54245, 148}, /* mt-mt */
- {39713, 275}, /* nb */
- {54251, 114}, /* nb-no */
+ {53485, 168}, /* am-et */
+ {38641, 0}, /* ar */
+ {53491, 249}, /* ar-ae */
+ {53497, 251}, /* ar-bh */
+ {53503, 211}, /* ar-dz */
+ {53509, 197}, /* ar-eg */
+ {53515, 182}, /* ar-iq */
+ {53521, 238}, /* ar-jo */
+ {53527, 246}, /* ar-kw */
+ {53533, 242}, /* ar-lb */
+ {53539, 204}, /* ar-ly */
+ {53545, 218}, /* ar-ma */
+ {53551, 227}, /* ar-om */
+ {53557, 253}, /* ar-qa */
+ {53563, 96}, /* ar-sa */
+ {53569, 234}, /* ar-sy */
+ {53575, 223}, /* ar-tn */
+ {53581, 231}, /* ar-ye */
+ {42655, 70}, /* as */
+ {53587, 159}, /* as-in */
+ {40958, 44}, /* az */
+ {53593, 266}, /* az-cyrl */
+ {53601, 193}, /* az-cyrl-az */
+ {53612, 270}, /* az-latn */
+ {53620, 138}, /* az-latn-az */
+ {40470, 35}, /* be */
+ {53631, 129}, /* be-by */
+ {38702, 1}, /* bg */
+ {53637, 97}, /* bg-bg */
+ {41958, 62}, /* bn */
+ {53643, 196}, /* bn-bd */
+ {53649, 152}, /* bn-in */
+ {42909, 73}, /* bo */
+ {53655, 161}, /* bo-cn */
+ {43789, 91}, /* br */
+ {53661, 178}, /* br-fr */
+ {50633, 269}, /* bs */
+ {53667, 262}, /* bs-cyrl */
+ {53675, 230}, /* bs-cyrl-ba */
+ {53686, 263}, /* bs-latn */
+ {53694, 217}, /* bs-latn-ba */
+ {38784, 2}, /* ca */
+ {53705, 98}, /* ca-es */
+ {38920, 5}, /* cs */
+ {53711, 100}, /* cs-cz */
+ {42953, 74}, /* cy */
+ {53717, 162}, /* cy-gb */
+ {38973, 6}, /* da */
+ {53723, 101}, /* da-dk */
+ {39018, 7}, /* de */
+ {53729, 199}, /* de-at */
+ {53735, 184}, /* de-ch */
+ {53741, 102}, /* de-de */
+ {53747, 213}, /* de-li */
+ {53753, 206}, /* de-lu */
+ {39069, 8}, /* el */
+ {53759, 103}, /* el-gr */
+ {39145, 9}, /* en */
+ {53765, 200}, /* en-au */
+ {53771, 235}, /* en-bz */
+ {53777, 207}, /* en-ca */
+ {53783, 185}, /* en-gb */
+ {53789, 219}, /* en-ie */
+ {53795, 254}, /* en-in */
+ {53801, 228}, /* en-jm */
+ {53807, 214}, /* en-nz */
+ {53813, 247}, /* en-ph */
+ {53819, 257}, /* en-sg */
+ {53825, 239}, /* en-tt */
+ {53831, 104}, /* en-us */
+ {53837, 224}, /* en-za */
+ {53843, 243}, /* en-zw */
+ {39183, 10}, /* es */
+ {53849, 240}, /* es-ar */
+ {53855, 255}, /* es-bo */
+ {53861, 248}, /* es-cl */
+ {53867, 232}, /* es-co */
+ {53873, 215}, /* es-cr */
+ {53879, 225}, /* es-do */
+ {53885, 244}, /* es-ec */
+ {53891, 201}, /* es-es */
+ {53897, 208}, /* es-gt */
+ {53903, 258}, /* es-hn */
+ {53909, 186}, /* es-mx */
+ {53915, 259}, /* es-ni */
+ {53921, 220}, /* es-pa */
+ {53927, 236}, /* es-pe */
+ {53933, 260}, /* es-pr */
+ {53939, 252}, /* es-py */
+ {53945, 256}, /* es-sv */
+ {53951, 261}, /* es-us */
+ {53957, 250}, /* es-uy */
+ {53963, 229}, /* es-ve */
+ {40612, 37}, /* et */
+ {53969, 131}, /* et-ee */
+ {41012, 45}, /* eu */
+ {53975, 139}, /* eu-es */
+ {40791, 41}, /* fa */
+ {53981, 135}, /* fa-ir */
+ {39233, 11}, /* fi */
+ {53987, 105}, /* fi-fi */
+ {43536, 84}, /* fil */
+ {53993, 171}, /* fil-ph */
+ {41391, 52}, /* fo */
+ {54000, 146}, /* fo-fo */
+ {39283, 12}, /* fr */
+ {54006, 187}, /* fr-be */
+ {54012, 202}, /* fr-ca */
+ {54018, 209}, /* fr-ch */
+ {54024, 106}, /* fr-fr */
+ {54030, 216}, /* fr-lu */
+ {54036, 221}, /* fr-mc */
+ {41613, 56}, /* ga */
+ {54042, 194}, /* ga-ie */
+ {43957, 95}, /* gd */
+ {54048, 181}, /* gd-gb */
+ {43153, 77}, /* gl */
+ {54054, 165}, /* gl-es */
+ {43837, 92}, /* gsw */
+ {42143, 64}, /* gu */
+ {54060, 153}, /* gu-in */
+ {43576, 85}, /* ha */
+ {54066, 280}, /* ha-latn */
+ {54074, 172}, /* ha-latn-ng */
+ {39333, 13}, /* he */
+ {54085, 107}, /* he-il */
+ {41420, 53}, /* hi */
+ {54091, 147}, /* hi-in */
+ {39997, 26}, /* hr */
+ {54097, 210}, /* hr-ba */
+ {54103, 120}, /* hr-hr */
+ {39395, 14}, /* hu */
+ {54109, 108}, /* hu-hu */
+ {40893, 43}, /* hy */
+ {54115, 137}, /* hy-am */
+ {40324, 33}, /* id */
+ {54121, 127}, /* id-id */
+ {43728, 89}, /* ig */
+ {54127, 176}, /* ig-ng */
+ {43744, 90}, /* ii */
+ {54133, 177}, /* ii-cn */
+ {39439, 15}, /* is */
+ {54139, 109}, /* is-is */
+ {39490, 16}, /* it */
+ {54145, 188}, /* it-ch */
+ {54151, 110}, /* it-it */
+ {39540, 17}, /* ja */
+ {54157, 111}, /* ja-jp */
+ {41284, 51}, /* ka */
+ {54163, 145}, /* ka-ge */
+ {41707, 58}, /* kk */
+ {43666, 88}, /* kl */
+ {54169, 175}, /* kl-gl */
+ {42994, 75}, /* km */
+ {54175, 163}, /* km-kh */
+ {37890, 68}, /* kn */
+ {54181, 157}, /* kn-in */
+ {39597, 18}, /* ko */
+ {54187, 112}, /* ko-kr */
+ {43180, 78}, /* kok */
+ {54193, 166}, /* kok-in */
+ {41787, 59}, /* ky */
+ {43082, 76}, /* lo */
+ {54200, 164}, /* lo-la */
+ {40706, 39}, /* lt */
+ {54206, 133}, /* lt-lt */
+ {40658, 38}, /* lv */
+ {54212, 132}, /* lv-lv */
+ {41058, 46}, /* mk */
+ {54218, 140}, /* mk-mk */
+ {42571, 69}, /* ml */
+ {54224, 158}, /* ml-in */
+ {42843, 72}, /* mn */
+ {54230, 272}, /* mn-cyrl */
+ {42750, 71}, /* mr */
+ {54238, 160}, /* mr-in */
+ {41659, 57}, /* ms */
+ {41506, 54}, /* mt */
+ {54244, 148}, /* mt-mt */
+ {39712, 275}, /* nb */
+ {54250, 114}, /* nb-no */
{1992, 82}, /* ne */
- {54257, 169}, /* ne-np */
- {39636, 19}, /* nl */
- {54263, 189}, /* nl-be */
- {54269, 113}, /* nl-nl */
- {49042, 268}, /* nn */
- {54275, 190}, /* nn-no */
- {39686, 20}, /* no */
- {43627, 87}, /* nso */
- {54281, 174}, /* nso-za */
- {42242, 65}, /* or */
- {54288, 154}, /* or-in */
- {42059, 63}, /* pa */
- {39716, 21}, /* pl */
- {54294, 115}, /* pl-pl */
- {43510, 83}, /* ps */
- {54300, 170}, /* ps-af */
- {39765, 22}, /* pt */
- {54306, 116}, /* pt-br */
- {54312, 191}, /* pt-pt */
- {39821, 23}, /* rm */
- {54318, 117}, /* rm-ch */
- {39870, 24}, /* ro */
- {54324, 118}, /* ro-ro */
- {39918, 25}, /* ru */
- {54330, 119}, /* ru-ru */
- {43935, 94}, /* rw */
- {54336, 180}, /* rw-rw */
- {43903, 93}, /* sah */
- {54342, 179}, /* sah-ru */
- {41553, 55}, /* se */
- {54349, 203}, /* se-fi */
- {54355, 149}, /* se-no */
- {43216, 79}, /* si */
- {54361, 167}, /* si-lk */
+ {54256, 169}, /* ne-np */
+ {39635, 19}, /* nl */
+ {54262, 189}, /* nl-be */
+ {54268, 113}, /* nl-nl */
+ {49041, 268}, /* nn */
+ {54274, 190}, /* nn-no */
+ {39685, 20}, /* no */
+ {43626, 87}, /* nso */
+ {54280, 174}, /* nso-za */
+ {42241, 65}, /* or */
+ {54287, 154}, /* or-in */
+ {42058, 63}, /* pa */
+ {39715, 21}, /* pl */
+ {54293, 115}, /* pl-pl */
+ {43509, 83}, /* ps */
+ {54299, 170}, /* ps-af */
+ {39764, 22}, /* pt */
+ {54305, 116}, /* pt-br */
+ {54311, 191}, /* pt-pt */
+ {39820, 23}, /* rm */
+ {54317, 117}, /* rm-ch */
+ {39869, 24}, /* ro */
+ {54323, 118}, /* ro-ro */
+ {39917, 25}, /* ru */
+ {54329, 119}, /* ru-ru */
+ {43934, 94}, /* rw */
+ {54335, 180}, /* rw-rw */
+ {43902, 93}, /* sah */
+ {54341, 179}, /* sah-ru */
+ {41552, 55}, /* se */
+ {54348, 203}, /* se-fi */
+ {54354, 149}, /* se-no */
+ {43215, 79}, /* si */
+ {54360, 167}, /* si-lk */
{12824, 27}, /* sk */
- {54367, 121}, /* sk-sk */
- {40556, 36}, /* sl */
- {54373, 130}, /* sl-si */
- {40101, 28}, /* sq */
- {54379, 122}, /* sq-al */
- {50956, 276}, /* sr */
- {54385, 264}, /* sr-cyrl */
- {54393, 226}, /* sr-cyrl-ba */
- {54404, 245}, /* sr-cyrl-me */
- {54415, 237}, /* sr-cyrl-rs */
- {54426, 265}, /* sr-latn */
- {54434, 222}, /* sr-latn-ba */
- {54445, 241}, /* sr-latn-me */
- {54456, 233}, /* sr-latn-rs */
- {40147, 29}, /* sv */
- {54467, 192}, /* sv-fi */
- {54473, 123}, /* sv-se */
- {41861, 60}, /* sw */
- {54479, 150}, /* sw-ke */
- {42275, 66}, /* ta */
- {54485, 155}, /* ta-in */
- {42373, 67}, /* te */
- {54491, 156}, /* te-in */
- {40762, 40}, /* tg */
- {54497, 277}, /* tg-cyrl */
- {54505, 134}, /* tg-cyrl-tj */
- {40174, 30}, /* th */
- {54516, 124}, /* th-th */
- {41146, 47}, /* tn */
- {54522, 141}, /* tn-za */
+ {54366, 121}, /* sk-sk */
+ {40555, 36}, /* sl */
+ {54372, 130}, /* sl-si */
+ {40100, 28}, /* sq */
+ {54378, 122}, /* sq-al */
+ {50955, 276}, /* sr */
+ {54384, 264}, /* sr-cyrl */
+ {54392, 226}, /* sr-cyrl-ba */
+ {54403, 245}, /* sr-cyrl-me */
+ {54414, 237}, /* sr-cyrl-rs */
+ {54425, 265}, /* sr-latn */
+ {54433, 222}, /* sr-latn-ba */
+ {54444, 241}, /* sr-latn-me */
+ {54455, 233}, /* sr-latn-rs */
+ {40146, 29}, /* sv */
+ {54466, 192}, /* sv-fi */
+ {54472, 123}, /* sv-se */
+ {41860, 60}, /* sw */
+ {54478, 150}, /* sw-ke */
+ {42274, 66}, /* ta */
+ {54484, 155}, /* ta-in */
+ {42372, 67}, /* te */
+ {54490, 156}, /* te-in */
+ {40761, 40}, /* tg */
+ {54496, 277}, /* tg-cyrl */
+ {54504, 134}, /* tg-cyrl-tj */
+ {40173, 30}, /* th */
+ {54515, 124}, /* th-th */
+ {41145, 47}, /* tn */
+ {54521, 141}, /* tn-za */
{12833, 31}, /* tr */
- {54528, 125}, /* tr-tr */
- {43384, 81}, /* tzm */
- {54534, 279}, /* tzm-latn */
- {40383, 34}, /* uk */
- {54543, 128}, /* uk-ua */
- {40270, 32}, /* ur */
- {54549, 126}, /* ur-pk */
- {41911, 61}, /* uz */
- {54555, 271}, /* uz-cyrl */
- {54563, 195}, /* uz-cyrl-uz */
- {54574, 278}, /* uz-latn */
- {54582, 151}, /* uz-latn-uz */
- {40846, 42}, /* vi */
- {54593, 136}, /* vi-vn */
- {41173, 48}, /* xh */
- {54599, 142}, /* xh-za */
- {43594, 86}, /* yo */
- {54605, 173}, /* yo-ng */
- {38882, 267}, /* zh */
- {54611, 3}, /* zh-chs */
- {54618, 274}, /* zh-cht */
- {54625, 183}, /* zh-cn */
- {54631, 4}, /* zh-hans */
- {54639, 273}, /* zh-hant */
- {54647, 198}, /* zh-hk */
- {54653, 212}, /* zh-mo */
- {54659, 205}, /* zh-sg */
- {54665, 99}, /* zh-tw */
- {41199, 49}, /* zu */
- {54671, 143} /* zu-za */
+ {54527, 125}, /* tr-tr */
+ {43383, 81}, /* tzm */
+ {54533, 279}, /* tzm-latn */
+ {40382, 34}, /* uk */
+ {54542, 128}, /* uk-ua */
+ {40269, 32}, /* ur */
+ {54548, 126}, /* ur-pk */
+ {41910, 61}, /* uz */
+ {54554, 271}, /* uz-cyrl */
+ {54562, 195}, /* uz-cyrl-uz */
+ {54573, 278}, /* uz-latn */
+ {54581, 151}, /* uz-latn-uz */
+ {40845, 42}, /* vi */
+ {54592, 136}, /* vi-vn */
+ {41172, 48}, /* xh */
+ {54598, 142}, /* xh-za */
+ {43593, 86}, /* yo */
+ {54604, 173}, /* yo-ng */
+ {38881, 267}, /* zh */
+ {54610, 3}, /* zh-chs */
+ {54617, 274}, /* zh-cht */
+ {54624, 183}, /* zh-cn */
+ {54630, 4}, /* zh-hans */
+ {54638, 273}, /* zh-hant */
+ {54646, 198}, /* zh-hk */
+ {54652, 212}, /* zh-mo */
+ {54658, 205}, /* zh-sg */
+ {54664, 99}, /* zh-tw */
+ {41198, 49}, /* zu */
+ {54670, 143} /* zu-za */
};
static const RegionInfoEntry region_entries [] = {
- { 224,52400,49439,49439,54677,54698,38585,54745,54749,54777},
- { 3,48077,54801,54801,54805,54817,38358,54836,54840,54855},
- { 6,45393,54868,54868,54872,54880,37898,54890,54894,54907},
- { 7,1929,50713,50713,54921,54929,38141,54946,54950,54964},
- { 11,51891,50244,50244,54990,54990,37629,51614,55000,55015},
- { 14,49588,55030,55030,55034,55042,37525,55054,55058,55058},
- { 12,49621,55063,55063,55067,55067,37629,55077,55081,55081},
- { 5,46291,40986,40986,55099,55110,38393,55122,55126,55144},
- { 25,50186,55164,55164,55168,55191,38453,55211,55215,55251},
- { 23,49391,55271,55271,55275,55286,38429,55311,55315,55332},
- { 21,48883,40506,40506,55373,55381,37525,55054,55058,55390},
- { 35,44177,38735,38735,55395,55404,37507,55421,55425,55439},
- { 17,52512,55465,55465,55469,55477,38595,55492,55496,55511},
- { 26,52692,55535,55535,55539,55539,38619,42946,55547,55566},
- { 32,45097,55576,55576,55580,55587,37784,55594,55598,55613},
- { 29,45779,55629,55629,55633,55641,38001,55658,55662,55679},
- { 24,51648,55711,55711,55715,55715,37629,55722,55726,55726},
- { 39,49714,55740,55740,55744,55744,37629,55751,55755,55771},
- { 223,13778,55787,55787,55791,55803,37793,37793,55810,55822},
- { 46,52293,55836,55836,55840,55840,37629,55846,55850,55863},
- { 45,13857,55876,55876,55880,55886,37546,55905,55909,55922},
- { 51,51492,55941,55941,55945,55945,37629,55954,55958,55973},
- { 54,50488,55989,55989,55993,55993,38471,56004,56008,56027},
- { 75,44340,56048,56048,56052,56067,37549,56085,56089,56111},
- { 94,44430,39037,39037,56126,56134,37525,55054,55058,55058},
- { 61,44382,56146,56146,56150,56158,37577,56166,56170,56183},
- { 65,51120,56195,56195,56199,56218,37629,56240,56244,56259},
- { 4,50248,56275,56275,56279,56287,38456,56302,56306,56321},
- { 66,52110,56345,56345,56349,56349,37629,56357,56361,56371},
- { 70,45877,53003,53003,56393,56401,37525,55054,55058,55390},
- { 67,49443,56407,56407,56411,56417,38433,56424,56428,56443},
- { 217,44220,39204,39204,56461,56467,37525,55054,55058,55390},
- { 73,47956,56475,56475,56479,56488,38338,56504,56508,56523},
- { 77,44560,39251,39251,56549,56557,37525,55054,55058,55390},
- { 81,46708,56563,56563,56567,56581,37577,56166,56170,56590},
- { 84,44604,39304,39304,56603,56603,37525,55054,55058,55390},
- { 242,47613,56610,56610,56614,56629,38282,56646,56650,56673},
- { 88,46654,56695,56695,56699,56707,0,56738,56742,56756},
- { 93,48355,56791,56791,56795,56805,37577,56166,56170,56822},
- { 98,44486,56842,56842,56846,56853,37525,55054,55058,56866},
- { 99,50054,56875,56875,56879,56879,8056,56889,56893,56912},
- { 104,49536,56933,56933,56937,56957,37629,56985,56989,57006},
- { 106,52832,57013,57013,57017,57017,2436,57026,57030,57047},
- { 108,45296,40019,40019,57066,57074,37895,57083,57087,57101},
- { 109,44705,39416,39416,57115,57123,37702,57137,57141,57158},
- { 111,45642,57172,57172,57176,57176,37977,57186,57190,57208},
- { 68,49236,57225,57225,57229,57237,37525,55054,55058,55058},
- { 117,44653,57243,57243,57247,57254,37675,57265,57269,57288},
- { 113,46762,40356,40356,57295,57301,38220,57314,57318,57331},
- { 121,48645,57366,57366,57370,57375,38404,57388,57392,57404},
- { 116,46102,57426,57426,57430,57435,38095,57446,57450,57463},
- { 110,44754,39463,39463,57483,57491,37577,57499,57503,57520},
- { 118,44797,39511,39511,57536,57542,37525,55054,55058,55058},
- { 124,51268,57549,57549,57553,57553,37629,57561,57565,57565},
- { 126,51794,57581,57581,57585,57592,38555,57605,57609,57625},
- { 122,44842,39563,39563,57647,57653,37715,57660,57664,57677},
- { 129,46898,57687,57687,57691,57691,38244,57697,57701,57717},
- { 40,47679,43020,43020,57735,57744,38285,57766,57770,57785},
- { 134,44897,39618,39618,57817,57829,37719,57842,57846,57863},
- { 136,52215,57880,57880,57884,57891,38575,57904,57908,57922},
- { 138,47721,43100,43100,57944,43090,38289,57949,57953,57965},
- { 139,52028,57985,57985,57989,57997,38565,58008,58012,58027},
- { 145,50397,58049,58049,58053,58053,0,37793,55810,58067},
- { 42,47897,58085,58085,58089,58099,38330,58131,58135,58152},
- { 141,45975,58200,58200,58204,58214,38069,58222,58226,58243},
- { 147,49973,58258,58258,58262,58273,37525,55054,55058,55058},
- { 140,45923,58283,58283,58287,58294,37525,55054,55058,58302},
- { 148,49856,58307,58307,58311,58317,38443,58328,58332,58345},
- { 159,50717,42778,42778,58365,58373,38475,58386,58390,58406},
- { 158,50842,58426,58426,58430,58430,37525,55054,55058,55390},
- { 270,51970,58437,58437,58441,58452,37525,55054,55058,58470},
- { 19618,46407,58475,58475,58479,58489,38166,58475,58510,58527},
- { 151,50337,58559,58559,58563,58579,38466,58607,58611,58627},
- { 163,46801,41524,41524,58637,58637,37525,55054,55058,58643},
- { 166,48832,58648,58648,58652,58659,37629,58667,58671,58684},
- { 175,48185,58698,58698,58702,58710,38365,58719,58723,58738},
- { 182,52886,58744,58744,58748,58748,38622,58758,58762,58782},
- { 176,44949,39656,39656,58805,58817,37525,55054,55058,55058},
- { 177,45007,39705,39705,58827,58834,37577,58840,58844,58860},
- { 178,48017,58874,58874,58878,58884,38345,58900,58904,58919},
- { 183,50432,58960,58960,58964,58964,37629,58976,58980,58980},
- { 164,51237,58999,58999,59003,59008,38504,59019,59023,59034},
- { 192,50794,42089,42089,59054,59061,38485,59069,59073,59091},
- { 187,51693,59108,59108,59112,59117,38543,59123,59127,59146},
- { 201,48131,59164,59164,59168,59180,38361,59190,59194,59194},
- { 190,45581,59210,59210,59214,59223,37919,59238,59242,59258},
- { 191,45048,59286,59286,59290,59297,37742,59304,59308,59321},
- { 202,52944,59335,59335,59339,59339,37629,56357,56361,56371},
- { 193,49099,59351,59351,59355,59355,37525,55054,55058,55058},
- { 185,52564,59364,59364,59368,59368,38605,59377,59381,59400},
- { 197,52616,59419,59419,59423,59429,38609,59436,59440,59452},
- { 200,45192,59470,59470,59474,59482,0,59491,59495,59508},
- { 271,51562,53366,53366,59522,59529,38528,59542,59546,59560},
- { 203,45248,39944,39944,59573,59580,37815,59593,59597,59611},
- { 204,48513,59643,59643,59647,59647,38369,59654,59658,0},
- { 205,13775,59672,59672,59676,59689,37449,59736,59740,59752},
- { 221,45437,59772,59772,59776,59783,37577,59791,59795,59809},
- { 215,49920,59822,59822,59826,59836,37629,59846,59850,59867},
- { 212,45835,59880,59880,59884,59893,37525,55054,55058,59903},
- { 143,45347,59908,59908,59912,59921,37525,55054,55058,55058},
- { 72,52750,40583,40583,59931,59931,37629,56357,56361,56371},
- { 222,51618,59943,59943,59947,59953,38533,59964,59968,59981},
- { 227,45484,40192,40192,60001,40182,37911,60010,60014,60024},
- { 228,46054,60043,60043,60047,60058,38386,60079,60083,60102},
- { 234,51012,60115,60115,60119,60127,38489,60136,60140,60155},
- { 235,45530,60176,60176,60180,60187,37915,60196,60200,60213},
- { 225,51837,60227,60227,60231,60231,37629,60251,60255,60255},
- { 237,44271,60282,60282,60286,60293,38372,60300,60304,60322},
- { 241,45709,40417,40417,60332,60340,37980,60355,60359,60377},
- { 244,44519,60411,60411,60415,60415,37629,56357,56361,56361},
- { 246,52450,60429,60429,60433,60433,37629,60441,60445,60460},
- { 247,46964,41931,41931,60474,60485,38398,60498,60502,60517},
- { 249,51322,60536,60536,60540,60540,38514,60550,60554,60574},
- { 251,46160,60594,60594,60598,60606,38137,60617,60621,60637},
- { 261,51440,60656,60656,60660,60666,38518,60677,60681,60693},
- { 209,46438,60711,60711,60715,0,10836,60728,60732,0},
- { 264,52060,60751,60751,60755,60755,37629,56357,56361,56361}
+ { 224,52399,49438,49438,54676,54697,38584,54744,54748,54776},
+ { 3,48076,54800,54800,54804,54816,38355,54835,54839,54854},
+ { 6,45392,54867,54867,54871,54879,37893,54889,54893,54906},
+ { 7,1929,50712,50712,54920,54928,38136,54945,54949,54963},
+ { 11,51890,50243,50243,54989,54989,37626,51613,54999,55014},
+ { 14,49587,55029,55029,55033,55041,37522,55053,55057,55057},
+ { 12,49620,55062,55062,55066,55066,37626,55076,55080,55080},
+ { 5,46290,40985,40985,55098,55109,38390,55121,55125,55143},
+ { 25,50185,55163,55163,55167,55190,38452,55210,55214,55250},
+ { 23,49390,55270,55270,55274,55285,38428,55310,55314,55331},
+ { 21,48882,40505,40505,55372,55380,37522,55053,55057,55389},
+ { 35,44176,38734,38734,55394,55403,37504,55420,55424,55438},
+ { 17,52511,55464,55464,55468,55476,38594,55491,55495,55510},
+ { 26,52691,55534,55534,55538,55538,38618,42945,55546,55565},
+ { 32,45096,55575,55575,55579,55586,37781,55593,55597,55612},
+ { 29,45778,55628,55628,55632,55640,37996,55657,55661,55678},
+ { 24,51647,55710,55710,55714,55714,37626,55721,55725,55725},
+ { 39,49713,55739,55739,55743,55743,37626,55750,55754,55770},
+ { 223,13778,55786,55786,55790,55802,37788,37788,55809,55821},
+ { 46,52292,55835,55835,55839,55839,37626,55845,55849,55862},
+ { 45,13857,55875,55875,55879,55885,37543,55904,55908,55921},
+ { 51,51491,55940,55940,55944,55944,37626,55953,55957,55972},
+ { 54,50487,55988,55988,55992,55992,38470,56003,56007,56026},
+ { 75,44339,56047,56047,56051,56066,37546,56084,56088,56110},
+ { 94,44429,39036,39036,56125,56133,37522,55053,55057,55057},
+ { 61,44381,56145,56145,56149,56157,37574,56165,56169,56182},
+ { 65,51119,56194,56194,56198,56217,37626,56239,56243,56258},
+ { 4,50247,56274,56274,56278,56286,38455,56301,56305,56320},
+ { 66,52109,56344,56344,56348,56348,37626,56356,56360,56370},
+ { 70,45876,53002,53002,56392,56400,37522,55053,55057,55389},
+ { 67,49442,56406,56406,56410,56416,38432,56423,56427,56442},
+ { 217,44219,39203,39203,56460,56466,37522,55053,55057,55389},
+ { 73,47955,56474,56474,56478,56487,38335,56503,56507,56522},
+ { 77,44559,39250,39250,56548,56556,37522,55053,55057,55389},
+ { 81,46707,56562,56562,56566,56580,37574,56165,56169,56589},
+ { 84,44603,39303,39303,56602,56602,37522,55053,55057,55389},
+ { 242,47612,56609,56609,56613,56628,38279,56645,56649,56672},
+ { 88,46653,56694,56694,56698,56706,0,56737,56741,56755},
+ { 93,48354,56790,56790,56794,56804,37574,56165,56169,56821},
+ { 98,44485,56841,56841,56845,56852,37522,55053,55057,56865},
+ { 99,50053,56874,56874,56878,56878,8056,56888,56892,56911},
+ { 104,49535,56932,56932,56936,56956,37626,56984,56988,57005},
+ { 106,52831,57012,57012,57016,57016,2436,57025,57029,57046},
+ { 108,45295,40018,40018,57065,57073,37890,57082,57086,57100},
+ { 109,44704,39415,39415,57114,57122,37699,57136,57140,57157},
+ { 111,45641,57171,57171,57175,57175,37972,57185,57189,57207},
+ { 68,49235,57224,57224,57228,57236,37522,55053,55057,55057},
+ { 117,44652,57242,57242,57246,57253,37672,57264,57268,57287},
+ { 113,46761,40355,40355,57294,57300,38215,57313,57317,57330},
+ { 121,48644,57365,57365,57369,57374,38401,57387,57391,57403},
+ { 116,46101,57425,57425,57429,57434,38090,57445,57449,57462},
+ { 110,44753,39462,39462,57482,57490,37574,57498,57502,57519},
+ { 118,44796,39510,39510,57535,57541,37522,55053,55057,55057},
+ { 124,51267,57548,57548,57552,57552,37626,57560,57564,57564},
+ { 126,51793,57580,57580,57584,57591,38554,57604,57608,57624},
+ { 122,44841,39562,39562,57646,57652,37712,57659,57663,57676},
+ { 129,46897,57686,57686,57690,57690,38239,57696,57700,57716},
+ { 40,47678,43019,43019,57734,57743,38282,57765,57769,57784},
+ { 134,44896,39617,39617,57816,57828,37716,57841,57845,57862},
+ { 136,52214,57879,57879,57883,57890,38574,57903,57907,57921},
+ { 138,47720,43099,43099,57943,43089,38286,57948,57952,57964},
+ { 139,52027,57984,57984,57988,57996,38564,58007,58011,58026},
+ { 145,50396,58048,58048,58052,58052,0,37788,55809,58066},
+ { 42,47896,58084,58084,58088,58098,38327,58130,58134,58151},
+ { 141,45974,58199,58199,58203,58213,38066,58221,58225,58242},
+ { 147,49972,58257,58257,58261,58272,37522,55053,55057,55057},
+ { 140,45922,58282,58282,58286,58293,37522,55053,55057,58301},
+ { 148,49855,58306,58306,58310,58316,38442,58327,58331,58344},
+ { 159,50716,42777,42777,58364,58372,38474,58385,58389,58405},
+ { 158,50841,58425,58425,58429,58429,37522,55053,55057,55389},
+ { 270,51969,58436,58436,58440,58451,37522,55053,55057,58469},
+ { 19618,46406,58474,58474,58478,58488,38161,58474,58509,58526},
+ { 151,50336,58558,58558,58562,58578,38465,58606,58610,58626},
+ { 163,46800,41523,41523,58636,58636,37522,55053,55057,58642},
+ { 166,48831,58647,58647,58651,58658,37626,58666,58670,58683},
+ { 175,48184,58697,58697,58701,58709,38362,58718,58722,58737},
+ { 182,52885,58743,58743,58747,58747,38621,58757,58761,58781},
+ { 176,44948,39655,39655,58804,58816,37522,55053,55057,55057},
+ { 177,45006,39704,39704,58826,58833,37574,58839,58843,58859},
+ { 178,48016,58873,58873,58877,58883,38342,58899,58903,58918},
+ { 183,50431,58959,58959,58963,58963,37626,58975,58979,58979},
+ { 164,51236,58998,58998,59002,59007,38503,59018,59022,59033},
+ { 192,50793,42088,42088,59053,59060,38484,59068,59072,59090},
+ { 187,51692,59107,59107,59111,59116,38542,59122,59126,59145},
+ { 201,48130,59163,59163,59167,59179,38358,59189,59193,59193},
+ { 190,45580,59209,59209,59213,59222,37914,59237,59241,59257},
+ { 191,45047,59285,59285,59289,59296,37739,59303,59307,59320},
+ { 202,52943,59334,59334,59338,59338,37626,56356,56360,56370},
+ { 193,49098,59350,59350,59354,59354,37522,55053,55057,55057},
+ { 185,52563,59363,59363,59367,59367,38604,59376,59380,59399},
+ { 197,52615,59418,59418,59422,59428,38608,59435,59439,59451},
+ { 200,45191,59469,59469,59473,59481,0,59490,59494,59507},
+ { 271,51561,53365,53365,59521,59528,38527,59541,59545,59559},
+ { 203,45247,39943,39943,59572,59579,37810,59592,59596,59610},
+ { 204,48512,59642,59642,59646,59646,38366,59653,59657,0},
+ { 205,13775,59671,59671,59675,59688,37446,59735,59739,59751},
+ { 221,45436,59771,59771,59775,59782,37574,59790,59794,59808},
+ { 215,49919,59821,59821,59825,59835,37626,59845,59849,59866},
+ { 212,45834,59879,59879,59883,59892,37522,55053,55057,59902},
+ { 143,45346,59907,59907,59911,59920,37522,55053,55057,55057},
+ { 72,52749,40582,40582,59930,59930,37626,56356,56360,56370},
+ { 222,51617,59942,59942,59946,59952,38532,59963,59967,59980},
+ { 227,45483,40191,40191,60000,40181,37906,60009,60013,60023},
+ { 228,46053,60042,60042,60046,60057,38383,60078,60082,60101},
+ { 234,51011,60114,60114,60118,60126,38488,60135,60139,60154},
+ { 235,45529,60175,60175,60179,60186,37910,60195,60199,60212},
+ { 225,51836,60226,60226,60230,60230,37626,60250,60254,60254},
+ { 237,44270,60281,60281,60285,60292,38369,60299,60303,60321},
+ { 241,45708,40416,40416,60331,60339,37975,60354,60358,60376},
+ { 244,44518,60410,60410,60414,60414,37626,56356,56360,56360},
+ { 246,52449,60428,60428,60432,60432,37626,60440,60444,60459},
+ { 247,46963,41930,41930,60473,60484,38395,60497,60501,60516},
+ { 249,51321,60535,60535,60539,60539,38513,60549,60553,60573},
+ { 251,46159,60593,60593,60597,60605,38132,60616,60620,60636},
+ { 261,51439,60655,60655,60659,60665,38517,60676,60680,60692},
+ { 209,46437,60710,60710,60714,0,10836,60727,60731,0},
+ { 264,52059,60750,60750,60754,60754,37626,56356,56360,56360}
};
static const RegionInfoNameEntry region_name_entries [] = {
- {52400, 0}, /* AE */
- {48077, 1}, /* AF */
- {45393, 2}, /* AL */
+ {52399, 0}, /* AE */
+ {48076, 1}, /* AF */
+ {45392, 2}, /* AL */
{1929, 3}, /* AM */
- {51891, 4}, /* AR */
- {49588, 5}, /* AT */
- {49621, 6}, /* AU */
- {46291, 7}, /* AZ */
- {50186, 8}, /* BA */
- {49391, 9}, /* BD */
- {48883, 10}, /* BE */
- {44177, 11}, /* BG */
- {52512, 12}, /* BH */
- {52692, 13}, /* BO */
- {45097, 14}, /* BR */
- {45779, 15}, /* BY */
- {51648, 16}, /* BZ */
- {49714, 17}, /* CA */
+ {51890, 4}, /* AR */
+ {49587, 5}, /* AT */
+ {49620, 6}, /* AU */
+ {46290, 7}, /* AZ */
+ {50185, 8}, /* BA */
+ {49390, 9}, /* BD */
+ {48882, 10}, /* BE */
+ {44176, 11}, /* BG */
+ {52511, 12}, /* BH */
+ {52691, 13}, /* BO */
+ {45096, 14}, /* BR */
+ {45778, 15}, /* BY */
+ {51647, 16}, /* BZ */
+ {49713, 17}, /* CA */
{13778, 18}, /* CH */
- {52293, 19}, /* CL */
+ {52292, 19}, /* CL */
{13857, 20}, /* CN */
- {51492, 21}, /* CO */
- {50488, 22}, /* CR */
- {44340, 23}, /* CZ */
- {44430, 24}, /* DE */
- {44382, 25}, /* DK */
- {51120, 26}, /* DO */
- {50248, 27}, /* DZ */
- {52110, 28}, /* EC */
- {45877, 29}, /* EE */
- {49443, 30}, /* EG */
- {44220, 31}, /* ES */
- {47956, 32}, /* ET */
- {44560, 33}, /* FI */
- {46708, 34}, /* FO */
- {44604, 35}, /* FR */
- {47613, 36}, /* GB */
- {46654, 37}, /* GE */
- {48355, 38}, /* GL */
- {44486, 39}, /* GR */
- {50054, 40}, /* GT */
- {49536, 41}, /* HK */
- {52832, 42}, /* HN */
- {45296, 43}, /* HR */
- {44705, 44}, /* HU */
- {45642, 45}, /* ID */
- {49236, 46}, /* IE */
- {44653, 47}, /* IL */
- {46762, 48}, /* IN */
- {48645, 49}, /* IQ */
- {46102, 50}, /* IR */
- {44754, 51}, /* IS */
- {44797, 52}, /* IT */
- {51268, 53}, /* JM */
- {51794, 54}, /* JO */
- {44842, 55}, /* JP */
- {46898, 56}, /* KE */
- {47679, 57}, /* KH */
- {44897, 58}, /* KR */
- {52215, 59}, /* KW */
- {47721, 60}, /* LA */
- {52028, 61}, /* LB */
- {50397, 62}, /* LI */
- {47897, 63}, /* LK */
- {45975, 64}, /* LT */
- {49973, 65}, /* LU */
- {45923, 66}, /* LV */
- {49856, 67}, /* LY */
- {50717, 68}, /* MA */
- {50842, 69}, /* MC */
- {51970, 70}, /* ME */
- {46407, 71}, /* MK */
- {50337, 72}, /* MO */
- {46801, 73}, /* MT */
- {48832, 74}, /* MX */
- {48185, 75}, /* NG */
- {52886, 76}, /* NI */
- {44949, 77}, /* NL */
- {45007, 78}, /* NO */
- {48017, 79}, /* NP */
- {50432, 80}, /* NZ */
- {51237, 81}, /* OM */
- {50794, 82}, /* PA */
- {51693, 83}, /* PE */
- {48131, 84}, /* PH */
- {45581, 85}, /* PK */
- {45048, 86}, /* PL */
- {52944, 87}, /* PR */
- {49099, 88}, /* PT */
- {52564, 89}, /* PY */
- {52616, 90}, /* QA */
- {45192, 91}, /* RO */
- {51562, 92}, /* RS */
- {45248, 93}, /* RU */
- {48513, 94}, /* RW */
+ {51491, 21}, /* CO */
+ {50487, 22}, /* CR */
+ {44339, 23}, /* CZ */
+ {44429, 24}, /* DE */
+ {44381, 25}, /* DK */
+ {51119, 26}, /* DO */
+ {50247, 27}, /* DZ */
+ {52109, 28}, /* EC */
+ {45876, 29}, /* EE */
+ {49442, 30}, /* EG */
+ {44219, 31}, /* ES */
+ {47955, 32}, /* ET */
+ {44559, 33}, /* FI */
+ {46707, 34}, /* FO */
+ {44603, 35}, /* FR */
+ {47612, 36}, /* GB */
+ {46653, 37}, /* GE */
+ {48354, 38}, /* GL */
+ {44485, 39}, /* GR */
+ {50053, 40}, /* GT */
+ {49535, 41}, /* HK */
+ {52831, 42}, /* HN */
+ {45295, 43}, /* HR */
+ {44704, 44}, /* HU */
+ {45641, 45}, /* ID */
+ {49235, 46}, /* IE */
+ {44652, 47}, /* IL */
+ {46761, 48}, /* IN */
+ {48644, 49}, /* IQ */
+ {46101, 50}, /* IR */
+ {44753, 51}, /* IS */
+ {44796, 52}, /* IT */
+ {51267, 53}, /* JM */
+ {51793, 54}, /* JO */
+ {44841, 55}, /* JP */
+ {46897, 56}, /* KE */
+ {47678, 57}, /* KH */
+ {44896, 58}, /* KR */
+ {52214, 59}, /* KW */
+ {47720, 60}, /* LA */
+ {52027, 61}, /* LB */
+ {50396, 62}, /* LI */
+ {47896, 63}, /* LK */
+ {45974, 64}, /* LT */
+ {49972, 65}, /* LU */
+ {45922, 66}, /* LV */
+ {49855, 67}, /* LY */
+ {50716, 68}, /* MA */
+ {50841, 69}, /* MC */
+ {51969, 70}, /* ME */
+ {46406, 71}, /* MK */
+ {50336, 72}, /* MO */
+ {46800, 73}, /* MT */
+ {48831, 74}, /* MX */
+ {48184, 75}, /* NG */
+ {52885, 76}, /* NI */
+ {44948, 77}, /* NL */
+ {45006, 78}, /* NO */
+ {48016, 79}, /* NP */
+ {50431, 80}, /* NZ */
+ {51236, 81}, /* OM */
+ {50793, 82}, /* PA */
+ {51692, 83}, /* PE */
+ {48130, 84}, /* PH */
+ {45580, 85}, /* PK */
+ {45047, 86}, /* PL */
+ {52943, 87}, /* PR */
+ {49098, 88}, /* PT */
+ {52563, 89}, /* PY */
+ {52615, 90}, /* QA */
+ {45191, 91}, /* RO */
+ {51561, 92}, /* RS */
+ {45247, 93}, /* RU */
+ {48512, 94}, /* RW */
{13775, 95}, /* SA */
- {45437, 96}, /* SE */
- {49920, 97}, /* SG */
- {45835, 98}, /* SI */
- {45347, 99}, /* SK */
- {52750, 100}, /* SV */
- {51618, 101}, /* SY */
- {45484, 102}, /* TH */
- {46054, 103}, /* TJ */
- {51012, 104}, /* TN */
- {45530, 105}, /* TR */
- {51837, 106}, /* TT */
- {44271, 107}, /* TW */
- {45709, 108}, /* UA */
- {44519, 109}, /* US */
- {52450, 110}, /* UY */
- {46964, 111}, /* UZ */
- {51322, 112}, /* VE */
- {46160, 113}, /* VN */
- {51440, 114}, /* YE */
- {46438, 115}, /* ZA */
- {52060, 116} /* ZW */
+ {45436, 96}, /* SE */
+ {49919, 97}, /* SG */
+ {45834, 98}, /* SI */
+ {45346, 99}, /* SK */
+ {52749, 100}, /* SV */
+ {51617, 101}, /* SY */
+ {45483, 102}, /* TH */
+ {46053, 103}, /* TJ */
+ {51011, 104}, /* TN */
+ {45529, 105}, /* TR */
+ {51836, 106}, /* TT */
+ {44270, 107}, /* TW */
+ {45708, 108}, /* UA */
+ {44518, 109}, /* US */
+ {52449, 110}, /* UY */
+ {46963, 111}, /* UZ */
+ {51321, 112}, /* VE */
+ {46159, 113}, /* VN */
+ {51439, 114}, /* YE */
+ {46437, 115}, /* ZA */
+ {52059, 116} /* ZW */
};
"MM-dd-yyyy\0"
"MMMM' del 'yyyy\0"
",\0"
- "\xd9\xab\0"
"\xd9\xac\0"
"\xd8\xb1.\xd8\xb3.\xe2\x80\x8f\0"
"\xd9\xaa\0"
"-niesko\xc5\x84\x63zono\xc5\x9b\xc4\x87\0"
"+niesko\xc5\x84\x63zono\xc5\x9b\xc4\x87\0"
"R$\0"
- "'\0"
"\xe2\x80\x99\0"
"CHF\0"
"-infinit\0"
"nav\xc2\xa0skaitlis\0"
"-bezgal\xc4\xab\x62\x61\0"
"bezgal\xc4\xab\x62\x61\0"
+ " \0"
"Lt\0"
"-begalyb\xc4\x97\0"
"begalyb\xc4\x97\0"
- ";\0"
"\xd8\xb1\xdb\x8c\xd8\xa7\xd9\x84\0"
"\xd9\x86\xd8\xa7\xd8\xb9\xd8\xaf\xd8\xaf\0"
"\xe2\x80\x8e\xe2\x88\x92Infinity\0"
"Ksh\0"
"\xe0\xa6\x9f\xe0\xa6\xbe\0"
"\xe0\xa6\xb8\xe0\xa6\x82\xe0\xa6\x96\xe0\xa7\x8d\xe0\xa6\xaf\xe0\xa6\xbe\xc2\xa0\xe0\xa6\xa8\xe0\xa6\xbe\0"
+ "`\0"
"\xc2\xa3\0"
"\xe1\x9f\x9b\0"
"\xe2\x82\xad\0"
"man.\0"
"so\xca\xbbm\0"
"\xd8\xaf.\xd8\xb9.\xe2\x80\x8f\0"
+ "'\0"
"\xd0\xbc\xd0\xb0\xd0\xbd.\0"
"\xd1\x81\xd1\x9e\xd0\xbc\0"
"\xe0\xa7\xb3\0"
typedef struct {
const stridx_t currency_decimal_separator;
const stridx_t currency_group_separator;
- const stridx_t percent_decimal_separator;
- const stridx_t percent_group_separator;
const stridx_t number_decimal_separator;
const stridx_t number_group_separator;
const gint8 number_negative_pattern;
const gint8 currency_decimal_digits;
- const gint8 percent_decimal_digits;
const gint8 number_decimal_digits;
const gint currency_group_sizes [GROUP_SIZE];
- const gint percent_group_sizes [GROUP_SIZE];
const gint number_group_sizes [GROUP_SIZE];
} NumberFormatEntry;
#define DECIMAL_LO32(dec) ((dec).v.v.Lo32)
#define DECIMAL_MID32(dec) ((dec).v.v.Mid32)
#define DECIMAL_HI32(dec) ((dec).Hi32)
-#define DECIMAL_LO64_GET(dec) ((dec).v.Lo64)
-#define DECIMAL_LO64_SET(dec,value) {(dec).v.Lo64 = value; }
+#if G_BYTE_ORDER != G_LITTLE_ENDIAN
+# define DECIMAL_LO64_GET(dec) (((uint64_t)((dec).v.v.Mid32) << 32) | (dec).v.v.Lo32)
+# define DECIMAL_LO64_SET(dec,value) {(dec).v.v.Lo32 = (value); (dec).v.v.Mid32 = ((value) >> 32); }
+#else
+# define DECIMAL_LO64_GET(dec) ((dec).v.Lo64)
+# define DECIMAL_LO64_SET(dec,value) {(dec).v.Lo64 = value; }
+#endif
#define DECIMAL_SETZERO(dec) {DECIMAL_LO32(dec) = 0; DECIMAL_MID32(dec) = 0; DECIMAL_HI32(dec) = 0; DECIMAL_SIGNSCALE(dec) = 0;}
#define COPYDEC(dest, src) {DECIMAL_SIGNSCALE(dest) = DECIMAL_SIGNSCALE(src); DECIMAL_HI32(dest) = DECIMAL_HI32(src); \
uint32_t right_sign;
MonoDecimal result;
+ result.Hi32 = 0; // Just to shut up the compiler
+
// First check signs and whether either are zero. If both are
// non-zero and of the same sign, just use subtraction to compare.
//
gpointer try_start;
gpointer try_end;
gpointer handler_start;
+ /*
+ * For LLVM compiled code, this is the index of the il clause
+ * associated with this handler.
+ */
+ int clause_index;
union {
MonoClass *catch_class;
gpointer filter;
const AssemblyVersionSet version_sets [4];
} MonoRuntimeInfo;
-#define mono_domain_lock(domain) mono_locks_acquire(&(domain)->lock, DomainLock)
-#define mono_domain_unlock(domain) mono_locks_release(&(domain)->lock, DomainLock)
#define mono_domain_assemblies_lock(domain) mono_locks_acquire(&(domain)->assemblies_lock, DomainAssembliesLock)
#define mono_domain_assemblies_unlock(domain) mono_locks_release(&(domain)->assemblies_lock, DomainAssembliesLock)
#define mono_domain_jit_code_hash_lock(domain) mono_locks_acquire(&(domain)->jit_code_hash_lock, DomainJitCodeHashLock)
typedef MonoDomain* (*MonoLoadFunc) (const char *filename, const char *runtime_version);
+void mono_domain_lock (MonoDomain *domain);
+void mono_domain_unlock (MonoDomain *domain);
+
void
mono_install_runtime_load (MonoLoadFunc func);
mono_defaults.corlib, "System", "MonoType");
g_assert (mono_defaults.monotype_class != 0);
+ mono_defaults.runtimetype_class = mono_class_from_name (
+ mono_defaults.corlib, "System", "RuntimeType");
+ g_assert (mono_defaults.runtimetype_class != 0);
+
mono_defaults.exception_class = mono_class_from_name (
mono_defaults.corlib, "System", "Exception");
g_assert (mono_defaults.exception_class != 0);
{
return &aot_cache_config;
}
+
+void
+mono_domain_lock (MonoDomain *domain)
+{
+ MONO_PREPARE_BLOCKING
+ mono_locks_acquire (&(domain)->lock, DomainLock);
+ MONO_FINISH_BLOCKING
+}
+
+void
+mono_domain_unlock (MonoDomain *domain)
+{
+ mono_locks_release (&(domain)->lock, DomainLock);
+}
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/mono-debug.h>
+#include <mono/utils/mono-error-internals.h>
#include <string.h>
#ifdef HAVE_EXECINFO_H
g_free (trace);
return res;
}
+
+/**
+ * mono_error_raise_exception:
+ * @target_error: the exception to raise
+ *
+ * Raises the exception of @target_error.
+ * Does nothing if @target_error has a success error code.
+ * Aborts in case of a double fault. This happens when it can't recover from an error caused by trying
+ * to construct the first exception object.
+ * The error object @target_error is cleaned up.
+*/
+void
+mono_error_raise_exception (MonoError *target_error)
+{
+ MonoException *ex = mono_error_convert_to_exception (target_error);
+ if (ex)
+ mono_raise_exception (ex);
+}
+
+void
+mono_error_set_pending_exception (MonoError *error)
+{
+ MonoException *ex = mono_error_convert_to_exception (error);
+ if (ex)
+ mono_set_pending_exception (ex);
+}
ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path, gint32 *error)
{
gboolean ret;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
if(ret==FALSE) {
*error=GetLastError ();
}
-
+
+ MONO_FINISH_BLOCKING
return(ret);
}
ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path, gint32 *error)
{
gboolean ret;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
if(ret==FALSE) {
*error=GetLastError ();
}
-
+
+ MONO_FINISH_BLOCKING
return(ret);
}
return result;
}
-MonoArray *
-ves_icall_System_IO_MonoIO_GetFileSystemEntries (MonoString *path,
+static GPtrArray *
+get_filesystem_entries (MonoString *path,
MonoString *path_with_pattern,
gint attrs, gint mask,
gint32 *error)
{
- MonoDomain *domain;
- MonoArray *result;
int i;
WIN32_FIND_DATA data;
HANDLE find_handle;
- GPtrArray *names;
- gchar *utf8_path, *utf8_result, *full_name;
+ GPtrArray *names = NULL;
+ gchar *utf8_path = NULL, *utf8_result, *full_name;
gint32 attributes;
-
- result = NULL;
- *error = ERROR_SUCCESS;
- domain = mono_domain_get ();
mask = convert_attrs (mask);
attributes = get_file_attributes (mono_string_chars (path));
if (attributes != -1) {
if ((attributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
*error = ERROR_INVALID_NAME;
- goto leave;
+ goto fail;
}
} else {
*error = GetLastError ();
- goto leave;
+ goto fail;
}
find_handle = FindFirstFile (mono_string_chars (path_with_pattern), &data);
if (find_error == ERROR_FILE_NOT_FOUND || find_error == ERROR_NO_MORE_FILES) {
/* No files, so just return an empty array */
- goto leave;
+ goto fail;
}
*error = find_error;
- goto leave;
+ goto fail;
}
utf8_path = get_search_dir (path_with_pattern);
if (FindClose (find_handle) == FALSE) {
*error = GetLastError ();
- result = NULL;
- } else {
- result = mono_array_new (domain, mono_defaults.string_class, names->len);
- for (i = 0; i < names->len; i++) {
- mono_array_setref (result, i, mono_string_new (domain, g_ptr_array_index (names, i)));
- }
+ goto fail;
}
- for (i = 0; i < names->len; i++) {
- g_free (g_ptr_array_index (names, i));
+ g_free (utf8_path);
+ return names;
+fail:
+ if (names) {
+ for (i = 0; i < names->len; i++)
+ g_free (g_ptr_array_index (names, i));
+ g_ptr_array_free (names, TRUE);
}
- g_ptr_array_free (names, TRUE);
g_free (utf8_path);
+ return FALSE;
+}
+
+
+MonoArray *
+ves_icall_System_IO_MonoIO_GetFileSystemEntries (MonoString *path,
+ MonoString *path_with_pattern,
+ gint attrs, gint mask,
+ gint32 *error)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoArray *result;
+ int i;
+ GPtrArray *names;
+
+ *error = ERROR_SUCCESS;
-leave:
- // If there's no array and no error, then return an empty array.
- if (result == NULL && *error == ERROR_SUCCESS)
- result = mono_array_new (domain, mono_defaults.string_class, 0);
+ MONO_PREPARE_BLOCKING
+ names = get_filesystem_entries (path, path_with_pattern, attrs, mask, error);
+ MONO_FINISH_BLOCKING
+ if (!names) {
+ // If there's no array and no error, then return an empty array.
+ if (*error == ERROR_SUCCESS)
+ return mono_array_new (domain, mono_defaults.string_class, 0);
+ return NULL;
+ }
+
+ result = mono_array_new (domain, mono_defaults.string_class, names->len);
+ for (i = 0; i < names->len; i++) {
+ mono_array_setref (result, i, mono_string_new (domain, g_ptr_array_index (names, i)));
+ g_free (g_ptr_array_index (names, i));
+ }
+ g_ptr_array_free (names, TRUE);
return result;
}
return TRUE;
}
+/* FIXME make gc suspendable */
MonoString *
ves_icall_System_IO_MonoIO_FindFirst (MonoString *path,
MonoString *path_with_pattern,
return result;
}
+/* FIXME make gc suspendable */
MonoString *
ves_icall_System_IO_MonoIO_FindNext (gpointer handle, gint32 *result_attr, gint32 *error)
{
{
IncrementalFind *ifh = handle;
gint32 error;
-
+
+ MONO_PREPARE_BLOCKING
if (FindClose (ifh->find_handle) == FALSE){
error = GetLastError ();
} else
error = ERROR_SUCCESS;
g_free (ifh->utf8_path);
g_free (ifh);
+ MONO_FINISH_BLOCKING
return error;
}
gint32 *error)
{
gboolean ret;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
-
+
ret=MoveFile (mono_string_chars (path), mono_string_chars (dest));
if(ret==FALSE) {
*error=GetLastError ();
}
-
+
+ MONO_FINISH_BLOCKING
return(ret);
}
gboolean ret;
gunichar2 *utf16_sourceFileName = NULL, *utf16_destinationFileName = NULL, *utf16_destinationBackupFileName = NULL;
guint32 replaceFlags = REPLACEFILE_WRITE_THROUGH;
+ MONO_PREPARE_BLOCKING
if (sourceFileName)
utf16_sourceFileName = mono_string_chars (sourceFileName);
if (ret == FALSE)
*error = GetLastError ();
+ MONO_FINISH_BLOCKING
return ret;
}
MonoBoolean overwrite, gint32 *error)
{
gboolean ret;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
*error=GetLastError ();
}
+ MONO_FINISH_BLOCKING
return(ret);
}
ves_icall_System_IO_MonoIO_DeleteFile (MonoString *path, gint32 *error)
{
gboolean ret;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
*error=GetLastError ();
}
+ MONO_FINISH_BLOCKING
return(ret);
}
ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString *path, gint32 *error)
{
gint32 ret;
-
+ MONO_PREPARE_BLOCKING
+
*error=ERROR_SUCCESS;
ret=get_file_attributes (mono_string_chars (path));
*error=GetLastError ();
}
+ MONO_FINISH_BLOCKING
return(ret);
}
gint32 *error)
{
gboolean ret;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
if(ret==FALSE) {
*error=GetLastError ();
}
-
+
+ MONO_FINISH_BLOCKING
return(ret);
}
ves_icall_System_IO_MonoIO_GetFileType (HANDLE handle, gint32 *error)
{
gboolean ret;
-
+ MONO_PREPARE_BLOCKING
+
*error=ERROR_SUCCESS;
ret=GetFileType (handle);
*error=GetLastError ();
}
+ MONO_FINISH_BLOCKING
return(ret);
}
{
gboolean result;
WIN32_FILE_ATTRIBUTE_DATA data;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
memset (stat, 0, sizeof (MonoIOStat));
}
+ MONO_FINISH_BLOCKING
return result;
}
{
HANDLE ret;
int attributes, attrs;
- gunichar2 *chars = mono_string_chars (filename);
-
+ gunichar2 *chars;
+ MONO_PREPARE_BLOCKING
+
+ chars = mono_string_chars (filename);
*error=ERROR_SUCCESS;
if (options != 0){
*error=GetLastError ();
}
+ MONO_FINISH_BLOCKING
return(ret);
}
ves_icall_System_IO_MonoIO_Close (HANDLE handle, gint32 *error)
{
gboolean ret;
-
+ MONO_PREPARE_BLOCKING
+
*error=ERROR_SUCCESS;
ret=CloseHandle (handle);
*error=GetLastError ();
}
+ MONO_FINISH_BLOCKING
return(ret);
}
}
buffer = mono_array_addr (dest, guchar, dest_offset);
+
+ MONO_PREPARE_BLOCKING
result = ReadFile (handle, buffer, count, &n, NULL);
+ MONO_FINISH_BLOCKING
if (!result) {
*error=GetLastError ();
}
buffer = mono_array_addr (src, guchar, src_offset);
+ MONO_PREPARE_BLOCKING
result = WriteFile (handle, buffer, count, &n, NULL);
+ MONO_FINISH_BLOCKING
if (!result) {
*error=GetLastError ();
gint32 *error)
{
gint32 offset_hi;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
if(offset==INVALID_SET_FILE_POINTER) {
*error=GetLastError ();
}
-
+
+ MONO_FINISH_BLOCKING
return offset | ((gint64)offset_hi << 32);
}
ves_icall_System_IO_MonoIO_Flush (HANDLE handle, gint32 *error)
{
gboolean ret;
-
+ MONO_PREPARE_BLOCKING
+
*error=ERROR_SUCCESS;
ret=FlushFileBuffers (handle);
*error=GetLastError ();
}
+ MONO_FINISH_BLOCKING
return(ret);
}
{
gint64 length;
guint32 length_hi;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
*error=GetLastError ();
}
+ MONO_FINISH_BLOCKING
return length | ((gint64)length_hi << 32);
}
+/* FIXME make gc suspendable */
MonoBoolean
ves_icall_System_IO_MonoIO_SetLength (HANDLE handle, gint64 length,
gint32 *error)
const FILETIME *creation_filetime;
const FILETIME *last_access_filetime;
const FILETIME *last_write_filetime;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
if(ret==FALSE) {
*error=GetLastError ();
}
-
+
+ MONO_FINISH_BLOCKING
return(ret);
}
attr.nLength=sizeof(SECURITY_ATTRIBUTES);
attr.bInheritHandle=TRUE;
attr.lpSecurityDescriptor=NULL;
-
+
+ MONO_PREPARE_BLOCKING
ret=CreatePipe (read_handle, write_handle, &attr, 0);
+ MONO_FINISH_BLOCKING
+
if(ret==FALSE) {
/* FIXME: throw an exception? */
return(FALSE);
/* This is only used on Windows */
gboolean ret;
+ MONO_PREPARE_BLOCKING
ret=DuplicateHandle (source_process_handle, source_handle, target_process_handle, target_handle, access, inherit, options);
+ MONO_FINISH_BLOCKING
+
if(ret==FALSE) {
/* FIXME: throw an exception? */
return(FALSE);
gunichar2 *name;
int ret;
+ MONO_PREPARE_BLOCKING
name=g_new0 (gunichar2, 256);
ret=GetTempPath (256, name);
name=g_new0 (gunichar2, ret+2); /* include the terminator */
ret=GetTempPath (ret, name);
}
+ MONO_FINISH_BLOCKING
if(ret>0) {
#ifdef DEBUG
gint64 length, gint32 *error)
{
gboolean ret;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
if (ret == FALSE) {
*error = GetLastError ();
}
+
+ MONO_FINISH_BLOCKING
}
void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position,
gint64 length, gint32 *error)
{
gboolean ret;
+ MONO_PREPARE_BLOCKING
*error=ERROR_SUCCESS;
if (ret == FALSE) {
*error = GetLastError ();
}
+
+ MONO_FINISH_BLOCKING
}
//Support for io-layer free mmap'd files.
struct stat buf;
gint64 res;
char *path = mono_string_to_utf8 (string);
-
+
+ MONO_PREPARE_BLOCKING
if (stat (path, &buf) == -1)
res = -1;
else
res = (gint64)buf.st_size;
g_free (path);
+
+ MONO_FINISH_BLOCKING
return res;
}
mono_filesize_from_fd (int fd)
{
struct stat buf;
+ int res;
- if (fstat (fd, &buf) == -1)
+ MONO_PREPARE_BLOCKING
+ res = fstat (fd, &buf);
+ MONO_FINISH_BLOCKING
+
+ if (res == -1)
return (gint64)-1;
return (gint64)buf.st_size;
#include <config.h>
-#ifndef TARGET_WIN32
+#ifndef HOST_WIN32
#include <glib.h>
#include <string.h>
#include <config.h>
-#ifdef TARGET_WIN32
+#ifdef HOST_WIN32
#include <glib.h>
#include <string.h>
ICALL(ARRAY_13, "SetValueImpl", ves_icall_System_Array_SetValueImpl)
ICALL_TYPE(BUFFER, "System.Buffer", BUFFER_1)
-ICALL(BUFFER_1, "BlockCopyInternal", ves_icall_System_Buffer_BlockCopyInternal)
-ICALL(BUFFER_2, "ByteLengthInternal", ves_icall_System_Buffer_ByteLengthInternal)
-ICALL(BUFFER_3, "GetByteInternal", ves_icall_System_Buffer_GetByteInternal)
-ICALL(BUFFER_4, "SetByteInternal", ves_icall_System_Buffer_SetByteInternal)
+ICALL(BUFFER_1, "InternalBlockCopy", ves_icall_System_Buffer_BlockCopyInternal)
+ICALL(BUFFER_2, "_ByteLength", ves_icall_System_Buffer_ByteLengthInternal)
+ICALL(BUFFER_3, "_GetByte", ves_icall_System_Buffer_GetByteInternal)
+ICALL(BUFFER_4, "_SetByte", ves_icall_System_Buffer_SetByteInternal)
ICALL_TYPE (COMPO_W, "System.ComponentModel.Win32Exception", COMPO_W_1)
ICALL (COMPO_W_1, "W32ErrorMessage", ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage)
ICALL_TYPE(COMPINF, "System.Globalization.CompareInfo", COMPINF_1)
ICALL(COMPINF_1, "assign_sortkey(object,string,System.Globalization.CompareOptions)", ves_icall_System_Globalization_CompareInfo_assign_sortkey)
-ICALL(COMPINF_2, "construct_compareinfo(string)", ves_icall_System_Globalization_CompareInfo_construct_compareinfo)
-ICALL(COMPINF_3, "free_internal_collator()", ves_icall_System_Globalization_CompareInfo_free_internal_collator)
ICALL(COMPINF_4, "internal_compare(string,int,int,string,int,int,System.Globalization.CompareOptions)", ves_icall_System_Globalization_CompareInfo_internal_compare)
ICALL(COMPINF_5, "internal_index(string,int,int,char,System.Globalization.CompareOptions,bool)", ves_icall_System_Globalization_CompareInfo_internal_index_char)
ICALL(COMPINF_6, "internal_index(string,int,int,string,System.Globalization.CompareOptions,bool)", ves_icall_System_Globalization_CompareInfo_internal_index)
ICALL_TYPE(CULDATA, "System.Globalization.CultureData", CULDATA_1)
ICALL(CULDATA_1, "fill_culture_data", ves_icall_System_Globalization_CultureData_fill_culture_data)
+ICALL(CULDATA_2, "fill_number_data", ves_icall_System_Globalization_CultureData_fill_number_data)
ICALL_TYPE(CULINF, "System.Globalization.CultureInfo", CULINF_5)
ICALL(CULINF_5, "construct_internal_locale_from_lcid", ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_lcid)
ICALL(CULINF_6, "construct_internal_locale_from_name", ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_name)
-ICALL(CULINF_8, "construct_number_format", ves_icall_System_Globalization_CultureInfo_construct_number_format)
ICALL(CULINF_7, "get_current_locale_name", ves_icall_System_Globalization_CultureInfo_get_current_locale_name)
ICALL(CULINF_9, "internal_get_cultures", ves_icall_System_Globalization_CultureInfo_internal_get_cultures)
//ICALL(CULINF_10, "internal_is_lcid_neutral", ves_icall_System_Globalization_CultureInfo_internal_is_lcid_neutral)
ICALL(MAC_IFACE_PROPS_1, "ParseRouteInfo_internal", ves_icall_System_Net_NetworkInformation_MacOsIPInterfaceProperties_ParseRouteInfo_internal)
#endif
+ICALL_TYPE(MSRWI, "System.Net.Sockets.MonoSocketRuntimeWorkItem", MSRWI_1)
+ICALL(MSRWI_1, "ExecuteWorkItem", ves_icall_System_Net_Sockets_MonoSocketRuntimeWorkItem_ExecuteWorkItem)
+
ICALL_TYPE(SOCK, "System.Net.Sockets.Socket", SOCK_1)
ICALL(SOCK_1, "Accept_internal(intptr,int&,bool)", ves_icall_System_Net_Sockets_Socket_Accept_internal)
ICALL(SOCK_2, "Available_internal(intptr,int&)", ves_icall_System_Net_Sockets_Socket_Available_internal)
ICALL (SOCK_6a, "Disconnect_internal(intptr,bool,int&)", ves_icall_System_Net_Sockets_Socket_Disconnect_internal)
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)
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)
+ICALL(SOCK_21, "IOControl_internal(intptr,int,byte[],byte[],int&)", ves_icall_System_Net_Sockets_Socket_IOControl_internal)
ICALL(SOCK_9, "Listen_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_Listen_internal)
ICALL(SOCK_10, "LocalEndPoint_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal)
ICALL(SOCK_11, "Poll_internal", ves_icall_System_Net_Sockets_Socket_Poll_internal)
+ICALL(SOCK_13, "ReceiveFrom_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)", ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal)
ICALL(SOCK_11a, "Receive_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Receive_array_internal)
ICALL(SOCK_12, "Receive_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Receive_internal)
-ICALL(SOCK_13, "RecvFrom_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)", ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
ICALL(SOCK_14, "RemoteEndPoint_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal)
ICALL(SOCK_15, "Select_internal(System.Net.Sockets.Socket[]&,int,int&)", ves_icall_System_Net_Sockets_Socket_Select_internal)
-ICALL(SOCK_15a, "SendFile(intptr,string,byte[],byte[],System.Net.Sockets.TransmitFileOptions)", ves_icall_System_Net_Sockets_Socket_SendFile)
+ICALL(SOCK_15a, "SendFile_internal(intptr,string,byte[],byte[],System.Net.Sockets.TransmitFileOptions)", ves_icall_System_Net_Sockets_Socket_SendFile_internal)
ICALL(SOCK_16, "SendTo_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress,int&)", ves_icall_System_Net_Sockets_Socket_SendTo_internal)
ICALL(SOCK_16a, "Send_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_array_internal)
ICALL(SOCK_17, "Send_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_internal)
ICALL(SOCK_18, "SetSocketOption_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object,byte[],int,int&)", ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal)
ICALL(SOCK_19, "Shutdown_internal(intptr,System.Net.Sockets.SocketShutdown,int&)", ves_icall_System_Net_Sockets_Socket_Shutdown_internal)
ICALL(SOCK_20, "Socket_internal(System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType,System.Net.Sockets.ProtocolType,int&)", ves_icall_System_Net_Sockets_Socket_Socket_internal)
-ICALL(SOCK_21, "WSAIoctl(intptr,int,byte[],byte[],int&)", ves_icall_System_Net_Sockets_Socket_WSAIoctl)
ICALL(SOCK_21a, "cancel_blocking_socket_operation", icall_cancel_blocking_socket_operation)
ICALL(SOCK_22, "socket_pool_queue", icall_append_io_job)
ICALL(RT_2, "GetConstructors_internal", ves_icall_Type_GetConstructors_internal)
ICALL(RT_3, "GetEvents_internal", ves_icall_Type_GetEvents_internal)
ICALL(RT_5, "GetFields_internal", ves_icall_Type_GetFields_internal)
-ICALL(RT_6, "GetGenericArguments", ves_icall_MonoType_GetGenericArguments)
+ICALL(RT_6, "GetGenericArgumentsInternal", ves_icall_MonoType_GetGenericArguments)
ICALL(RT_7, "GetGenericParameterAttributes", ves_icall_Type_GetGenericParameterAttributes)
ICALL(RT_8, "GetGenericParameterConstraints_impl", ves_icall_Type_GetGenericParameterConstraints)
ICALL(RT_9, "GetGenericParameterPosition", ves_icall_Type_GetGenericParameterPosition)
ICALL(MTHREADP_7, "NotifyWorkItemComplete", ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete)
ICALL(MTHREADP_8, "NotifyWorkItemProgressNative", ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemProgressNative)
ICALL(MTHREADP_9, "PostQueuedCompletionStatus", ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus)
-ICALL(MTHREADP_10, "RegisterWaitForSingleObjectNative", ves_icall_System_Threading_Microsoft_ThreadPool_RegisterWaitForSingleObjectNative)
ICALL(MTHREADP_11, "ReportThreadStatus", ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus)
ICALL(MTHREADP_12, "RequestWorkerThread", ves_icall_System_Threading_Microsoft_ThreadPool_RequestWorkerThread)
ICALL(MTHREADP_13, "SetMaxThreadsNative", ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative)
#include <mono/metadata/threads.h>
#include <mono/metadata/threads-types.h>
#include <mono/metadata/threadpool.h>
-#include <mono/metadata/threadpool-microsoft.h>
+#include <mono/metadata/threadpool-ms.h>
+#include <mono/metadata/threadpool-ms-io.h>
#include <mono/metadata/monitor.h>
#include <mono/metadata/reflection.h>
#include <mono/metadata/assembly.h>
return class->rank;
}
+static MonoArray*
+create_type_array (MonoDomain *domain, MonoBoolean runtimeTypeArray, int count)
+{
+ MonoArray *res;
+ res = mono_array_new (domain, runtimeTypeArray ? mono_defaults.runtimetype_class : mono_defaults.systemtype_class, count);
+ return res;
+}
+
ICALL_EXPORT MonoArray*
-ves_icall_MonoType_GetGenericArguments (MonoReflectionType *type)
+ves_icall_MonoType_GetGenericArguments (MonoReflectionType *type, MonoBoolean runtimeTypeArray)
{
MonoArray *res;
MonoClass *klass, *pklass;
MonoDomain *domain = mono_object_domain (type);
- MonoVTable *array_vtable = mono_class_vtable_full (domain, mono_array_class_get_cached (mono_defaults.systemtype_class, 1), TRUE);
int i;
klass = mono_class_from_mono_type (type->type);
if (klass->generic_container) {
MonoGenericContainer *container = klass->generic_container;
- res = mono_array_new_specific (array_vtable, container->type_argc);
+ res = create_type_array (domain, runtimeTypeArray, container->type_argc);
for (i = 0; i < container->type_argc; ++i) {
pklass = mono_class_from_generic_parameter (mono_generic_container_get_param (container, i), klass->image, FALSE);
mono_array_setref (res, i, mono_type_get_object (domain, &pklass->byval_arg));
}
} else if (klass->generic_class) {
MonoGenericInst *inst = klass->generic_class->context.class_inst;
- res = mono_array_new_specific (array_vtable, inst->type_argc);
+ res = create_type_array (domain, runtimeTypeArray, inst->type_argc);
for (i = 0; i < inst->type_argc; ++i)
mono_array_setref (res, i, mono_type_get_object (domain, inst->type_argv [i]));
} else {
- res = mono_array_new_specific (array_vtable, 0);
+ res = NULL;
}
return res;
}
MonoTypedRef res;
MonoReflectionField *f;
MonoClass *klass;
- MonoType *ftype;
- guint8 *p;
+ MonoType *ftype = NULL;
+ guint8 *p = NULL;
int i;
memset (&res, 0, sizeof (res));
}
ICALL_EXPORT int
-ves_icall_System_StackFrame_GetILOffsetFromFile (MonoString *path, int methodToken, int nativeOffset)
+ves_icall_System_StackFrame_GetILOffsetFromFile (MonoString *path, guint32 method_token, guint32 method_index, int native_offset)
{
guint32 il_offset;
char *path_str = mono_string_to_utf8 (path);
- if (!seq_point_data_get_il_offset (path_str, methodToken, nativeOffset, &il_offset))
+ if (!seq_point_data_get_il_offset (path_str, method_token, method_index, native_offset, &il_offset))
il_offset = -1;
g_free (path_str);
}
free_hash (image->native_wrapper_cache);
+ free_hash (image->native_wrapper_aot_cache);
+ free_hash (image->native_wrapper_check_cache);
+ free_hash (image->native_wrapper_aot_check_cache);
free_hash (image->native_func_wrapper_cache);
free_hash (image->managed_wrapper_cache);
free_hash (image->delegate_begin_invoke_cache);
free_hash (image->var_cache_slow);
free_hash (image->mvar_cache_slow);
free_hash (image->wrapper_param_names);
- free_hash (image->native_wrapper_aot_cache);
free_hash (image->pinvoke_scopes);
free_hash (image->pinvoke_scope_filenames);
for (i = 0; i < image->gshared_types_len; ++i)
void
mono_loader_lock (void)
{
+ MONO_PREPARE_BLOCKING
mono_locks_acquire (&loader_mutex, LoaderLock);
+ MONO_FINISH_BLOCKING
+
if (G_UNLIKELY (loader_lock_track_ownership)) {
mono_native_tls_set_value (loader_lock_nest_id, GUINT_TO_POINTER (GPOINTER_TO_UINT (mono_native_tls_get_value (loader_lock_nest_id)) + 1));
}
}
void
-ves_icall_System_Globalization_CultureInfo_construct_number_format (MonoCultureInfo *this)
+ves_icall_System_Globalization_CultureData_fill_number_data (MonoNumberFormatInfo* number, gint32 number_index)
{
MonoDomain *domain;
- MonoNumberFormatInfo *number;
const NumberFormatEntry *nfe;
- g_assert (this->number_format != 0);
- if (this->number_index < 0)
- return;
+ g_assert (number_index != 0);
- number = this->number_format;
- nfe = &number_format_entries [this->number_index];
+ nfe = &number_format_entries [number_index];
domain = mono_domain_get ();
- number->readOnly = this->is_read_only;
number->currencyDecimalDigits = nfe->currency_decimal_digits;
MONO_OBJECT_SETREF (number, currencyDecimalSeparator, mono_string_new (domain,
idx2string (nfe->currency_decimal_separator)));
MONO_OBJECT_SETREF (number, numberGroupSizes, create_group_sizes_array (nfe->number_group_sizes,
GROUP_SIZE));
number->numberNegativePattern = nfe->number_negative_pattern;
- number->percentDecimalDigits = nfe->percent_decimal_digits;
- MONO_OBJECT_SETREF (number, percentDecimalSeparator, mono_string_new (domain,
- idx2string (nfe->percent_decimal_separator)));
- MONO_OBJECT_SETREF (number, percentGroupSeparator, mono_string_new (domain,
- idx2string (nfe->percent_group_separator)));
- MONO_OBJECT_SETREF (number, percentGroupSizes, create_group_sizes_array (nfe->percent_group_sizes,
- GROUP_SIZE));
number->percentNegativePattern = nfe->percent_negative_pattern;
number->percentPositivePattern = nfe->percent_positive_pattern;
MONO_OBJECT_SETREF (number, percentSymbol, mono_string_new (domain, idx2string (nfe->percent_symbol)));
return ret;
}
-void ves_icall_System_Globalization_CompareInfo_construct_compareinfo (MonoCompareInfo *comp, MonoString *locale)
-{
- /* Nothing to do here */
-}
-
int ves_icall_System_Globalization_CompareInfo_internal_compare (MonoCompareInfo *this, MonoString *str1, gint32 off1, gint32 len1, MonoString *str2, gint32 off2, gint32 len2, gint32 options)
{
/* Do a normal ascii string compare, as we only know the
options));
}
-void ves_icall_System_Globalization_CompareInfo_free_internal_collator (MonoCompareInfo *this)
-{
- /* Nothing to do here */
-}
-
void ves_icall_System_Globalization_CompareInfo_assign_sortkey (MonoCompareInfo *this, MonoSortKey *key, MonoString *source, gint32 options)
{
MonoArray *arr;
extern MonoBoolean ves_icall_System_Globalization_CalendarData_fill_calendar_data (MonoCalendarData *this_obj, MonoString *name, gint32 calendar_index);
extern void ves_icall_System_Globalization_CultureData_fill_culture_data (MonoCultureData *this_obj, gint32 datetime_index);
+extern void ves_icall_System_Globalization_CultureData_fill_number_data (MonoNumberFormatInfo* number, gint32 number_index);
extern void ves_icall_System_Globalization_CultureInfo_construct_internal_locale (MonoCultureInfo *this_obj, MonoString *locale);
extern MonoString* ves_icall_System_Globalization_CultureInfo_get_current_locale_name (void);
extern MonoBoolean ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_lcid (MonoCultureInfo *this_obj, gint lcid);
extern MonoBoolean ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_name (MonoCultureInfo *this_obj, MonoString *name);
extern MonoArray *ves_icall_System_Globalization_CultureInfo_internal_get_cultures (MonoBoolean neutral, MonoBoolean specific, MonoBoolean installed);
-extern void ves_icall_System_Globalization_CultureInfo_construct_number_format (MonoCultureInfo *this_obj);
extern void ves_icall_System_Globalization_CompareInfo_construct_compareinfo (MonoCompareInfo *comp, MonoString *locale);
extern int ves_icall_System_Globalization_CompareInfo_internal_compare (MonoCompareInfo *this_obj, MonoString *str1, gint32 off1, gint32 len1, MonoString *str2, gint32 off2, gint32 len2, gint32 options);
extern void ves_icall_System_Globalization_CompareInfo_free_internal_collator (MonoCompareInfo *this_obj);
+++ /dev/null
-#!/usr/bin/perl -w
-# Copyright (C) 2003 Ximian, Inc.
-# Paolo Molaro (lupus@ximian.com)
-#
-# Create an header file to be included in the mono libraries to
-# bundle assemblies inside the runtime.
-# The template file contains a list of assemblies, one per line,
-# with the name followed by a ':' and the filename.
-# Lines starting with '#' and empty lines are ignored.
-# See sample-bundle for an example.
-# We need to use an assembly file because gcc can't handle large arrays:-(
-
-if ($#ARGV != 2) {
- die "Usage: make-bundle.pl template headerfile.h asm-file\n";
-}
-
-my $template = $ARGV [0];
-my $header = $ARGV [1];
-my $output = $ARGV [2];
-my %assemblies = ();
-
-my $line = 0;
-open (T, $template) || die "Cannot open bundle template: $!\n";
-while (<T>) {
- ++$line;
- next if (/^\s*#/);
- next if (/^\s*$/);
- if (/^([a-zA-Z0-9-.]+):\s*(.+?)\s*$/) {
- my ($name, $filename) = ($1, $2);
- if (exists $assemblies {$name}) {
- die "Assembly $name defined multiple times.\n";
- } else {
- $assemblies {$name} = $filename;
- }
- } else {
- die "Unknown format at line $line: $_";
- }
-}
-close (T);
-
-open (O, ">$output.tmp") || die "Cannot open $output: $!\n";
-open (H, ">$header.tmp") || die "Cannot open $output: $!\n";
-print H <<"EOF";
-/* File generated by make-bundle: do not edit! */
-
-#ifndef __MONO_BUNDLE_H__
-#define __MONO_BUNDLE_H__
-
-typedef struct {
- const char *name;
- const unsigned char *data;
- const unsigned int size;
-} MonoBundledAssembly;
-
-EOF
-
-my $bundle_entries = "";
-
-foreach my $name (sort keys %assemblies) {
- my $file = $assemblies {$name};
- my ($nread, $buf, $i, $cname, $need_eol, $size);
- $cname = $name;
- $cname =~ s/[-.]/_/g;
- open (F, $file) || die "Cannot open $file: $!\n";
- $size = -s F;
-# print O "/* assembly $name from $file */\n";
-# print O "static const unsigned char assembly_data_$cname [] = {\n";
- print O ".globl assembly_data_$cname\n";
- print O "\t.section .rodata\n";
- print O "\t.align 32\n";
- print O "\t.type assembly_data_$cname, \@object\n";
- print O "\t.size assembly_data_$cname, $size\n";
- print O "assembly_data_$cname:\n";
- print H "extern const unsigned char assembly_data_$cname [];\n";
- print H "static const MonoBundledAssembly assembly_bundle_$cname = {\"$name\", assembly_data_$cname, $size};\n";
- $bundle_entries .= "\t&assembly_bundle_$cname,\n";
- $need_eol = 0;
- print "Adding assembly '$name' from $file...\n";
- while (($n = sysread (F, $buf, 32))) {
- for ($i = 0; $i < $n; ++$i) {
- print O "\t.byte ", ord (substr ($buf, $i, 1)), "\n";
- }
-# print O ",\n" if ($need_eol);
-# $need_eol = 1;
-# print O "\t";
-# for ($i = 0; $i < $n; ++$i) {
-# print O ", " if $i > 0;
-# print O ord (substr ($buf, $i, 1));
-# }
- }
-# print O "\n};\n\n";
- close (F);
-}
-
-print H "\nstatic const MonoBundledAssembly* bundled_assemblies [] = {\n";
-print H $bundle_entries;
-print H "\tNULL\n";
-print H "};\n\n";
-print H "#endif /* __MONO_BUNDLE_H__ */\n";
-close (O);
-close (H);
-rename ("$header.tmp", $header);
-rename ("$output.tmp", $output);
-
#include "mono/utils/mono-tls.h"
#include "mono/utils/mono-memory-model.h"
#include "mono/utils/atomic.h"
+#include <mono/utils/mono-threads.h>
+
#include <string.h>
#include <errno.h>
mono_cominterop_init ();
mono_remoting_init ();
+
+#ifdef USE_COOP_GC
+ register_icall (mono_threads_prepare_blocking, "mono_threads_prepare_blocking", "int", FALSE);
+ register_icall (mono_threads_finish_blocking, "mono_threads_finish_blocking", "void int", FALSE);
+ register_icall (mono_threads_reset_blocking_start, "mono_threads_reset_blocking_start","int", FALSE);
+ register_icall (mono_threads_reset_blocking_end, "mono_threads_reset_blocking_end","void int", FALSE);
+#endif
}
}
}
static MonoStringBuilder *
-mono_string_builder_new (void)
+mono_string_builder_new (int starting_string_length)
{
static MonoClass *string_builder_class;
static MonoMethod *sb_ctor;
static void *args [1];
- static int initial_len;
+ int initial_len = starting_string_length;
- if (!string_builder_class) {
+ if (initial_len < 0)
+ initial_len = 0;
+
+ if (!sb_ctor) {
MonoMethodDesc *desc;
+ MonoMethod *m;
string_builder_class = mono_class_from_name (mono_defaults.corlib, "System.Text", "StringBuilder");
g_assert (string_builder_class);
desc = mono_method_desc_new (":.ctor(int)", FALSE);
- sb_ctor = mono_method_desc_search_in_class (desc, string_builder_class);
- g_assert (sb_ctor);
+ m = mono_method_desc_search_in_class (desc, string_builder_class);
+ g_assert (m);
mono_method_desc_free (desc);
-
- // We make a new array in the _to_builder function, so this
- // array will always be garbage collected.
- initial_len = 1;
- args [0] = &initial_len;
+ mono_memory_barrier ();
+ sb_ctor = m;
}
+ // We make a new array in the _to_builder function, so this
+ // array will always be garbage collected.
+ args [0] = &initial_len;
+
MonoStringBuilder *sb = (MonoStringBuilder*)mono_object_new (mono_domain_get (), string_builder_class);
MonoObject *exc;
g_assert (sb);
mono_runtime_invoke (sb_ctor, sb, args, &exc);
-
- g_assert (sb->chunkChars->max_length == initial_len);
g_assert (!exc);
+ g_assert (sb->chunkChars->max_length >= initial_len);
+
return sb;
}
static void
-mono_string_utf16_to_builder_copy (MonoStringBuilder *sb, gunichar2 *text, size_t len)
+mono_string_utf16_to_builder_copy (MonoStringBuilder *sb, gunichar2 *text, size_t string_len)
{
- MonoClass *ac = mono_array_class_get (mono_defaults.char_class, 1);
- g_assert (ac);
-
- MonoArray* newArray = mono_array_new (mono_domain_get (), mono_defaults.char_class, len);
-
- gunichar2 *charDst = (gunichar2 *)newArray->vector;
+ gunichar2 *charDst = (gunichar2 *)sb->chunkChars->vector;
gunichar2 *charSrc = (gunichar2 *)text;
- memcpy (charDst, charSrc, sizeof (gunichar2) * len);
+ memcpy (charDst, charSrc, sizeof (gunichar2) * string_len);
- MONO_OBJECT_SETREF (sb, chunkChars, newArray);
- sb->chunkOffset = 0;
- sb->chunkLength = len;
+ sb->chunkLength = string_len;
return;
}
if (!text)
return NULL;
- MonoStringBuilder *sb = mono_string_builder_new ();
+ int len;
+ for (len = 0; text [len] != 0; ++len);
+
+ MonoStringBuilder *sb = mono_string_builder_new (len);
mono_string_utf16_to_builder (sb, text);
return sb;
void
mono_string_utf8_to_builder (MonoStringBuilder *sb, char *text)
{
-
if (!sb || !text)
return;
int len = strlen (text);
+ if (len > mono_string_builder_capacity (sb))
+ len = mono_string_builder_capacity (sb);
+
GError *error = NULL;
- gunichar2* ut = g_utf8_to_utf16 (text, len, NULL, NULL, &error);
+ glong copied;
+ gunichar2* ut = g_utf8_to_utf16 (text, len, NULL, &copied, &error);
if (!error) {
MONO_OBJECT_SETREF (sb, chunkPrevious, NULL);
- mono_string_utf16_to_builder_copy (sb, ut, len);
+ mono_string_utf16_to_builder_copy (sb, ut, copied);
} else
g_error_free (error);
if (!text)
return NULL;
- MonoStringBuilder *sb = mono_string_builder_new ();
+ int len = strlen (text);
+ MonoStringBuilder *sb = mono_string_builder_new (len);
mono_string_utf8_to_builder (sb, text);
return sb;
guint32 len;
for (len = 0; text [len] != 0; ++len);
+
+ if (len > mono_string_builder_capacity (sb))
+ len = mono_string_builder_capacity (sb);
mono_string_utf16_to_builder_copy (sb, text, len);
}
mono_raise_exception (mono_get_exception_execution_engine ("Failed to convert StringBuilder from utf16 to utf8"));
return NULL;
} else {
- guint len = mono_string_builder_length (sb) + 1;
+ guint len = mono_string_builder_capacity (sb) + 1;
gchar *res = mono_marshal_alloc (len * sizeof (gchar));
g_assert (str_len < len);
memcpy (res, tmp, str_len * sizeof (gchar));
g_assert (sb->chunkChars);
- guint len = mono_string_builder_length (sb);
+ guint len = mono_string_builder_capacity (sb);
if (len == 0)
len = 1;
int i, argnum, *tmp_locals;
int type, param_shift = 0;
static MonoMethodSignature *get_last_error_sig = NULL;
+#ifdef USE_COOP_GC
+ int coop_gc_var;
+#endif
memset (&m, 0, sizeof (m));
m.mb = mb;
mono_mb_add_local (mb, sig->ret);
}
+#ifdef USE_COOP_GC
+ /* local 4, the local to be used when calling the suspend funcs */
+ coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+#endif
+
if (mspecs [0] && mspecs [0]->native == MONO_NATIVE_CUSTOM) {
/* Return type custom marshaling */
/*
emit_marshal (&m, i + param_shift, sig->params [i], mspecs [i + 1], tmp_locals [i], NULL, MARSHAL_ACTION_PUSH);
}
+#ifdef USE_COOP_GC
+ mono_mb_emit_icall (mb, mono_threads_prepare_blocking);
+ mono_mb_emit_stloc (mb, coop_gc_var);
+#endif
+
/* call the native method */
if (func_param) {
mono_mb_emit_byte (mb, CEE_LDARG_0);
#endif
}
+#ifdef USE_COOP_GC
+ mono_mb_emit_ldloc (mb, coop_gc_var);
+ mono_mb_emit_icall (mb, mono_threads_finish_blocking);
+#endif
+
/* convert the result */
if (!sig->ret->byref) {
MonoMarshalSpec *spec = mspecs [0];
g_assert (method != NULL);
g_assert (mono_method_signature (method)->pinvoke);
- if (aot)
- cache = get_cache (&method->klass->image->native_wrapper_aot_cache, mono_aligned_addr_hash, NULL);
- else
- cache = get_cache (&method->klass->image->native_wrapper_cache, mono_aligned_addr_hash, NULL);
+ if (aot) {
+ if (check_exceptions)
+ cache = get_cache (&method->klass->image->native_wrapper_aot_check_cache, mono_aligned_addr_hash, NULL);
+ else
+ cache = get_cache (&method->klass->image->native_wrapper_aot_cache, mono_aligned_addr_hash, NULL);
+ } else {
+ if (check_exceptions)
+ cache = get_cache (&method->klass->image->native_wrapper_check_cache, mono_aligned_addr_hash, NULL);
+ else
+ cache = get_cache (&method->klass->image->native_wrapper_cache, mono_aligned_addr_hash, NULL);
+ }
if ((res = mono_marshal_find_in_cache (cache, method)))
return res;
MonoMethodSignature *sig, *csig;
int i, *tmp_locals;
gboolean closed = FALSE;
+#ifdef USE_COOP_GC
+ int coop_gc_var;
+#endif
sig = m->sig;
csig = m->csig;
/* allocate local 3 to store the return value */
mono_mb_add_local (mb, sig->ret);
}
+#ifdef USE_COOP_GC
+ /* local 4, the local to be used when calling the reset_blocking funcs */
+ /* tons of code hardcode 3 to be the return var */
+ coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int32_class->byval_arg);
+#endif
mono_mb_emit_icon (mb, 0);
mono_mb_emit_stloc (mb, 2);
mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
mono_mb_emit_byte (mb, CEE_MONO_JIT_ATTACH);
+#ifdef USE_COOP_GC
+ /* XXX can we merge reset_blocking_start with JIT_ATTACH above and save one call? */
+ mono_mb_emit_icall (mb, mono_threads_reset_blocking_start);
+ mono_mb_emit_stloc (mb, coop_gc_var);
+#endif
+
/* we first do all conversions */
tmp_locals = alloca (sizeof (int) * sig->param_count);
for (i = 0; i < sig->param_count; i ++) {
}
}
+#ifdef USE_COOP_GC
+ /* XXX merge reset_blocking_end with detach */
+ mono_mb_emit_ldloc (mb, coop_gc_var);
+ mono_mb_emit_icall (mb, mono_threads_reset_blocking_end);
+#endif
+
mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
mono_mb_emit_byte (mb, CEE_MONO_JIT_DETACH);
GHashTable *managed_wrapper_cache;
GHashTable *native_wrapper_cache;
GHashTable *native_wrapper_aot_cache;
+ GHashTable *native_wrapper_check_cache;
+ GHashTable *native_wrapper_aot_check_cache;
GHashTable *native_func_wrapper_aot_cache;
GHashTable *remoting_invoke_cache;
GHashTable *synchronized_cache;
* We pass TRUE instead of allow_interruption since we have to check for the
* StopRequested case below.
*/
+ MONO_PREPARE_BLOCKING
ret = WaitForSingleObjectEx (mon->entry_sem, waitms, TRUE);
+ MONO_FINISH_BLOCKING
mono_thread_clr_state (thread, ThreadState_WaitSleepJoin);
* is private to this thread. Therefore even if the event was
* signalled before we wait, we still succeed.
*/
+ MONO_PREPARE_BLOCKING
ret = WaitForSingleObjectEx (event, ms, TRUE);
+ MONO_FINISH_BLOCKING
/* Reset the thread state fairly early, so we don't have to worry
* about the monitor error checking
unsigned char cval [8];
} mono_rdouble;
-#if NO_UNALIGNED_ACCESS
+#if defined(__s390x__)
+
+#define read16(x) s390x_read16(*(guint16 *)(x))
+#define read32(x) s390x_read32(*(guint32 *)(x))
+#define read64(x) s390x_read64(*(guint64 *)(x))
+
+static __inline__ guint16
+s390x_read16(guint16 x)
+{
+ guint16 ret;
+
+ __asm__ (" lrvr %0,%1\n"
+ " sra %0,16\n"
+ : "=r" (ret) : "r" (x));
+
+ return(ret);
+}
+
+static __inline__ guint32
+s390x_read32(guint32 x)
+{
+ guint32 ret;
+
+ __asm__ (" lrvr %0,%1\n"
+ : "=r" (ret) : "r" (x));
+
+ return(ret);
+}
+
+static __inline__ guint64
+s390x_read64(guint64 x)
+{
+ guint64 ret;
+
+ __asm__ (" lrvgr %0,%1\n"
+ : "=r" (ret) : "r" (x));
+
+ return(ret);
+}
+
+#else
+
+# if NO_UNALIGNED_ACCESS
guint16 mono_read16 (const unsigned char *x);
guint32 mono_read32 (const unsigned char *x);
#define read32(x) (mono_read32 ((const unsigned char *)(x)))
#define read64(x) (mono_read64 ((const unsigned char *)(x)))
-#else
+# else
#define read16(x) GUINT16_FROM_LE (*((const guint16 *) (x)))
#define read32(x) GUINT32_FROM_LE (*((const guint32 *) (x)))
#define read64(x) GUINT64_FROM_LE (*((const guint64 *) (x)))
+# endif
+
#endif
#define readr4(x,dest) \
+++ /dev/null
-/*
- * monosn.c: Mono String Name Utility
- *
- * Author:
- * Paolo Molaro (lupus@ximian.com)
- *
- * Copyright 2002-2003 Ximian, Inc (http://www.ximian.com)
- * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
- *
- */
-#include <mono/metadata/class.h>
-#include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/tokentype.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/assembly.h>
-#include "mono/utils/mono-digest.h"
-/* trim headers */
-
-#include <string.h>
-#include <ctype.h>
-
-#define RSA1_MAGIC 0x32415351
-#define RSA2_MAGIC 0x32415352
-#define PRIVKEY_MAGIC 0x00000207
-#define PUBKEY_MAGIC 0x00008004
-
-typedef struct {
- guchar type, version;
- guint16 reserved1;
- guint32 algid;
-} MonoKeyHeader;
-
-typedef struct {
- MonoKeyHeader header;
- guint32 bitlen;
- guint32 exponent;
- guchar modulus [MONO_ZERO_LEN_ARRAY];
-} MonoRSAPubHeader;
-
-static void
-print_data (const char *data, int len)
-{
- int i;
- for (i = 0; i < len; ++i) {
- if (i && !(i % 32))
- printf ("\n");
- printf ("%02x", data [i] & 0xff);
- }
- printf ("\n");
-}
-
-static int
-show_token (const char *file, int is_assembly, int show_pubkey) {
- char token [20];
- if (!is_assembly) {
- char *pubkey;
- gsize len;
- if (!g_file_get_contents (file, &pubkey, &len, NULL)) {
- printf ("Cannot load file: %s\n", file);
- return 2;
- }
- mono_digest_get_public_token (token, pubkey, len);
- if (show_pubkey) {
- printf ("Public key is\n");
- print_data (pubkey, len);
- }
- g_free (pubkey);
- } else {
- MonoImage *image;
- const char *pubkey;
- guint32 len;
-
- mono_metadata_init ();
- mono_images_init ();
- mono_assemblies_init ();
- mono_loader_init ();
-
- image = mono_image_open (file, NULL);
- if (!image) {
- printf ("Cannot open image file: %s\n", file);
- return 2;
- }
- pubkey = mono_image_get_public_key (image, &len);
- if (!pubkey) {
- printf ("%s does not represent a strongly named assembly\n", mono_image_get_name(image));
- mono_image_close (image);
- return 2;
- }
- if (show_pubkey) {
- printf ("Public key is\n");
- print_data (pubkey, len);
- }
- mono_digest_get_public_token (token, pubkey, len);
- mono_image_close (image);
- }
- printf ("Public key token is ");
- print_data (token, 8);
- return 0;
-}
-
-static int
-extract_data_to_file (int pubk, const char *assembly, const char *outfile) {
- MonoImage *image;
- FILE *file;
- const char *pubkey;
- guint32 len;
-
- image = mono_image_open (assembly, NULL);
- if (!image) {
- printf ("Cannot open image file: %s\n", assembly);
- return 2;
- }
- if (pubk)
- pubkey = mono_image_get_public_key (image, &len);
- else
- pubkey = mono_image_get_strong_name (image, &len);
- if (!pubkey) {
- printf ("%s does not represent a strongly named assembly\n", mono_image_get_name(image));
- mono_image_close (image);
- return 2;
- }
- if (!(file = fopen (outfile, "wb"))) {
- printf ("Cannot open output file: %s\n", outfile);
- return 2;
- }
- fwrite (pubkey, len, 1, file);
- fclose (file);
- mono_image_close (image);
- return 0;
-}
-
-const static guint8 asciitable [128] = {
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f,
- 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
- 0x3a, 0x3b, 0x3c, 0x3d, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
- 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
- 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
- 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
- 0x19, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
- 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24,
- 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
- 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- 0x31, 0x32, 0x33, 0xff, 0xff, 0xff,
- 0xff, 0xff
-};
-
-/* data is changed in place */
-static char*
-pem_decode (guchar *data, int len, int *rlen) {
- guchar *p, *s;
- int b64len, i, rem = 0, full;
- int b0, b1, b2, b3, offset, dlen;
-
- p = strstr (data, "-----BEGIN");
- s = strstr (data, "\n-----END");
- if (!p || !s)
- return NULL;
- while (*p != '\n') p++;
- *s = 0;
- s = data = p;
- while (*p) {
- if (isalnum (*p) || *p == '+' || *p == '=' || *p == '/') {
- *s++ = *p++;
- } else {
- p++;
- }
- }
- *s = 0;
- b64len = s - data;
-
- full = b64len >> 2;
- if (data [b64len - 1] == '=') {
- full--;
- rem++;
- }
- if (data [b64len - 2] == '=')
- rem++;
- offset = 0;
- p = data;
- for (i = 0; i < full; ++i) {
- b0 = asciitable [data [offset++]];
- b1 = asciitable [data [offset++]];
- b2 = asciitable [data [offset++]];
- b3 = asciitable [data [offset++]];
-
- *p++ = (b0 << 2) | (b1 >> 4);
- *p++ = (b1 << 4) | (b2 >> 2);
- *p++ = (b2 << 6) | b3;
- }
- dlen = full * 3;
- switch (rem) {
- case 1:
- b0 = asciitable [data [offset++]];
- b1 = asciitable [data [offset++]];
- b2 = asciitable [data [offset++]];
-
- *p++ = (b0 << 2) | (b1 >> 4);
- *p++ = (b1 << 4) | (b2 >> 2);
- dlen += 2;
- break;
- case 2:
- b0 = asciitable [data [offset++]];
- b1 = asciitable [data [offset++]];
-
- *p++ = (b0 << 2) | (b1 >> 4);
- dlen++;
- break;
- }
- *rlen = dlen;
- return data;
-}
-
-enum {
- DER_INTEGER = 2,
- DER_BITSTRING = 3,
- DER_NULL = 5,
- DER_OBJID = 6,
- DER_SEQUENCE = 16,
- DER_INVALID = -1,
- DER_END = -2
-};
-
-static int
-der_get_next (guchar *data, int dlen, int offset, int *len, guchar **rdata)
-{
- int i, l, type, val;
-
- if (offset + 1 >= dlen)
- return DER_END;
-
- type = data [offset++] & 0x1f;
- if (data [offset] == 0x80) /* not supported */
- return DER_INVALID;
- l = 0;
- if (data [offset] & 0x80) {
- val = data [offset++] & 0x7f;
- for (i = 0; i < val; ++i) {
- l = (l << 8) | data [offset++];
- }
- } else {
- l = data [offset++];
- }
- *len = l;
- *rdata = data + offset;
- return type;
-}
-
-static void
-dump_asn1 (guchar *key, int len) {
- int type, offset, elen;
- guchar *edata;
-
- offset = 0;
- while ((type = der_get_next (key, len, offset, &elen, &edata)) >= 0) {
- switch (type) {
- case DER_SEQUENCE:
- g_print ("seq (%d) at %d\n", elen, offset);
- dump_asn1 (edata, elen);
- offset = elen + edata - key;
- break;
- case DER_BITSTRING:
- g_print ("bits (%d) at %p + %d\n", elen, edata, offset);
- dump_asn1 (edata + 1, elen);
- offset = 1 + elen + edata - key;
- break;
- case DER_INTEGER:
- g_print ("int (%d) at %d\n", elen, offset);
- offset = elen + edata - key;
- break;
- case DER_NULL:
- g_print ("null (%d) at %d\n", elen, offset);
- offset = elen + edata - key;
- break;
- case DER_OBJID:
- g_print ("objid (%d) at %d\n", elen, offset);
- offset = elen + edata - key;
- break;
- default:
- return;
- }
- }
-}
-
-static guint32
-get_der_int (guchar *data, int len)
-{
- guint32 val = 0;
- int i;
- for (i = 0; i < len; ++i)
- val = (val << 8) | data [i];
- return val;
-}
-
-static void
-mem_reverse (guchar *p, int len) {
- int i, t;
-
- for (i = 0; i < len/2; ++i) {
- t = p [i];
- p [i] = p [len - i - 1];
- p [len - i - 1] = t;
- }
-}
-
-static int
-convert_der_key (guchar *key, int len, guchar **ret, int *retlen)
-{
- int type, offset, val, elen;
- guchar *r, *edata;
-
- offset = 0;
- type = der_get_next (key, len, offset, &elen, &edata);
- if (type != DER_SEQUENCE)
- return 1;
- key = edata;
- len = elen;
- type = der_get_next (key, len, offset, &elen, &edata);
- if (type == DER_INTEGER) {
- int i;
- guchar *ints [6];
- int lengths [6];
- guchar *p;
- /* a private RSA key */
- val = get_der_int (edata, elen);
- if (val != 0)
- return 2;
- offset = elen + edata - key;
- /* the modulus */
- type = der_get_next (key, len, offset, &elen, &edata);
- if (type != DER_INTEGER)
- return 2;
- offset = elen + edata - key;
- if ((elen & 1) && *edata == 0) {
- edata ++;
- elen--;
- }
- r = g_new0 (guchar, elen*4 + elen/2 + 20);
- r [0] = 0x7; r [1] = 0x2; r [5] = 0x24;
- r [8] = 0x52; r [9] = 0x53; r [10] = 0x41; r [11] = 0x32;
- *(guint32*)(r + 12) = elen * 8;
- memcpy (r + 20, edata, elen);
- mem_reverse (r + 20, elen);
- p = r + 20 + elen;
- /* the exponent */
- type = der_get_next (key, len, offset, &elen, &edata);
- if (type != DER_INTEGER)
- return 2;
- offset = elen + edata - key;
- val = get_der_int (edata, elen);
- *(guint32*)(r + 16) = val;
- for (i = 0; i < 6; i++) {
- type = der_get_next (key, len, offset, &elen, &edata);
- if (type != DER_INTEGER)
- return 2;
- offset = elen + edata - key;
- if ((elen & 1) && *edata == 0) {
- edata++;
- elen--;
- }
- ints [i] = edata;
- lengths [i] = elen;
- g_print ("len: %d\n", elen);
- }
- /* prime1 */
- g_print ("prime1 at %d (%d)\n", p-r, lengths [1]);
- memcpy (p, ints [1], lengths [1]);
- mem_reverse (p, lengths [1]);
- p += lengths [1];
- /* prime2 */
- g_print ("prime2 at %d (%d)\n", p-r, lengths [2]);
- memcpy (p, ints [2], lengths [2]);
- mem_reverse (p, lengths [2]);
- p += lengths [2];
- /* exponent1 */
- g_print ("exp1 at %d (%d)\n", p-r, lengths [3]);
- memcpy (p, ints [3], lengths [3]);
- mem_reverse (p, lengths [3]);
- p += lengths [3];
- /* exponent2 */
- g_print ("exp2 at %d (%d)\n", p-r, lengths [4]);
- memcpy (p, ints [4], lengths [4]);
- mem_reverse (p, lengths [4]);
- p += lengths [4];
- /* coeff */
- g_print ("coeff at %d (%d)\n", p-r, lengths [5]);
- memcpy (p, ints [5], lengths [5]);
- mem_reverse (p, lengths [5]);
- p += lengths [5];
- /* private exponent */
- g_print ("prive at %d (%d)\n", p-r, lengths [0]);
- memcpy (p, ints [0], lengths [0]);
- mem_reverse (p, lengths [0]);
- p += lengths [0];
- *ret = r;
- *retlen = p-r;
- return 0;
- }
- return 1;
-}
-
-static int
-convert_format (const char *from, const char *outfile) {
- guchar *key, *bindata, *keyout;
- gsize len;
- int binlen, ret, lenout;
- FILE *file;
-
- if (!g_file_get_contents (from, (gchar**) &key, &len, NULL)) {
- printf ("Cannot load file: %s\n", from);
- return 2;
- }
-
- if (*key == 0 || *key == 0x24) {
- g_free (key);
- printf ("Cannot convert to pem format yet\n");
- return 2;
- }
- bindata = pem_decode (key, len, &binlen);
- if (!(file = fopen (outfile, "wb"))) {
- g_free (key);
- printf ("Cannot open output file: %s\n", outfile);
- return 2;
- }
- dump_asn1 (bindata, binlen);
- ret = convert_der_key (bindata, binlen, &keyout, &lenout);
- if (!ret) {
- fwrite (keyout, lenout, 1, file);
- g_free (keyout);
- } else {
- printf ("Cannot convert key\n");
- }
- fclose (file);
- g_free (key);
- return ret;
-}
-
-static int
-get_digest (const char *from, const char *outfile)
-{
- guchar *ass;
- guchar digest [20];
- gsize len;
- guint32 snpos, snsize;
- FILE *file;
- MonoImage *image;
- MonoSHA1Context sha1;
-
- image = mono_image_open (from, NULL);
- if (!image) {
- printf ("Cannot open image file: %s\n", from);
- return 2;
- }
- snpos = mono_image_strong_name_position (image, &snsize);
- if (!snpos) {
- /*printf ("%s does not represent a strongly named assembly\n", from);
- mono_image_close (image);
- return 2;*/
- snsize = 0;
- }
-
- if (!g_file_get_contents (from, (gchar**) &ass, &len, NULL)) {
- printf ("Cannot load file: %s\n", from);
- mono_image_close (image);
- return 2;
- }
- /*
- * FIXME: we may need to set the STRONGNAMESIGNED flag in the cli header
- * before taking the sha1 digest of the image.
- */
- mono_sha1_init (&sha1);
- mono_sha1_update (&sha1, ass, snpos);
- mono_sha1_update (&sha1, ass + snpos + snsize, len - snsize - snpos);
- mono_sha1_final (&sha1, digest);
-
- mono_image_close (image);
- g_free (ass);
- if (!(file = fopen (outfile, "wb"))) {
- printf ("Cannot open output file: %s\n", outfile);
- return 2;
- }
- fwrite (digest, 20, 1, file);
- fclose (file);
- return 0;
-}
-
-static void
-help (int err) {
- printf ("monosn: Mono Strong Name Utility\nUsage: monosn option [arguments]\n");
- printf ("Available options:\n");
- printf ("\t-C keyin keyout Convert key file format from PEM to cryptoAPI (or the reverse).\n");
- printf ("\t-e assembly file Extract the public key from assembly to file.\n");
- printf ("\t-E assembly file Extract the strong name from assembly to file.\n");
- printf ("\t-r assembly file Extract the sha1 digest from assembly to file.\n");
- printf ("\t-t[p] file Display the public key token from file.\n");
- printf ("\t-T[p] assembly Display the public key token from assembly.\n");
- exit (err);
-}
-
-int
-main (int argc, char *argv[]) {
- int opt;
-
- if (argc < 2 || argv [1] [0] != '-')
- help (1);
-
- opt = argv [1] [1];
- switch (opt) {
- case 'C':
- if (argc != 4)
- help (1);
- return convert_format (argv [2], argv [3]);
- case 'e':
- if (argc != 4)
- help (1);
- return extract_data_to_file (1, argv [2], argv [3]);
- case 'E':
- if (argc != 4)
- help (1);
- return extract_data_to_file (0, argv [2], argv [3]);
- case 'h':
- case '?':
- help (0);
- return 0;
- case 'r':
- if (argc != 4)
- help (1);
- return get_digest (argv [2], argv [3]);
- case 't':
- if (argc != 3)
- help (1);
- return show_token (argv [2], 0, argv [1] [2] == 'p');
- case 'T':
- if (argc != 3)
- help (1);
- return show_token (argv [2], 1, argv [1] [2] == 'p');
- default:
- help (1);
- }
- return 0;
-}
-
return retval; \
}; }G_STMT_END
-#define mono_string_builder_length(sb) sb->chunkOffset + sb->chunkChars->max_length
+#define mono_string_builder_capacity(sb) sb->chunkOffset + sb->chunkChars->max_length
#define mono_string_builder_string_length(sb) sb->chunkOffset + sb->chunkLength
/*
MonoString *param_name;
} MonoArgumentException;
-typedef struct {
- MonoSystemException base;
- MonoString *msg;
- MonoString *type_name;
-} MonoTypeLoadException;
-
typedef struct {
MonoObject object;
MonoObject *async_state;
guint32 call_type;
} MonoMethodMessage;
+/* Keep in sync with the System.MonoAsyncCall */
+typedef struct {
+ MonoObject object;
+ MonoMethodMessage *msg;
+ MonoMethod *cb_method;
+ MonoDelegate *cb_target;
+ MonoObject *state;
+ MonoObject *res;
+ MonoArray *out_args;
+} MonoAsyncCall;
+
typedef struct {
MonoObject obj;
gint32 il_offset;
gint32 native_offset;
gint64 method_address;
+ gint32 method_index;
MonoReflectionMethod *method;
MonoString *filename;
gint32 line;
typedef struct
{
MonoObject obj;
- MonoBoolean readOnly;
- MonoString *decimalFormats;
- MonoString *currencyFormats;
- MonoString *percentFormats;
- MonoString *digitPattern;
- MonoString *zeroPattern;
- gint32 currencyDecimalDigits;
- MonoString *currencyDecimalSeparator;
- MonoString *currencyGroupSeparator;
+ MonoArray *numberGroupSizes;
MonoArray *currencyGroupSizes;
- gint32 currencyNegativePattern;
- gint32 currencyPositivePattern;
- MonoString *currencySymbol;
- MonoString *naNSymbol;
- MonoString *negativeInfinitySymbol;
+ MonoArray *percentGroupSizes;
+ MonoString *positiveSign;
MonoString *negativeSign;
- guint32 numberDecimalDigits;
MonoString *numberDecimalSeparator;
MonoString *numberGroupSeparator;
- MonoArray *numberGroupSizes;
- gint32 numberNegativePattern;
- gint32 percentDecimalDigits;
+ MonoString *currencyGroupSeparator;
+ MonoString *currencyDecimalSeparator;
+ MonoString *currencySymbol;
+ MonoString *ansiCurrencySymbol; /* unused */
+ MonoString *naNSymbol;
+ MonoString *positiveInfinitySymbol;
+ MonoString *negativeInfinitySymbol;
MonoString *percentDecimalSeparator;
MonoString *percentGroupSeparator;
- MonoArray *percentGroupSizes;
- gint32 percentNegativePattern;
- gint32 percentPositivePattern;
MonoString *percentSymbol;
MonoString *perMilleSymbol;
- MonoString *positiveInfinitySymbol;
- MonoString *positiveSign;
+ MonoString *nativeDigits; /* unused */
+ gint32 dataItem; /* unused */
+ guint32 numberDecimalDigits;
+ gint32 currencyDecimalDigits;
+ gint32 currencyPositivePattern;
+ gint32 currencyNegativePattern;
+ gint32 numberNegativePattern;
+ gint32 percentPositivePattern;
+ gint32 percentNegativePattern;
+ gint32 percentDecimalDigits;
} MonoNumberFormatInfo;
typedef struct {
mono_async_result_new (MonoDomain *domain, HANDLE handle,
MonoObject *state, gpointer data, MonoObject *object_data);
+MonoObject *
+mono_async_result_invoke (MonoAsyncResult *ares, MonoObject **exc);
+
MonoWaitHandle *
mono_wait_handle_new (MonoDomain *domain, HANDLE handle);
void
mono_copy_value (MonoType *type, void *dest, void *value, int deref_pointer);
+void
+mono_error_raise_exception (MonoError *target_error);
+
+void
+mono_error_set_pending_exception (MonoError *error);
+
#endif /* __MONO_OBJECT_INTERNALS_H__ */
DECL_OFFSET(MonoContext, r8)
DECL_OFFSET(MonoContext, r9)
DECL_OFFSET(MonoContext, r10)
+DECL_OFFSET(MonoContext, r11)
DECL_OFFSET(MonoContext, r12)
DECL_OFFSET(MonoContext, r13)
DECL_OFFSET(MonoContext, r14)
DECL_OFFSET(MonoLMF, rbp)
DECL_OFFSET(MonoLMF, rip)
+DECL_OFFSET(SeqPointInfo, ss_tramp_addr)
DECL_OFFSET(SeqPointInfo, bp_addrs)
+
DECL_OFFSET(DynCallArgs, res)
-DECL_OFFSET(SeqPointInfo, ss_trigger_page)
DECL_OFFSET(MonoLMFTramp, regs)
DECL_OFFSET(MonoLMFTramp, lmf_addr)
#define mono_type_initialization_unlock() mono_mutex_unlock (&type_initialization_section)
static mono_mutex_t type_initialization_section;
+
+static void
+mono_type_init_lock (TypeInitializationLock *lock)
+{
+ MONO_PREPARE_BLOCKING
+ mono_mutex_lock (&lock->initialization_section);
+ MONO_FINISH_BLOCKING
+}
+
+static void
+mono_type_init_unlock (TypeInitializationLock *lock)
+{
+ mono_mutex_unlock (&lock->initialization_section);
+}
+
/* from vtable to lock */
static GHashTable *type_initialization_hash;
lock->waiting_count = 1;
lock->done = FALSE;
/* grab the vtable lock while this thread still owns type_initialization_section */
- mono_mutex_lock (&lock->initialization_section);
+ mono_type_init_lock (lock);
g_hash_table_insert (type_initialization_hash, vtable, lock);
do_initialization = 1;
} else {
if (last_domain)
mono_domain_set (last_domain, TRUE);
lock->done = TRUE;
- mono_mutex_unlock (&lock->initialization_section);
+ mono_type_init_unlock (lock);
} else {
/* this just blocks until the initializing thread is done */
- mono_mutex_lock (&lock->initialization_section);
- mono_mutex_unlock (&lock->initialization_section);
+ mono_type_init_lock (lock);
+ mono_type_init_unlock (lock);
}
mono_type_initialization_lock ();
* and get_type_init_exception_for_class () needs to be aware of this.
*/
vtable->init_failed = 1;
- mono_mutex_unlock (&lock->initialization_section);
+ mono_type_init_unlock (lock);
--lock->waiting_count;
if (lock->waiting_count == 0) {
mono_mutex_destroy (&lock->initialization_section);
size_t size;
/* check for overflow */
- if (len < 0 || len > ((SIZE_MAX - G_STRUCT_OFFSET (MonoString, chars) - 2) / 2))
+ if (len < 0 || len > ((SIZE_MAX - G_STRUCT_OFFSET (MonoString, chars) - 8) / 2))
mono_gc_out_of_memory (-1);
size = (G_STRUCT_OFFSET (MonoString, chars) + (((size_t)len + 1) * 2));
}
#endif
ldstr_lock ();
- if ((interned = mono_g_hash_table_lookup (domain->ldstr_table, o))) {
- ldstr_unlock ();
- /* o will get garbage collected */
- return interned;
- }
+ interned = mono_g_hash_table_lookup (domain->ldstr_table, o);
+ ldstr_unlock ();
+ if (interned)
+ return interned; /* o will get garbage collected */
o = mono_string_get_pinned (o);
- if (o)
- mono_g_hash_table_insert (domain->ldstr_table, o, o);
- ldstr_unlock ();
+ if (o) {
+ ldstr_lock ();
+ interned = mono_g_hash_table_lookup (domain->ldstr_table, o);
+ if (!interned) {
+ mono_g_hash_table_insert (domain->ldstr_table, o, o);
+ interned = o;
+ }
+ ldstr_unlock ();
+ }
- return o;
+ return interned;
}
/**
return res;
}
+MonoObject *
+mono_async_result_invoke (MonoAsyncResult *ares, MonoObject **exc)
+{
+ MonoAsyncCall *ac;
+ MonoObject *res;
+ MonoInternalThread *thread;
+
+ g_assert (ares);
+ g_assert (ares->async_delegate);
+
+ thread = mono_thread_internal_current ();
+
+ if (!ares->execution_context) {
+ ares->original_context = NULL;
+ } else {
+ /* use captured ExecutionContext (if available) */
+ MONO_OBJECT_SETREF (ares, original_context, mono_thread_get_execution_context ());
+ mono_thread_set_execution_context (ares->execution_context);
+ }
+
+ ac = (MonoAsyncCall*) ares->object_data;
+ if (!ac) {
+ thread->async_invoke_method = ((MonoDelegate*) ares->async_delegate)->method;
+ res = mono_runtime_delegate_invoke (ares->async_delegate, (void**) &ares->async_state, exc);
+ thread->async_invoke_method = NULL;
+ } else {
+ MonoArray *out_args = NULL;
+ gpointer wait_event = NULL;
+
+ ac->msg->exc = NULL;
+ res = mono_message_invoke (ares->async_delegate, ac->msg, exc, &out_args);
+ MONO_OBJECT_SETREF (ac->msg, exc, *exc);
+ MONO_OBJECT_SETREF (ac, res, res);
+ MONO_OBJECT_SETREF (ac, out_args, out_args);
+
+ mono_monitor_enter ((MonoObject*) ares);
+ ares->completed = 1;
+ if (ares->handle)
+ wait_event = mono_wait_handle_get_handle ((MonoWaitHandle*) ares->handle);
+ mono_monitor_exit ((MonoObject*) ares);
+
+ if (wait_event != NULL)
+ SetEvent (wait_event);
+
+ if (!ac->cb_method) {
+ *exc = NULL;
+ } else {
+ thread->async_invoke_method = ac->cb_method;
+ mono_runtime_invoke (ac->cb_method, ac->cb_target, (gpointer*) &ares, exc);
+ thread->async_invoke_method = NULL;
+ }
+ }
+
+ /* restore original thread execution context if flow isn't suppressed, i.e. non null */
+ if (ares->original_context) {
+ mono_thread_set_execution_context (ares->original_context);
+ ares->original_context = NULL;
+ }
+
+ return res;
+}
+
void
mono_message_init (MonoDomain *domain,
MonoMethodMessage *this,
MONO_PROFILER_CODE_BUFFER_HELPER,
MONO_PROFILER_CODE_BUFFER_MONITOR,
MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE,
+ MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING,
MONO_PROFILER_CODE_BUFFER_LAST
} MonoProfilerCodeBufferType;
+++ /dev/null
-# sample bundle template for use with the configure option --with-bundle=...
-
-console: ../tests/console.exe
-mscorlib: /usr/local/lib/corlib.dll
-
data->entry_count = entry_count;
for (i=0; i<entry_count; i++) {
- data->entries [i].token = decode_var_int (buffer, &buffer);
+ data->entries [i].method_token = decode_var_int (buffer, &buffer);
+ data->entries [i].method_index = decode_var_int (buffer, &buffer);
buffer += seq_point_info_read (&data->entries [i].seq_points, buffer, TRUE);
data->entries [i].free_seq_points = TRUE;
}
encode_var_int (buffer, &buffer, data->entry_count);
for (i=0; i<data->entry_count; i++) {
- encode_var_int (buffer, &buffer, data->entries [i].token);
+ encode_var_int (buffer, &buffer, data->entries [i].method_token);
+ encode_var_int (buffer, &buffer, data->entries [i].method_index);
buffer += seq_point_info_write (data->entries [i].seq_points, buffer);
}
}
void
-seq_point_data_add (SeqPointData *data, guint32 token, MonoSeqPointInfo* info)
+seq_point_data_add (SeqPointData *data, guint32 method_token, guint32 method_index, MonoSeqPointInfo* info)
{
int i;
g_assert (data->entry_count < data->entry_capacity);
i = data->entry_count++;
data->entries [i].seq_points = info;
- data->entries [i].token = token;
+ data->entries [i].method_token = method_token;
+ data->entries [i].method_index = method_index;
data->entries [i].free_seq_points = FALSE;
}
gboolean
-seq_point_data_get (SeqPointData *data, guint32 token, MonoSeqPointInfo** info)
+seq_point_data_get (SeqPointData *data, guint32 method_token, guint32 method_index, MonoSeqPointInfo** info)
{
int i;
for (i=0; i<data->entry_count; i++) {
- if (data->entries [i].token == token) {
+ if (data->entries [i].method_token == method_token && (method_index == 0xffffff || data->entries [i].method_index == method_index)) {
(*info) = data->entries [i].seq_points;
return TRUE;
}
}
gboolean
-seq_point_data_get_il_offset (char *path, guint32 token, guint32 native_offset, guint32 *il_offset)
+seq_point_data_get_il_offset (char *path, guint32 method_token, guint32 method_index, guint32 native_offset, guint32 *il_offset)
{
SeqPointData sp_data;
MonoSeqPointInfo *seq_points;
if (!seq_point_data_read (&sp_data, path))
return FALSE;
- if (!seq_point_data_get (&sp_data, token, &seq_points))
+ if (!seq_point_data_get (&sp_data, method_token, method_index, &seq_points))
return FALSE;
if (!seq_point_find_prev_by_native_offset (seq_points, native_offset, &sp))
*/
typedef struct {
- guint32 token;
+ guint32 method_token;
+ guint32 method_index;
MonoSeqPointInfo* seq_points;
gboolean free_seq_points;
} SeqPointDataEntry;
seq_point_data_write (SeqPointData *data, char *path);
void
-seq_point_data_add (SeqPointData *data, guint32 token, MonoSeqPointInfo* info);
+seq_point_data_add (SeqPointData *data, guint32 methodToken, guint32 methodIndex, MonoSeqPointInfo* info);
gboolean
-seq_point_data_get (SeqPointData *data, guint32 token, MonoSeqPointInfo** info);
+seq_point_data_get (SeqPointData *data, guint32 methodToken, guint32 methodIndex, MonoSeqPointInfo** info);
gboolean
-seq_point_data_get_il_offset (char *path, guint32 token, guint32 native_offset, guint32 *il_offset);
+seq_point_data_get_il_offset (char *path, guint32 methodToken, guint32 methodIndex, guint32 native_offset, guint32 *il_offset);
#endif /* __MONO_SEQ_POINTS_DATA_H__ */
\ No newline at end of file
printf ("VTable is invalid (points inside nursery).\n");
goto bridge;
}
- printf ("Class: %s\n", vtable->klass->name);
+ printf ("Class: %s.%s\n", vtable->klass->name_space, vtable->klass->name);
desc = ((GCVTable*)vtable)->desc;
printf ("Descriptor: %lx\n", (long)desc);
if (need_setup)
setup_valid_nursery_objects ();
- for (i = 0; i < valid_nursery_object_count; ++i) {
- if (valid_nursery_objects [i] >= ptr)
+ for (i = 0; i < valid_nursery_object_count - 1; ++i) {
+ if (valid_nursery_objects [i + 1] > ptr)
break;
}
if (i >= valid_nursery_object_count || valid_nursery_objects [i] + safe_object_get_size ((MonoObject *)valid_nursery_objects [i]) < ptr) {
- SGEN_LOG (0, "nursery-ptr (unalloc'd-memory)\n");
+ SGEN_LOG (0, "nursery-ptr (unalloc'd-memory)");
return NULL;
} else {
char *obj = valid_nursery_objects [i];
if (obj == ptr)
- SGEN_LOG (0, "nursery-ptr\n");
+ SGEN_LOG (0, "nursery-ptr %p", obj);
else
- SGEN_LOG (0, "nursery-ptr (interior-ptr offset %td)\n", ptr - obj);
+ SGEN_LOG (0, "nursery-ptr %p (interior-ptr offset %td)", obj, ptr - obj);
return obj;
}
}
static guint64 time_minor_pinning = 0;
static guint64 time_minor_scan_remsets = 0;
static guint64 time_minor_scan_pinned = 0;
-static guint64 time_minor_scan_registered_roots = 0;
-static guint64 time_minor_scan_thread_data = 0;
+static guint64 time_minor_scan_roots = 0;
static guint64 time_minor_finish_gray_stack = 0;
static guint64 time_minor_fragment_creation = 0;
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_registered_roots = 0;
-static guint64 time_major_scan_thread_data = 0;
-static guint64 time_major_scan_alloc_pinned = 0;
-static guint64 time_major_scan_finalized = 0;
-static guint64 time_major_scan_big_objects = 0;
+static guint64 time_major_scan_roots = 0;
+static guint64 time_major_scan_mod_union = 0;
static guint64 time_major_finish_gray_stack = 0;
static guint64 time_major_free_bigobjs = 0;
static guint64 time_major_los_sweep = 0;
if (wake) {
g_assert (concurrent_collection_in_progress);
- if (sgen_workers_have_started ()) {
- sgen_workers_ensure_awake ();
- } else {
- if (concurrent_collection_in_progress)
- g_assert (current_collection_generation == -1);
- }
+ sgen_workers_ensure_awake ();
}
}
sgen_perform_collection (0, GENERATION_OLD, "clear domain", TRUE);
g_assert (!concurrent_collection_in_progress);
+ major_collector.finish_sweeping ();
+
sgen_process_fin_stage_entries ();
sgen_process_dislink_stage_entries ();
mono_counters_register ("Minor pinning", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_pinning);
mono_counters_register ("Minor scan remembered set", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_remsets);
mono_counters_register ("Minor scan pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_pinned);
- mono_counters_register ("Minor scan registered roots", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_registered_roots);
- mono_counters_register ("Minor scan thread data", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_thread_data);
- mono_counters_register ("Minor finish gray stack", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_finish_gray_stack);
+ mono_counters_register ("Minor scan roots", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_roots);
mono_counters_register ("Minor fragment creation", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_fragment_creation);
mono_counters_register ("Major fragment clear", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_pre_collection_fragment_clear);
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 registered roots", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_registered_roots);
- mono_counters_register ("Major scan thread data", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_thread_data);
- mono_counters_register ("Major scan alloc_pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_alloc_pinned);
- mono_counters_register ("Major scan finalized", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_finalized);
- mono_counters_register ("Major scan big objects", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_big_objects);
+ 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 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);
}
static void
-job_remembered_set_scan (WorkerData *worker_data, void *dummy)
+job_remembered_set_scan (void *worker_data_untyped, SgenThreadPoolJob *job)
{
+ WorkerData *worker_data = worker_data_untyped;
remset.scan_remsets (sgen_workers_get_job_gray_queue (worker_data));
}
-typedef struct
-{
+typedef struct {
+ SgenThreadPoolJob job;
CopyOrMarkObjectFunc copy_or_mark_func;
ScanObjectFunc scan_func;
char *heap_start;
char *heap_end;
int root_type;
-} ScanFromRegisteredRootsJobData;
+} ScanFromRegisteredRootsJob;
static void
-job_scan_from_registered_roots (WorkerData *worker_data, void *job_data_untyped)
+job_scan_from_registered_roots (void *worker_data_untyped, SgenThreadPoolJob *job)
{
- ScanFromRegisteredRootsJobData *job_data = job_data_untyped;
+ WorkerData *worker_data = worker_data_untyped;
+ ScanFromRegisteredRootsJob *job_data = (ScanFromRegisteredRootsJob*)job;
ScanCopyContext ctx = { job_data->scan_func, job_data->copy_or_mark_func,
sgen_workers_get_job_gray_queue (worker_data) };
scan_from_registered_roots (job_data->heap_start, job_data->heap_end, job_data->root_type, ctx);
- sgen_free_internal_dynamic (job_data, sizeof (ScanFromRegisteredRootsJobData), INTERNAL_MEM_WORKER_JOB_DATA);
}
-typedef struct
-{
+typedef struct {
+ SgenThreadPoolJob job;
char *heap_start;
char *heap_end;
-} ScanThreadDataJobData;
+} ScanThreadDataJob;
static void
-job_scan_thread_data (WorkerData *worker_data, void *job_data_untyped)
+job_scan_thread_data (void *worker_data_untyped, SgenThreadPoolJob *job)
{
- ScanThreadDataJobData *job_data = job_data_untyped;
+ WorkerData *worker_data = worker_data_untyped;
+ ScanThreadDataJob *job_data = (ScanThreadDataJob*)job;
scan_thread_data (job_data->heap_start, job_data->heap_end, TRUE,
sgen_workers_get_job_gray_queue (worker_data));
- sgen_free_internal_dynamic (job_data, sizeof (ScanThreadDataJobData), INTERNAL_MEM_WORKER_JOB_DATA);
}
+typedef struct {
+ SgenThreadPoolJob job;
+ FinalizeReadyEntry *list;
+} ScanFinalizerEntriesJob;
+
static void
-job_scan_finalizer_entries (WorkerData *worker_data, void *job_data_untyped)
+job_scan_finalizer_entries (void *worker_data_untyped, SgenThreadPoolJob *job)
{
- FinalizeReadyEntry *list = job_data_untyped;
+ WorkerData *worker_data = worker_data_untyped;
+ ScanFinalizerEntriesJob *job_data = (ScanFinalizerEntriesJob*)job;
ScanCopyContext ctx = { NULL, current_object_ops.copy_or_mark_object, sgen_workers_get_job_gray_queue (worker_data) };
- scan_finalizer_entries (list, ctx);
+ scan_finalizer_entries (job_data->list, ctx);
}
static void
-job_scan_major_mod_union_cardtable (WorkerData *worker_data, void *job_data_untyped)
+job_scan_major_mod_union_cardtable (void *worker_data_untyped, SgenThreadPoolJob *job)
{
+ WorkerData *worker_data = worker_data_untyped;
g_assert (concurrent_collection_in_progress);
major_collector.scan_card_table (TRUE, sgen_workers_get_job_gray_queue (worker_data));
}
static void
-job_scan_los_mod_union_cardtable (WorkerData *worker_data, void *job_data_untyped)
+job_scan_los_mod_union_cardtable (void *worker_data_untyped, SgenThreadPoolJob *job)
{
+ WorkerData *worker_data = worker_data_untyped;
g_assert (concurrent_collection_in_progress);
sgen_los_scan_card_table (TRUE, sgen_workers_get_job_gray_queue (worker_data));
}
sgen_gray_object_queue_init (&gray_queue, NULL);
}
+static void
+enqueue_scan_from_roots_jobs (char *heap_start, char *heap_end)
+{
+ ScanFromRegisteredRootsJob *scrrj;
+ ScanThreadDataJob *stdj;
+ ScanFinalizerEntriesJob *sfej;
+
+ /* registered roots, this includes static fields */
+
+ scrrj = (ScanFromRegisteredRootsJob*)sgen_thread_pool_job_alloc ("scan from registered roots normal", job_scan_from_registered_roots, sizeof (ScanFromRegisteredRootsJob));
+ scrrj->copy_or_mark_func = current_object_ops.copy_or_mark_object;
+ scrrj->scan_func = current_object_ops.scan_object;
+ scrrj->heap_start = heap_start;
+ scrrj->heap_end = heap_end;
+ scrrj->root_type = ROOT_TYPE_NORMAL;
+ sgen_workers_enqueue_job (&scrrj->job);
+
+ scrrj = (ScanFromRegisteredRootsJob*)sgen_thread_pool_job_alloc ("scan from registered roots wbarrier", job_scan_from_registered_roots, sizeof (ScanFromRegisteredRootsJob));
+ scrrj->copy_or_mark_func = current_object_ops.copy_or_mark_object;
+ scrrj->scan_func = current_object_ops.scan_object;
+ scrrj->heap_start = heap_start;
+ scrrj->heap_end = heap_end;
+ scrrj->root_type = ROOT_TYPE_WBARRIER;
+ sgen_workers_enqueue_job (&scrrj->job);
+
+ /* Threads */
+
+ stdj = (ScanThreadDataJob*)sgen_thread_pool_job_alloc ("scan thread data", job_scan_thread_data, sizeof (ScanThreadDataJob));
+ stdj->heap_start = heap_start;
+ stdj->heap_end = heap_end;
+ sgen_workers_enqueue_job (&stdj->job);
+
+ /* Scan the list of objects ready for finalization. */
+
+ sfej = (ScanFinalizerEntriesJob*)sgen_thread_pool_job_alloc ("scan finalizer entries", job_scan_finalizer_entries, sizeof (ScanFinalizerEntriesJob));
+ sfej->list = fin_ready_list;
+ sgen_workers_enqueue_job (&sfej->job);
+
+ sfej = (ScanFinalizerEntriesJob*)sgen_thread_pool_job_alloc ("scan critical finalizer entries", job_scan_finalizer_entries, sizeof (ScanFinalizerEntriesJob));
+ sfej->list = critical_fin_list;
+ sgen_workers_enqueue_job (&sfej->job);
+}
+
/*
* Perform a nursery collection.
*
gboolean needs_major;
size_t max_garbage_amount;
char *nursery_next;
- ScanFromRegisteredRootsJobData *scrrjd_normal, *scrrjd_wbarrier;
- ScanThreadDataJobData *stdjd;
mword fragment_total;
ScanCopyContext ctx;
TV_DECLARE (atv);
current_collection_generation = GENERATION_NURSERY;
current_object_ops = sgen_minor_collector.serial_ops;
+ SGEN_ASSERT (0, !sgen_collection_is_concurrent (), "Why is the nursery collection concurrent?");
+
reset_pinned_from_failed_allocation ();
check_scan_starts ();
* as part of which we scan the card table. Then, later, we scan the mod union
* cardtable. We should only have to do one.
*/
- sgen_workers_enqueue_job ("scan remset", job_remembered_set_scan, NULL);
+ sgen_workers_enqueue_job (sgen_thread_pool_job_alloc ("scan remset", job_remembered_set_scan, sizeof (SgenThreadPoolJob)));
/* we don't have complete write barrier yet, so we scan all the old generation sections */
TV_GETTIME (btv);
MONO_GC_CHECKPOINT_5 (GENERATION_NURSERY);
- /* registered roots, this includes static fields */
- scrrjd_normal = sgen_alloc_internal_dynamic (sizeof (ScanFromRegisteredRootsJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
- scrrjd_normal->copy_or_mark_func = current_object_ops.copy_or_mark_object;
- scrrjd_normal->scan_func = current_object_ops.scan_object;
- scrrjd_normal->heap_start = sgen_get_nursery_start ();
- scrrjd_normal->heap_end = nursery_next;
- scrrjd_normal->root_type = ROOT_TYPE_NORMAL;
- sgen_workers_enqueue_job ("scan from registered roots normal", job_scan_from_registered_roots, scrrjd_normal);
-
- scrrjd_wbarrier = sgen_alloc_internal_dynamic (sizeof (ScanFromRegisteredRootsJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
- scrrjd_wbarrier->copy_or_mark_func = current_object_ops.copy_or_mark_object;
- scrrjd_wbarrier->scan_func = current_object_ops.scan_object;
- scrrjd_wbarrier->heap_start = sgen_get_nursery_start ();
- scrrjd_wbarrier->heap_end = nursery_next;
- scrrjd_wbarrier->root_type = ROOT_TYPE_WBARRIER;
- sgen_workers_enqueue_job ("scan from registered roots wbarrier", job_scan_from_registered_roots, scrrjd_wbarrier);
+ enqueue_scan_from_roots_jobs (sgen_get_nursery_start (), nursery_next);
TV_GETTIME (btv);
- time_minor_scan_registered_roots += TV_ELAPSED (atv, btv);
+ time_minor_scan_roots += TV_ELAPSED (atv, btv);
MONO_GC_CHECKPOINT_6 (GENERATION_NURSERY);
-
- /* thread data */
- stdjd = sgen_alloc_internal_dynamic (sizeof (ScanThreadDataJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
- stdjd->heap_start = sgen_get_nursery_start ();
- stdjd->heap_end = nursery_next;
- sgen_workers_enqueue_job ("scan thread data", job_scan_thread_data, stdjd);
-
- TV_GETTIME (atv);
- time_minor_scan_thread_data += TV_ELAPSED (btv, atv);
- btv = atv;
-
MONO_GC_CHECKPOINT_7 (GENERATION_NURSERY);
-
- g_assert (!sgen_collection_is_concurrent ());
-
- /* Scan the list of objects ready for finalization. If */
- sgen_workers_enqueue_job ("scan finalizer entries", job_scan_finalizer_entries, fin_ready_list);
- sgen_workers_enqueue_job ("scan criticial finalizer entries", job_scan_finalizer_entries, critical_fin_list);
-
MONO_GC_CHECKPOINT_8 (GENERATION_NURSERY);
finish_gray_stack (GENERATION_NURSERY, &gray_queue);
MONO_GC_CHECKPOINT_9 (GENERATION_NURSERY);
- /*
- * The (single-threaded) finalization code might have done
- * some copying/marking so we can only reset the GC thread's
- * worker data here instead of earlier when we joined the
- * workers.
- */
- sgen_workers_reset_data ();
-
if (objects_pinned) {
sgen_optimize_pin_queue ();
sgen_pinning_setup_section (nursery_section);
char *heap_end = (char*)-1;
gboolean profile_roots = mono_profiler_get_events () & MONO_PROFILE_GC_ROOTS;
GCRootReport root_report = { 0 };
- ScanFromRegisteredRootsJobData *scrrjd_normal, *scrrjd_wbarrier;
- ScanThreadDataJobData *stdjd;
ScanCopyContext ctx;
if (concurrent_collection_in_progress) {
TV_GETTIME (atv);
time_major_scan_pinned += TV_ELAPSED (btv, atv);
- /* registered roots, this includes static fields */
- scrrjd_normal = sgen_alloc_internal_dynamic (sizeof (ScanFromRegisteredRootsJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
- scrrjd_normal->copy_or_mark_func = current_object_ops.copy_or_mark_object;
- scrrjd_normal->scan_func = current_object_ops.scan_object;
- scrrjd_normal->heap_start = heap_start;
- scrrjd_normal->heap_end = heap_end;
- scrrjd_normal->root_type = ROOT_TYPE_NORMAL;
- sgen_workers_enqueue_job ("scan from registered roots normal", job_scan_from_registered_roots, scrrjd_normal);
-
- scrrjd_wbarrier = sgen_alloc_internal_dynamic (sizeof (ScanFromRegisteredRootsJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
- scrrjd_wbarrier->copy_or_mark_func = current_object_ops.copy_or_mark_object;
- scrrjd_wbarrier->scan_func = current_object_ops.scan_object;
- scrrjd_wbarrier->heap_start = heap_start;
- scrrjd_wbarrier->heap_end = heap_end;
- scrrjd_wbarrier->root_type = ROOT_TYPE_WBARRIER;
- sgen_workers_enqueue_job ("scan from registered roots wbarrier", job_scan_from_registered_roots, scrrjd_wbarrier);
-
- TV_GETTIME (btv);
- time_major_scan_registered_roots += TV_ELAPSED (atv, btv);
-
- /* Threads */
- stdjd = sgen_alloc_internal_dynamic (sizeof (ScanThreadDataJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
- stdjd->heap_start = heap_start;
- stdjd->heap_end = heap_end;
- sgen_workers_enqueue_job ("scan thread data", job_scan_thread_data, stdjd);
-
- TV_GETTIME (atv);
- time_major_scan_thread_data += TV_ELAPSED (btv, atv);
-
- TV_GETTIME (btv);
- time_major_scan_alloc_pinned += TV_ELAPSED (atv, btv);
-
if (mono_profiler_get_events () & MONO_PROFILE_GC_ROOTS)
report_finalizer_roots ();
- /* scan the list of objects ready for finalization */
- sgen_workers_enqueue_job ("scan finalizer entries", job_scan_finalizer_entries, fin_ready_list);
- sgen_workers_enqueue_job ("scan critical finalizer entries", job_scan_finalizer_entries, critical_fin_list);
+ enqueue_scan_from_roots_jobs (heap_start, heap_end);
+
+ TV_GETTIME (btv);
+ time_major_scan_roots += TV_ELAPSED (atv, btv);
if (scan_mod_union) {
g_assert (finish_up_concurrent_mark);
/* Mod union card table */
- sgen_workers_enqueue_job ("scan mod union cardtable", job_scan_major_mod_union_cardtable, NULL);
- sgen_workers_enqueue_job ("scan LOS mod union cardtable", job_scan_los_mod_union_cardtable, NULL);
- }
-
- TV_GETTIME (atv);
- time_major_scan_finalized += TV_ELAPSED (btv, atv);
- SGEN_LOG (2, "Root scan: %d usecs", TV_ELAPSED (btv, atv));
+ sgen_workers_enqueue_job (sgen_thread_pool_job_alloc ("scan mod union cardtable", job_scan_major_mod_union_cardtable, sizeof (SgenThreadPoolJob)));
+ sgen_workers_enqueue_job (sgen_thread_pool_job_alloc ("scan LOS mod union cardtable", job_scan_los_mod_union_cardtable, sizeof (SgenThreadPoolJob)));
- TV_GETTIME (btv);
- time_major_scan_big_objects += TV_ELAPSED (atv, btv);
+ TV_GETTIME (atv);
+ time_major_scan_mod_union += TV_ELAPSED (btv, atv);
+ }
}
static void
}
static void
-wait_for_workers_to_finish (void)
-{
- while (!sgen_workers_all_done ())
- g_usleep (200);
-}
-
-static void
-major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean scan_whole_nursery)
+major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean forced, gboolean scan_whole_nursery)
{
ScannedObjectCounts counts;
LOSObject *bigobj, *prevbo;
SGEN_ASSERT (0, sgen_workers_all_done (), "Can't have workers working after joining");
- /*
- * The (single-threaded) finalization code might have done
- * some copying/marking so we can only reset the GC thread's
- * worker data here instead of earlier when we joined the
- * workers.
- */
- sgen_workers_reset_data ();
-
if (objects_pinned) {
g_assert (!concurrent_collection_in_progress);
g_assert (sgen_gray_object_queue_is_empty (&gray_queue));
- sgen_memgov_major_collection_end ();
+ sgen_memgov_major_collection_end (forced);
current_collection_generation = -1;
memset (&counts, 0, sizeof (ScannedObjectCounts));
}
static gboolean
-major_do_collection (const char *reason)
+major_do_collection (const char *reason, gboolean forced)
{
TV_DECLARE (time_start);
TV_DECLARE (time_end);
TV_GETTIME (time_start);
major_start_collection (FALSE, &old_next_pin_slot);
- major_finish_collection (reason, old_next_pin_slot, FALSE);
+ major_finish_collection (reason, old_next_pin_slot, forced, FALSE);
TV_GETTIME (time_end);
gc_stats.major_gc_time += TV_ELAPSED (time_start, time_end);
}
static void
-major_finish_concurrent_collection (void)
+major_finish_concurrent_collection (gboolean forced)
{
TV_DECLARE (total_start);
TV_DECLARE (total_end);
* marking before the nursery collection is allowed to run, otherwise we might miss
* some remsets.
*/
- wait_for_workers_to_finish ();
+ sgen_workers_wait ();
SGEN_TV_GETTIME (time_major_conc_collection_end);
gc_stats.major_gc_time_concurrent += SGEN_TV_ELAPSED (time_major_conc_collection_start, time_major_conc_collection_end);
sgen_check_mod_union_consistency ();
current_collection_generation = GENERATION_OLD;
- major_finish_collection ("finishing", -1, late_pinned);
+ major_finish_collection ("finishing", -1, forced, late_pinned);
if (whole_heap_check_before_collection)
sgen_check_whole_heap (FALSE);
int generation_to_collect = -1;
const char *reason = NULL;
-
if (size > SGEN_MAX_SMALL_OBJ_SIZE) {
if (sgen_need_major_collection (size)) {
reason = "LOS overflow";
gboolean finish = major_should_finish_concurrent_collection () || (wait_to_finish && generation_to_collect == GENERATION_OLD);
if (finish) {
- major_finish_concurrent_collection ();
+ major_finish_concurrent_collection (wait_to_finish);
oldest_generation_collected = GENERATION_OLD;
} else {
sgen_workers_signal_start_nursery_collection_and_wait ();
goto done;
}
- if (major_do_collection (reason)) {
+ if (major_do_collection (reason, wait_to_finish)) {
overflow_generation_to_collect = GENERATION_NURSERY;
overflow_reason = "Excessive pinning";
}
if (overflow_generation_to_collect == GENERATION_NURSERY)
collect_nursery (NULL, FALSE);
else
- major_do_collection (overflow_reason);
+ major_do_collection (overflow_reason, wait_to_finish);
TV_GETTIME (gc_end);
infos [1].total_time = SGEN_TV_ELAPSED (infos [1].total_time, gc_end);
g_strfreev (opts);
}
- if (major_collector.is_concurrent)
- sgen_workers_init (1);
-
if (major_collector_opt)
g_free (major_collector_opt);
if (major_collector.post_param_init)
major_collector.post_param_init (&major_collector);
+ if (major_collector.needs_thread_pool)
+ sgen_workers_init (1);
+
sgen_memgov_init (max_heap, soft_limit, debug_print_allowance, allowance_ratio, save_target);
memset (&remset, 0, sizeof (remset));
#ifdef HAVE_SGEN_GC
typedef struct _SgenThreadInfo SgenThreadInfo;
+#undef THREAD_INFO_TYPE
#define THREAD_INFO_TYPE SgenThreadInfo
#include <glib.h>
its use in mono_gc_base_init in sgen-gc.c */
#define LOCK_INIT(name) mono_mutex_init (&(name))
#define LOCK_GC do { \
+ MONO_PREPARE_BLOCKING \
mono_mutex_lock (&gc_mutex); \
MONO_GC_LOCKED (); \
+ MONO_FINISH_BLOCKING \
} while (0)
#define UNLOCK_GC do { sgen_gc_unlock (); } while (0)
#define UNLOCK_INTERRUPTION mono_mutex_unlock (&sgen_interruption_mutex)
/* FIXME: Use InterlockedAdd & InterlockedAdd64 to reduce the CAS cost. */
+#define SGEN_CAS InterlockedCompareExchange
#define SGEN_CAS_PTR InterlockedCompareExchangePointer
#define SGEN_ATOMIC_ADD(x,i) do { \
int __old_x; \
void sgen_wait_for_suspend_ack (int count);
void sgen_os_init (void);
-gboolean sgen_is_worker_thread (MonoNativeThreadId thread);
-
void sgen_update_heap_boundaries (mword low, mword high);
void sgen_scan_area_with_callback (char *start, char *end, IterateObjectCallbackFunc callback, void *data, gboolean allow_flags);
INTERNAL_MEM_MS_BLOCK_INFO_SORT,
INTERNAL_MEM_EPHEMERON_LINK,
INTERNAL_MEM_WORKER_DATA,
- INTERNAL_MEM_WORKER_JOB_DATA,
+ INTERNAL_MEM_THREAD_POOL_JOB,
INTERNAL_MEM_BRIDGE_DATA,
INTERNAL_MEM_OLD_BRIDGE_HASH_TABLE,
INTERNAL_MEM_OLD_BRIDGE_HASH_TABLE_ENTRY,
INTERNAL_MEM_TARJAN_BRIDGE_HASH_TABLE_ENTRY,
INTERNAL_MEM_TARJAN_OBJ_BUCKET,
INTERNAL_MEM_BRIDGE_DEBUG,
- INTERNAL_MEM_JOB_QUEUE_ENTRY,
INTERNAL_MEM_TOGGLEREF_DATA,
INTERNAL_MEM_CARDTABLE_MOD_UNION,
INTERNAL_MEM_BINARY_PROTOCOL,
/* Updating references */
#ifdef SGEN_CHECK_UPDATE_REFERENCE
+gboolean sgen_thread_pool_is_thread_pool_thread (MonoNativeThreadId some_thread) MONO_INTERNAL;
static inline void
sgen_update_reference (void **p, void *o, gboolean allow_null)
{
if (!allow_null)
SGEN_ASSERT (0, o, "Cannot update a reference with a NULL pointer");
- SGEN_ASSERT (0, !sgen_is_worker_thread (mono_native_thread_id_get ()), "Can't update a reference in the worker thread");
+ SGEN_ASSERT (0, !sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()), "Can't update a reference in the worker thread");
*p = o;
}
struct _SgenMajorCollector {
size_t section_size;
gboolean is_concurrent;
+ gboolean needs_thread_pool;
gboolean supports_cardtable;
gboolean sweeps_lazily;
void* (*alloc_object) (MonoVTable *vtable, size_t size, gboolean has_references);
void (*free_pinned_object) (char *obj, size_t size);
+
+ /*
+ * This is used for domain unloading, heap walking from the logging profiler, and
+ * debugging. Can assume the world is stopped.
+ */
void (*iterate_objects) (IterateObjectsFlags flags, IterateObjectCallbackFunc callback, void *data);
+
void (*free_non_pinned_object) (char *obj, size_t size);
void (*pin_objects) (SgenGrayQueue *queue);
void (*pin_major_object) (char *obj, SgenGrayQueue *queue);
void (*update_cardtable_mod_union) (void);
void (*init_to_space) (void);
void (*sweep) (void);
- gboolean (*have_finished_sweeping) (void);
- void (*free_swept_blocks) (void);
+ gboolean (*have_swept) (void);
+ void (*finish_sweeping) (void);
+ void (*free_swept_blocks) (size_t allowance);
void (*check_scan_starts) (void);
void (*dump_heap) (FILE *heap_dump_file);
gint64 (*get_used_size) (void);
gboolean (*obj_is_from_pinned_alloc) (char *obj);
void (*report_pinned_memory_usage) (void);
size_t (*get_num_major_sections) (void);
+ size_t (*get_bytes_survived_last_sweep) (void);
gboolean (*handle_gc_param) (const char *opt);
void (*print_gc_param_usage) (void);
- gboolean (*is_worker_thread) (MonoNativeThreadId thread);
void (*post_param_init) (SgenMajorCollector *collector);
- void* (*alloc_worker_data) (void);
- void (*init_worker_thread) (void *data);
- void (*reset_worker_data) (void *data);
gboolean (*is_valid_object) (char *object);
MonoVTable* (*describe_pointer) (char *pointer);
guint8* (*get_cardtable_mod_union_for_object) (char *object);
int sgen_stop_world (int generation);
int sgen_restart_world (int generation, GGTimingInfo *timing);
+gboolean sgen_is_world_stopped (void);
void sgen_init_stw (void);
/* LOS */
case INTERNAL_MEM_MS_BLOCK_INFO_SORT: return "marksweep-block-info-sort";
case INTERNAL_MEM_EPHEMERON_LINK: return "ephemeron-link";
case INTERNAL_MEM_WORKER_DATA: return "worker-data";
- case INTERNAL_MEM_WORKER_JOB_DATA: return "worker-job-data";
+ case INTERNAL_MEM_THREAD_POOL_JOB: return "thread-pool-job";
case INTERNAL_MEM_BRIDGE_DATA: return "bridge-data";
case INTERNAL_MEM_OLD_BRIDGE_HASH_TABLE: return "old-bridge-hash-table";
case INTERNAL_MEM_OLD_BRIDGE_HASH_TABLE_ENTRY: return "old-bridge-hash-table-entry";
case INTERNAL_MEM_BRIDGE_ALIVE_HASH_TABLE: return "bridge-alive-hash-table";
case INTERNAL_MEM_BRIDGE_ALIVE_HASH_TABLE_ENTRY: return "bridge-alive-hash-table-entry";
case INTERNAL_MEM_BRIDGE_DEBUG: return "bridge-debug";
- case INTERNAL_MEM_JOB_QUEUE_ENTRY: return "job-queue-entry";
case INTERNAL_MEM_TOGGLEREF_DATA: return "toggleref-data";
case INTERNAL_MEM_CARDTABLE_MOD_UNION: return "cardtable-mod-union";
case INTERNAL_MEM_BINARY_PROTOCOL: return "binary-protocol";
#include "metadata/sgen-pointer-queue.h"
#include "metadata/sgen-pinning.h"
#include "metadata/sgen-workers.h"
+#include "metadata/sgen-thread-pool.h"
#if defined(ARCH_MIN_MS_BLOCK_SIZE) && defined(ARCH_MIN_MS_BLOCK_SIZE_SHIFT)
#define MS_BLOCK_SIZE ARCH_MIN_MS_BLOCK_SIZE
#define MS_NUM_MARK_WORDS ((MS_BLOCK_SIZE / SGEN_ALLOC_ALIGN + sizeof (mword) * 8 - 1) / (sizeof (mword) * 8))
+/*
+ * Blocks progress from one state to the next:
+ *
+ * SWEPT The block is fully swept. It might or might not be in
+ * a free list.
+ *
+ * MARKING The block might or might not contain live objects. If
+ * we're in between an initial collection pause and the
+ * finishing pause, the block might or might not be in a
+ * free list.
+ *
+ * CHECKING The sweep thread is investigating the block to determine
+ * whether or not it contains live objects. The block is
+ * not in a free list.
+ *
+ * NEED_SWEEPING The block contains live objects but has not yet been
+ * swept. It also contains free slots. It is in a block
+ * free list.
+ *
+ * SWEEPING The block is being swept. It might be in a free list.
+ */
+
+enum {
+ BLOCK_STATE_SWEPT,
+ BLOCK_STATE_MARKING,
+ BLOCK_STATE_CHECKING,
+ BLOCK_STATE_NEED_SWEEPING,
+ BLOCK_STATE_SWEEPING
+};
+
typedef struct _MSBlockInfo MSBlockInfo;
struct _MSBlockInfo {
guint16 obj_size;
* recalculating to save the space.
*/
guint16 obj_size_index;
+ /* FIXME: Reduce this - it only needs a byte. */
+ volatile gint32 state;
unsigned int pinned : 1;
unsigned int has_references : 1;
unsigned int has_pinned : 1; /* means cannot evacuate */
unsigned int is_to_space : 1;
- unsigned int swept : 1;
void ** volatile free_list;
MSBlockInfo * volatile next_free;
guint8 *cardtable_mod_union;
static float concurrent_evacuation_threshold = 0.666f;
static gboolean want_evacuation = FALSE;
-static gboolean lazy_sweep = TRUE;
-static gboolean have_swept = TRUE;
+static gboolean lazy_sweep = FALSE;
+
+enum {
+ SWEEP_STATE_SWEPT,
+ SWEEP_STATE_NEED_SWEEPING,
+ SWEEP_STATE_SWEEPING,
+ SWEEP_STATE_SWEEPING_AND_ITERATING,
+ SWEEP_STATE_COMPACTING
+};
+
+static volatile int sweep_state = SWEEP_STATE_SWEPT;
static gboolean concurrent_mark;
+static gboolean concurrent_sweep = TRUE;
#define BLOCK_IS_TAGGED_HAS_REFERENCES(bl) SGEN_POINTER_IS_TAGGED_1 ((bl))
#define BLOCK_TAG_HAS_REFERENCES(bl) SGEN_POINTER_TAG_1 ((bl))
-#define BLOCK_UNTAG_HAS_REFERENCES(bl) SGEN_POINTER_UNTAG_1 ((bl))
-#define BLOCK_TAG(bl) ((bl)->has_references ? BLOCK_TAG_HAS_REFERENCES ((bl)) : (bl))
+#define BLOCK_IS_TAGGED_CHECKING(bl) SGEN_POINTER_IS_TAGGED_2 ((bl))
+#define BLOCK_TAG_CHECKING(bl) SGEN_POINTER_TAG_2 ((bl))
+
+#define BLOCK_UNTAG(bl) SGEN_POINTER_UNTAG_12 ((bl))
+
+#define BLOCK_TAG(bl) ((bl)->has_references ? BLOCK_TAG_HAS_REFERENCES ((bl)) : (bl))
/* all allocated blocks in the system */
static SgenPointerQueue allocated_blocks;
static void *empty_blocks = NULL;
static size_t num_empty_blocks = 0;
-#define FOREACH_BLOCK(bl) { size_t __index; for (__index = 0; __index < allocated_blocks.next_slot; ++__index) { (bl) = BLOCK_UNTAG_HAS_REFERENCES (allocated_blocks.data [__index]);
-#define FOREACH_BLOCK_HAS_REFERENCES(bl,hr) { size_t __index; for (__index = 0; __index < allocated_blocks.next_slot; ++__index) { (bl) = allocated_blocks.data [__index]; (hr) = BLOCK_IS_TAGGED_HAS_REFERENCES ((bl)); (bl) = BLOCK_UNTAG_HAS_REFERENCES ((bl));
-#define END_FOREACH_BLOCK } }
-#define DELETE_BLOCK_IN_FOREACH() (allocated_blocks.data [__index] = NULL)
-
-static size_t num_major_sections = 0;
-/* one free block list for each block object size */
-static MSBlockInfo **free_block_lists [MS_BLOCK_TYPE_MAX];
+#define FOREACH_BLOCK_NO_LOCK_CONDITION(cond,bl) { \
+ size_t __index; \
+ SGEN_ASSERT (0, (cond) && !sweep_in_progress (), "Can't iterate blocks while the world is running or sweep is in progress."); \
+ for (__index = 0; __index < allocated_blocks.next_slot; ++__index) { \
+ (bl) = BLOCK_UNTAG (allocated_blocks.data [__index]);
+#define FOREACH_BLOCK_NO_LOCK(bl) \
+ FOREACH_BLOCK_NO_LOCK_CONDITION(sgen_is_world_stopped (), bl)
+#define FOREACH_BLOCK_HAS_REFERENCES_NO_LOCK(bl,hr) { \
+ size_t __index; \
+ SGEN_ASSERT (0, sgen_is_world_stopped () && !sweep_in_progress (), "Can't iterate blocks while the world is running or sweep is in progress."); \
+ for (__index = 0; __index < allocated_blocks.next_slot; ++__index) { \
+ (bl) = allocated_blocks.data [__index]; \
+ (hr) = BLOCK_IS_TAGGED_HAS_REFERENCES ((bl)); \
+ (bl) = BLOCK_UNTAG ((bl));
+#define END_FOREACH_BLOCK_NO_LOCK } }
+
+static volatile size_t num_major_sections = 0;
+/*
+ * One free block list for each block object size. We add and remove blocks from these
+ * lists lock-free via CAS.
+ *
+ * Blocks accessed/removed from `free_block_lists`:
+ * from the mutator (with GC lock held)
+ * in nursery collections
+ * in non-concurrent major collections
+ * in the finishing pause of concurrent major collections (whole list is cleared)
+ *
+ * Blocks added to `free_block_lists`:
+ * in the sweeping thread
+ * during nursery collections
+ * from domain clearing (with the world stopped and no sweeping happening)
+ *
+ * The only item of those that doesn't require the GC lock is the sweep thread. The sweep
+ * thread only ever adds blocks to the free list, so the ABA problem can't occur.
+ */
+static MSBlockInfo * volatile *free_block_lists [MS_BLOCK_TYPE_MAX];
static guint64 stat_major_blocks_alloced = 0;
static guint64 stat_major_blocks_freed = 0;
}
#endif
-static void
-sweep_block (MSBlockInfo *block, gboolean during_major_collection);
+static gboolean sweep_block (MSBlockInfo *block);
static int
ms_find_block_obj_size_index (size_t size)
sgen_update_heap_boundaries ((mword)MS_BLOCK_FOR_BLOCK_INFO (block), (mword)MS_BLOCK_FOR_BLOCK_INFO (block) + MS_BLOCK_SIZE);
}
+/*
+ * Thread safe
+ */
static void*
ms_get_empty_block (void)
{
} while (SGEN_CAS_PTR (&empty_blocks, block, empty) != empty);
SGEN_ATOMIC_ADD_P (num_empty_blocks, 1);
+
+ binary_protocol_block_free (block, MS_BLOCK_SIZE);
+}
+
+static gboolean
+sweep_in_progress (void)
+{
+ int state = sweep_state;
+ return state == SWEEP_STATE_SWEEPING ||
+ state == SWEEP_STATE_SWEEPING_AND_ITERATING ||
+ state == SWEEP_STATE_COMPACTING;
+}
+
+static inline gboolean
+block_is_swept_or_marking (MSBlockInfo *block)
+{
+ gint32 state = block->state;
+ return state == BLOCK_STATE_SWEPT || state == BLOCK_STATE_MARKING;
}
//#define MARKSWEEP_CONSISTENCY_CHECK
static void
check_block_free_list (MSBlockInfo *block, int size, gboolean pinned)
{
- MSBlockInfo *b;
-
+ SGEN_ASSERT (0, !sweep_in_progress (), "Can't examine allocated blocks during sweep");
for (; block; block = block->next_free) {
+ SGEN_ASSERT (0, block->state != BLOCK_STATE_CHECKING, "Can't have a block we're checking in a free list.");
g_assert (block->obj_size == size);
g_assert ((pinned && block->pinned) || (!pinned && !block->pinned));
/* blocks in the free lists must have at least
one free slot */
- if (block->swept)
- g_assert (block->free_list);
+ g_assert (block->free_list);
/* the block must be in the allocated_blocks array */
g_assert (sgen_pointer_queue_find (&allocated_blocks, BLOCK_TAG (block)) != (size_t)-1);
int i;
/* check all blocks */
- FOREACH_BLOCK (block) {
+ FOREACH_BLOCK_NO_LOCK (block) {
int count = MS_BLOCK_FREE / block->obj_size;
int num_free = 0;
void **free;
- /* check block header */
- g_assert (((MSBlockHeader*)block->block)->info == block);
-
/* count number of free slots */
for (i = 0; i < count; ++i) {
void **obj = (void**) MS_BLOCK_OBJ (block, i);
g_assert (num_free == 0);
/* check all mark words are zero */
- if (block->swept) {
+ if (!sgen_concurrent_collection_in_progress () && block_is_swept_or_marking (block)) {
for (i = 0; i < MS_NUM_MARK_WORDS; ++i)
g_assert (block->mark_words [i] == 0);
}
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
/* check free blocks */
for (i = 0; i < num_block_obj_sizes; ++i) {
}
#endif
+static void
+add_free_block (MSBlockInfo * volatile *free_blocks, int size_index, MSBlockInfo *block)
+{
+ MSBlockInfo *old;
+ do {
+ block->next_free = old = free_blocks [size_index];
+ } while (SGEN_CAS_PTR ((gpointer)&free_blocks [size_index], block, old) != old);
+}
+
+static void major_finish_sweep_checking (void);
+
static gboolean
ms_alloc_block (int size_index, gboolean pinned, gboolean has_references)
{
int size = block_obj_sizes [size_index];
int count = MS_BLOCK_FREE / size;
MSBlockInfo *info;
- MSBlockInfo **free_blocks = FREE_BLOCKS (pinned, has_references);
+ MSBlockInfo * volatile * free_blocks = FREE_BLOCKS (pinned, has_references);
char *obj_start;
int i;
* want further evacuation.
*/
info->is_to_space = (sgen_get_current_collection_generation () == GENERATION_OLD);
- info->swept = 1;
+ info->state = (info->is_to_space || sgen_concurrent_collection_in_progress ()) ? BLOCK_STATE_MARKING : BLOCK_STATE_SWEPT;
+ SGEN_ASSERT (6, !sweep_in_progress () || info->state == BLOCK_STATE_SWEPT, "How do we add a new block to be swept while sweeping?");
info->cardtable_mod_union = NULL;
update_heap_boundaries_for_block (info);
+ binary_protocol_block_alloc (info, MS_BLOCK_SIZE);
+
/* build free list */
obj_start = MS_BLOCK_FOR_BLOCK_INFO (info) + MS_BLOCK_SKIP;
info->free_list = (void**)obj_start;
/* the last one */
*(void**)obj_start = NULL;
- info->next_free = free_blocks [size_index];
- free_blocks [size_index] = info;
+ add_free_block (free_blocks, size_index, info);
+
+ /*
+ * This is the only place where the `allocated_blocks` array can potentially grow.
+ * We need to make sure concurrent sweep isn't running when that happens, so in that
+ * specific case we just wait for sweep to finish.
+ */
+ if (sgen_pointer_queue_will_grow (&allocated_blocks))
+ major_finish_sweep_checking ();
sgen_pointer_queue_add (&allocated_blocks, BLOCK_TAG (info));
- ++num_major_sections;
+ SGEN_ATOMIC_ADD_P (num_major_sections, 1);
return TRUE;
}
{
MSBlockInfo *block;
- FOREACH_BLOCK (block) {
+ FOREACH_BLOCK_NO_LOCK (block) {
if (ptr >= MS_BLOCK_FOR_BLOCK_INFO (block) && ptr <= MS_BLOCK_FOR_BLOCK_INFO (block) + MS_BLOCK_SIZE)
return block->pinned;
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
return FALSE;
}
+static void
+ensure_can_access_block_free_list (MSBlockInfo *block)
+{
+ retry:
+ for (;;) {
+ switch (block->state) {
+ case BLOCK_STATE_SWEPT:
+ case BLOCK_STATE_MARKING:
+ return;
+ case BLOCK_STATE_CHECKING:
+ SGEN_ASSERT (0, FALSE, "How did we get a block that's being checked from a free list?");
+ break;
+ case BLOCK_STATE_NEED_SWEEPING:
+ if (sweep_block (block))
+ ++stat_major_blocks_lazy_swept;
+ break;
+ case BLOCK_STATE_SWEEPING:
+ /* FIXME: do this more elegantly */
+ g_usleep (100);
+ goto retry;
+ default:
+ SGEN_ASSERT (0, FALSE, "Illegal block state");
+ break;
+ }
+ }
+}
+
static void*
-unlink_slot_from_free_list_uncontested (MSBlockInfo **free_blocks, int size_index)
+unlink_slot_from_free_list_uncontested (MSBlockInfo * volatile *free_blocks, int size_index)
{
- MSBlockInfo *block;
- void *obj;
+ MSBlockInfo *block, *next_free_block;
+ void *obj, *next_free_slot;
+ retry:
block = free_blocks [size_index];
SGEN_ASSERT (9, block, "no free block to unlink from free_blocks %p size_index %d", free_blocks, size_index);
- if (G_UNLIKELY (!block->swept)) {
- stat_major_blocks_lazy_swept ++;
- sweep_block (block, FALSE);
- }
+ ensure_can_access_block_free_list (block);
obj = block->free_list;
- SGEN_ASSERT (9, obj, "block %p in free list had no available object to alloc from", block);
+ SGEN_ASSERT (6, obj, "block %p in free list had no available object to alloc from", block);
- block->free_list = *(void**)obj;
- if (!block->free_list) {
- free_blocks [size_index] = block->next_free;
- block->next_free = NULL;
+ next_free_slot = *(void**)obj;
+ if (next_free_slot) {
+ block->free_list = next_free_slot;
+ return obj;
}
+ next_free_block = block->next_free;
+ if (SGEN_CAS_PTR ((gpointer)&free_blocks [size_index], next_free_block, block) != block)
+ goto retry;
+
+ block->free_list = NULL;
+ block->next_free = NULL;
+
return obj;
}
alloc_obj (MonoVTable *vtable, size_t size, gboolean pinned, gboolean has_references)
{
int size_index = MS_BLOCK_OBJ_SIZE_INDEX (size);
- MSBlockInfo **free_blocks = FREE_BLOCKS (pinned, has_references);
+ MSBlockInfo * volatile * free_blocks = FREE_BLOCKS (pinned, has_references);
void *obj;
if (!free_blocks [size_index]) {
{
MSBlockInfo *block = MS_BLOCK_FOR_OBJ (obj);
int word, bit;
+ gboolean in_free_list;
+
+ SGEN_ASSERT (9, sweep_state == SWEEP_STATE_SWEPT, "Should have waited for sweep to free objects.");
- if (!block->swept)
- sweep_block (block, FALSE);
+ ensure_can_access_block_free_list (block);
SGEN_ASSERT (9, (pinned && block->pinned) || (!pinned && !block->pinned), "free-object pinning mixup object %p pinned %d block %p pinned %d", obj, pinned, block, block->pinned);
SGEN_ASSERT (9, MS_OBJ_ALLOCED (obj, block), "object %p is already free", obj);
MS_CALC_MARK_BIT (word, bit, obj);
SGEN_ASSERT (9, !MS_MARK_BIT (block, word, bit), "object %p has mark bit set");
- if (!block->free_list) {
- MSBlockInfo **free_blocks = FREE_BLOCKS (pinned, block->has_references);
- int size_index = MS_BLOCK_OBJ_SIZE_INDEX (size);
- SGEN_ASSERT (9, !block->next_free, "block %p doesn't have a free-list of object but belongs to a free-list of blocks");
- block->next_free = free_blocks [size_index];
- free_blocks [size_index] = block;
- }
+
memset (obj, 0, size);
+
+ in_free_list = !!block->free_list;
*(void**)obj = block->free_list;
block->free_list = (void**)obj;
+
+ if (!in_free_list) {
+ MSBlockInfo * volatile *free_blocks = FREE_BLOCKS (pinned, block->has_references);
+ int size_index = MS_BLOCK_OBJ_SIZE_INDEX (size);
+ SGEN_ASSERT (9, !block->next_free, "block %p doesn't have a free-list of object but belongs to a free-list of blocks");
+ add_free_block (free_blocks, size_index, block);
+ }
}
static void
static void*
major_alloc_degraded (MonoVTable *vtable, size_t size)
{
- void *obj;
- size_t old_num_sections;
-
- old_num_sections = num_major_sections;
-
- obj = alloc_obj (vtable, size, FALSE, SGEN_VTABLE_HAS_REFERENCES (vtable));
+ void *obj = alloc_obj (vtable, size, FALSE, SGEN_VTABLE_HAS_REFERENCES (vtable));
if (G_LIKELY (obj)) {
HEAVY_STAT (++stat_objects_alloced_degraded);
HEAVY_STAT (stat_bytes_alloced_degraded += size);
- g_assert (num_major_sections >= old_num_sections);
- sgen_register_major_sections_alloced (num_major_sections - old_num_sections);
}
return obj;
}
{
MSBlockInfo *block;
- FOREACH_BLOCK (block) {
+ FOREACH_BLOCK_NO_LOCK (block) {
if (ptr >= MS_BLOCK_FOR_BLOCK_INFO (block) && ptr <= MS_BLOCK_FOR_BLOCK_INFO (block) + MS_BLOCK_SIZE) {
int count = MS_BLOCK_FREE / block->obj_size;
int i;
}
return !block->pinned;
}
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
return FALSE;
}
+static gboolean
+try_set_sweep_state (int new, int expected)
+{
+ int old = SGEN_CAS (&sweep_state, new, expected);
+ return old == expected;
+}
+
+static void
+set_sweep_state (int new, int expected)
+{
+ gboolean success = try_set_sweep_state (new, expected);
+ SGEN_ASSERT (0, success, "Could not set sweep state.");
+}
+
+static gboolean ensure_block_is_checked_for_sweeping (int block_index, gboolean wait, gboolean *have_checked);
+
+static SgenThreadPoolJob * volatile sweep_job;
+
+static void
+major_finish_sweep_checking (void)
+{
+ int block_index;
+ SgenThreadPoolJob *job;
+
+ retry:
+ switch (sweep_state) {
+ case SWEEP_STATE_SWEPT:
+ case SWEEP_STATE_NEED_SWEEPING:
+ return;
+ case SWEEP_STATE_SWEEPING:
+ if (try_set_sweep_state (SWEEP_STATE_SWEEPING_AND_ITERATING, SWEEP_STATE_SWEEPING))
+ break;
+ goto retry;
+ case SWEEP_STATE_SWEEPING_AND_ITERATING:
+ SGEN_ASSERT (0, FALSE, "Is there another minor collection running?");
+ goto retry;
+ case SWEEP_STATE_COMPACTING:
+ goto wait;
+ default:
+ SGEN_ASSERT (0, FALSE, "Invalid sweep state.");
+ break;
+ }
+
+ /*
+ * We're running with the world stopped and the only other thread doing work is the
+ * sweep thread, which doesn't add blocks to the array, so we can safely access
+ * `next_slot`.
+ */
+ for (block_index = 0; block_index < allocated_blocks.next_slot; ++block_index)
+ ensure_block_is_checked_for_sweeping (block_index, FALSE, NULL);
+
+ set_sweep_state (SWEEP_STATE_SWEEPING, SWEEP_STATE_SWEEPING_AND_ITERATING);
+
+ wait:
+ job = sweep_job;
+ if (job)
+ sgen_thread_pool_job_wait (job);
+ SGEN_ASSERT (0, !sweep_job, "Why did the sweep job not null itself?");
+ SGEN_ASSERT (0, sweep_state == SWEEP_STATE_SWEPT, "How is the sweep job done but we're not swept?");
+}
+
static void
major_iterate_objects (IterateObjectsFlags flags, IterateObjectCallbackFunc callback, void *data)
{
gboolean pinned = flags & ITERATE_OBJECTS_PINNED;
MSBlockInfo *block;
- FOREACH_BLOCK (block) {
+ major_finish_sweep_checking ();
+ FOREACH_BLOCK_NO_LOCK (block) {
int count = MS_BLOCK_FREE / block->obj_size;
int i;
if (!block->pinned && !non_pinned)
continue;
if (sweep && lazy_sweep) {
- sweep_block (block, FALSE);
- SGEN_ASSERT (0, block->swept, "Block must be swept after sweeping");
+ sweep_block (block);
+ SGEN_ASSERT (6, block->state == BLOCK_STATE_SWEPT, "Block must be swept after sweeping");
}
for (i = 0; i < count; ++i) {
void **obj = (void**) MS_BLOCK_OBJ (block, i);
- if (!block->swept) {
+ /*
+ * We've finished sweep checking, but if we're sweeping lazily and
+ * the flags don't require us to sweep, the block might still need
+ * sweeping. In that case, we need to consult the mark bits to tell
+ * us whether an object slot is live.
+ */
+ if (!block_is_swept_or_marking (block)) {
int word, bit;
+ SGEN_ASSERT (6, !sweep && block->state == BLOCK_STATE_NEED_SWEEPING, "Has sweeping not finished?");
MS_CALC_MARK_BIT (word, bit, obj);
if (!MS_MARK_BIT (block, word, bit))
continue;
if (MS_OBJ_ALLOCED (obj, block))
callback ((char*)obj, block->obj_size, data);
}
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
}
static gboolean
{
MSBlockInfo *block;
- FOREACH_BLOCK (block) {
+ FOREACH_BLOCK_NO_LOCK (block) {
int idx;
char *obj;
if (obj != object)
return FALSE;
return MS_OBJ_ALLOCED (obj, block);
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
return FALSE;
}
{
MSBlockInfo *block;
- FOREACH_BLOCK (block) {
+ FOREACH_BLOCK_NO_LOCK (block) {
int idx;
char *obj;
gboolean live;
SGEN_LOG (0, " marked %d)\n", marked ? 1 : 0);
return vtable;
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
return NULL;
}
for (i = 0; i < num_block_obj_sizes; ++i)
slots_available [i] = slots_used [i] = 0;
- FOREACH_BLOCK (block) {
+ FOREACH_BLOCK_NO_LOCK (block) {
int index = ms_find_block_obj_size_index (block->obj_size);
int count = MS_BLOCK_FREE / block->obj_size;
if (MS_OBJ_ALLOCED (MS_BLOCK_OBJ (block, i), block))
++slots_used [index];
}
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
fprintf (heap_dump_file, "<occupancies>\n");
for (i = 0; i < num_block_obj_sizes; ++i) {
}
fprintf (heap_dump_file, "</occupancies>\n");
- FOREACH_BLOCK (block) {
+ FOREACH_BLOCK_NO_LOCK (block) {
int count = MS_BLOCK_FREE / block->obj_size;
int i;
int start = -1;
}
fprintf (heap_dump_file, "</section>\n");
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
}
#define LOAD_VTABLE SGEN_LOAD_VTABLE
major_copy_or_mark_object_with_evacuation_concurrent (void **ptr, void *obj, SgenGrayQueue *queue)
{
SGEN_ASSERT (9, sgen_concurrent_collection_in_progress (), "Why are we scanning concurrently when there's no concurrent collection on?");
- SGEN_ASSERT (9, !sgen_workers_are_working () || sgen_is_worker_thread (mono_native_thread_id_get ()), "We must not scan from two threads at the same time!");
+ SGEN_ASSERT (9, !sgen_workers_are_working () || sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()), "We must not scan from two threads at the same time!");
g_assert (!SGEN_OBJECT_IS_FORWARDED (obj));
}
}
+static inline gboolean
+try_set_block_state (MSBlockInfo *block, gint32 new_state, gint32 expected_state)
+{
+ gint32 old_state = SGEN_CAS (&block->state, new_state, expected_state);
+ gboolean success = old_state == expected_state;
+ if (success)
+ binary_protocol_block_set_state (block, MS_BLOCK_SIZE, old_state, new_state);
+ return success;
+}
+
+static inline void
+set_block_state (MSBlockInfo *block, gint32 new_state, gint32 expected_state)
+{
+ SGEN_ASSERT (6, block->state == expected_state, "Block state incorrect before set");
+ block->state = new_state;
+}
+
/*
- * sweep_block:
+ * If `block` needs sweeping, sweep it and return TRUE. Otherwise return FALSE.
*
- * Traverse BLOCK, freeing and zeroing unused objects.
+ * Sweeping means iterating through the block's slots and building the free-list from the
+ * unmarked ones. They will also be zeroed. The mark bits will be reset.
*/
-static void
-sweep_block (MSBlockInfo *block, gboolean during_major_collection)
+static gboolean
+sweep_block (MSBlockInfo *block)
{
int count;
void *reversed = NULL;
- if (!during_major_collection)
- g_assert (!sgen_concurrent_collection_in_progress ());
+ retry:
+ switch (block->state) {
+ case BLOCK_STATE_SWEPT:
+ return FALSE;
+ case BLOCK_STATE_MARKING:
+ case BLOCK_STATE_CHECKING:
+ SGEN_ASSERT (0, FALSE, "How did we get to sweep a block that's being marked or being checked?");
+ goto retry;
+ case BLOCK_STATE_SWEEPING:
+ /* FIXME: Do this more elegantly */
+ g_usleep (100);
+ goto retry;
+ case BLOCK_STATE_NEED_SWEEPING:
+ if (!try_set_block_state (block, BLOCK_STATE_SWEEPING, BLOCK_STATE_NEED_SWEEPING))
+ goto retry;
+ break;
+ default:
+ SGEN_ASSERT (0, FALSE, "Illegal block state");
+ }
- if (block->swept)
- return;
+ SGEN_ASSERT (6, block->state == BLOCK_STATE_SWEEPING, "How did we get here without setting state to sweeping?");
count = MS_BLOCK_FREE / block->obj_size;
}
block->free_list = reversed;
- block->swept = 1;
+ mono_memory_write_barrier ();
+
+ set_block_state (block, BLOCK_STATE_SWEPT, BLOCK_STATE_SWEEPING);
+
+ return TRUE;
}
static inline int
return count;
}
+/* statistics for evacuation */
+static size_t *sweep_slots_available;
+static size_t *sweep_slots_used;
+static size_t *sweep_num_blocks;
+
+static volatile size_t num_major_sections_before_sweep;
+static volatile size_t num_major_sections_freed_in_sweep;
+
static void
-major_sweep (void)
+sweep_start (void)
{
int i;
- MSBlockInfo *block;
-
- /* statistics for evacuation */
- int *slots_available = alloca (sizeof (int) * num_block_obj_sizes);
- int *slots_used = alloca (sizeof (int) * num_block_obj_sizes);
- int *num_blocks = alloca (sizeof (int) * num_block_obj_sizes);
-
- mword total_evacuate_heap = 0;
- mword total_evacuate_saved = 0;
for (i = 0; i < num_block_obj_sizes; ++i)
- slots_available [i] = slots_used [i] = num_blocks [i] = 0;
+ sweep_slots_available [i] = sweep_slots_used [i] = sweep_num_blocks [i] = 0;
/* clear all the free lists */
for (i = 0; i < MS_BLOCK_TYPE_MAX; ++i) {
- MSBlockInfo **free_blocks = free_block_lists [i];
+ MSBlockInfo * volatile *free_blocks = free_block_lists [i];
int j;
for (j = 0; j < num_block_obj_sizes; ++j)
free_blocks [j] = NULL;
}
+}
- /* traverse all blocks, free and zero unmarked objects */
- FOREACH_BLOCK (block) {
- int count;
- gboolean have_live = FALSE;
- gboolean has_pinned;
- gboolean have_free = FALSE;
- int obj_size_index;
- int nused = 0;
+static void sweep_finish (void);
- obj_size_index = block->obj_size_index;
+/*
+ * If `wait` is TRUE and the block is currently being checked, this function will wait until
+ * the checking has finished.
+ *
+ * Returns whether the block is still there. If `wait` is FALSE, the return value will not
+ * be correct, i.e. must not be used.
+ */
+static gboolean
+ensure_block_is_checked_for_sweeping (int block_index, gboolean wait, gboolean *have_checked)
+{
+ int count;
+ gboolean have_live = FALSE;
+ gboolean have_free = FALSE;
+ int nused = 0;
+ int block_state;
+ int i;
+ void *tagged_block;
+ MSBlockInfo *block;
+
+ SGEN_ASSERT (6, sweep_in_progress (), "Why do we call this function if there's no sweep in progress?");
+
+ if (have_checked)
+ *have_checked = FALSE;
- has_pinned = block->has_pinned;
- block->has_pinned = block->pinned;
+ retry:
+ tagged_block = *(void * volatile *)&allocated_blocks.data [block_index];
+ if (!tagged_block)
+ return FALSE;
- block->is_to_space = FALSE;
- block->swept = 0;
+ if (BLOCK_IS_TAGGED_CHECKING (tagged_block)) {
+ if (!wait)
+ return FALSE;
+ /* FIXME: do this more elegantly */
+ g_usleep (100);
+ goto retry;
+ }
- count = MS_BLOCK_FREE / block->obj_size;
+ if (SGEN_CAS_PTR (&allocated_blocks.data [block_index], BLOCK_TAG_CHECKING (tagged_block), tagged_block) != tagged_block)
+ goto retry;
- if (block->cardtable_mod_union) {
- sgen_free_internal_dynamic (block->cardtable_mod_union, CARDS_PER_BLOCK, INTERNAL_MEM_CARDTABLE_MOD_UNION);
- block->cardtable_mod_union = NULL;
- }
+ block = BLOCK_UNTAG (tagged_block);
+ block_state = block->state;
- /* Count marked objects in the block */
- for (i = 0; i < MS_NUM_MARK_WORDS; ++i) {
- nused += bitcount (block->mark_words [i]);
+ if (!sweep_in_progress ()) {
+ SGEN_ASSERT (6, block_state != BLOCK_STATE_SWEEPING && block_state != BLOCK_STATE_CHECKING, "Invalid block state.");
+ if (!lazy_sweep)
+ SGEN_ASSERT (6, block_state != BLOCK_STATE_NEED_SWEEPING, "Invalid block state.");
+ }
+
+ switch (block_state) {
+ case BLOCK_STATE_SWEPT:
+ case BLOCK_STATE_NEED_SWEEPING:
+ case BLOCK_STATE_SWEEPING:
+ goto done;
+ case BLOCK_STATE_MARKING:
+ break;
+ case BLOCK_STATE_CHECKING:
+ SGEN_ASSERT (0, FALSE, "We set the CHECKING bit - how can the stage be CHECKING?");
+ goto done;
+ default:
+ SGEN_ASSERT (0, FALSE, "Illegal block state");
+ break;
+ }
+
+ SGEN_ASSERT (6, block->state == BLOCK_STATE_MARKING, "When we sweep all blocks must start out marking.");
+ set_block_state (block, BLOCK_STATE_CHECKING, BLOCK_STATE_MARKING);
+
+ if (have_checked)
+ *have_checked = TRUE;
+
+ block->has_pinned = block->pinned;
+
+ block->is_to_space = FALSE;
+
+ count = MS_BLOCK_FREE / block->obj_size;
+
+ if (block->cardtable_mod_union) {
+ sgen_free_internal_dynamic (block->cardtable_mod_union, CARDS_PER_BLOCK, INTERNAL_MEM_CARDTABLE_MOD_UNION);
+ block->cardtable_mod_union = NULL;
+ }
+
+ /* Count marked objects in the block */
+ for (i = 0; i < MS_NUM_MARK_WORDS; ++i)
+ nused += bitcount (block->mark_words [i]);
+
+ if (nused)
+ have_live = TRUE;
+ if (nused < count)
+ have_free = TRUE;
+
+ if (have_live) {
+ int obj_size_index = block->obj_size_index;
+ gboolean has_pinned = block->has_pinned;
+
+ set_block_state (block, BLOCK_STATE_NEED_SWEEPING, BLOCK_STATE_CHECKING);
+
+ /*
+ * FIXME: Go straight to SWEPT if there are no free slots. We need
+ * to set the free slot list to NULL, though, and maybe update some
+ * statistics.
+ */
+ if (!lazy_sweep)
+ sweep_block (block);
+
+ if (!has_pinned) {
+ ++sweep_num_blocks [obj_size_index];
+ sweep_slots_used [obj_size_index] += nused;
+ sweep_slots_available [obj_size_index] += count;
}
- if (nused) {
- have_live = TRUE;
+
+ /*
+ * If there are free slots in the block, add
+ * the block to the corresponding free list.
+ */
+ if (have_free) {
+ MSBlockInfo * volatile *free_blocks = FREE_BLOCKS (block->pinned, block->has_references);
+
+ if (!lazy_sweep)
+ SGEN_ASSERT (6, block->free_list, "How do we not have a free list when there are free slots?");
+
+ add_free_block (free_blocks, obj_size_index, block);
}
- if (nused < count)
- have_free = TRUE;
- if (!lazy_sweep)
- sweep_block (block, TRUE);
+ /* FIXME: Do we need the heap boundaries while we do nursery collections? */
+ update_heap_boundaries_for_block (block);
+ } else {
+ /*
+ * Blocks without live objects are removed from the
+ * block list and freed.
+ */
+ SGEN_ASSERT (6, block_index < allocated_blocks.next_slot, "How did the number of blocks shrink?");
+ SGEN_ASSERT (6, allocated_blocks.data [block_index] == BLOCK_TAG_CHECKING (tagged_block), "How did the block move?");
- if (have_live) {
- if (!has_pinned) {
- ++num_blocks [obj_size_index];
- slots_used [obj_size_index] += nused;
- slots_available [obj_size_index] += count;
- }
+ binary_protocol_empty (MS_BLOCK_OBJ (block, 0), (char*)MS_BLOCK_OBJ (block, count) - (char*)MS_BLOCK_OBJ (block, 0));
+ ms_free_block (block);
- /*
- * If there are free slots in the block, add
- * the block to the corresponding free list.
- */
- if (have_free) {
- MSBlockInfo **free_blocks = FREE_BLOCKS (block->pinned, block->has_references);
- int index = MS_BLOCK_OBJ_SIZE_INDEX (block->obj_size);
- block->next_free = free_blocks [index];
- free_blocks [index] = block;
- }
+ SGEN_ATOMIC_ADD_P (num_major_sections, -1);
- update_heap_boundaries_for_block (block);
- } else {
- /*
- * Blocks without live objects are removed from the
- * block list and freed.
- */
- DELETE_BLOCK_IN_FOREACH ();
+ tagged_block = NULL;
+ }
- binary_protocol_empty (MS_BLOCK_OBJ (block, 0), (char*)MS_BLOCK_OBJ (block, count) - (char*)MS_BLOCK_OBJ (block, 0));
- ms_free_block (block);
+ done:
+ allocated_blocks.data [block_index] = tagged_block;
+ return !!tagged_block;
+}
- --num_major_sections;
+static void
+sweep_job_func (void *thread_data_untyped, SgenThreadPoolJob *job)
+{
+ int block_index;
+ int num_blocks = num_major_sections_before_sweep;
+
+ SGEN_ASSERT (0, sweep_in_progress (), "Sweep thread called with wrong state");
+ SGEN_ASSERT (0, num_blocks <= allocated_blocks.next_slot, "How did we lose blocks?");
+
+ /*
+ * We traverse the block array from high to low. Nursery collections will have to
+ * cooperate with the sweep thread to finish sweeping, and they will traverse from
+ * low to high, to avoid constantly colliding on the same blocks.
+ */
+ for (block_index = num_blocks - 1; block_index >= 0; --block_index) {
+ gboolean have_checked;
+
+ /*
+ * The block might have been freed by another thread doing some checking
+ * work.
+ */
+ if (!ensure_block_is_checked_for_sweeping (block_index, TRUE, &have_checked))
+ ++num_major_sections_freed_in_sweep;
+ }
+
+ while (!try_set_sweep_state (SWEEP_STATE_COMPACTING, SWEEP_STATE_SWEEPING)) {
+ /*
+ * The main GC thread is currently iterating over the block array to help us
+ * finish the sweep. We have already finished, but we don't want to mess up
+ * that iteration, so we just wait for it.
+ */
+ g_usleep (100);
+ }
+
+ if (SGEN_MAX_ASSERT_LEVEL >= 6) {
+ for (block_index = num_blocks; block_index < allocated_blocks.next_slot; ++block_index) {
+ MSBlockInfo *block = BLOCK_UNTAG (allocated_blocks.data [block_index]);
+ SGEN_ASSERT (6, block && block->state == BLOCK_STATE_SWEPT, "How did a new block to be swept get added while swept?");
}
- } END_FOREACH_BLOCK;
+ }
+
sgen_pointer_queue_remove_nulls (&allocated_blocks);
+ sweep_finish ();
+
+ sweep_job = NULL;
+}
+
+static void
+sweep_finish (void)
+{
+ mword total_evacuate_heap = 0;
+ mword total_evacuate_saved = 0;
+ int i;
+
for (i = 0; i < num_block_obj_sizes; ++i) {
- float usage = (float)slots_used [i] / (float)slots_available [i];
- if (num_blocks [i] > 5 && usage < evacuation_threshold) {
+ float usage = (float)sweep_slots_used [i] / (float)sweep_slots_available [i];
+ if (sweep_num_blocks [i] > 5 && usage < evacuation_threshold) {
evacuate_block_obj_sizes [i] = TRUE;
/*
g_print ("slot size %d - %d of %d used\n",
evacuate_block_obj_sizes [i] = FALSE;
}
{
- mword total_bytes = block_obj_sizes [i] * slots_available [i];
+ mword total_bytes = block_obj_sizes [i] * sweep_slots_available [i];
total_evacuate_heap += total_bytes;
if (evacuate_block_obj_sizes [i])
- total_evacuate_saved += total_bytes - block_obj_sizes [i] * slots_used [i];
+ total_evacuate_saved += total_bytes - block_obj_sizes [i] * sweep_slots_used [i];
}
}
want_evacuation = (float)total_evacuate_saved / (float)total_evacuate_heap > (1 - concurrent_evacuation_threshold);
- have_swept = TRUE;
+ set_sweep_state (SWEEP_STATE_SWEPT, SWEEP_STATE_COMPACTING);
+}
+
+static void
+major_sweep (void)
+{
+ set_sweep_state (SWEEP_STATE_SWEEPING, SWEEP_STATE_NEED_SWEEPING);
+
+ sweep_start ();
+
+ SGEN_ASSERT (0, num_major_sections == allocated_blocks.next_slot, "We don't know how many blocks we have?");
+
+ num_major_sections_before_sweep = num_major_sections;
+ num_major_sections_freed_in_sweep = 0;
+
+ SGEN_ASSERT (0, !sweep_job, "We haven't finished the last sweep?");
+ if (concurrent_sweep) {
+ sweep_job = sgen_thread_pool_job_alloc ("sweep", sweep_job_func, sizeof (SgenThreadPoolJob));
+ sgen_thread_pool_job_enqueue (sweep_job);
+ } else {
+ sweep_job_func (NULL, NULL);
+ }
}
static gboolean
-major_have_finished_sweeping (void)
+major_have_swept (void)
{
- return have_swept;
+ return sweep_state == SWEEP_STATE_SWEPT;
}
static int count_pinned_ref;
#ifdef MARKSWEEP_CONSISTENCY_CHECK
consistency_check ();
#endif
- sgen_register_major_sections_alloced (num_major_sections - old_num_major_sections);
}
static void
major_start_major_collection (void)
{
+ MSBlockInfo *block;
int i;
- /* clear the free lists */
+ major_finish_sweep_checking ();
+
+ /*
+ * Clear the free lists for block sizes where we do evacuation. For those block
+ * sizes we will have to allocate new blocks.
+ */
for (i = 0; i < num_block_obj_sizes; ++i) {
if (!evacuate_block_obj_sizes [i])
continue;
free_block_lists [MS_BLOCK_FLAG_REFS][i] = NULL;
}
- // Sweep all unswept blocks
- if (lazy_sweep) {
- MSBlockInfo *block;
-
+ if (lazy_sweep)
MONO_GC_SWEEP_BEGIN (GENERATION_OLD, TRUE);
- FOREACH_BLOCK (block) {
- sweep_block (block, TRUE);
- } END_FOREACH_BLOCK;
+ /* Sweep all unswept blocks and set them to MARKING */
+ FOREACH_BLOCK_NO_LOCK (block) {
+ if (lazy_sweep)
+ sweep_block (block);
+ SGEN_ASSERT (0, block->state == BLOCK_STATE_SWEPT, "All blocks must be swept when we're pinning.");
+ set_block_state (block, BLOCK_STATE_MARKING, BLOCK_STATE_SWEPT);
+ } END_FOREACH_BLOCK_NO_LOCK;
+ if (lazy_sweep)
MONO_GC_SWEEP_END (GENERATION_OLD, TRUE);
- }
- SGEN_ASSERT (0, have_swept, "Cannot start major collection without having finished sweeping");
- have_swept = FALSE;
+ set_sweep_state (SWEEP_STATE_NEED_SWEEPING, SWEEP_STATE_SWEPT);
}
static void
}
#endif
+/*
+ * This is called with sweep completed and the world stopped.
+ */
static void
-major_free_swept_blocks (void)
+major_free_swept_blocks (size_t allowance)
{
- size_t section_reserve = sgen_get_minor_collection_allowance () / MS_BLOCK_SIZE;
+ /* FIXME: This is probably too much. It's assuming all objects are small. */
+ size_t section_reserve = allowance / MS_BLOCK_SIZE;
- g_assert (have_swept);
+ SGEN_ASSERT (0, sweep_state == SWEEP_STATE_SWEPT, "Sweeping must have finished before freeing blocks");
#if SIZEOF_VOID_P != 8
{
for (i = 0; i < arr_length; ++i) {
int d = dest;
void *block = empty_block_arr [i];
- SGEN_ASSERT (0, block, "we're not shifting correctly");
+ SGEN_ASSERT (6, block, "we're not shifting correctly");
if (i != dest) {
empty_block_arr [dest] = block;
/*
continue;
}
- SGEN_ASSERT (0, first >= 0 && d > first, "algorithm is wrong");
+ SGEN_ASSERT (6, first >= 0 && d > first, "algorithm is wrong");
if ((char*)block != ((char*)empty_block_arr [d-1]) + MS_BLOCK_SIZE) {
first = d;
}
}
- SGEN_ASSERT (0, dest <= i && dest <= arr_length, "array length is off");
+ SGEN_ASSERT (6, dest <= i && dest <= arr_length, "array length is off");
arr_length = dest;
- SGEN_ASSERT (0, arr_length == num_empty_blocks, "array length is off");
+ SGEN_ASSERT (6, arr_length == num_empty_blocks, "array length is off");
num_blocks >>= 1;
}
rebuild_next = (void**)&empty_blocks;
for (i = 0; i < arr_length; ++i) {
void *block = empty_block_arr [i];
- SGEN_ASSERT (0, block, "we're missing blocks");
+ SGEN_ASSERT (6, block, "we're missing blocks");
*rebuild_next = block;
rebuild_next = (void**)block;
}
{
MSBlockInfo *block;
- FOREACH_BLOCK (block) {
+ FOREACH_BLOCK_NO_LOCK (block) {
size_t first_entry, last_entry;
- SGEN_ASSERT (0, block->swept, "All blocks must be swept when we're pinning.");
+ SGEN_ASSERT (6, block_is_swept_or_marking (block), "All blocks must be swept when we're pinning.");
sgen_find_optimized_pin_queue_area (MS_BLOCK_FOR_BLOCK_INFO (block) + MS_BLOCK_SKIP, MS_BLOCK_FOR_BLOCK_INFO (block) + MS_BLOCK_SIZE,
&first_entry, &last_entry);
mark_pinned_objects_in_block (block, first_entry, last_entry, queue);
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
}
static void
gint64 size = 0;
MSBlockInfo *block;
- FOREACH_BLOCK (block) {
+ /*
+ * We're holding the GC lock, but the sweep thread might be running. Make sure it's
+ * finished, then we can iterate over the block array.
+ */
+ major_finish_sweep_checking ();
+
+ FOREACH_BLOCK_NO_LOCK_CONDITION (TRUE, block) {
int count = MS_BLOCK_FREE / block->obj_size;
void **iter;
size += count * block->obj_size;
for (iter = block->free_list; iter; iter = (void**)*iter)
size -= block->obj_size;
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
return size;
}
+/* FIXME: return number of bytes, not of sections */
static size_t
get_num_major_sections (void)
{
return num_major_sections;
}
+/*
+ * Returns the number of bytes in blocks that were present when the last sweep was
+ * initiated, and were not freed during the sweep. They are the basis for calculating the
+ * allowance.
+ */
+static size_t
+get_bytes_survived_last_sweep (void)
+{
+ SGEN_ASSERT (0, sweep_state == SWEEP_STATE_SWEPT, "Can only query unswept sections after sweep");
+ return (num_major_sections_before_sweep - num_major_sections_freed_in_sweep) * MS_BLOCK_SIZE;
+}
+
static gboolean
major_handle_gc_param (const char *opt)
{
} else if (!strcmp (opt, "no-lazy-sweep")) {
lazy_sweep = FALSE;
return TRUE;
+ } else if (!strcmp (opt, "concurrent-sweep")) {
+ concurrent_sweep = TRUE;
+ return TRUE;
+ } else if (!strcmp (opt, "no-concurrent-sweep")) {
+ concurrent_sweep = FALSE;
+ return TRUE;
}
return FALSE;
""
" evacuation-threshold=P (where P is a percentage, an integer in 0-100)\n"
" (no-)lazy-sweep\n"
+ " (no-)concurrent-sweep\n"
);
}
+/*
+ * This callback is used to clear cards, move cards to the shadow table and do counting.
+ */
static void
major_iterate_live_block_ranges (sgen_cardtable_block_callback callback)
{
MSBlockInfo *block;
gboolean has_references;
- FOREACH_BLOCK_HAS_REFERENCES (block, has_references) {
+ major_finish_sweep_checking ();
+ FOREACH_BLOCK_HAS_REFERENCES_NO_LOCK (block, has_references) {
if (has_references)
callback ((mword)MS_BLOCK_FOR_BLOCK_INFO (block), MS_BLOCK_SIZE);
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
}
#ifdef HEAVY_STATISTICS
}
static void
-major_scan_card_table (gboolean mod_union, SgenGrayQueue *queue)
+scan_card_table_for_block (MSBlockInfo *block, gboolean mod_union, ScanObjectFunc scan_func, SgenGrayQueue *queue)
{
- MSBlockInfo *block;
- gboolean has_references;
- ScanObjectFunc scan_func = sgen_get_current_object_ops ()->scan_object;
-
- if (!concurrent_mark)
- g_assert (!mod_union);
-
- FOREACH_BLOCK_HAS_REFERENCES (block, has_references) {
#ifndef SGEN_HAVE_OVERLAPPING_CARDS
- guint8 cards_copy [CARDS_PER_BLOCK];
+ guint8 cards_copy [CARDS_PER_BLOCK];
#endif
- gboolean small_objects;
- int block_obj_size;
- char *block_start;
- guint8 *card_data, *card_base;
- guint8 *card_data_end;
- char *scan_front = NULL;
+ gboolean small_objects;
+ int block_obj_size;
+ char *block_start;
+ guint8 *card_data, *card_base;
+ guint8 *card_data_end;
+ char *scan_front = NULL;
-#ifdef PREFETCH_CARDS
- int prefetch_index = __index + 6;
- if (prefetch_index < allocated_blocks.next_slot) {
- MSBlockInfo *prefetch_block = BLOCK_UNTAG_HAS_REFERENCES (allocated_blocks.data [prefetch_index]);
- guint8 *prefetch_cards = sgen_card_table_get_card_scan_address ((mword)MS_BLOCK_FOR_BLOCK_INFO (prefetch_block));
- PREFETCH_READ (prefetch_block);
- PREFETCH_WRITE (prefetch_cards);
- PREFETCH_WRITE (prefetch_cards + 32);
- }
-#endif
+ block_obj_size = block->obj_size;
+ small_objects = block_obj_size < CARD_SIZE_IN_BYTES;
- if (!has_references)
- continue;
-
- block_obj_size = block->obj_size;
- small_objects = block_obj_size < CARD_SIZE_IN_BYTES;
-
- block_start = MS_BLOCK_FOR_BLOCK_INFO (block);
+ block_start = MS_BLOCK_FOR_BLOCK_INFO (block);
+ /*
+ * This is safe in face of card aliasing for the following reason:
+ *
+ * Major blocks are 16k aligned, or 32 cards aligned.
+ * Cards aliasing happens in powers of two, so as long as major blocks are aligned to their
+ * sizes, they won't overflow the cardtable overlap modulus.
+ */
+ if (mod_union) {
+ card_data = card_base = block->cardtable_mod_union;
/*
- * This is safe in face of card aliasing for the following reason:
- *
- * Major blocks are 16k aligned, or 32 cards aligned.
- * Cards aliasing happens in powers of two, so as long as major blocks are aligned to their
- * sizes, they won't overflow the cardtable overlap modulus.
+ * This happens when the nursery collection that precedes finishing
+ * the concurrent collection allocates new major blocks.
*/
- if (mod_union) {
- card_data = card_base = block->cardtable_mod_union;
- /*
- * This happens when the nursery collection that precedes finishing
- * the concurrent collection allocates new major blocks.
- */
- if (!card_data)
- continue;
- } else {
+ if (!card_data)
+ return;
+ } else {
#ifdef SGEN_HAVE_OVERLAPPING_CARDS
- card_data = card_base = sgen_card_table_get_card_scan_address ((mword)block_start);
+ card_data = card_base = sgen_card_table_get_card_scan_address ((mword)block_start);
#else
- if (!sgen_card_table_get_card_data (cards_copy, (mword)block_start, CARDS_PER_BLOCK))
- continue;
- card_data = card_base = cards_copy;
+ if (!sgen_card_table_get_card_data (cards_copy, (mword)block_start, CARDS_PER_BLOCK))
+ return;
+ card_data = card_base = cards_copy;
#endif
- }
- card_data_end = card_data + CARDS_PER_BLOCK;
+ }
+ card_data_end = card_data + CARDS_PER_BLOCK;
- card_data += MS_BLOCK_SKIP >> CARD_BITS;
+ card_data += MS_BLOCK_SKIP >> CARD_BITS;
- card_data = initial_skip_card (card_data);
- while (card_data < card_data_end) {
- size_t card_index, first_object_index;
- char *start;
- char *end;
- char *first_obj, *obj;
+ card_data = initial_skip_card (card_data);
+ while (card_data < card_data_end) {
+ size_t card_index, first_object_index;
+ char *start;
+ char *end;
+ char *first_obj, *obj;
- HEAVY_STAT (++scanned_cards);
+ HEAVY_STAT (++scanned_cards);
- if (!*card_data) {
- ++card_data;
- continue;
- }
+ if (!*card_data) {
+ ++card_data;
+ continue;
+ }
- card_index = card_data - card_base;
- start = (char*)(block_start + card_index * CARD_SIZE_IN_BYTES);
- end = start + CARD_SIZE_IN_BYTES;
+ card_index = card_data - card_base;
+ start = (char*)(block_start + card_index * CARD_SIZE_IN_BYTES);
+ end = start + CARD_SIZE_IN_BYTES;
- if (!block->swept)
- sweep_block (block, FALSE);
+ if (!block_is_swept_or_marking (block))
+ sweep_block (block);
- HEAVY_STAT (++marked_cards);
+ HEAVY_STAT (++marked_cards);
- if (small_objects)
- sgen_card_table_prepare_card_for_scanning (card_data);
+ if (small_objects)
+ sgen_card_table_prepare_card_for_scanning (card_data);
- /*
- * If the card we're looking at starts at or in the block header, we
- * must start at the first object in the block, without calculating
- * the index of the object we're hypothetically starting at, because
- * it would be negative.
- */
- if (card_index <= (MS_BLOCK_SKIP >> CARD_BITS))
- first_object_index = 0;
- else
- first_object_index = MS_BLOCK_OBJ_INDEX_FAST (start, block_start, block_obj_size);
+ /*
+ * If the card we're looking at starts at or in the block header, we
+ * must start at the first object in the block, without calculating
+ * the index of the object we're hypothetically starting at, because
+ * it would be negative.
+ */
+ if (card_index <= (MS_BLOCK_SKIP >> CARD_BITS))
+ first_object_index = 0;
+ else
+ first_object_index = MS_BLOCK_OBJ_INDEX_FAST (start, block_start, block_obj_size);
- obj = first_obj = (char*)MS_BLOCK_OBJ_FAST (block_start, block_obj_size, first_object_index);
+ obj = first_obj = (char*)MS_BLOCK_OBJ_FAST (block_start, block_obj_size, first_object_index);
- while (obj < end) {
- if (obj < scan_front || !MS_OBJ_ALLOCED_FAST (obj, block_start))
- goto next_object;
+ binary_protocol_card_scan (first_obj, end - first_obj);
- if (mod_union) {
- /* FIXME: do this more efficiently */
- int w, b;
- MS_CALC_MARK_BIT (w, b, obj);
- if (!MS_MARK_BIT (block, w, b))
- goto next_object;
- }
+ while (obj < end) {
+ if (obj < scan_front || !MS_OBJ_ALLOCED_FAST (obj, block_start))
+ goto next_object;
- if (small_objects) {
- HEAVY_STAT (++scanned_objects);
- scan_func (obj, sgen_obj_get_descriptor (obj), queue);
- } else {
- size_t offset = card_offset (obj, block_start);
- sgen_cardtable_scan_object (obj, block_obj_size, card_base + offset, mod_union, queue);
- }
- next_object:
- obj += block_obj_size;
- g_assert (scan_front <= obj);
- scan_front = obj;
+ if (mod_union) {
+ /* FIXME: do this more efficiently */
+ int w, b;
+ MS_CALC_MARK_BIT (w, b, obj);
+ if (!MS_MARK_BIT (block, w, b))
+ goto next_object;
}
- HEAVY_STAT (if (*card_data) ++remarked_cards);
- binary_protocol_card_scan (first_obj, obj - first_obj);
-
- if (small_objects)
- ++card_data;
- else
- card_data = card_base + card_offset (obj, block_start);
+ if (small_objects) {
+ HEAVY_STAT (++scanned_objects);
+ scan_func (obj, sgen_obj_get_descriptor (obj), queue);
+ } else {
+ size_t offset = card_offset (obj, block_start);
+ sgen_cardtable_scan_object (obj, block_obj_size, card_base + offset, mod_union, queue);
+ }
+ next_object:
+ obj += block_obj_size;
+ g_assert (scan_front <= obj);
+ scan_front = obj;
}
- } END_FOREACH_BLOCK;
+
+ HEAVY_STAT (if (*card_data) ++remarked_cards);
+
+ if (small_objects)
+ ++card_data;
+ else
+ card_data = card_base + card_offset (obj, block_start);
+ }
+}
+
+static void
+major_scan_card_table (gboolean mod_union, SgenGrayQueue *queue)
+{
+ ScanObjectFunc scan_func = sgen_get_current_object_ops ()->scan_object;
+ MSBlockInfo *block;
+ gboolean has_references;
+
+ if (!concurrent_mark)
+ g_assert (!mod_union);
+
+ major_finish_sweep_checking ();
+ FOREACH_BLOCK_HAS_REFERENCES_NO_LOCK (block, has_references) {
+#ifdef PREFETCH_CARDS
+ int prefetch_index = __index + 6;
+ if (prefetch_index < allocated_blocks.next_slot) {
+ MSBlockInfo *prefetch_block = BLOCK_UNTAG (allocated_blocks.data [prefetch_index]);
+ guint8 *prefetch_cards = sgen_card_table_get_card_scan_address ((mword)MS_BLOCK_FOR_BLOCK_INFO (prefetch_block));
+ PREFETCH_READ (prefetch_block);
+ PREFETCH_WRITE (prefetch_cards);
+ PREFETCH_WRITE (prefetch_cards + 32);
+ }
+#endif
+
+ if (!has_references)
+ continue;
+
+ scan_card_table_for_block (block, mod_union, scan_func, queue);
+ } END_FOREACH_BLOCK_NO_LOCK;
}
static void
long long total_cards = 0;
long long marked_cards = 0;
- FOREACH_BLOCK_HAS_REFERENCES (block, has_references) {
+ if (sweep_in_progress ()) {
+ *num_total_cards = -1;
+ *num_marked_cards = -1;
+ return;
+ }
+
+ FOREACH_BLOCK_HAS_REFERENCES_NO_LOCK (block, has_references) {
guint8 *cards = sgen_card_table_get_card_scan_address ((mword) MS_BLOCK_FOR_BLOCK_INFO (block));
int i;
if (cards [i])
++marked_cards;
}
- } END_FOREACH_BLOCK;
+ } END_FOREACH_BLOCK_NO_LOCK;
*num_total_cards = total_cards;
*num_marked_cards = marked_cards;
{
MSBlockInfo *block;
- FOREACH_BLOCK (block) {
+ FOREACH_BLOCK_NO_LOCK (block) {
size_t num_cards;
block->cardtable_mod_union = sgen_card_table_update_mod_union (block->cardtable_mod_union,
MS_BLOCK_FOR_BLOCK_INFO (block), MS_BLOCK_SIZE, &num_cards);
- SGEN_ASSERT (0, num_cards == CARDS_PER_BLOCK, "Number of cards calculation is wrong");
- } END_FOREACH_BLOCK;
+ SGEN_ASSERT (6, num_cards == CARDS_PER_BLOCK, "Number of cards calculation is wrong");
+ } END_FOREACH_BLOCK_NO_LOCK;
}
static guint8*
return &block->cardtable_mod_union [offset];
}
-static void
-alloc_free_block_lists (MSBlockInfo ***lists)
-{
- int i;
- for (i = 0; i < MS_BLOCK_TYPE_MAX; ++i)
- lists [i] = sgen_alloc_internal_dynamic (sizeof (MSBlockInfo*) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE);
-}
-
#undef pthread_create
static void
post_param_init (SgenMajorCollector *collector)
{
collector->sweeps_lazily = lazy_sweep;
+ collector->needs_thread_pool = concurrent_mark || concurrent_sweep;
}
static void
for (i = 0; i < num_block_obj_sizes; ++i)
evacuate_block_obj_sizes [i] = FALSE;
+ sweep_slots_available = sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE);
+ sweep_slots_used = sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE);
+ sweep_num_blocks = sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE);
+
/*
{
int i;
}
*/
- alloc_free_block_lists (free_block_lists);
+ for (i = 0; i < MS_BLOCK_TYPE_MAX; ++i)
+ free_block_lists [i] = sgen_alloc_internal_dynamic (sizeof (MSBlockInfo*) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE);
for (i = 0; i < MS_NUM_FAST_BLOCK_OBJ_SIZE_INDEXES; ++i)
fast_block_obj_size_indexes [i] = ms_find_block_obj_size_index (i * 8);
collector->section_size = MAJOR_SECTION_SIZE;
concurrent_mark = is_concurrent;
- if (is_concurrent) {
- collector->is_concurrent = TRUE;
+ collector->is_concurrent = is_concurrent;
+ collector->needs_thread_pool = is_concurrent || concurrent_sweep;
+ if (is_concurrent)
collector->want_synchronous_collection = &want_evacuation;
- } else {
- collector->is_concurrent = FALSE;
+ else
collector->want_synchronous_collection = NULL;
- }
collector->get_and_reset_num_major_objects_marked = major_get_and_reset_num_major_objects_marked;
collector->supports_cardtable = TRUE;
}
collector->init_to_space = major_init_to_space;
collector->sweep = major_sweep;
- collector->have_finished_sweeping = major_have_finished_sweeping;
+ collector->have_swept = major_have_swept;
+ collector->finish_sweeping = major_finish_sweep_checking;
collector->free_swept_blocks = major_free_swept_blocks;
collector->check_scan_starts = major_check_scan_starts;
collector->dump_heap = major_dump_heap;
collector->obj_is_from_pinned_alloc = obj_is_from_pinned_alloc;
collector->report_pinned_memory_usage = major_report_pinned_memory_usage;
collector->get_num_major_sections = get_num_major_sections;
+ collector->get_bytes_survived_last_sweep = get_bytes_survived_last_sweep;
collector->handle_gc_param = major_handle_gc_param;
collector->print_gc_param_usage = major_print_gc_param_usage;
collector->post_param_init = post_param_init;
}
#if !defined (FIXED_HEAP) && !defined (SGEN_PARALLEL_MARK)
- /* FIXME: this will not work with evacuation or the split nursery. */
if (!is_concurrent)
collector->drain_gray_stack = drain_gray_stack;
#include "metadata/sgen-gc.h"
#include "metadata/sgen-memory-governor.h"
+#include "metadata/sgen-thread-pool.h"
#include "metadata/mono-gc.h"
#include "utils/mono-counters.h"
/* use this to tune when to do a major/minor collection */
static mword memory_pressure = 0;
-static mword minor_collection_allowance;
-static mword minor_collection_sections_alloced = 0;
+static mword major_collection_trigger_size;
static mword last_major_num_sections = 0;
static mword last_los_memory_usage = 0;
static gboolean need_calculate_minor_collection_allowance;
-static mword last_collection_old_num_major_sections;
+/* The size of the LOS after the last major collection, after sweeping. */
static mword last_collection_los_memory_usage = 0;
-static mword last_collection_old_los_memory_usage;
-static mword last_collection_los_memory_alloced;
static mword sgen_memgov_available_free_space (void);
/* GC trigger heuristics. */
static void
-sgen_memgov_try_calculate_minor_collection_allowance (gboolean overwrite)
+sgen_memgov_calculate_minor_collection_allowance (void)
{
- size_t num_major_sections;
- mword new_major, new_heap_size, allowance_target;
-
- if (overwrite)
- g_assert (need_calculate_minor_collection_allowance);
+ size_t new_major, new_heap_size, allowance_target, allowance;
if (!need_calculate_minor_collection_allowance)
return;
- if (!major_collector.have_finished_sweeping ()) {
- if (overwrite)
- minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
- return;
- }
-
- num_major_sections = major_collector.get_num_major_sections ();
+ SGEN_ASSERT (0, major_collector.have_swept (), "Can only calculate allowance if heap is swept");
- new_major = num_major_sections * major_collector.section_size;
+ new_major = major_collector.get_bytes_survived_last_sweep ();
new_heap_size = new_major + last_collection_los_memory_usage;
/*
*/
allowance_target = new_heap_size / 3;
- minor_collection_allowance = MAX (allowance_target, MIN_MINOR_COLLECTION_ALLOWANCE);
+ allowance = MAX (allowance_target, MIN_MINOR_COLLECTION_ALLOWANCE);
- if (new_heap_size + minor_collection_allowance > soft_heap_limit) {
+ if (new_heap_size + allowance > soft_heap_limit) {
if (new_heap_size > soft_heap_limit)
- minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
+ allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
else
- minor_collection_allowance = MAX (soft_heap_limit - new_heap_size, MIN_MINOR_COLLECTION_ALLOWANCE);
- }
-
- if (debug_print_allowance) {
- mword old_major = last_collection_old_num_major_sections * major_collector.section_size;
-
- SGEN_LOG (1, "Before collection: %ld bytes (%ld major, %ld LOS)",
- (long)(old_major + last_collection_old_los_memory_usage), (long)old_major, (long)last_collection_old_los_memory_usage);
- SGEN_LOG (1, "After collection: %ld bytes (%ld major, %ld LOS)",
- (long)new_heap_size, (long)new_major, (long)last_collection_los_memory_usage);
- SGEN_LOG (1, "Allowance: %ld bytes", (long)minor_collection_allowance);
+ allowance = MAX (soft_heap_limit - new_heap_size, MIN_MINOR_COLLECTION_ALLOWANCE);
}
+ /* FIXME: Why is this here? */
if (major_collector.free_swept_blocks)
- major_collector.free_swept_blocks ();
+ major_collector.free_swept_blocks (allowance);
+
+ major_collection_trigger_size = new_heap_size + allowance;
need_calculate_minor_collection_allowance = FALSE;
-}
+ if (debug_print_allowance) {
+ SGEN_LOG (0, "Surviving sweep: %ld bytes (%ld major, %ld LOS)", (long)new_heap_size, (long)new_major, (long)last_collection_los_memory_usage);
+ SGEN_LOG (0, "Allowance: %ld bytes", (long)allowance);
+ SGEN_LOG (0, "Trigger size: %ld bytes", (long)major_collection_trigger_size);
+ }
+}
gboolean
sgen_need_major_collection (mword space_needed)
{
- mword los_alloced;
+ size_t heap_size;
+
if (sgen_concurrent_collection_in_progress ())
return FALSE;
- los_alloced = los_memory_usage - MIN (last_collection_los_memory_usage, los_memory_usage);
- return (space_needed > sgen_memgov_available_free_space ()) ||
- minor_collection_sections_alloced * major_collector.section_size + los_alloced > minor_collection_allowance;
+
+ /* FIXME: This is a cop-out. We should have some way of figuring this out. */
+ if (!major_collector.have_swept ())
+ return FALSE;
+
+ if (space_needed > sgen_memgov_available_free_space ())
+ return TRUE;
+
+ sgen_memgov_calculate_minor_collection_allowance ();
+
+ heap_size = major_collector.get_num_major_sections () * major_collector.section_size + los_memory_usage;
+
+ return heap_size > major_collection_trigger_size;
}
void
sgen_memgov_minor_collection_start (void)
{
- sgen_memgov_try_calculate_minor_collection_allowance (FALSE);
}
void
void
sgen_memgov_major_collection_start (void)
{
- last_collection_old_num_major_sections = sgen_get_major_collector ()->get_num_major_sections ();
-
- /*
- * A domain could have been freed, resulting in
- * los_memory_usage being less than last_collection_los_memory_usage.
- */
- last_collection_los_memory_alloced = los_memory_usage - MIN (last_collection_los_memory_usage, los_memory_usage);
- last_collection_old_los_memory_usage = los_memory_usage;
-
need_calculate_minor_collection_allowance = TRUE;
+
+ if (debug_print_allowance) {
+ SGEN_LOG (0, "Starting collection with heap size %ld bytes", (long)(major_collector.get_num_major_sections () * major_collector.section_size + los_memory_usage));
+ }
}
void
-sgen_memgov_major_collection_end (void)
+sgen_memgov_major_collection_end (gboolean forced)
{
- sgen_memgov_try_calculate_minor_collection_allowance (TRUE);
-
- minor_collection_sections_alloced = 0;
last_collection_los_memory_usage = los_memory_usage;
-}
-void
-sgen_memgov_collection_start (int generation)
-{
- last_major_num_sections = major_collector.get_num_major_sections ();
- last_los_memory_usage = los_memory_usage;
+ if (forced) {
+ sgen_get_major_collector ()->finish_sweeping ();
+ sgen_memgov_calculate_minor_collection_allowance ();
+ }
}
static void
los_memory_usage / 1024);
}
+/* FIXME: Remove either these or the specialized ones above. */
+void
+sgen_memgov_collection_start (int generation)
+{
+}
+
void
sgen_memgov_collection_end (int generation, GGTimingInfo* info, int info_count)
{
}
}
-void
-sgen_register_major_sections_alloced (size_t num_sections)
-{
- minor_collection_sections_alloced += num_sections;
-}
-
-mword
-sgen_get_minor_collection_allowance (void)
-{
- return minor_collection_allowance;
-}
-
/* Memory pressure API */
/* Negative value to remove */
sgen_memgov_try_alloc_space (mword size, int space)
{
if (sgen_memgov_available_free_space () < size) {
- SGEN_ASSERT (4, !sgen_is_worker_thread (mono_native_thread_id_get ()), "Memory shouldn't run out in worker thread");
+ SGEN_ASSERT (4, !sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()), "Memory shouldn't run out in worker thread");
return FALSE;
}
soft_heap_limit = soft_limit;
debug_print_allowance = debug_allowance;
- minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
+ major_collection_trigger_size = MIN_MINOR_COLLECTION_ALLOWANCE;
mono_counters_register ("Memgov alloc", MONO_COUNTER_GC | MONO_COUNTER_WORD | MONO_COUNTER_BYTES | MONO_COUNTER_VARIABLE, &total_alloc);
mono_counters_register ("Memgov max alloc", MONO_COUNTER_GC | MONO_COUNTER_WORD | MONO_COUNTER_BYTES | MONO_COUNTER_MONOTONIC, &total_alloc_max);
if (save_target)
save_target_ratio = save_target;
- minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
}
#endif
void sgen_memgov_minor_collection_end (void);
void sgen_memgov_major_collection_start (void);
-void sgen_memgov_major_collection_end (void);
+void sgen_memgov_major_collection_end (gboolean forced);
void sgen_memgov_collection_start (int generation);
void sgen_memgov_collection_end (int generation, GGTimingInfo* info, int info_count);
-void sgen_register_major_sections_alloced (size_t num_sections);
-mword sgen_get_minor_collection_allowance (void);
gboolean sgen_need_major_collection (mword space_needed);
#include "metadata/sgen-gc.h"
#include "metadata/sgen-archdep.h"
#include "metadata/sgen-protocol.h"
+#include "metadata/sgen-thread-pool.h"
#include "metadata/object-internals.h"
#include "metadata/gc-internal.h"
cur_thread->suspend_done = TRUE;
FOREACH_THREAD_SAFE (info) {
- if (info == cur_thread || sgen_is_worker_thread (mono_thread_info_get_tid (info)))
+ if (info == cur_thread || sgen_thread_pool_is_thread_pool_thread (mono_thread_info_get_tid (info)))
continue;
info->suspend_done = FALSE;
SGEN_LOG (4, "Reallocated pointer queue to size: %lu", new_size);
}
+gboolean
+sgen_pointer_queue_will_grow (SgenPointerQueue *queue)
+{
+ return queue->next_slot >= queue->size;
+}
+
void
sgen_pointer_queue_add (SgenPointerQueue *queue, void *ptr)
{
- if (queue->next_slot >= queue->size)
+ if (sgen_pointer_queue_will_grow (queue))
realloc_queue (queue);
queue->data [queue->next_slot++] = ptr;
void* sgen_pointer_queue_pop (SgenPointerQueue *queue);
gboolean sgen_pointer_queue_is_empty (SgenPointerQueue *queue);
void sgen_pointer_queue_free (SgenPointerQueue *queue);
+gboolean sgen_pointer_queue_will_grow (SgenPointerQueue *queue);
#endif
IS_VTABLE_MATCH (FALSE)
END_PROTOCOL_ENTRY
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_block_alloc, TYPE_POINTER, addr, TYPE_SIZE, size)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (FALSE)
+MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY_HEAVY
+
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_block_free, TYPE_POINTER, addr, TYPE_SIZE, size)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (FALSE)
+MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY_HEAVY
+
+BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_block_set_state, TYPE_POINTER, addr, TYPE_SIZE, size, TYPE_INT, old, TYPE_INT, new)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (FALSE)
+MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY_HEAVY
+
BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_alloc, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_INT, size)
DEFAULT_PRINT ()
IS_ALWAYS_MATCH (FALSE)
#include "sgen-gc.h"
#include "sgen-protocol.h"
#include "sgen-memory-governor.h"
+#include "sgen-thread-pool.h"
#include "utils/mono-mmap.h"
#include "utils/mono-threads.h"
if (binary_protocol_file == -1)
return;
- if (sgen_is_worker_thread (mono_native_thread_id_get ()))
+ if (sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()))
type |= 0x80;
lock_recursive ();
#include "metadata/sgen-gc.h"
#include "metadata/sgen-protocol.h"
#include "metadata/sgen-memory-governor.h"
+#include "metadata/sgen-thread-pool.h"
#include "metadata/profiler-private.h"
#include "utils/mono-time.h"
#include "utils/dtrace.h"
#include "utils/mono-counters.h"
#include "utils/mono-threads.h"
+static gboolean world_is_stopped = FALSE;
+
#define TV_DECLARE SGEN_TV_DECLARE
#define TV_GETTIME SGEN_TV_GETTIME
#define TV_ELAPSED SGEN_TV_ELAPSED
TV_DECLARE (end_handshake);
int count, dead;
+ SGEN_ASSERT (0, !world_is_stopped, "Why are we stopping a stopped world?");
+
mono_profiler_gc_event (MONO_GC_EVENT_PRE_STOP_WORLD, generation);
MONO_GC_WORLD_STOP_BEGIN ();
binary_protocol_world_stopping (sgen_timestamp ());
count -= dead;
}
+ world_is_stopped = TRUE;
+
SGEN_LOG (3, "world stopped %d thread(s)", count);
mono_profiler_gc_event (MONO_GC_EVENT_POST_STOP_WORLD, generation);
MONO_GC_WORLD_STOP_END ();
TV_DECLARE (end_bridge);
unsigned long usec, bridge_usec;
+ SGEN_ASSERT (0, world_is_stopped, "Why are we restarting a running world?");
+
if (binary_protocol_is_enabled ()) {
long long major_total = -1, major_marked = -1, los_total = -1, los_marked = -1;
if (binary_protocol_is_heavy_enabled ())
time_restart_world += TV_ELAPSED (start_handshake, end_sw);
usec = TV_ELAPSED (stop_world_time, end_sw);
max_pause_usec = MAX (usec, max_pause_usec);
+
+ world_is_stopped = FALSE;
+
SGEN_LOG (2, "restarted %d thread(s) (pause time: %d usec, max: %d)", count, (int)usec, (int)max_pause_usec);
mono_profiler_gc_event (MONO_GC_EVENT_POST_START_WORLD, generation);
MONO_GC_WORLD_RESTART_END (generation);
return count;
}
+gboolean
+sgen_is_world_stopped (void)
+{
+ return world_is_stopped;
+}
+
void
sgen_init_stw (void)
{
We can't suspend the workers that will do all the heavy lifting.
FIXME Use some state bit in SgenThreadInfo for this.
*/
- if (sgen_is_worker_thread (mono_thread_info_get_tid (info))) {
+ if (sgen_thread_pool_is_thread_pool_thread (mono_thread_info_get_tid (info))) {
return FALSE;
}
#define SGEN_POINTER_TAG_4(p) ((void*)((mword)(p) | 4))
#define SGEN_POINTER_UNTAG_4(p) ((void*)((mword)(p) & ~4))
+#define SGEN_POINTER_UNTAG_12(p) ((void*)((mword)(p) & ~3))
#define SGEN_POINTER_UNTAG_24(p) ((void*)((mword)(p) & ~6))
#define SGEN_POINTER_IS_TAGGED_ANY(p) ((mword)(p) & SGEN_TAGGED_POINTER_MASK)
--- /dev/null
+/*
+ * sgen-thread-pool.c: Threadpool for all concurrent GC work.
+ *
+ * Copyright (C) 2015 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "config.h"
+#ifdef HAVE_SGEN_GC
+
+#include "mono/metadata/sgen-gc.h"
+#include "mono/metadata/sgen-thread-pool.h"
+#include "mono/metadata/sgen-pointer-queue.h"
+#include "mono/utils/mono-mutex.h"
+#include "mono/utils/mono-threads.h"
+
+static mono_mutex_t lock;
+static mono_cond_t work_cond;
+static mono_cond_t done_cond;
+
+static MonoNativeThreadId thread;
+
+/* Only accessed with the lock held. */
+static SgenPointerQueue job_queue;
+static volatile gboolean idle_working;
+
+static SgenThreadPoolThreadInitFunc thread_init_func;
+static SgenThreadPoolIdleJobFunc idle_job_func;
+
+enum {
+ STATE_WAITING,
+ STATE_IN_PROGRESS,
+ STATE_DONE
+};
+
+/* Assumes that the lock is held. */
+static SgenThreadPoolJob*
+get_job_and_set_in_progress (void)
+{
+ for (size_t i = 0; i < job_queue.next_slot; ++i) {
+ SgenThreadPoolJob *job = job_queue.data [i];
+ if (job->state == STATE_WAITING) {
+ job->state = STATE_IN_PROGRESS;
+ return job;
+ }
+ }
+ return NULL;
+}
+
+/* Assumes that the lock is held. */
+static ssize_t
+find_job_in_queue (SgenThreadPoolJob *job)
+{
+ for (ssize_t i = 0; i < job_queue.next_slot; ++i) {
+ if (job_queue.data [i] == job)
+ return i;
+ }
+ return -1;
+}
+
+/* Assumes that the lock is held. */
+static void
+remove_job (SgenThreadPoolJob *job)
+{
+ ssize_t index;
+ SGEN_ASSERT (0, job->state == STATE_DONE, "Why are we removing a job that's not done?");
+ index = find_job_in_queue (job);
+ SGEN_ASSERT (0, index >= 0, "Why is the job we're trying to remove not in the queue?");
+ job_queue.data [index] = NULL;
+ sgen_pointer_queue_remove_nulls (&job_queue);
+ sgen_thread_pool_job_free (job);
+}
+
+static mono_native_thread_return_t
+thread_func (void *thread_data)
+{
+ thread_init_func (thread_data);
+
+ mono_mutex_lock (&lock);
+ for (;;) {
+ SgenThreadPoolJob *job;
+ gboolean do_idle = idle_working;
+
+ job = get_job_and_set_in_progress ();
+ if (!job && !do_idle) {
+ mono_cond_wait (&work_cond, &lock);
+ do_idle = idle_working;
+ job = get_job_and_set_in_progress ();
+ }
+
+ mono_mutex_unlock (&lock);
+
+ if (job) {
+ job->func (thread_data, job);
+
+ mono_mutex_lock (&lock);
+
+ SGEN_ASSERT (0, job->state == STATE_IN_PROGRESS, "The job should still be in progress.");
+ job->state = STATE_DONE;
+ remove_job (job);
+ /*
+ * Only the main GC thread will ever wait on the done condition, so we don't
+ * have to broadcast.
+ */
+ mono_cond_signal (&done_cond);
+ } else {
+ SGEN_ASSERT (0, do_idle, "Why did we unlock if we still have to wait for idle?");
+ SGEN_ASSERT (0, idle_job_func, "Why do we have idle work when there's no idle job function?");
+ do {
+ do_idle = idle_job_func (thread_data);
+ } while (do_idle && !job_queue.next_slot);
+
+ mono_mutex_lock (&lock);
+
+ if (!do_idle) {
+ idle_working = FALSE;
+ mono_cond_signal (&done_cond);
+ }
+ }
+ }
+}
+
+void
+sgen_thread_pool_init (int num_threads, SgenThreadPoolThreadInitFunc init_func, SgenThreadPoolIdleJobFunc idle_func, void **thread_datas)
+{
+ SGEN_ASSERT (0, num_threads == 1, "We only support 1 thread pool thread for now.");
+
+ mono_mutex_init (&lock);
+ mono_cond_init (&work_cond, NULL);
+ mono_cond_init (&done_cond, NULL);
+
+ thread_init_func = init_func;
+ idle_job_func = idle_func;
+ idle_working = idle_func != NULL;
+
+ mono_native_thread_create (&thread, thread_func, thread_datas ? thread_datas [0] : NULL);
+}
+
+SgenThreadPoolJob*
+sgen_thread_pool_job_alloc (const char *name, SgenThreadPoolJobFunc func, size_t size)
+{
+ SgenThreadPoolJob *job = sgen_alloc_internal_dynamic (size, INTERNAL_MEM_THREAD_POOL_JOB, TRUE);
+ job->name = name;
+ job->size = size;
+ job->state = STATE_WAITING;
+ job->func = func;
+ return job;
+}
+
+void
+sgen_thread_pool_job_free (SgenThreadPoolJob *job)
+{
+ sgen_free_internal_dynamic (job, job->size, INTERNAL_MEM_THREAD_POOL_JOB);
+}
+
+void
+sgen_thread_pool_job_enqueue (SgenThreadPoolJob *job)
+{
+ mono_mutex_lock (&lock);
+
+ sgen_pointer_queue_add (&job_queue, job);
+ /*
+ * FIXME: We could check whether there is a job in progress. If there is, there's
+ * no need to signal the condition, at least as long as we have only one thread.
+ */
+ mono_cond_signal (&work_cond);
+
+ mono_mutex_unlock (&lock);
+}
+
+void
+sgen_thread_pool_job_wait (SgenThreadPoolJob *job)
+{
+ SGEN_ASSERT (0, job, "Where's the job?");
+
+ mono_mutex_lock (&lock);
+
+ while (find_job_in_queue (job) >= 0)
+ mono_cond_wait (&done_cond, &lock);
+
+ mono_mutex_unlock (&lock);
+}
+
+void
+sgen_thread_pool_idle_signal (void)
+{
+ SGEN_ASSERT (0, idle_job_func, "Why are we signaling idle without an idle function?");
+
+ if (idle_working)
+ return;
+
+ mono_mutex_lock (&lock);
+
+ idle_working = TRUE;
+ mono_cond_signal (&work_cond);
+
+ mono_mutex_unlock (&lock);
+}
+
+void
+sgen_thread_pool_idle_wait (void)
+{
+ SGEN_ASSERT (0, idle_job_func, "Why are we waiting for idle without an idle function?");
+
+ if (!idle_working)
+ return;
+
+ mono_mutex_lock (&lock);
+
+ while (idle_working)
+ mono_cond_wait (&done_cond, &lock);
+
+ mono_mutex_unlock (&lock);
+}
+
+void
+sgen_thread_pool_wait_for_all_jobs (void)
+{
+ mono_mutex_lock (&lock);
+
+ while (!sgen_pointer_queue_is_empty (&job_queue))
+ mono_cond_wait (&done_cond, &lock);
+
+ mono_mutex_unlock (&lock);
+}
+
+gboolean
+sgen_thread_pool_is_thread_pool_thread (MonoNativeThreadId some_thread)
+{
+ return some_thread == thread;
+}
+
+#endif
--- /dev/null
+/*
+ * sgen-thread-pool.h: Threadpool for all concurrent GC work.
+ *
+ * Copyright (C) 2015 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __MONO_SGEN_THREAD_POOL_H__
+#define __MONO_SGEN_THREAD_POOL_H__
+
+typedef struct _SgenThreadPoolJob SgenThreadPoolJob;
+
+typedef void (*SgenThreadPoolJobFunc) (void *thread_data, SgenThreadPoolJob *job);
+
+struct _SgenThreadPoolJob {
+ const char *name;
+ SgenThreadPoolJobFunc func;
+ size_t size;
+ volatile gint32 state;
+};
+
+typedef void (*SgenThreadPoolThreadInitFunc) (void*);
+typedef gboolean (*SgenThreadPoolIdleJobFunc) (void*);
+
+void sgen_thread_pool_init (int num_threads, SgenThreadPoolThreadInitFunc init_func, SgenThreadPoolIdleJobFunc idle_func, void **thread_datas);
+
+SgenThreadPoolJob* sgen_thread_pool_job_alloc (const char *name, SgenThreadPoolJobFunc func, size_t size);
+/* This only needs to be called on jobs that are not enqueued. */
+void sgen_thread_pool_job_free (SgenThreadPoolJob *job);
+
+void sgen_thread_pool_job_enqueue (SgenThreadPoolJob *job);
+/* This must only be called after the job has been enqueued. */
+void sgen_thread_pool_job_wait (SgenThreadPoolJob *job);
+
+void sgen_thread_pool_idle_signal (void);
+void sgen_thread_pool_idle_wait (void);
+
+void sgen_thread_pool_wait_for_all_jobs (void);
+
+gboolean sgen_thread_pool_is_thread_pool_thread (MonoNativeThreadId thread);
+
+#endif
#include "metadata/sgen-gc.h"
#include "metadata/sgen-workers.h"
+#include "metadata/sgen-thread-pool.h"
#include "utils/mono-counters.h"
static int workers_num;
static WorkerData *workers_data;
-static void *workers_gc_thread_major_collector_data = NULL;
static SgenSectionGrayQueue workers_distribute_gray_queue;
static gboolean workers_distribute_gray_queue_inited;
-static gboolean workers_started = FALSE;
-
enum {
STATE_NOT_WORKING,
STATE_WORKING,
STATE_NURSERY_COLLECTION
} WorkersStateName;
-/*
- * | state | num_awake | num_posted | post_done |
- * |--------------------------+-----------+----------------------------+-----------|
- * | STATE_NOT_WORKING | 0 | * | 0 |
- * | STATE_WORKING | > 0 | <= workers_num - num_awake | * |
- * | STATE_NURSERY_COLLECTION | * | <= workers_num - num_awake | 1 |
- * | STATE_NURSERY_COLLECTION | 0 | 0 | 0 |
- */
-typedef union {
- gint32 value;
- struct {
- guint state : 4; /* WorkersStateName */
- /* Number of worker threads awake. */
- guint num_awake : 8;
- /* The state of the waiting semaphore. */
- guint num_posted : 8;
- /* Whether to post `workers_done_sem` */
- guint post_done : 1;
- } data;
-} State;
+typedef gint32 State;
static volatile State workers_state;
-static MonoSemType workers_waiting_sem;
-static MonoSemType workers_done_sem;
-
-static volatile int workers_job_queue_num_entries = 0;
-static volatile JobQueueEntry *workers_job_queue = NULL;
-static LOCK_DECLARE (workers_job_queue_mutex);
-static int workers_num_jobs_enqueued = 0;
-static volatile int workers_num_jobs_finished = 0;
-
-static guint64 stat_workers_stolen_from_self_lock;
-static guint64 stat_workers_stolen_from_self_no_lock;
-static guint64 stat_workers_stolen_from_others;
-static guint64 stat_workers_num_waited;
+static guint64 stat_workers_num_finished;
static gboolean
set_state (State old_state, State new_state)
{
- if (old_state.data.state == STATE_NURSERY_COLLECTION)
- SGEN_ASSERT (0, new_state.data.state != STATE_NOT_WORKING, "Can't go from nursery collection to not working");
+ if (old_state == STATE_NURSERY_COLLECTION)
+ SGEN_ASSERT (0, new_state != STATE_NOT_WORKING, "Can't go from nursery collection to not working");
- return InterlockedCompareExchange (&workers_state.value,
- new_state.value, old_state.value) == old_state.value;
+ return InterlockedCompareExchange (&workers_state, new_state, old_state) == old_state;
}
static void
assert_not_working (State state)
{
- SGEN_ASSERT (0, state.data.state == STATE_NOT_WORKING, "Can only signal enqueue work when in no work state");
- SGEN_ASSERT (0, state.data.num_awake == 0, "No workers can be awake when not working");
- SGEN_ASSERT (0, state.data.num_posted == 0, "Can't have posted already");
- SGEN_ASSERT (0, !state.data.post_done, "post_done can only be set when working");
-
+ SGEN_ASSERT (0, state == STATE_NOT_WORKING, "Can only signal enqueue work when in no work state");
}
static void
-assert_working (State state, gboolean from_worker)
+assert_working (State state)
{
- SGEN_ASSERT (0, state.data.state == STATE_WORKING, "A worker can't wait without being in working state");
- if (from_worker)
- SGEN_ASSERT (0, state.data.num_awake > 0, "How can we be awake, yet we are not counted?");
- else
- SGEN_ASSERT (0, state.data.num_awake + state.data.num_posted > 0, "How can we be working, yet no worker threads are awake or to be awoken?");
- SGEN_ASSERT (0, state.data.num_awake + state.data.num_posted <= workers_num, "There are too many worker threads awake");
+ SGEN_ASSERT (0, state == STATE_WORKING, "A worker can't wait without being in working state");
}
static void
-assert_nursery_collection (State state, gboolean from_worker)
+assert_nursery_collection (State state)
{
- SGEN_ASSERT (0, state.data.state == STATE_NURSERY_COLLECTION, "Must be in the nursery collection state");
- if (from_worker) {
- SGEN_ASSERT (0, state.data.num_awake > 0, "We're awake, but num_awake is zero");
- SGEN_ASSERT (0, state.data.post_done, "post_done must be set in the nursery collection state");
- }
- SGEN_ASSERT (0, state.data.num_awake <= workers_num, "There are too many worker threads awake");
- if (!state.data.post_done) {
- SGEN_ASSERT (0, state.data.num_awake == 0, "Once done has been posted no threads can be awake");
- SGEN_ASSERT (0, state.data.num_posted == 0, "Once done has been posted no thread must be awoken");
- }
+ SGEN_ASSERT (0, state == STATE_NURSERY_COLLECTION, "Must be in the nursery collection state");
}
static void
assert_working_or_nursery_collection (State state)
{
- if (state.data.state == STATE_WORKING)
- assert_working (state, TRUE);
- else
- assert_nursery_collection (state, TRUE);
+ if (state != STATE_WORKING)
+ assert_nursery_collection (state);
}
static void
-workers_signal_enqueue_work (int num_wake_up, gboolean from_nursery_collection)
+workers_signal_enqueue_work (gboolean from_nursery_collection)
{
State old_state = workers_state;
- State new_state = old_state;
- int i;
gboolean did_set_state;
- SGEN_ASSERT (0, num_wake_up <= workers_num, "Cannot wake up more workers than are present");
-
if (from_nursery_collection)
- assert_nursery_collection (old_state, FALSE);
+ assert_nursery_collection (old_state);
else
assert_not_working (old_state);
- new_state.data.state = STATE_WORKING;
- new_state.data.num_posted = num_wake_up;
-
- did_set_state = set_state (old_state, new_state);
+ did_set_state = set_state (old_state, STATE_WORKING);
SGEN_ASSERT (0, did_set_state, "Nobody else should be mutating the state");
- for (i = 0; i < num_wake_up; ++i)
- MONO_SEM_POST (&workers_waiting_sem);
+ sgen_thread_pool_idle_signal ();
}
static void
-workers_signal_enqueue_work_if_necessary (int num_wake_up)
+workers_signal_enqueue_work_if_necessary (void)
{
- if (workers_state.data.state == STATE_NOT_WORKING)
- workers_signal_enqueue_work (num_wake_up, FALSE);
+ if (workers_state == STATE_NOT_WORKING)
+ workers_signal_enqueue_work (FALSE);
}
void
sgen_workers_ensure_awake (void)
{
- SGEN_ASSERT (0, workers_state.data.state != STATE_NURSERY_COLLECTION, "Can't wake workers during nursery collection");
- workers_signal_enqueue_work_if_necessary (workers_num);
+ SGEN_ASSERT (0, workers_state != STATE_NURSERY_COLLECTION, "Can't wake workers during nursery collection");
+ workers_signal_enqueue_work_if_necessary ();
}
static void
-workers_wait (void)
+worker_finish (void)
{
- State old_state, new_state;
- gboolean post_done;
+ State old_state;
- ++stat_workers_num_waited;
+ ++stat_workers_num_finished;
do {
- new_state = old_state = workers_state;
+ old_state = workers_state;
assert_working_or_nursery_collection (old_state);
+ if (old_state == STATE_NURSERY_COLLECTION)
+ return;
- --new_state.data.num_awake;
- post_done = FALSE;
- if (!new_state.data.num_awake && !new_state.data.num_posted) {
- /* We are the last thread to go to sleep. */
- if (old_state.data.state == STATE_WORKING)
- new_state.data.state = STATE_NOT_WORKING;
-
- new_state.data.post_done = 0;
- if (old_state.data.post_done)
- post_done = TRUE;
- }
- } while (!set_state (old_state, new_state));
-
- if (post_done)
- MONO_SEM_POST (&workers_done_sem);
-
- MONO_SEM_WAIT (&workers_waiting_sem);
-
- do {
- new_state = old_state = workers_state;
-
- SGEN_ASSERT (0, old_state.data.num_posted > 0, "How can we be awake without the semaphore having been posted?");
- SGEN_ASSERT (0, old_state.data.num_awake < workers_num, "There are too many worker threads awake");
-
- --new_state.data.num_posted;
- ++new_state.data.num_awake;
-
- assert_working_or_nursery_collection (new_state);
- } while (!set_state (old_state, new_state));
+ /* We are the last thread to go to sleep. */
+ } while (!set_state (old_state, STATE_NOT_WORKING));
}
static gboolean
}
void
-sgen_workers_enqueue_job (const char *name, JobFunc func, void *data)
+sgen_workers_enqueue_job (SgenThreadPoolJob *job)
{
- int num_entries;
- JobQueueEntry *entry;
-
if (!collection_needs_workers ()) {
- func (NULL, data);
+ job->func (NULL, job);
+ sgen_thread_pool_job_free (job);
return;
}
- entry = sgen_alloc_internal (INTERNAL_MEM_JOB_QUEUE_ENTRY);
- entry->name = name;
- entry->func = func;
- entry->data = data;
-
- mono_mutex_lock (&workers_job_queue_mutex);
- entry->next = workers_job_queue;
- workers_job_queue = entry;
- num_entries = ++workers_job_queue_num_entries;
- ++workers_num_jobs_enqueued;
- mono_mutex_unlock (&workers_job_queue_mutex);
-
- if (workers_state.data.state != STATE_NURSERY_COLLECTION)
- workers_signal_enqueue_work_if_necessary (num_entries < workers_num ? num_entries : workers_num);
+ sgen_thread_pool_job_enqueue (job);
}
void
sgen_workers_wait_for_jobs_finished (void)
{
- // FIXME: implement this properly
- while (workers_num_jobs_finished < workers_num_jobs_enqueued) {
- workers_signal_enqueue_work_if_necessary (workers_num);
- /* FIXME: sleep less? */
- g_usleep (1000);
- }
+ sgen_thread_pool_wait_for_all_jobs ();
}
void
sgen_workers_signal_start_nursery_collection_and_wait (void)
{
- State old_state, new_state;
+ State old_state;
do {
- new_state = old_state = workers_state;
-
- new_state.data.state = STATE_NURSERY_COLLECTION;
-
- if (old_state.data.state == STATE_NOT_WORKING) {
- assert_not_working (old_state);
- } else {
- assert_working (old_state, FALSE);
- SGEN_ASSERT (0, !old_state.data.post_done, "We are not waiting for the workers");
+ old_state = workers_state;
- new_state.data.post_done = 1;
- }
- } while (!set_state (old_state, new_state));
+ if (old_state != STATE_NOT_WORKING)
+ assert_working (old_state);
+ } while (!set_state (old_state, STATE_NURSERY_COLLECTION));
- if (new_state.data.post_done)
- MONO_SEM_WAIT (&workers_done_sem);
+ sgen_thread_pool_idle_wait ();
- old_state = workers_state;
- assert_nursery_collection (old_state, FALSE);
- SGEN_ASSERT (0, !old_state.data.post_done, "We got the semaphore, so it must have been posted");
+ assert_nursery_collection (workers_state);
}
void
sgen_workers_signal_finish_nursery_collection (void)
{
- State old_state = workers_state;
-
- assert_nursery_collection (old_state, FALSE);
- SGEN_ASSERT (0, !old_state.data.post_done, "We are finishing the nursery collection, so we should have waited for the semaphore earlier");
-
- workers_signal_enqueue_work (workers_num, TRUE);
-}
-
-static gboolean
-workers_dequeue_and_do_job (WorkerData *data)
-{
- JobQueueEntry *entry;
-
- /*
- * At this point the GC might not be running anymore. We
- * could have been woken up by a job that was then taken by
- * another thread, after which the collection finished, so we
- * first have to successfully dequeue a job before doing
- * anything assuming that the collection is still ongoing.
- */
-
- if (!workers_job_queue_num_entries)
- return FALSE;
-
- mono_mutex_lock (&workers_job_queue_mutex);
- entry = (JobQueueEntry*)workers_job_queue;
- if (entry) {
- workers_job_queue = entry->next;
- --workers_job_queue_num_entries;
- }
- mono_mutex_unlock (&workers_job_queue_mutex);
-
- if (!entry)
- return FALSE;
-
- g_assert (collection_needs_workers ());
-
- entry->func (data, entry->data);
- sgen_free_internal (entry, INTERNAL_MEM_JOB_QUEUE_ENTRY);
-
- SGEN_ATOMIC_ADD (workers_num_jobs_finished, 1);
-
- return TRUE;
+ assert_nursery_collection (workers_state);
+ workers_signal_enqueue_work (TRUE);
}
static gboolean
sgen_get_major_collector ()->is_concurrent ? concurrent_enqueue_check : NULL);
}
-static mono_native_thread_return_t
-workers_thread_func (void *data_untyped)
+static void
+thread_pool_init_func (void *data_untyped)
{
WorkerData *data = data_untyped;
SgenMajorCollector *major = sgen_get_major_collector ();
mono_thread_info_register_small_id ();
- if (major->init_worker_thread)
- major->init_worker_thread (data->major_collector_data);
+ if (!major->is_concurrent)
+ return;
init_private_gray_queue (data);
+}
- for (;;) {
- gboolean did_work = FALSE;
-
- SGEN_ASSERT (0, sgen_get_current_collection_generation () != GENERATION_NURSERY, "Why are we doing work while there's a nursery collection happening?");
-
- while (workers_state.data.state == STATE_WORKING && workers_dequeue_and_do_job (data)) {
- did_work = TRUE;
- /* FIXME: maybe distribute the gray queue here? */
- }
+static gboolean
+marker_idle_func (void *data_untyped)
+{
+ WorkerData *data = data_untyped;
+ SgenMajorCollector *major = sgen_get_major_collector ();
- if (!did_work && (!sgen_gray_object_queue_is_empty (&data->private_gray_queue) || workers_get_work (data))) {
- SgenObjectOperations *ops = sgen_concurrent_collection_in_progress ()
- ? &major->major_concurrent_ops
- : &major->major_ops;
- ScanCopyContext ctx = { ops->scan_object, NULL, &data->private_gray_queue };
+ if (workers_state != STATE_WORKING)
+ return FALSE;
- g_assert (!sgen_gray_object_queue_is_empty (&data->private_gray_queue));
+ SGEN_ASSERT (0, sgen_get_current_collection_generation () != GENERATION_NURSERY, "Why are we doing work while there's a nursery collection happening?");
- while (!sgen_drain_gray_stack (32, ctx)) {
- if (workers_state.data.state == STATE_NURSERY_COLLECTION)
- workers_wait ();
- }
- g_assert (sgen_gray_object_queue_is_empty (&data->private_gray_queue));
+ if (!sgen_gray_object_queue_is_empty (&data->private_gray_queue) || workers_get_work (data)) {
+ SgenObjectOperations *ops = sgen_concurrent_collection_in_progress ()
+ ? &major->major_concurrent_ops
+ : &major->major_ops;
+ ScanCopyContext ctx = { ops->scan_object, NULL, &data->private_gray_queue };
- init_private_gray_queue (data);
+ SGEN_ASSERT (0, !sgen_gray_object_queue_is_empty (&data->private_gray_queue), "How is our gray queue empty if we just got work?");
- did_work = TRUE;
- }
+ sgen_drain_gray_stack (32, ctx);
- if (!did_work)
- workers_wait ();
+ return TRUE;
}
- /* dummy return to make compilers happy */
- return NULL;
+ worker_finish ();
+
+ return FALSE;
}
static void
-init_distribute_gray_queue (gboolean locked)
+init_distribute_gray_queue (void)
{
if (workers_distribute_gray_queue_inited) {
g_assert (sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue));
- g_assert (!workers_distribute_gray_queue.locked == !locked);
+ g_assert (workers_distribute_gray_queue.locked);
return;
}
- sgen_section_gray_queue_init (&workers_distribute_gray_queue, locked,
+ sgen_section_gray_queue_init (&workers_distribute_gray_queue, TRUE,
sgen_get_major_collector ()->is_concurrent ? concurrent_enqueue_check : NULL);
workers_distribute_gray_queue_inited = TRUE;
}
void
sgen_workers_init_distribute_gray_queue (void)
{
- if (!collection_needs_workers ())
- return;
-
- init_distribute_gray_queue (sgen_get_major_collector ()->is_concurrent);
+ SGEN_ASSERT (0, sgen_get_major_collector ()->is_concurrent && collection_needs_workers (),
+ "Why should we init the distribute gray queue if we don't need it?");
+ init_distribute_gray_queue ();
}
void
sgen_workers_init (int num_workers)
{
int i;
+ void *workers_data_ptrs [num_workers];
- if (!sgen_get_major_collector ()->is_concurrent)
+ if (!sgen_get_major_collector ()->is_concurrent) {
+ sgen_thread_pool_init (num_workers, thread_pool_init_func, NULL, NULL);
return;
+ }
//g_print ("initing %d workers\n", num_workers);
workers_data = sgen_alloc_internal_dynamic (sizeof (WorkerData) * num_workers, INTERNAL_MEM_WORKER_DATA, TRUE);
memset (workers_data, 0, sizeof (WorkerData) * num_workers);
- MONO_SEM_INIT (&workers_waiting_sem, 0);
- MONO_SEM_INIT (&workers_done_sem, 0);
-
- init_distribute_gray_queue (sgen_get_major_collector ()->is_concurrent);
-
- if (sgen_get_major_collector ()->alloc_worker_data)
- workers_gc_thread_major_collector_data = sgen_get_major_collector ()->alloc_worker_data ();
-
- for (i = 0; i < workers_num; ++i) {
- workers_data [i].index = i;
-
- if (sgen_get_major_collector ()->alloc_worker_data)
- workers_data [i].major_collector_data = sgen_get_major_collector ()->alloc_worker_data ();
- }
-
- LOCK_INIT (workers_job_queue_mutex);
+ init_distribute_gray_queue ();
- sgen_register_fixed_internal_mem_type (INTERNAL_MEM_JOB_QUEUE_ENTRY, sizeof (JobQueueEntry));
-
- mono_counters_register ("Stolen from self lock", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_stolen_from_self_lock);
- mono_counters_register ("Stolen from self no lock", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_stolen_from_self_no_lock);
- mono_counters_register ("Stolen from others", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_stolen_from_others);
- mono_counters_register ("# workers waited", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_num_waited);
-}
-
-/* only the GC thread is allowed to start and join workers */
+ for (i = 0; i < workers_num; ++i)
+ workers_data_ptrs [i] = &workers_data [i];
-static void
-workers_start_worker (int index)
-{
- g_assert (index >= 0 && index < workers_num);
+ sgen_thread_pool_init (num_workers, thread_pool_init_func, marker_idle_func, workers_data_ptrs);
- g_assert (!workers_data [index].thread);
- mono_native_thread_create (&workers_data [index].thread, workers_thread_func, &workers_data [index]);
+ mono_counters_register ("# workers finished", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_num_finished);
}
void
sgen_workers_start_all_workers (void)
{
- State old_state, new_state;
- int i;
- gboolean result;
-
if (!collection_needs_workers ())
return;
- if (sgen_get_major_collector ()->init_worker_thread)
- sgen_get_major_collector ()->init_worker_thread (workers_gc_thread_major_collector_data);
-
- old_state = new_state = workers_state;
- assert_not_working (old_state);
-
- g_assert (workers_job_queue_num_entries == 0);
- workers_num_jobs_enqueued = 0;
- workers_num_jobs_finished = 0;
-
- if (workers_started) {
- workers_signal_enqueue_work (workers_num, FALSE);
- return;
- }
-
- new_state.data.state = STATE_WORKING;
- new_state.data.num_awake = workers_num;
- result = set_state (old_state, new_state);
- SGEN_ASSERT (0, result, "Nobody else should have modified the state - workers have not been started yet");
-
- for (i = 0; i < workers_num; ++i)
- workers_start_worker (i);
-
- workers_started = TRUE;
-}
-
-gboolean
-sgen_workers_have_started (void)
-{
- return workers_started;
+ workers_signal_enqueue_work (FALSE);
}
void
sgen_workers_join (void)
{
- State old_state;
int i;
if (!collection_needs_workers ())
return;
- for (;;) {
- old_state = workers_state;
- SGEN_ASSERT (0, old_state.data.state != STATE_NURSERY_COLLECTION, "Can't be in nursery collection when joining");
-
- if (old_state.data.state == STATE_WORKING) {
- State new_state = old_state;
-
- SGEN_ASSERT (0, !old_state.data.post_done, "Why is post_done already set?");
- new_state.data.post_done = 1;
- if (!set_state (old_state, new_state))
- continue;
-
- MONO_SEM_WAIT (&workers_done_sem);
+ sgen_thread_pool_wait_for_all_jobs ();
- old_state = workers_state;
- }
-
- assert_not_working (old_state);
+ for (;;) {
+ SGEN_ASSERT (0, workers_state != STATE_NURSERY_COLLECTION, "Can't be in nursery collection when joining");
+ sgen_thread_pool_idle_wait ();
+ assert_not_working (workers_state);
/*
* Checking whether there is still work left and, if not, going to sleep,
* workers. Therefore there's a race condition where work can be added
* after they've checked for work, and before they've gone to sleep.
*/
- if (!workers_job_queue_num_entries && sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue))
+ if (sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue))
break;
- workers_signal_enqueue_work (workers_num, FALSE);
+ workers_signal_enqueue_work (FALSE);
}
/* At this point all the workers have stopped. */
- if (sgen_get_major_collector ()->reset_worker_data) {
- for (i = 0; i < workers_num; ++i)
- sgen_get_major_collector ()->reset_worker_data (workers_data [i].major_collector_data);
- }
-
- g_assert (workers_job_queue_num_entries == 0);
g_assert (sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue));
for (i = 0; i < workers_num; ++i)
g_assert (sgen_gray_object_queue_is_empty (&workers_data [i].private_gray_queue));
gboolean
sgen_workers_all_done (void)
{
- return workers_state.data.state == STATE_NOT_WORKING;
+ return workers_state == STATE_NOT_WORKING;
}
gboolean
sgen_workers_are_working (void)
{
- State state = workers_state;
- return state.data.num_awake > 0 || state.data.num_posted > 0;
+ return workers_state == STATE_WORKING;
}
-gboolean
-sgen_is_worker_thread (MonoNativeThreadId thread)
+void
+sgen_workers_wait (void)
{
- int i;
-
- if (sgen_get_major_collector ()->is_worker_thread && sgen_get_major_collector ()->is_worker_thread (thread))
- return TRUE;
-
- for (i = 0; i < workers_num; ++i) {
- if (workers_data [i].thread == thread)
- return TRUE;
- }
- return FALSE;
+ sgen_thread_pool_idle_wait ();
+ SGEN_ASSERT (0, sgen_workers_all_done (), "Why are the workers not done after we wait for them?");
}
SgenSectionGrayQueue*
return &workers_distribute_gray_queue;
}
-void
-sgen_workers_reset_data (void)
-{
- if (sgen_get_major_collector ()->reset_worker_data)
- sgen_get_major_collector ()->reset_worker_data (workers_gc_thread_major_collector_data);
-}
#endif
#ifndef __MONO_SGEN_WORKER_H__
#define __MONO_SGEN_WORKER_H__
+#include "mono/metadata/sgen-thread-pool.h"
+
typedef struct _WorkerData WorkerData;
struct _WorkerData {
- int index;
- MonoNativeThreadId thread;
- void *major_collector_data;
-
SgenGrayQueue private_gray_queue; /* only read/written by worker thread */
};
-typedef void (*JobFunc) (WorkerData *worker_data, void *job_data);
-
-typedef struct _JobQueueEntry JobQueueEntry;
-struct _JobQueueEntry {
- const char *name;
- JobFunc func;
- void *data;
-
- volatile JobQueueEntry *next;
-};
-
void sgen_workers_init (int num_workers);
void sgen_workers_start_all_workers (void);
-gboolean sgen_workers_have_started (void);
void sgen_workers_ensure_awake (void);
void sgen_workers_init_distribute_gray_queue (void);
-void sgen_workers_enqueue_job (const char *name, JobFunc func, void *data);
+void sgen_workers_enqueue_job (SgenThreadPoolJob *job);
void sgen_workers_wait_for_jobs_finished (void);
void sgen_workers_distribute_gray_queue_sections (void);
void sgen_workers_reset_data (void);
void sgen_workers_join (void);
gboolean sgen_workers_all_done (void);
gboolean sgen_workers_are_working (void);
+void sgen_workers_wait (void);
SgenSectionGrayQueue* sgen_workers_get_distribute_section_gray_queue (void);
void sgen_workers_signal_start_nursery_collection_and_wait (void);
*
* Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
* Copyright 2004-2009 Novell, Inc (http://www.novell.com)
+ *
+ * This file has been re-licensed under the MIT License:
+ * http://opensource.org/licenses/MIT
*/
#include <config.h>
MonoVTable *vtable;
socket_class = mono_class_from_name (get_socket_assembly (), "System.Net.Sockets", "Socket");
- ipv4_field = mono_class_get_field_from_name (socket_class, "ipv4Supported");
- ipv6_field = mono_class_get_field_from_name (socket_class, "ipv6Supported");
+ ipv4_field = mono_class_get_field_from_name (socket_class, "ipv4_supported");
+ ipv6_field = mono_class_get_field_from_name (socket_class, "ipv6_supported");
vtable = mono_class_vtable (mono_domain_get (), socket_class);
g_assert (vtable);
mono_runtime_class_init (vtable);
gboolean blocking)
{
SOCKET newsock;
+ MonoInternalThread* curthread G_GNUC_UNUSED = mono_thread_internal_current ();
+ MONO_PREPARE_BLOCKING
*error = 0;
#ifdef HOST_WIN32
{
- MonoInternalThread* curthread = mono_thread_internal_current ();
curthread->interrupt_on_stop = (gpointer)TRUE;
newsock = _wapi_accept (sock, NULL, 0);
curthread->interrupt_on_stop = (gpointer)FALSE;
#else
newsock = _wapi_accept (sock, NULL, 0);
#endif
+ MONO_FINISH_BLOCKING
+
if(newsock==INVALID_SOCKET) {
*error = WSAGetLastError ();
return(NULL);
return NULL;
}
sa = (salen <= 128) ? alloca (salen) : g_malloc0 (salen);
+ MONO_PREPARE_BLOCKING
ret = _wapi_getsockname (sock, (struct sockaddr *)sa, &salen);
+ MONO_FINISH_BLOCKING
if(ret==SOCKET_ERROR) {
*error = WSAGetLastError ();
}
sa = (salen <= 128) ? alloca (salen) : g_malloc0 (salen);
/* Note: linux returns just 2 for AF_UNIX. Always. */
+ MONO_PREPARE_BLOCKING
ret = _wapi_getpeername (sock, (struct sockaddr *)sa, &salen);
+ MONO_FINISH_BLOCKING
if(ret==SOCKET_ERROR) {
*error = WSAGetLastError ();
if (salen > 128)
LOGDEBUG (g_message("%s: connecting to %s port %d", __func__, inet_ntoa(((struct sockaddr_in *)sa)->sin_addr), ntohs (((struct sockaddr_in *)sa)->sin_port)));
+ MONO_PREPARE_BLOCKING
ret = _wapi_connect (sock, sa, sa_size);
+ MONO_FINISH_BLOCKING
+
if(ret==SOCKET_ERROR) {
*error = WSAGetLastError ();
}
LPFN_DISCONNECTEX _wapi_disconnectex = NULL;
LPFN_TRANSMITFILE _wapi_transmitfile = NULL;
gboolean bret;
+ MONO_PREPARE_BLOCKING
*error = 0;
TF_DISCONNECT | TF_REUSE_SOCKET);
} else {
*error = ERROR_NOT_SUPPORTED;
- return;
+ bret = TRUE; //we don't want the following bret check to change *error
}
if (bret == FALSE) {
*error = WSAGetLastError ();
}
+
+ MONO_FINISH_BLOCKING
}
gint32 ves_icall_System_Net_Sockets_Socket_Receive_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error)
guchar *buf;
gint32 alen;
int recvflags=0;
+ MonoInternalThread* curthread G_GNUC_UNUSED = mono_thread_internal_current ();
*error = 0;
return (0);
}
+ MONO_PREPARE_BLOCKING
#ifdef HOST_WIN32
{
- MonoInternalThread* curthread = mono_thread_internal_current ();
curthread->interrupt_on_stop = (gpointer)TRUE;
ret = _wapi_recv (sock, buf, count, recvflags);
curthread->interrupt_on_stop = (gpointer)FALSE;
#else
ret = _wapi_recv (sock, buf, count, recvflags);
#endif
+ MONO_FINISH_BLOCKING
if(ret==SOCKET_ERROR) {
*error = WSAGetLastError ();
return(recv);
}
-gint32 ves_icall_System_Net_Sockets_Socket_RecvFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error)
+gint32 ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error)
{
int ret;
guchar *buf;
return (0);
}
+ MONO_PREPARE_BLOCKING
ret = _wapi_recvfrom (sock, buf, count, recvflags, sa, &sa_size);
+ MONO_FINISH_BLOCKING
+
if(ret==SOCKET_ERROR) {
g_free(sa);
*error = WSAGetLastError ();
return (0);
}
+ MONO_PREPARE_BLOCKING
ret = _wapi_send (sock, buf, count, sendflags);
+ MONO_FINISH_BLOCKING
if(ret==SOCKET_ERROR) {
*error = WSAGetLastError ();
return(0);
return (0);
}
+ MONO_PREPARE_BLOCKING
ret = _wapi_sendto (sock, buf, count, sendflags, sa, sa_size);
+ MONO_FINISH_BLOCKING
if(ret==SOCKET_ERROR) {
*error = WSAGetLastError ();
}
MonoSafeHandle *safe_handle;
MonoClassField *field;
- field = mono_class_get_field_from_name (sockobj->vtable->klass, "socket");
+ field = mono_class_get_field_from_name (sockobj->vtable->klass, "safe_handle");
safe_handle = ((MonoSafeHandle*) (*(gpointer *)(((char *)sockobj)+field->offset)));
if (safe_handle == NULL)
gint32 *error)
{
int ret;
-
+ MONO_PREPARE_BLOCKING
+
*error = 0;
/* Currently, the values for how (recv=0, send=1, both=2) match
if(ret==SOCKET_ERROR) {
*error = WSAGetLastError ();
}
+
+ MONO_FINISH_BLOCKING
}
gint
-ves_icall_System_Net_Sockets_Socket_WSAIoctl (SOCKET sock, gint32 code,
+ves_icall_System_Net_Sockets_Socket_IOControl_internal (SOCKET sock, gint32 code,
MonoArray *input,
MonoArray *output, gint32 *error)
{
MonoBoolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list)
{
- gboolean add_local_ips = FALSE;
+ gboolean add_local_ips = FALSE, add_info_ok = TRUE;
gchar this_hostname [256];
MonoAddressInfo *info = NULL;
- char *hostname;
-
- hostname=mono_string_to_utf8 (host);
+ char *hostname = mono_string_to_utf8 (host);
+ MONO_PREPARE_BLOCKING
+
if (*hostname == '\0') {
add_local_ips = TRUE;
*h_name = host;
}
}
- if (*hostname && mono_get_address_info (hostname, 0, MONO_HINT_CANONICAL_NAME | get_addrinfo_family_hint (), &info)) {
- g_free (hostname);
- return(FALSE);
- }
-
+ if (*hostname && mono_get_address_info (hostname, 0, MONO_HINT_CANONICAL_NAME | get_addrinfo_family_hint (), &info))
+ add_info_ok = FALSE;
+
g_free(hostname);
+ MONO_FINISH_BLOCKING
- return (addrinfo_to_IPHostEntry(info, h_name, h_aliases, h_addr_list, add_local_ips));
+ if (add_info_ok)
+ return addrinfo_to_IPHostEntry(info, h_name, h_aliases, h_addr_list, add_local_ips);
+ return FALSE;
}
extern MonoBoolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *addr, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list)
}
gboolean
-ves_icall_System_Net_Sockets_Socket_SendFile (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags)
+ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags)
{
HANDLE file;
gint32 error;
extern void ves_icall_System_Net_Sockets_Socket_Connect_internal(SOCKET sock, MonoObject *sockaddr, gint32 *error);
extern gint32 ves_icall_System_Net_Sockets_Socket_Receive_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error);
extern gint32 ves_icall_System_Net_Sockets_Socket_Receive_array_internal(SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *error);
-extern gint32 ves_icall_System_Net_Sockets_Socket_RecvFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error);
+extern gint32 ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error);
extern gint32 ves_icall_System_Net_Sockets_Socket_Send_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error);
extern gint32 ves_icall_System_Net_Sockets_Socket_Send_array_internal(SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *error);
extern gint32 ves_icall_System_Net_Sockets_Socket_SendTo_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject *sockaddr, gint32 *error);
extern void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET sock, gint32 level, gint32 name, MonoObject **obj_val, gint32 *error);
extern void ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal(SOCKET sock, gint32 level, gint32 name, MonoArray **byte_val, gint32 *error);
extern void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, gint32 level, gint32 name, MonoObject *obj_val, MonoArray *byte_val, gint32 int_val, gint32 *error);
-extern int ves_icall_System_Net_Sockets_Socket_WSAIoctl (SOCKET sock, gint32 code, MonoArray *input, MonoArray *output, gint32 *error);
+extern int ves_icall_System_Net_Sockets_Socket_IOControl_internal (SOCKET sock, gint32 code, MonoArray *input, MonoArray *output, gint32 *error);
extern MonoBoolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list);
extern MonoBoolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *addr, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list);
extern MonoBoolean ves_icall_System_Net_Dns_GetHostName_internal(MonoString **h_name);
extern MonoBoolean ves_icall_System_Net_Sockets_Socket_Poll_internal (SOCKET sock, gint mode, gint timeout, gint32 *error);
extern void ves_icall_System_Net_Sockets_Socket_Disconnect_internal(SOCKET sock, MonoBoolean reuse, gint32 *error);
-extern gboolean ves_icall_System_Net_Sockets_Socket_SendFile (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags);
+extern gboolean ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags);
void icall_cancel_blocking_socket_operation (MonoThread *thread);
extern void mono_network_init(void);
gboolean mono_thread_pool_is_queue_array (MonoArray *o);
void mono_internal_thread_unhandled_exception (MonoObject* exc);
-//TP implementations
-gpointer tp_poll_init (SocketIOData *data);
-
//TP internals the impls use
void check_for_interruption_critical (void);
void socket_io_cleanup (SocketIOData *data);
+++ /dev/null
-/*
- * threadpool-microsoft.c: Microsoft threadpool runtime support
- *
- * Author:
- * Ludovic Henry (ludovic.henry@xamarin.com)
- *
- * Copyright 2015 Xamarin, Inc (http://www.xamarin.com)
- */
-
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// Files:
-// - src/vm/comthreadpool.cpp
-// - src/vm/win32threadpoolcpp
-// - src/vm/threadpoolrequest.cpp
-// - src/vm/hillclimbing.cpp
-//
-// Ported from C++ to C and adjusted to Mono runtime
-
-#include <config.h>
-#include <stdlib.h>
-#include <math.h>
-
-#ifdef PLATFORM_ANDROID
-#include <../../support/libm/complex.h>
-#else
-#include <complex.h>
-#endif
-
-#include <glib.h>
-
-#include "class-internals.h"
-#include "exception.h"
-#include "object.h"
-#include "object-internals.h"
-#include "threadpool-microsoft.h"
-#include "threadpool-internals.h"
-#include "utils/atomic.h"
-#include "utils/mono-compiler.h"
-#include "utils/mono-proclib.h"
-#include "utils/mono-threads.h"
-#include "utils/mono-time.h"
-#include "utils/mono-rand.h"
-
-#define SMALL_STACK (sizeof (gpointer) * 32 * 1024)
-
-#define CPU_USAGE_LOW 80
-#define CPU_USAGE_HIGH 95
-
-#define MONITOR_INTERVAL 100 // ms
-
-/* The exponent to apply to the gain. 1.0 means to use linear gain,
- * higher values will enhance large moves and damp small ones.
- * default: 2.0 */
-#define HILL_CLIMBING_GAIN_EXPONENT 2.0
-
-/* The 'cost' of a thread. 0 means drive for increased throughput regardless
- * of thread count, higher values bias more against higher thread counts.
- * default: 0.15 */
-#define HILL_CLIMBING_BIAS 0.15
-
-#define HILL_CLIMBING_WAVE_PERIOD 4
-#define HILL_CLIMBING_MAX_WAVE_MAGNITUDE 20
-#define HILL_CLIMBING_WAVE_MAGNITUDE_MULTIPLIER 1.0
-#define HILL_CLIMBING_WAVE_HISTORY_SIZE 8
-#define HILL_CLIMBING_TARGET_SIGNAL_TO_NOISE_RATIO 3.0
-#define HILL_CLIMBING_MAX_CHANGE_PER_SECOND 4
-#define HILL_CLIMBING_MAX_CHANGE_PER_SAMPLE 20
-#define HILL_CLIMBING_SAMPLE_INTERVAL_LOW 10
-#define HILL_CLIMBING_SAMPLE_INTERVAL_HIGH 200
-#define HILL_CLIMBING_ERROR_SMOOTHING_FACTOR 0.01
-#define HILL_CLIMBING_MAX_SAMPLE_ERROR_PERCENT 0.15
-
-/* Keep in sync with System.Threading.NativeOverlapped */
-struct _MonoNativeOverlapped {
- gpointer internal_low;
- gpointer internal_high;
- gint offset_low;
- gint offset_high;
- gpointer event_handle;
-};
-
-/* Keep in sync with System.Threading.RegisteredWaitHandleSafe */
-typedef struct _MonoRegisteredWaitHandleSafe MonoRegisteredWaitHandleSafe;
-struct _MonoRegisteredWaitHandleSafe {
- MonoObject object;
- gpointer registered_wait_handle;
- MonoWaitHandle *internal_wait_object;
- gboolean release_needed; // init: false
- volatile gint32 lock; // initt: 0
-};
-
-/* Keep in sync with System.Threading.RegisteredWaitHandle */
-struct _MonoRegisteredWaitHandle {
- MonoObject object;
- MonoRegisteredWaitHandleSafe *internal_registered_wait;
-};
-
-/* Keep in sync with the System.MonoAsyncCall class which provides GC tracking */
-typedef struct _MonoAsyncCall MonoAsyncCall;
-struct _MonoAsyncCall {
- MonoObject object;
- MonoMethodMessage *msg;
- MonoMethod *cb_method;
- MonoDelegate *cb_target;
- MonoObject *state;
- MonoObject *res;
- MonoArray *out_args;
-};
-
-/* Keep in sync with System.Threading.RuntimeWorkItem */
-struct _MonoRuntimeWorkItem {
- MonoObject object;
- MonoAsyncResult *ares;
-};
-
-typedef union _ThreadPoolCounter ThreadPoolCounter;
-union _ThreadPoolCounter {
- struct {
- gint16 max_working; /* determined by heuristic */
- gint16 active; /* working or waiting on thread_work_sem; warm threads */
- gint16 working;
- gint16 parked;
- } _;
- gint64 as_gint64;
-};
-
-typedef struct _ThreadPoolDomain ThreadPoolDomain;
-struct _ThreadPoolDomain {
- MonoDomain *domain;
- gint32 outstanding_request;
-};
-
-typedef struct _ThreadPoolThread ThreadPoolThread;
-struct _ThreadPoolThread {
- mono_cond_t cond;
-};
-
-typedef struct _ThreadPoolHillClimbing ThreadPoolHillClimbing;
-struct _ThreadPoolHillClimbing {
- gint32 wave_period;
- gint32 samples_to_measure;
- gdouble target_throughput_ratio;
- gdouble target_signal_to_noise_ratio;
- gdouble max_change_per_second;
- gdouble max_change_per_sample;
- gint32 max_thread_wave_magnitude;
- gint32 sample_interval_low;
- gdouble thread_magnitude_multiplier;
- gint32 sample_interval_high;
- gdouble throughput_error_smoothing_factor;
- gdouble gain_exponent;
- gdouble max_sample_error;
-
- gdouble current_control_setting;
- gint64 total_samples;
- gint16 last_thread_count;
- gdouble elapsed_since_last_change;
- gdouble completions_since_last_change;
-
- gdouble average_throughput_noise;
-
- gdouble *samples;
- gdouble *thread_counts;
-
- guint32 current_sample_interval;
- gpointer random_interval_generator;
-
- gint32 accumulated_completion_count;
- gdouble accumulated_sample_duration;
-};
-
-typedef struct _ThreadPool ThreadPool;
-struct _ThreadPool {
- ThreadPoolCounter counters;
-
- GPtrArray *domains; // ThreadPoolDomain* []
- mono_mutex_t domains_lock;
-
- GPtrArray *working_threads; // MonoInternalThread* []
- mono_mutex_t working_threads_lock;
-
- GPtrArray *parked_threads; // ThreadPoolThread* []
- mono_mutex_t parked_threads_lock;
-
- gint32 heuristic_completions;
- guint32 heuristic_sample_start;
- guint32 heuristic_last_dequeue; // ms
- guint32 heuristic_last_adjustment; // ms
- guint32 heuristic_adjustment_interval; // ms
- ThreadPoolHillClimbing heuristic_hill_climbing;
- mono_mutex_t heuristic_lock;
-
- gint32 limit_worker_min;
- gint32 limit_worker_max;
- gint32 limit_io_min;
- gint32 limit_io_max;
-
- MonoCpuUsageState *cpu_usage_state;
- gint32 cpu_usage;
-
- /* suspended by the debugger */
- gboolean suspended;
-};
-
-typedef enum _ThreadPoolHeuristicStateTransition ThreadPoolHeuristicStateTransition;
-enum _ThreadPoolHeuristicStateTransition {
- TRANSITION_WARMUP,
- TRANSITION_INITIALIZING,
- TRANSITION_RANDOM_MOVE,
- TRANSITION_CLIMBING_MOVE,
- TRANSITION_CHANGE_POINT,
- TRANSITION_STABILIZING,
- TRANSITION_STARVATION,
- TRANSITION_THREAD_TIMED_OUT,
- TRANSITION_UNDEFINED,
-};
-
-enum {
- STATUS_NOT_INITIALIZED,
- STATUS_INITIALIZING,
- STATUS_INITIALIZED,
- STATUS_CLEANING_UP,
- STATUS_CLEANED_UP,
-};
-
-enum {
- MONITOR_STATUS_REQUESTED,
- MONITOR_STATUS_WAITING_FOR_REQUEST,
- MONITOR_STATUS_NOT_RUNNING,
-};
-
-static gint32 status = STATUS_NOT_INITIALIZED;
-static gint32 monitor_status = MONITOR_STATUS_NOT_RUNNING;
-
-static ThreadPool* threadpool;
-
-#define TP_COUNTER_CHECK(counter) \
- do { \
- g_assert (counter._.max_working > 0); \
- g_assert (counter._.active >= 0); \
- } while (0)
-
-#define TP_COUNTER_READ() ((ThreadPoolCounter) InterlockedRead64 (&threadpool->counters.as_gint64))
-
-#define TP_COUNTER_ATOMIC(var,block) \
- do { \
- ThreadPoolCounter __old; \
- do { \
- g_assert (threadpool); \
- (var) = __old = TP_COUNTER_READ (); \
- { block; } \
- TP_COUNTER_CHECK (var); \
- } while (InterlockedCompareExchange64 (&threadpool->counters.as_gint64, (var).as_gint64, __old.as_gint64) != __old.as_gint64); \
- } while (0)
-
-#define TP_COUNTER_TRY_ATOMIC(res,var,block) \
- do { \
- ThreadPoolCounter __old; \
- do { \
- g_assert (threadpool); \
- (var) = __old = TP_COUNTER_READ (); \
- (res) = FALSE; \
- { block; } \
- TP_COUNTER_CHECK (var); \
- (res) = InterlockedCompareExchange64 (&threadpool->counters.as_gint64, (var).as_gint64, __old.as_gint64) == __old.as_gint64; \
- } while (0); \
- } while (0)
-
-static gpointer
-tp_rand_create (void)
-{
- mono_rand_open ();
- return mono_rand_init (NULL, 0);
-}
-
-static guint32
-tp_rand_next (gpointer *handle, guint32 min, guint32 max)
-{
- guint32 val;
- if (!mono_rand_try_get_uint32 (handle, &val, min, max)) {
- // FIXME handle error
- g_assert_not_reached ();
- }
- return val;
-}
-
-static void
-tp_rand_free (gpointer handle)
-{
- mono_rand_close (handle);
-}
-
-static void
-tp_ensure_initialized (gboolean *enable_worker_tracking)
-{
- ThreadPoolHillClimbing *hc;
- const char *threads_per_cpu_env;
- gint threads_per_cpu;
- gint threads_count;
-
- if (enable_worker_tracking) {
- // TODO implement some kind of switch to have the possibily to use it
- *enable_worker_tracking = FALSE;
- }
-
- if (status >= STATUS_INITIALIZED)
- return;
- if (status == STATUS_INITIALIZING || InterlockedCompareExchange (&status, STATUS_INITIALIZING, STATUS_NOT_INITIALIZED) != STATUS_NOT_INITIALIZED) {
- while (status == STATUS_INITIALIZING)
- mono_thread_info_yield ();
- g_assert (status >= STATUS_INITIALIZED);
- return;
- }
-
- g_assert (!threadpool);
- threadpool = g_new0 (ThreadPool, 1);
- g_assert (threadpool);
-
- threadpool->domains = g_ptr_array_new ();
- mono_mutex_init_recursive (&threadpool->domains_lock);
-
- threadpool->parked_threads = g_ptr_array_new ();
- mono_mutex_init (&threadpool->parked_threads_lock);
-
- threadpool->working_threads = g_ptr_array_new ();
- mono_mutex_init (&threadpool->working_threads_lock);
-
- threadpool->heuristic_adjustment_interval = 10;
- mono_mutex_init (&threadpool->heuristic_lock);
-
- mono_rand_open ();
-
- hc = &threadpool->heuristic_hill_climbing;
-
- hc->wave_period = HILL_CLIMBING_WAVE_PERIOD;
- hc->max_thread_wave_magnitude = HILL_CLIMBING_MAX_WAVE_MAGNITUDE;
- hc->thread_magnitude_multiplier = (gdouble) HILL_CLIMBING_WAVE_MAGNITUDE_MULTIPLIER;
- hc->samples_to_measure = hc->wave_period * HILL_CLIMBING_WAVE_HISTORY_SIZE;
- hc->target_throughput_ratio = (gdouble) HILL_CLIMBING_BIAS;
- hc->target_signal_to_noise_ratio = (gdouble) HILL_CLIMBING_TARGET_SIGNAL_TO_NOISE_RATIO;
- hc->max_change_per_second = (gdouble) HILL_CLIMBING_MAX_CHANGE_PER_SECOND;
- hc->max_change_per_sample = (gdouble) HILL_CLIMBING_MAX_CHANGE_PER_SAMPLE;
- hc->sample_interval_low = HILL_CLIMBING_SAMPLE_INTERVAL_LOW;
- hc->sample_interval_high = HILL_CLIMBING_SAMPLE_INTERVAL_HIGH;
- hc->throughput_error_smoothing_factor = (gdouble) HILL_CLIMBING_ERROR_SMOOTHING_FACTOR;
- hc->gain_exponent = (gdouble) HILL_CLIMBING_GAIN_EXPONENT;
- hc->max_sample_error = (gdouble) HILL_CLIMBING_MAX_SAMPLE_ERROR_PERCENT;
- hc->current_control_setting = 0;
- hc->total_samples = 0;
- hc->last_thread_count = 0;
- hc->average_throughput_noise = 0;
- hc->elapsed_since_last_change = 0;
- hc->accumulated_completion_count = 0;
- hc->accumulated_sample_duration = 0;
- hc->samples = g_new0 (gdouble, hc->samples_to_measure);
- hc->thread_counts = g_new0 (gdouble, hc->samples_to_measure);
- hc->random_interval_generator = tp_rand_create ();
- hc->current_sample_interval = tp_rand_next (&hc->random_interval_generator, hc->sample_interval_low, hc->sample_interval_high);
-
- if (!(threads_per_cpu_env = g_getenv ("MONO_THREADS_PER_CPU")))
- threads_per_cpu = 1;
- else
- threads_per_cpu = CLAMP (atoi (threads_per_cpu_env), 1, 50);
-
- threads_count = mono_cpu_count () * threads_per_cpu;
-
- threadpool->limit_worker_min = threadpool->limit_io_min = threads_count;
- threadpool->limit_worker_max = threadpool->limit_io_max = threads_count * 100;
-
- threadpool->counters._.max_working = threadpool->limit_worker_min;
-
- threadpool->cpu_usage_state = g_new0 (MonoCpuUsageState, 1);
-
- threadpool->suspended = FALSE;
-
- status = STATUS_INITIALIZED;
-}
-
-static void
-tp_ensure_cleanedup (void)
-{
- if (status == STATUS_NOT_INITIALIZED && InterlockedCompareExchange (&status, STATUS_CLEANED_UP, STATUS_NOT_INITIALIZED) == STATUS_NOT_INITIALIZED)
- return;
- if (status == STATUS_INITIALIZING) {
- while (status == STATUS_INITIALIZING)
- mono_thread_info_yield ();
- }
- if (status == STATUS_CLEANED_UP)
- return;
- if (status == STATUS_CLEANING_UP || InterlockedCompareExchange (&status, STATUS_CLEANING_UP, STATUS_INITIALIZED) != STATUS_INITIALIZED) {
- while (status == STATUS_CLEANING_UP)
- mono_thread_info_yield ();
- g_assert (status == STATUS_CLEANED_UP);
- return;
- }
-
- /* we make the assumption along the code that we are
- * cleaning up only if the runtime is shutting down */
- g_assert (mono_runtime_is_shutting_down ());
-
- /* Unpark all worker threads */
- mono_mutex_lock (&threadpool->parked_threads_lock);
- for (;;) {
- guint i;
- ThreadPoolCounter counter = TP_COUNTER_READ ();
- if (counter._.active == 0 && counter._.parked == 0)
- break;
- for (i = 0; i < threadpool->parked_threads->len; ++i) {
- ThreadPoolThread *tpthread = g_ptr_array_index (threadpool->parked_threads, i);
- mono_cond_signal (&tpthread->cond);
- }
- mono_mutex_unlock (&threadpool->parked_threads_lock);
- usleep (1000);
- mono_mutex_lock (&threadpool->parked_threads_lock);
- }
- mono_mutex_unlock (&threadpool->parked_threads_lock);
-
- while (monitor_status != MONITOR_STATUS_NOT_RUNNING)
- usleep (1000);
-
- g_ptr_array_free (threadpool->domains, TRUE);
- mono_mutex_destroy (&threadpool->domains_lock);
-
- g_ptr_array_free (threadpool->parked_threads, TRUE);
- mono_mutex_destroy (&threadpool->parked_threads_lock);
-
- g_ptr_array_free (threadpool->working_threads, TRUE);
- mono_mutex_destroy (&threadpool->working_threads_lock);
-
- mono_mutex_destroy (&threadpool->heuristic_lock);
- g_free (threadpool->heuristic_hill_climbing.samples);
- g_free (threadpool->heuristic_hill_climbing.thread_counts);
- tp_rand_free (threadpool->heuristic_hill_climbing.random_interval_generator);
-
- g_free (threadpool->cpu_usage_state);
-
- g_assert (threadpool);
- g_free (threadpool);
- threadpool = NULL;
- g_assert (!threadpool);
-
- status = STATUS_CLEANED_UP;
-}
-
-static void
-tp_queue_work_item (MonoRuntimeWorkItem *rwi)
-{
- static MonoClass *threadpool_class = NULL;
- static MonoMethod *unsafe_queue_custom_work_item_method = NULL;
- MonoObject *exc = NULL;
- MonoBoolean f;
- gpointer args [2];
-
- g_assert (rwi);
-
- if (!threadpool_class)
- threadpool_class = mono_class_from_name (mono_defaults.corlib, "System.Threading", "ThreadPool");
- g_assert (threadpool_class);
-
- if (!unsafe_queue_custom_work_item_method)
- unsafe_queue_custom_work_item_method = mono_class_get_method_from_name (threadpool_class, "UnsafeQueueCustomWorkItem", 2);
- g_assert (unsafe_queue_custom_work_item_method);
-
- f = FALSE;
-
- args [0] = (gpointer) rwi;
- args [1] = (gpointer) mono_value_box (mono_domain_get (), mono_defaults.boolean_class, &f);
-
- mono_runtime_invoke (unsafe_queue_custom_work_item_method, rwi, args, &exc);
- if (exc)
- mono_raise_exception ((MonoException*) exc);
-}
-
-static void
-tp_domain_add (ThreadPoolDomain *tpdomain)
-{
- guint i, len;
-
- g_assert (tpdomain);
-
- mono_mutex_lock (&threadpool->domains_lock);
- len = threadpool->domains->len;
- for (i = 0; i < len; ++i) {
- if (g_ptr_array_index (threadpool->domains, i) == tpdomain)
- break;
- }
- if (i == len)
- g_ptr_array_add (threadpool->domains, tpdomain);
- mono_mutex_unlock (&threadpool->domains_lock);
-}
-
-static gboolean
-tp_domain_remove (ThreadPoolDomain *tpdomain)
-{
- gboolean res;
-
- g_assert (tpdomain);
-
- mono_mutex_lock (&threadpool->domains_lock);
- res = g_ptr_array_remove (threadpool->domains, tpdomain);
- mono_mutex_unlock (&threadpool->domains_lock);
-
- return res;
-}
-
-static ThreadPoolDomain *
-tp_domain_get_or_create (MonoDomain *domain)
-{
- ThreadPoolDomain *tpdomain = NULL;
- guint i;
-
- g_assert (domain);
-
- mono_mutex_lock (&threadpool->domains_lock);
- for (i = 0; i < threadpool->domains->len; ++i) {
- ThreadPoolDomain *tmp = g_ptr_array_index (threadpool->domains, i);
- if (tmp->domain == domain) {
- tpdomain = tmp;
- break;
- }
- }
- if (!tpdomain) {
- tpdomain = g_new0 (ThreadPoolDomain, 1);
- tpdomain->domain = domain;
- tp_domain_add (tpdomain);
- }
- mono_mutex_unlock (&threadpool->domains_lock);
- return tpdomain;
-}
-
-static gboolean
-tp_domain_any_has_request ()
-{
- gboolean res = FALSE;
- guint i;
-
- mono_mutex_lock (&threadpool->domains_lock);
- for (i = 0; i < threadpool->domains->len; ++i) {
- ThreadPoolDomain *tmp = g_ptr_array_index (threadpool->domains, i);
- if (tmp->outstanding_request > 0) {
- res = TRUE;
- break;
- }
- }
- mono_mutex_unlock (&threadpool->domains_lock);
- return res;
-}
-
-static ThreadPoolDomain *
-tp_domain_get_next (ThreadPoolDomain *current)
-{
- ThreadPoolDomain *tpdomain = NULL;
- guint len;
-
- mono_mutex_lock (&threadpool->domains_lock);
- len = threadpool->domains->len;
- if (len > 0) {
- guint i, current_idx = -1;
- if (current) {
- for (i = 0; i < len; ++i) {
- if (current == g_ptr_array_index (threadpool->domains, i)) {
- current_idx = i;
- break;
- }
- }
- g_assert (current_idx >= 0);
- }
- for (i = current_idx + 1; i < len + current_idx + 1; ++i) {
- ThreadPoolDomain *tmp = g_ptr_array_index (threadpool->domains, i % len);
- if (tmp->outstanding_request > 0) {
- tpdomain = tmp;
- tpdomain->outstanding_request --;
- g_assert (tpdomain->outstanding_request >= 0);
- break;
- }
- }
- }
- mono_mutex_unlock (&threadpool->domains_lock);
- return tpdomain;
-}
-
-static void
-tp_worker_park (void)
-{
- ThreadPoolThread tpthread;
- mono_cond_init (&tpthread.cond, NULL);
-
- mono_mutex_lock (&threadpool->parked_threads_lock);
- g_ptr_array_add (threadpool->parked_threads, &tpthread);
- mono_cond_wait (&tpthread.cond, &threadpool->parked_threads_lock);
- g_ptr_array_remove (threadpool->parked_threads, &tpthread);
- mono_mutex_unlock (&threadpool->parked_threads_lock);
-
- mono_cond_destroy (&tpthread.cond);
-}
-
-static gboolean
-tp_worker_try_unpark (void)
-{
- gboolean res = FALSE;
- guint len;
-
- mono_mutex_lock (&threadpool->parked_threads_lock);
- len = threadpool->parked_threads->len;
- if (len > 0) {
- ThreadPoolThread *tpthread = g_ptr_array_index (threadpool->parked_threads, len - 1);
- mono_cond_signal (&tpthread->cond);
- res = TRUE;
- }
- mono_mutex_unlock (&threadpool->parked_threads_lock);
- return res;
-}
-
-static void
-tp_worker_thread (gpointer data)
-{
- static MonoClass *threadpool_wait_callback_class = NULL;
- static MonoMethod *perform_wait_callback_method = NULL;
- MonoInternalThread *thread;
- ThreadPoolDomain *tpdomain;
- ThreadPoolCounter counter;
- gboolean retire = FALSE;
-
- g_assert (status >= STATUS_INITIALIZED);
-
- tpdomain = data;
- g_assert (tpdomain);
- g_assert (tpdomain->domain);
-
- if (mono_runtime_is_shutting_down () || mono_domain_is_unloading (tpdomain->domain)) {
- TP_COUNTER_ATOMIC (counter, { counter._.active --; });
- return;
- }
-
- if (!threadpool_wait_callback_class)
- threadpool_wait_callback_class = mono_class_from_name (mono_defaults.corlib, "System.Threading.Microsoft", "_ThreadPoolWaitCallback");
- g_assert (threadpool_wait_callback_class);
-
- if (!perform_wait_callback_method)
- perform_wait_callback_method = mono_class_get_method_from_name (threadpool_wait_callback_class, "PerformWaitCallback", 0);
- g_assert (perform_wait_callback_method);
-
- g_assert (threadpool);
-
- thread = mono_thread_internal_current ();
- g_assert (thread);
-
- mono_mutex_lock (&threadpool->domains_lock);
-
- do {
- guint i, c;
-
- g_assert (tpdomain);
- g_assert (tpdomain->domain);
-
- tpdomain->domain->threadpool_jobs ++;
-
- mono_mutex_unlock (&threadpool->domains_lock);
-
- mono_mutex_lock (&threadpool->working_threads_lock);
- g_ptr_array_add (threadpool->working_threads, thread);
- mono_mutex_unlock (&threadpool->working_threads_lock);
-
- TP_COUNTER_ATOMIC (counter, { counter._.working ++; });
-
- mono_thread_push_appdomain_ref (tpdomain->domain);
- if (mono_domain_set (tpdomain->domain, FALSE)) {
- MonoObject *exc = NULL;
- MonoObject *res = mono_runtime_invoke (perform_wait_callback_method, NULL, NULL, &exc);
- if (exc)
- mono_internal_thread_unhandled_exception (exc);
- else if (res && *(MonoBoolean*) mono_object_unbox (res) == FALSE)
- retire = TRUE;
-
- mono_thread_clr_state (thread , ~ThreadState_Background);
- if (!mono_thread_test_state (thread , ThreadState_Background))
- ves_icall_System_Threading_Thread_SetState (thread, ThreadState_Background);
- }
- mono_thread_pop_appdomain_ref ();
-
- TP_COUNTER_ATOMIC (counter, { counter._.working --; });
-
- mono_mutex_lock (&threadpool->working_threads_lock);
- g_ptr_array_remove_fast (threadpool->working_threads, thread);
- mono_mutex_unlock (&threadpool->working_threads_lock);
-
- mono_mutex_lock (&threadpool->domains_lock);
-
- tpdomain->domain->threadpool_jobs --;
- g_assert (tpdomain->domain->threadpool_jobs >= 0);
-
- if (tpdomain->domain->threadpool_jobs == 0 && mono_domain_is_unloading (tpdomain->domain)) {
- gboolean removed = tp_domain_remove (tpdomain);
- g_assert (removed);
- if (tpdomain->domain->cleanup_semaphore)
- ReleaseSemaphore (tpdomain->domain->cleanup_semaphore, 1, NULL);
- g_free (tpdomain);
- tpdomain = NULL;
- }
-
- for (i = 0, c = 5; i < c; ++i) {
- if (mono_runtime_is_shutting_down ())
- break;
-
- if (!retire) {
- tpdomain = tp_domain_get_next (tpdomain);
- if (tpdomain)
- break;
- }
-
- if (i < c - 1) {
- gboolean park = TRUE;
-
- TP_COUNTER_ATOMIC (counter, {
- if (counter._.active <= counter._.max_working) {
- park = FALSE;
- break;
- }
- counter._.active --;
- counter._.parked ++;
- });
-
- if (park) {
- mono_mutex_unlock (&threadpool->domains_lock);
- tp_worker_park ();
- mono_mutex_lock (&threadpool->domains_lock);
-
- TP_COUNTER_ATOMIC (counter, {
- counter._.active ++;
- counter._.parked --;
- });
- }
- }
-
- retire = FALSE;
- }
- } while (tpdomain && !mono_runtime_is_shutting_down ());
-
- mono_mutex_unlock (&threadpool->domains_lock);
-
- TP_COUNTER_ATOMIC (counter, { counter._.active --; });
-}
-
-static gboolean
-tp_worker_try_create (ThreadPoolDomain *tpdomain)
-{
- g_assert (tpdomain);
- g_assert (tpdomain->domain);
-
- return mono_thread_create_internal (tpdomain->domain, tp_worker_thread, tpdomain, TRUE, 0) != NULL;
-}
-
-static void tp_monitor_ensure_running (void);
-
-static gboolean
-tp_worker_request (MonoDomain *domain)
-{
- ThreadPoolDomain *tpdomain;
- ThreadPoolCounter counter;
-
- g_assert (domain);
- g_assert (threadpool);
-
- if (mono_runtime_is_shutting_down () || mono_domain_is_unloading (domain))
- return FALSE;
-
- mono_mutex_lock (&threadpool->domains_lock);
- tpdomain = tp_domain_get_or_create (domain);
- g_assert (tpdomain);
- tpdomain->outstanding_request ++;
- mono_mutex_unlock (&threadpool->domains_lock);
-
- if (threadpool->suspended)
- return FALSE;
-
- tp_monitor_ensure_running ();
-
- if (tp_worker_try_unpark ())
- return TRUE;
-
- TP_COUNTER_ATOMIC (counter, {
- if (counter._.active >= counter._.max_working)
- return FALSE;
- counter._.active ++;
- });
-
- if (tp_worker_try_create (tpdomain))
- return TRUE;
-
- TP_COUNTER_ATOMIC (counter, { counter._.active --; });
- return FALSE;
-}
-
-static gboolean
-tp_monitor_should_keep_running (void)
-{
- g_assert (monitor_status == MONITOR_STATUS_WAITING_FOR_REQUEST || monitor_status == MONITOR_STATUS_REQUESTED);
-
- if (InterlockedExchange (&monitor_status, MONITOR_STATUS_WAITING_FOR_REQUEST) == MONITOR_STATUS_WAITING_FOR_REQUEST) {
- if (mono_runtime_is_shutting_down () || !tp_domain_any_has_request ()) {
- if (InterlockedExchange (&monitor_status, MONITOR_STATUS_NOT_RUNNING) == MONITOR_STATUS_WAITING_FOR_REQUEST)
- return FALSE;
- }
- }
-
- g_assert (monitor_status == MONITOR_STATUS_WAITING_FOR_REQUEST || monitor_status == MONITOR_STATUS_REQUESTED);
-
- return TRUE;
-}
-
-static gboolean
-tp_monitor_sufficient_delay_since_last_dequeue (void)
-{
- guint32 threshold;
-
- g_assert (threadpool);
-
- if (threadpool->cpu_usage < CPU_USAGE_LOW) {
- threshold = MONITOR_INTERVAL;
- } else {
- ThreadPoolCounter counter = TP_COUNTER_READ ();
- threshold = counter._.max_working * MONITOR_INTERVAL * 2;
- }
-
- return mono_msec_ticks () >= threadpool->heuristic_last_dequeue + threshold;
-}
-
-static void tp_hill_climbing_force_change (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition);
-
-static void
-tp_monitor_thread (void)
-{
- MonoInternalThread *current_thread = mono_thread_internal_current ();
- guint i;
-
- mono_cpu_usage (threadpool->cpu_usage_state);
-
- do {
- MonoInternalThread *thread;
- gboolean all_waitsleepjoin = TRUE;
- gint32 interval_left = MONITOR_INTERVAL;
- gint32 awake = 0; /* number of spurious awakes we tolerate before doing a round of rebalancing */
-
- g_assert (monitor_status != MONITOR_STATUS_NOT_RUNNING);
-
- do {
- guint32 ts;
-
- if (mono_runtime_is_shutting_down ())
- break;
-
- ts = mono_msec_ticks ();
- if (SleepEx (interval_left, TRUE) == 0)
- break;
- interval_left -= mono_msec_ticks () - ts;
-
- if ((current_thread->state & (ThreadState_StopRequested | ThreadState_SuspendRequested)) != 0)
- mono_thread_interruption_checkpoint ();
- } while (interval_left > 0 && ++awake < 10);
-
- if (threadpool->suspended)
- continue;
-
- if (mono_runtime_is_shutting_down () || !tp_domain_any_has_request ())
- continue;
-
- mono_mutex_lock (&threadpool->working_threads_lock);
- for (i = 0; i < threadpool->working_threads->len; ++i) {
- thread = g_ptr_array_index (threadpool->working_threads, i);
- if ((thread->state & ThreadState_WaitSleepJoin) == 0) {
- all_waitsleepjoin = FALSE;
- break;
- }
- }
- mono_mutex_unlock (&threadpool->working_threads_lock);
-
- if (all_waitsleepjoin) {
- ThreadPoolCounter counter;
- TP_COUNTER_ATOMIC (counter, { counter._.max_working ++; });
- tp_hill_climbing_force_change (counter._.max_working, TRANSITION_STARVATION);
- }
-
- threadpool->cpu_usage = mono_cpu_usage (threadpool->cpu_usage_state);
-
- if (tp_monitor_sufficient_delay_since_last_dequeue ()) {
- for (i = 0; i < 5; ++i) {
- ThreadPoolDomain *tpdomain;
- ThreadPoolCounter counter;
- gboolean success;
-
- if (mono_runtime_is_shutting_down ())
- break;
-
- if (tp_worker_try_unpark ())
- break;
-
- TP_COUNTER_TRY_ATOMIC (success, counter, {
- if (counter._.active >= counter._.max_working)
- break;
- counter._.active ++;
- });
-
- if (!success)
- continue;
-
- tpdomain = tp_domain_get_next (NULL);
- if (tpdomain && tp_worker_try_create (tpdomain))
- break;
-
- TP_COUNTER_ATOMIC (counter, { counter._.active --; });
- }
- }
- } while (tp_monitor_should_keep_running ());
-}
-
-static void
-tp_monitor_ensure_running (void)
-{
- for (;;) {
- switch (monitor_status) {
- case MONITOR_STATUS_REQUESTED:
- return;
- case MONITOR_STATUS_WAITING_FOR_REQUEST:
- InterlockedCompareExchange (&monitor_status, MONITOR_STATUS_REQUESTED, MONITOR_STATUS_WAITING_FOR_REQUEST);
- break;
- case MONITOR_STATUS_NOT_RUNNING:
- if (InterlockedCompareExchange (&monitor_status, MONITOR_STATUS_REQUESTED, MONITOR_STATUS_NOT_RUNNING) == MONITOR_STATUS_NOT_RUNNING) {
- if (!mono_thread_create_internal (mono_get_root_domain (), tp_monitor_thread, NULL, TRUE, SMALL_STACK))
- monitor_status = MONITOR_STATUS_NOT_RUNNING;
- return;
- }
- break;
- default: g_assert_not_reached ();
- }
- }
-}
-
-static void
-tp_hill_climbing_change_thread_count (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition)
-{
- ThreadPoolHillClimbing *hc;
-
- g_assert (threadpool);
-
- hc = &threadpool->heuristic_hill_climbing;
-
- hc->last_thread_count = new_thread_count;
- hc->current_sample_interval = tp_rand_next (&hc->random_interval_generator, hc->sample_interval_low, hc->sample_interval_high);
- hc->elapsed_since_last_change = 0;
- hc->completions_since_last_change = 0;
-}
-
-static void
-tp_hill_climbing_force_change (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition)
-{
- ThreadPoolHillClimbing *hc;
-
- g_assert (threadpool);
-
- hc = &threadpool->heuristic_hill_climbing;
-
- if (new_thread_count != hc->last_thread_count) {
- hc->current_control_setting += new_thread_count - hc->last_thread_count;
- tp_hill_climbing_change_thread_count (new_thread_count, transition);
- }
-}
-
-static double complex
-tp_hill_climbing_get_wave_component (gdouble *samples, guint sample_count, gdouble period)
-{
- ThreadPoolHillClimbing *hc;
- gdouble w, cosine, sine, coeff, q0, q1, q2;
- guint i;
-
- g_assert (threadpool);
- g_assert (sample_count >= period);
- g_assert (period >= 2);
-
- hc = &threadpool->heuristic_hill_climbing;
-
- w = 2.0 * M_PI / period;
- cosine = cos (w);
- sine = sin (w);
- coeff = 2.0 * cosine;
- q0 = q1 = q2 = 0;
-
- for (i = 0; i < sample_count; ++i) {
- q0 = coeff * q1 - q2 + samples [(hc->total_samples - sample_count + i) % hc->samples_to_measure];
- q2 = q1;
- q1 = q0;
- }
-
- return ((q1 - q2 * cosine) + (q2 * sine) * I) / ((gdouble) sample_count);
-}
-
-static gint16
-tp_hill_climbing_update (gint16 current_thread_count, guint32 sample_duration, gint32 completions, guint32 *adjustment_interval)
-{
- ThreadPoolHillClimbing *hc;
- ThreadPoolHeuristicStateTransition transition;
- gdouble throughput;
- gdouble throughput_error_estimate;
- gdouble confidence;
- gdouble move;
- gdouble gain;
- gint sample_index;
- gint sample_count;
- gint new_thread_wave_magnitude;
- gint new_thread_count;
- double complex thread_wave_component;
- double complex throughput_wave_component;
- double complex ratio;
-
- g_assert (threadpool);
- g_assert (adjustment_interval);
-
- hc = &threadpool->heuristic_hill_climbing;
-
- /* If someone changed the thread count without telling us, update our records accordingly. */
- if (current_thread_count != hc->last_thread_count)
- tp_hill_climbing_force_change (current_thread_count, TRANSITION_INITIALIZING);
-
- /* Update the cumulative stats for this thread count */
- hc->elapsed_since_last_change += sample_duration;
- hc->completions_since_last_change += completions;
-
- /* Add in any data we've already collected about this sample */
- sample_duration += hc->accumulated_sample_duration;
- completions += hc->accumulated_completion_count;
-
- /* We need to make sure we're collecting reasonably accurate data. Since we're just counting the end
- * of each work item, we are goinng to be missing some data about what really happened during the
- * sample interval. The count produced by each thread includes an initial work item that may have
- * started well before the start of the interval, and each thread may have been running some new
- * work item for some time before the end of the interval, which did not yet get counted. So
- * our count is going to be off by +/- threadCount workitems.
- *
- * The exception is that the thread that reported to us last time definitely wasn't running any work
- * at that time, and the thread that's reporting now definitely isn't running a work item now. So
- * we really only need to consider threadCount-1 threads.
- *
- * Thus the percent error in our count is +/- (threadCount-1)/numCompletions.
- *
- * We cannot rely on the frequency-domain analysis we'll be doing later to filter out this error, because
- * of the way it accumulates over time. If this sample is off by, say, 33% in the negative direction,
- * then the next one likely will be too. The one after that will include the sum of the completions
- * we missed in the previous samples, and so will be 33% positive. So every three samples we'll have
- * two "low" samples and one "high" sample. This will appear as periodic variation right in the frequency
- * range we're targeting, which will not be filtered by the frequency-domain translation. */
- if (hc->total_samples > 0 && ((current_thread_count - 1.0) / completions) >= hc->max_sample_error) {
- /* Not accurate enough yet. Let's accumulate the data so
- * far, and tell the ThreadPool to collect a little more. */
- hc->accumulated_sample_duration = sample_duration;
- hc->accumulated_completion_count = completions;
- *adjustment_interval = 10;
- return current_thread_count;
- }
-
- /* We've got enouugh data for our sample; reset our accumulators for next time. */
- hc->accumulated_sample_duration = 0;
- hc->accumulated_completion_count = 0;
-
- /* Add the current thread count and throughput sample to our history. */
- throughput = ((gdouble) completions) / sample_duration;
-
- sample_index = hc->total_samples % hc->samples_to_measure;
- hc->samples [sample_index] = throughput;
- hc->thread_counts [sample_index] = current_thread_count;
- hc->total_samples ++;
-
- /* Set up defaults for our metrics. */
- thread_wave_component = 0;
- throughput_wave_component = 0;
- throughput_error_estimate = 0;
- ratio = 0;
- confidence = 0;
-
- transition = TRANSITION_WARMUP;
-
- /* How many samples will we use? It must be at least the three wave periods we're looking for, and it must also
- * be a whole multiple of the primary wave's period; otherwise the frequency we're looking for will fall between
- * two frequency bands in the Fourier analysis, and we won't be able to measure it accurately. */
- sample_count = ((gint) MIN (hc->total_samples - 1, hc->samples_to_measure) / hc->wave_period) * hc->wave_period;
-
- if (sample_count > hc->wave_period) {
- guint i;
- gdouble average_throughput;
- gdouble average_thread_count;
- gdouble sample_sum = 0;
- gdouble thread_sum = 0;
-
- /* Average the throughput and thread count samples, so we can scale the wave magnitudes later. */
- for (i = 0; i < sample_count; ++i) {
- guint j = (hc->total_samples - sample_count + i) % hc->samples_to_measure;
- sample_sum += hc->samples [j];
- thread_sum += hc->thread_counts [j];
- }
-
- average_throughput = sample_sum / sample_count;
- average_thread_count = thread_sum / sample_count;
-
- if (average_throughput > 0 && average_thread_count > 0) {
- gdouble noise_for_confidence, adjacent_period_1, adjacent_period_2;
-
- /* Calculate the periods of the adjacent frequency bands we'll be using to
- * measure noise levels. We want the two adjacent Fourier frequency bands. */
- adjacent_period_1 = sample_count / (((gdouble) sample_count) / ((gdouble) hc->wave_period) + 1);
- adjacent_period_2 = sample_count / (((gdouble) sample_count) / ((gdouble) hc->wave_period) - 1);
-
- /* Get the the three different frequency components of the throughput (scaled by average
- * throughput). Our "error" estimate (the amount of noise that might be present in the
- * frequency band we're really interested in) is the average of the adjacent bands. */
- throughput_wave_component = tp_hill_climbing_get_wave_component (hc->samples, sample_count, hc->wave_period) / average_throughput;
- throughput_error_estimate = cabs (tp_hill_climbing_get_wave_component (hc->samples, sample_count, adjacent_period_1) / average_throughput);
-
- if (adjacent_period_2 <= sample_count) {
- throughput_error_estimate = MAX (throughput_error_estimate, cabs (tp_hill_climbing_get_wave_component (
- hc->samples, sample_count, adjacent_period_2) / average_throughput));
- }
-
- /* Do the same for the thread counts, so we have something to compare to. We don't
- * measure thread count noise, because there is none; these are exact measurements. */
- thread_wave_component = tp_hill_climbing_get_wave_component (hc->thread_counts, sample_count, hc->wave_period) / average_thread_count;
-
- /* Update our moving average of the throughput noise. We'll use this
- * later as feedback to determine the new size of the thread wave. */
- if (hc->average_throughput_noise == 0) {
- hc->average_throughput_noise = throughput_error_estimate;
- } else {
- hc->average_throughput_noise = (hc->throughput_error_smoothing_factor * throughput_error_estimate)
- + ((1.0 + hc->throughput_error_smoothing_factor) * hc->average_throughput_noise);
- }
-
- if (cabs (thread_wave_component) > 0) {
- /* Adjust the throughput wave so it's centered around the target wave,
- * and then calculate the adjusted throughput/thread ratio. */
- ratio = (throughput_wave_component - (hc->target_throughput_ratio * thread_wave_component)) / thread_wave_component;
- transition = TRANSITION_CLIMBING_MOVE;
- } else {
- ratio = 0;
- transition = TRANSITION_STABILIZING;
- }
-
- noise_for_confidence = MAX (hc->average_throughput_noise, throughput_error_estimate);
- if (noise_for_confidence > 0) {
- confidence = cabs (thread_wave_component) / noise_for_confidence / hc->target_signal_to_noise_ratio;
- } else {
- /* there is no noise! */
- confidence = 1.0;
- }
- }
- }
-
- /* We use just the real part of the complex ratio we just calculated. If the throughput signal
- * is exactly in phase with the thread signal, this will be the same as taking the magnitude of
- * the complex move and moving that far up. If they're 180 degrees out of phase, we'll move
- * backward (because this indicates that our changes are having the opposite of the intended effect).
- * If they're 90 degrees out of phase, we won't move at all, because we can't tell wether we're
- * having a negative or positive effect on throughput. */
- move = creal (ratio);
- move = CLAMP (move, -1.0, 1.0);
-
- /* Apply our confidence multiplier. */
- move *= CLAMP (confidence, -1.0, 1.0);
-
- /* Now apply non-linear gain, such that values around zero are attenuated, while higher values
- * are enhanced. This allows us to move quickly if we're far away from the target, but more slowly
- * if we're getting close, giving us rapid ramp-up without wild oscillations around the target. */
- gain = hc->max_change_per_second * sample_duration;
- move = pow (fabs (move), hc->gain_exponent) * (move >= 0.0 ? 1 : -1) * gain;
- move = MIN (move, hc->max_change_per_sample);
-
- /* If the result was positive, and CPU is > 95%, refuse the move. */
- if (move > 0.0 && threadpool->cpu_usage > CPU_USAGE_HIGH)
- move = 0.0;
-
- /* Apply the move to our control setting. */
- hc->current_control_setting += move;
-
- /* Calculate the new thread wave magnitude, which is based on the moving average we've been keeping of the
- * throughput error. This average starts at zero, so we'll start with a nice safe little wave at first. */
- new_thread_wave_magnitude = (gint)(0.5 + (hc->current_control_setting * hc->average_throughput_noise
- * hc->target_signal_to_noise_ratio * hc->thread_magnitude_multiplier * 2.0));
- new_thread_wave_magnitude = CLAMP (new_thread_wave_magnitude, 1, hc->max_thread_wave_magnitude);
-
- /* Make sure our control setting is within the ThreadPool's limits. */
- hc->current_control_setting = CLAMP (hc->current_control_setting, threadpool->limit_worker_min, threadpool->limit_worker_max - new_thread_wave_magnitude);
-
- /* Calculate the new thread count (control setting + square wave). */
- new_thread_count = (gint)(hc->current_control_setting + new_thread_wave_magnitude * ((hc->total_samples / (hc->wave_period / 2)) % 2));
-
- /* Make sure the new thread count doesn't exceed the ThreadPool's limits. */
- new_thread_count = CLAMP (new_thread_count, threadpool->limit_worker_min, threadpool->limit_worker_max);
-
- if (new_thread_count != current_thread_count)
- tp_hill_climbing_change_thread_count (new_thread_count, transition);
-
- if (creal (ratio) < 0.0 && new_thread_count == threadpool->limit_worker_min)
- *adjustment_interval = (gint)(0.5 + hc->current_sample_interval * (10.0 * MAX (-1.0 * creal (ratio), 1.0)));
- else
- *adjustment_interval = hc->current_sample_interval;
-
- return new_thread_count;
-}
-
-static void
-tp_heuristic_notify_work_completed (void)
-{
- g_assert (threadpool);
-
- InterlockedIncrement (&threadpool->heuristic_completions);
- threadpool->heuristic_last_dequeue = mono_msec_ticks ();
-}
-
-static gboolean
-tp_heuristic_should_adjust ()
-{
- g_assert (threadpool);
-
- if (threadpool->heuristic_last_dequeue > threadpool->heuristic_last_adjustment + threadpool->heuristic_adjustment_interval) {
- ThreadPoolCounter counter = TP_COUNTER_READ ();
- if (counter._.active <= counter._.max_working)
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void
-tp_heuristic_adjust ()
-{
- g_assert (threadpool);
-
- if (mono_mutex_trylock (&threadpool->heuristic_lock) == 0) {
- gint32 completions = InterlockedExchange (&threadpool->heuristic_completions, 0);
- guint32 sample_end = mono_msec_ticks ();
- guint32 sample_duration = sample_end - threadpool->heuristic_sample_start;
-
- if (sample_duration >= threadpool->heuristic_adjustment_interval / 2) {
- ThreadPoolCounter counter;
- gint16 new_thread_count;
-
- counter = TP_COUNTER_READ ();
- new_thread_count = tp_hill_climbing_update (counter._.max_working, sample_duration, completions, &threadpool->heuristic_adjustment_interval);
-
- TP_COUNTER_ATOMIC (counter, { counter._.max_working = new_thread_count; });
-
- if (new_thread_count > counter._.max_working)
- tp_worker_request (mono_domain_get ());
-
- threadpool->heuristic_sample_start = sample_end;
- threadpool->heuristic_last_adjustment = mono_msec_ticks ();
- }
-
- mono_mutex_unlock (&threadpool->heuristic_lock);
- }
-}
-
-void
-mono_thread_pool_ms_cleanup (void)
-{
- tp_ensure_cleanedup ();
-}
-
-MonoAsyncResult *
-mono_thread_pool_ms_add (MonoObject *target, MonoMethodMessage *msg, MonoDelegate *async_callback, MonoObject *state)
-{
- static MonoClass *async_call_klass = NULL;
- static MonoClass *runtime_work_item_class = NULL;
- MonoDomain *domain;
- MonoAsyncResult *ares;
- MonoAsyncCall *ac;
- MonoRuntimeWorkItem *rwi;
-
- if (!async_call_klass)
- async_call_klass = mono_class_from_name (mono_defaults.corlib, "System", "MonoAsyncCall");
- g_assert (async_call_klass);
-
- if (!runtime_work_item_class)
- runtime_work_item_class = mono_class_from_name (mono_defaults.corlib, "System.Threading", "MonoRuntimeWorkItem");
- g_assert (runtime_work_item_class);
-
- tp_ensure_initialized (NULL);
-
- domain = mono_domain_get ();
-
- ac = (MonoAsyncCall*) mono_object_new (domain, async_call_klass);
- MONO_OBJECT_SETREF (ac, msg, msg);
- MONO_OBJECT_SETREF (ac, state, state);
-
- if (async_callback) {
- MONO_OBJECT_SETREF (ac, cb_method, mono_get_delegate_invoke (((MonoObject*) async_callback)->vtable->klass));
- MONO_OBJECT_SETREF (ac, cb_target, async_callback);
- }
-
- ares = mono_async_result_new (domain, NULL, ac->state, NULL, (MonoObject*) ac);
- MONO_OBJECT_SETREF (ares, async_delegate, target);
-
- rwi = (MonoRuntimeWorkItem*) mono_object_new (domain, runtime_work_item_class);
- MONO_OBJECT_SETREF (rwi, ares, ares);
-
- tp_queue_work_item (rwi);
-
- return ares;
-}
-
-MonoObject *
-mono_thread_pool_ms_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc)
-{
- MonoAsyncCall *ac;
-
- g_assert (exc);
- g_assert (out_args);
-
- *exc = NULL;
- *out_args = NULL;
-
- /* check if already finished */
- mono_monitor_enter ((MonoObject*) ares);
-
- if (ares->endinvoke_called) {
- *exc = (MonoObject*) mono_get_exception_invalid_operation (NULL);
- mono_monitor_exit ((MonoObject*) ares);
- return NULL;
- }
-
- MONO_OBJECT_SETREF (ares, endinvoke_called, 1);
-
- /* wait until we are really finished */
- if (ares->completed) {
- mono_monitor_exit ((MonoObject *) ares);
- } else {
- gpointer wait_event;
- if (ares->handle) {
- wait_event = mono_wait_handle_get_handle ((MonoWaitHandle*) ares->handle);
- } else {
- wait_event = CreateEvent (NULL, TRUE, FALSE, NULL);
- g_assert(wait_event);
- MONO_OBJECT_SETREF (ares, handle, (MonoObject*) mono_wait_handle_new (mono_object_domain (ares), wait_event));
- }
- mono_monitor_exit ((MonoObject*) ares);
- WaitForSingleObjectEx (wait_event, INFINITE, TRUE);
- }
-
- ac = (MonoAsyncCall*) ares->object_data;
- g_assert (ac);
-
- *exc = ac->msg->exc; /* FIXME: GC add write barrier */
- *out_args = ac->out_args;
- return ac->res;
-}
-
-gboolean
-mono_thread_pool_ms_remove_domain_jobs (MonoDomain *domain, int timeout)
-{
- gboolean res = TRUE;
- guint32 start, now;
- gpointer sem;
-
- sem = domain->cleanup_semaphore = CreateSemaphore (NULL, 0, 1, NULL);
- /*
- * The memory barrier here is required to have global ordering between assigning to cleanup_semaphone
- * and reading threadpool_jobs. Otherwise this thread could read a stale version of threadpool_jobs
- * and wait forever.
- */
- mono_memory_write_barrier ();
-
- if (timeout != -1 && domain->threadpool_jobs)
- start = mono_msec_ticks ();
- while (domain->threadpool_jobs) {
- WaitForSingleObject (sem, timeout);
- if (timeout != -1) {
- now = mono_msec_ticks ();
- if (now - start > timeout) {
- res = FALSE;
- break;
- }
- timeout -= now - start;
- }
- }
-
- domain->cleanup_semaphore = NULL;
- CloseHandle (sem);
- return res;
-}
-
-void
-mono_thread_pool_ms_remove_socket (int sock)
-{
- // FIXME
- mono_raise_exception (mono_get_exception_not_implemented (NULL));
-}
-
-void
-mono_thread_pool_ms_suspend (void)
-{
- threadpool->suspended = TRUE;
-}
-
-void
-mono_thread_pool_ms_resume (void)
-{
- threadpool->suspended = FALSE;
-}
-
-void
-ves_icall_System_Threading_MonoRuntimeWorkItem_ExecuteWorkItem (MonoRuntimeWorkItem *rwi)
-{
- MonoAsyncResult *ares;
- MonoAsyncCall *ac;
- MonoObject *res;
- MonoObject *exc = NULL;
- MonoArray *out_args = NULL;
- gpointer wait_event = NULL;
- MonoInternalThread *thread = mono_thread_internal_current ();
-
- g_assert (rwi);
- ares = rwi->ares;
- g_assert (ares);
-
- if (!ares->execution_context) {
- MONO_OBJECT_SETREF (ares, original_context, NULL);
- } else {
- /* use captured ExecutionContext (if available) */
- MONO_OBJECT_SETREF (ares, original_context, mono_thread_get_execution_context ());
- mono_thread_set_execution_context (ares->execution_context);
- }
-
- ac = (MonoAsyncCall*) ares->object_data;
-
- if (!ac) {
- g_assert (ares->async_delegate);
- /* The debugger needs this */
- thread->async_invoke_method = ((MonoDelegate*) ares->async_delegate)->method;
- res = mono_runtime_delegate_invoke (ares->async_delegate, (gpointer*) &ares->async_state, &exc);
- thread->async_invoke_method = NULL;
- } else {
- MONO_OBJECT_SETREF (ac, msg->exc, NULL);
- res = mono_message_invoke (ares->async_delegate, ac->msg, &exc, &out_args);
- MONO_OBJECT_SETREF (ac, res, res);
- MONO_OBJECT_SETREF (ac, msg->exc, exc);
- MONO_OBJECT_SETREF (ac, out_args, out_args);
-
- mono_monitor_enter ((MonoObject*) ares);
- MONO_OBJECT_SETREF (ares, completed, 1);
- if (ares->handle)
- wait_event = mono_wait_handle_get_handle ((MonoWaitHandle*) ares->handle);
- mono_monitor_exit ((MonoObject*) ares);
-
- if (wait_event != NULL)
- SetEvent (wait_event);
-
- if (!ac->cb_method) {
- exc = NULL;
- } else {
- thread->async_invoke_method = ac->cb_method;
- mono_runtime_invoke (ac->cb_method, ac->cb_target, (gpointer*) &ares, &exc);
- thread->async_invoke_method = NULL;
- }
- }
-
- /* restore original thread execution context if flow isn't suppressed, i.e. non null */
- if (ares->original_context) {
- mono_thread_set_execution_context (ares->original_context);
- MONO_OBJECT_SETREF (ares, original_context, NULL);
- }
-
- if (exc)
- mono_raise_exception ((MonoException*) exc);
-}
-
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_GetAvailableThreadsNative (gint *worker_threads, gint *completion_port_threads)
-{
- if (!worker_threads || !completion_port_threads)
- return;
-
- tp_ensure_initialized (NULL);
-
- *worker_threads = threadpool->limit_worker_max;
- *completion_port_threads = threadpool->limit_io_max;
-}
-
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_GetMinThreadsNative (gint *worker_threads, gint *completion_port_threads)
-{
- if (!worker_threads || !completion_port_threads)
- return;
-
- tp_ensure_initialized (NULL);
-
- *worker_threads = threadpool->limit_worker_min;
- *completion_port_threads = threadpool->limit_io_min;
-}
-
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_GetMaxThreadsNative (gint *worker_threads, gint *completion_port_threads)
-{
- if (!worker_threads || !completion_port_threads)
- return;
-
- tp_ensure_initialized (NULL);
-
- *worker_threads = threadpool->limit_worker_max;
- *completion_port_threads = threadpool->limit_io_max;
-}
-
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_SetMinThreadsNative (gint worker_threads, gint completion_port_threads)
-{
- tp_ensure_initialized (NULL);
-
- if (worker_threads <= 0 || worker_threads > threadpool->limit_worker_max)
- return FALSE;
- if (completion_port_threads <= 0 || completion_port_threads > threadpool->limit_io_max)
- return FALSE;
-
- threadpool->limit_worker_max = worker_threads;
- threadpool->limit_io_max = completion_port_threads;
-
- return TRUE;
-}
-
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative (gint worker_threads, gint completion_port_threads)
-{
- gint cpu_count = mono_cpu_count ();
-
- tp_ensure_initialized (NULL);
-
- if (worker_threads < threadpool->limit_worker_min || worker_threads < cpu_count)
- return FALSE;
- if (completion_port_threads < threadpool->limit_io_min || completion_port_threads < cpu_count)
- return FALSE;
-
- threadpool->limit_worker_max = worker_threads;
- threadpool->limit_io_max = completion_port_threads;
-
- return TRUE;
-}
-
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (gboolean *enable_worker_tracking)
-{
- tp_ensure_initialized (enable_worker_tracking);
-}
-
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete (void)
-{
- ThreadPoolCounter counter;
-
- if (mono_domain_is_unloading (mono_domain_get ()) || mono_runtime_is_shutting_down ())
- return FALSE;
-
- tp_heuristic_notify_work_completed ();
-
- if (tp_heuristic_should_adjust ())
- tp_heuristic_adjust ();
-
- counter = TP_COUNTER_READ ();
- return counter._.active <= counter._.max_working;
-}
-
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemProgressNative (void)
-{
- tp_heuristic_notify_work_completed ();
-
- if (tp_heuristic_should_adjust ())
- tp_heuristic_adjust ();
-}
-
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (gboolean is_working)
-{
- // TODO
- mono_raise_exception (mono_get_exception_not_implemented (NULL));
-}
-
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_RequestWorkerThread (void)
-{
- return tp_worker_request (mono_domain_get ());
-}
-
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped)
-{
- /* This copy the behavior of the current Mono implementation */
- mono_raise_exception (mono_get_exception_not_implemented (NULL));
- return FALSE;
-}
-
-gpointer
-ves_icall_System_Threading_Microsoft_ThreadPool_RegisterWaitForSingleObjectNative (MonoWaitHandle *wait_handle, MonoObject *state, guint timeout_internal, gboolean execute_only_once,
- MonoRegisteredWaitHandle *registered_wait_handle, gint stack_mark, gboolean compress_stack)
-{
- // FIXME
- mono_raise_exception (mono_get_exception_not_implemented (NULL));
- return NULL;
-}
-
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle)
-{
- /* This copy the behavior of the current Mono implementation */
- return TRUE;
-}
+++ /dev/null
-#ifndef _MONO_THREADPOOL_MICROSOFT_H_
-#define _MONO_THREADPOOL_MICROSOFT_H_
-
-#include <glib.h>
-
-typedef struct _MonoRuntimeWorkItem MonoRuntimeWorkItem;
-typedef struct _MonoRegisteredWaitHandle MonoRegisteredWaitHandle;
-typedef struct _MonoNativeOverlapped MonoNativeOverlapped;
-
-static void
-mono_thread_pool_ms_init (void)
-{
- /* Initialization is done lazily */
-}
-
-static void
-mono_thread_pool_ms_init_tls (void)
-{
- /* The WSQ is now implemented in managed */
-}
-
-void
-mono_thread_pool_ms_cleanup (void);
-
-MonoAsyncResult *
-mono_thread_pool_ms_add (MonoObject *target, MonoMethodMessage *msg, MonoDelegate *async_callback, MonoObject *state);
-MonoObject *
-mono_thread_pool_ms_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc);
-
-gboolean
-mono_thread_pool_ms_remove_domain_jobs (MonoDomain *domain, int timeout);
-void
-mono_thread_pool_ms_remove_socket (int sock);
-
-void
-mono_thread_pool_ms_suspend (void);
-void
-mono_thread_pool_ms_resume (void);
-
-static gboolean
-mono_thread_pool_ms_is_queue_array (MonoArray *arr)
-{
- /* The queue is in managed code */
- return FALSE;
-}
-
-void
-ves_icall_System_Threading_MonoRuntimeWorkItem_ExecuteWorkItem (MonoRuntimeWorkItem *rwi);
-
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_GetAvailableThreadsNative (gint *worker_threads, gint *completion_port_threads);
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_GetMinThreadsNative (gint *worker_threads, gint *completion_port_threads);
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_GetMaxThreadsNative (gint *worker_threads, gint *completion_port_threads);
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_SetMinThreadsNative (gint worker_threads, gint completion_port_threads);
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative (gint worker_threads, gint completion_port_threads);
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (gboolean *enable_worker_tracking);
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete (void);
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemProgressNative (void);
-void
-ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (gboolean is_working);
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_RequestWorkerThread (void);
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped);
-gpointer
-ves_icall_System_Threading_Microsoft_ThreadPool_RegisterWaitForSingleObjectNative (MonoWaitHandle *wait_handle, MonoObject *state, guint timeout_internal, gboolean execute_only_once, MonoRegisteredWaitHandle *registered_wait_handle, gint stack_mark, gboolean compress_stack);
-gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle);
-
-static gboolean
-ves_icall_System_Threading_Microsoft_ThreadPool_IsThreadPoolHosted (void)
-{
- return FALSE;
-}
-
-#endif // _MONO_THREADPOOL_MICROSOFT_H_
\ No newline at end of file
--- /dev/null
+/*
+ * threadpool-ms-io.c: Microsoft IO threadpool runtime support
+ *
+ * Author:
+ * Ludovic Henry (ludovic.henry@xamarin.com)
+ *
+ * Copyright 2015 Xamarin, Inc (http://www.xamarin.com)
+ */
+
+#include <config.h>
+
+#ifndef DISABLE_SOCKETS
+
+#include <glib.h>
+
+#if defined(HOST_WIN32)
+#include <windows.h>
+#else
+#include <errno.h>
+#include <fcntl.h>
+#endif
+
+#if defined(HAVE_EPOLL)
+#include <sys/epoll.h>
+#elif defined(HAVE_KQUEUE)
+#include <sys/types.h>
+#include <sys/event.h>
+#include <sys/time.h>
+#endif
+
+#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/mono-mlist.h>
+#include <mono/metadata/threadpool-internals.h>
+#include <mono/metadata/threadpool-ms.h>
+#include <mono/metadata/threadpool-ms-io.h>
+#include <mono/utils/atomic.h>
+#include <mono/utils/mono-poll.h>
+#include <mono/utils/mono-threads.h>
+
+/* Keep in sync with System.Net.Sockets.MonoSocketRuntimeWorkItem */
+struct _MonoSocketRuntimeWorkItem {
+ MonoObject object;
+ MonoSocketAsyncResult *socket_async_result;
+};
+
+/* Keep in sync with System.Net.Sockets.Socket.SocketOperation */
+enum {
+ AIO_OP_FIRST,
+ AIO_OP_ACCEPT = 0,
+ AIO_OP_CONNECT,
+ AIO_OP_RECEIVE,
+ AIO_OP_RECEIVEFROM,
+ AIO_OP_SEND,
+ AIO_OP_SENDTO,
+ AIO_OP_RECV_JUST_CALLBACK,
+ AIO_OP_SEND_JUST_CALLBACK,
+ AIO_OP_READPIPE,
+ AIO_OP_CONSOLE2,
+ AIO_OP_DISCONNECT,
+ AIO_OP_ACCEPTRECEIVE,
+ AIO_OP_RECEIVE_BUFFERS,
+ AIO_OP_SEND_BUFFERS,
+ AIO_OP_LAST
+};
+
+typedef enum {
+ BACKEND_EPOLL,
+ BACKEND_KQUEUE,
+ BACKEND_POLL,
+} ThreadPoolIOBackend;
+
+typedef struct {
+ gint fd;
+
+ union {
+#if defined(HAVE_EPOLL)
+ struct {
+ struct epoll_event *event;
+ gint op;
+ } epoll;
+#elif defined(HAVE_KQUEUE)
+ struct {
+ struct kevent *event;
+ } kqueue;
+#endif
+ struct {
+ mono_pollfd fd;
+ } poll;
+ };
+} ThreadPoolIOUpdate;
+
+typedef struct {
+ MonoGHashTable *states;
+ mono_mutex_t states_lock;
+
+ ThreadPoolIOBackend backend;
+
+ ThreadPoolIOUpdate *updates;
+ guint updates_size;
+ mono_mutex_t updates_lock;
+
+#if !defined(HOST_WIN32)
+ gint wakeup_pipes [2];
+#else
+ SOCKET wakeup_pipes [2];
+#endif
+
+ union {
+#if defined(HAVE_EPOLL)
+ struct {
+ gint fd;
+ struct epoll_event *events;
+ } epoll;
+#elif defined(HAVE_KQUEUE)
+ struct {
+ gint fd;
+ struct kevent *events;
+ } kqueue;
+#endif
+ struct {
+ mono_pollfd *fds;
+ guint fds_size;
+ guint fds_max;
+ } poll;
+ };
+} ThreadPoolIO;
+
+static gint32 io_status = STATUS_NOT_INITIALIZED;
+static gint32 io_thread_status = STATUS_NOT_INITIALIZED;
+
+static ThreadPoolIO* threadpool_io;
+
+static int
+get_events_from_state (MonoSocketAsyncResult *ares)
+{
+ switch (ares->operation) {
+ case AIO_OP_ACCEPT:
+ case AIO_OP_RECEIVE:
+ case AIO_OP_RECV_JUST_CALLBACK:
+ case AIO_OP_RECEIVEFROM:
+ case AIO_OP_READPIPE:
+ case AIO_OP_ACCEPTRECEIVE:
+ case AIO_OP_RECEIVE_BUFFERS:
+ return MONO_POLLIN;
+ case AIO_OP_SEND:
+ case AIO_OP_SEND_JUST_CALLBACK:
+ case AIO_OP_SENDTO:
+ case AIO_OP_CONNECT:
+ case AIO_OP_SEND_BUFFERS:
+ case AIO_OP_DISCONNECT:
+ return MONO_POLLOUT;
+ default:
+ g_assert_not_reached ();
+ }
+}
+
+static MonoSocketAsyncResult*
+get_state (MonoMList **list, gint event)
+{
+ MonoSocketAsyncResult *state = NULL;
+ MonoMList *current;
+
+ g_assert (list);
+
+ for (current = *list; current; current = mono_mlist_next (current)) {
+ state = (MonoSocketAsyncResult*) mono_mlist_get_data (current);
+ if (get_events_from_state ((MonoSocketAsyncResult*) state) == event)
+ break;
+ state = NULL;
+ }
+
+ if (current)
+ *list = mono_mlist_remove_item (*list, current);
+
+ return state;
+}
+
+static gint
+get_events (MonoMList *list)
+{
+ MonoSocketAsyncResult *ares;
+ gint events = 0;
+
+ for (; list; list = mono_mlist_next (list))
+ if ((ares = (MonoSocketAsyncResult*) mono_mlist_get_data (list)))
+ events |= get_events_from_state (ares);
+
+ return events;
+}
+
+static void
+polling_thread_wakeup (void)
+{
+ gchar msg = 'c';
+ gint written;
+
+ for (;;) {
+#if !defined(HOST_WIN32)
+ written = write (threadpool_io->wakeup_pipes [1], &msg, 1);
+ if (written == 1)
+ break;
+ if (written == -1) {
+ g_warning ("polling_thread_wakeup: write () failed, error (%d) %s\n", errno, g_strerror (errno));
+ break;
+ }
+#else
+ written = send (threadpool_io->wakeup_pipes [1], &msg, 1, 0);
+ if (written == 1)
+ break;
+ if (written == SOCKET_ERROR) {
+ g_warning ("polling_thread_wakeup: write () failed, error (%d)\n", WSAGetLastError ());
+ break;
+ }
+#endif
+ }
+}
+
+static void
+polling_thread_drain_wakeup_pipes (void)
+{
+ gchar buffer [128];
+ gint received;
+
+ for (;;) {
+#if !defined(HOST_WIN32)
+ received = read (threadpool_io->wakeup_pipes [0], buffer, sizeof (buffer));
+ if (received == 0)
+ break;
+ if (received == -1) {
+ if (errno != EINTR && errno != EAGAIN)
+ g_warning ("poll_thread: read () failed, error (%d) %s\n", errno, g_strerror (errno));
+ break;
+ }
+#else
+ received = recv (threadpool_io->wakeup_pipes [0], buffer, sizeof (buffer), 0);
+ if (received == 0)
+ break;
+ if (received == SOCKET_ERROR) {
+ if (WSAGetLastError () != WSAEINTR && WSAGetLastError () != WSAEWOULDBLOCK)
+ g_warning ("poll_thread: recv () failed, error (%d) %s\n", WSAGetLastError ());
+ break;
+ }
+#endif
+ }
+}
+
+#if defined(HAVE_EPOLL)
+
+#if defined(HOST_WIN32)
+/* We assume that epoll is not available on windows */
+#error
+#endif
+
+#define EPOLL_NEVENTS 128
+
+static gboolean
+epoll_init (void)
+{
+#ifdef EPOOL_CLOEXEC
+ threadpool_io->epoll.fd = epoll_create1 (EPOLL_CLOEXEC);
+#else
+ threadpool_io->epoll.fd = epoll_create (256);
+ fcntl (threadpool_io->epoll.fd, F_SETFD, FD_CLOEXEC);
+#endif
+
+ if (threadpool_io->epoll.fd == -1) {
+#ifdef EPOOL_CLOEXEC
+ g_warning ("epoll_init: epoll (EPOLL_CLOEXEC) failed, error (%d) %s\n", errno, g_strerror (errno));
+#else
+ g_warning ("epoll_init: epoll (256) failed, error (%d) %s\n", errno, g_strerror (errno));
+#endif
+ return FALSE;
+ }
+
+ if (epoll_ctl (threadpool_io->epoll.fd, EPOLL_CTL_ADD, threadpool_io->wakeup_pipes [0], EPOLLIN) == -1) {
+ g_warning ("epoll_init: epoll_ctl () failed, error (%d) %s", errno, g_strerror (errno));
+ close (threadpool_io->epoll.fd);
+ return FALSE;
+ }
+
+ threadpool_io->epoll.events = g_new0 (struct epoll_event, EPOLL_NEVENTS);
+
+ return TRUE;
+}
+
+static void
+epoll_cleanup (void)
+{
+ g_free (threadpool_io->epoll.events);
+
+ close (threadpool_io->epoll.fd);
+}
+
+static void
+epoll_update (gint fd, gint events, gboolean is_new)
+{
+ ThreadPoolIOUpdate *update;
+ struct epoll_event *event;
+ gchar msg = 'c';
+
+ event = g_new0 (struct epoll_event, 1);
+ event->data.fd = fd;
+ if ((events & MONO_POLLIN) != 0)
+ event->events |= EPOLLIN;
+ if ((events & MONO_POLLOUT) != 0)
+ event->events |= EPOLLOUT;
+
+ mono_mutex_lock (&threadpool_io->updates_lock);
+ threadpool_io->updates_size += 1;
+ threadpool_io->updates = g_renew (ThreadPoolIOUpdate, threadpool_io->updates, threadpool_io->updates_size);
+
+ update = &threadpool_io->updates [threadpool_io->updates_size - 1];
+ update->fd = fd;
+ update->epoll.event = event;
+ update->epoll.op = is_new ? EPOLL_CTL_ADD : EPOLL_CTL_MOD;
+ mono_mutex_unlock (&threadpool_io->updates_lock);
+
+ polling_thread_wakeup ();
+}
+
+static void
+epoll_thread_add_update (ThreadPoolIOUpdate *update)
+{
+ if (epoll_ctl (threadpool_io->epoll.fd, update->epoll.op, update->fd, update->epoll.event) == -1)
+ g_warning ("epoll_thread_add_update: epoll_ctl(%s) failed, error (%d) %s", update->epoll.op == EPOLL_CTL_ADD ? "EPOLL_CTL_ADD" : "EPOLL_CTL_MOD", errno, g_strerror (errno));
+ g_free (update->epoll.event);
+}
+
+static gint
+epoll_thread_wait_for_event (void)
+{
+ gint ready;
+
+ ready = epoll_wait (threadpool_io->epoll.fd, threadpool_io->epoll.events, EPOLL_NEVENTS, -1);
+ if (ready == -1) {
+ switch (errno) {
+ case EINTR:
+ check_for_interruption_critical ();
+ ready = 0;
+ break;
+ default:
+ g_warning ("epoll_thread_wait_for_event: epoll_wait () failed, error (%d) %s", errno, g_strerror (errno));
+ break;
+ }
+ }
+
+ return ready;
+}
+
+static inline gint
+epoll_thread_get_fd_at (guint i)
+{
+ return threadpool_io->epoll.events [i].data.fd;
+}
+
+static gboolean
+epoll_thread_create_socket_async_results (gint fd, struct epoll_event *epoll_event, MonoMList **list)
+{
+ g_assert (epoll_event);
+ g_assert (list);
+
+ if (!*list) {
+ epoll_ctl (threadpool_io->epoll.fd, EPOLL_CTL_DEL, fd, epoll_event);
+ } else {
+ gint events;
+
+ if ((epoll_event->events & (EPOLLIN | EPOLLERR | EPOLLHUP)) != 0) {
+ MonoSocketAsyncResult *io_event = get_state (list, MONO_POLLIN);
+ if (io_event)
+ mono_threadpool_io_enqueue_socket_async_result (((MonoObject*) io_event)->vtable->domain, io_event);
+ }
+ if ((epoll_event->events & (EPOLLOUT | EPOLLERR | EPOLLHUP)) != 0) {
+ MonoSocketAsyncResult *io_event = get_state (list, MONO_POLLOUT);
+ if (io_event)
+ mono_threadpool_io_enqueue_socket_async_result (((MonoObject*) io_event)->vtable->domain, io_event);
+ }
+
+ events = get_events (*list);
+ epoll_event->events = ((events & MONO_POLLOUT) ? EPOLLOUT : 0) | ((events & MONO_POLLIN) ? EPOLLIN : 0);
+ if (epoll_ctl (threadpool_io->epoll.fd, EPOLL_CTL_MOD, fd, epoll_event) == -1) {
+ if (epoll_ctl (threadpool_io->epoll.fd, EPOLL_CTL_ADD, fd, epoll_event) == -1)
+ g_warning ("epoll_thread_create_socket_async_results: epoll_ctl () failed, error (%d) %s", errno, g_strerror (errno));
+ }
+ }
+
+ return TRUE;
+}
+
+#elif defined(HAVE_KQUEUE)
+
+#if defined(HOST_WIN32)
+/* We assume that kqueue is not available on windows */
+#error
+#endif
+
+#define KQUEUE_NEVENTS 128
+
+static gboolean
+kqueue_init (void)
+{
+ struct kevent event;
+
+ threadpool_io->kqueue.fd = kqueue ();
+ if (threadpool_io->kqueue.fd == -1) {
+ g_warning ("kqueue_init: kqueue () failed, error (%d) %s", errno, g_strerror (errno));
+ return FALSE;
+ }
+
+ EV_SET (&event, threadpool_io->wakeup_pipes [0], EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, 0);
+ if (kevent (threadpool_io->kqueue.fd, &event, 1, NULL, 0, NULL) == -1) {
+ g_warning ("kqueue_init: kevent () failed, error (%d) %s", errno, g_strerror (errno));
+ close (threadpool_io->kqueue.fd);
+ return FALSE;
+ }
+
+ threadpool_io->kqueue.events = g_new0 (struct kevent, KQUEUE_NEVENTS);
+
+ return TRUE;
+}
+
+static void
+kqueue_cleanup (void)
+{
+ g_free (threadpool_io->kqueue.events);
+
+ close (threadpool_io->kqueue.fd);
+}
+
+static void
+kqueue_update (gint fd, gint events, gboolean is_new)
+{
+ ThreadPoolIOUpdate *update;
+ struct kevent *event;
+
+ event = g_new0 (struct kevent, 1);
+ if ((events & MONO_POLLIN) != 0)
+ EV_SET (event, fd, EVFILT_READ, EV_ADD | EV_ENABLE | EV_ONESHOT, 0, 0, 0);
+ if ((events & MONO_POLLOUT) != 0)
+ EV_SET (event, fd, EVFILT_WRITE, EV_ADD | EV_ENABLE | EV_ONESHOT, 0, 0, 0);
+
+ mono_mutex_lock (&threadpool_io->updates_lock);
+ threadpool_io->updates_size += 1;
+ threadpool_io->updates = g_renew (ThreadPoolIOUpdate, threadpool_io->updates, threadpool_io->updates_size);
+
+ update = &threadpool_io->updates [threadpool_io->updates_size - 1];
+ update->fd = fd;
+ update->kqueue.event = event;
+ mono_mutex_unlock (&threadpool_io->updates_lock);
+
+ polling_thread_wakeup ();
+}
+
+static void
+kqueue_thread_add_update (ThreadPoolIOUpdate *update)
+{
+ if (kevent (threadpool_io->kqueue.fd, update->kqueue.event, 1, NULL, 0, NULL) == -1)
+ g_warning ("kqueue_thread_add_update: kevent(update) failed, error (%d) %s", errno, g_strerror (errno));
+ g_free (update->kqueue.event);
+}
+
+static gint
+kqueue_thread_wait_for_event (void)
+{
+ gint ready;
+
+ ready = kevent (threadpool_io->kqueue.fd, NULL, 0, threadpool_io->kqueue.events, KQUEUE_NEVENTS, NULL);
+ if (ready == -1) {
+ switch (errno) {
+ case EINTR:
+ check_for_interruption_critical ();
+ ready = 0;
+ break;
+ default:
+ g_warning ("kqueue_thread_wait_for_event: kevent () failed, error (%d) %s", errno, g_strerror (errno));
+ break;
+ }
+ }
+
+ return ready;
+}
+
+static inline gint
+kqueue_thread_get_fd_at (guint i)
+{
+ return threadpool_io->kqueue.events [i].ident;
+}
+
+static gboolean
+kqueue_thread_create_socket_async_results (gint fd, struct kevent *kqueue_event, MonoMList **list)
+{
+ g_assert (kqueue_event);
+ g_assert (list);
+
+ if (*list) {
+ gint events;
+
+ if (kqueue_event->filter == EVFILT_READ || (kqueue_event->flags & EV_ERROR) != 0) {
+ MonoSocketAsyncResult *io_event = get_state (list, MONO_POLLIN);
+ if (io_event)
+ mono_threadpool_io_enqueue_socket_async_result (((MonoObject*) io_event)->vtable->domain, io_event);
+ }
+ if (kqueue_event->filter == EVFILT_WRITE || (kqueue_event->flags & EV_ERROR) != 0) {
+ MonoSocketAsyncResult *io_event = get_state (list, MONO_POLLOUT);
+ if (io_event)
+ mono_threadpool_io_enqueue_socket_async_result (((MonoObject*) io_event)->vtable->domain, io_event);
+ }
+
+ events = get_events (*list);
+ if (kqueue_event->filter == EVFILT_READ && (events & MONO_POLLIN) != 0) {
+ EV_SET (kqueue_event, fd, EVFILT_READ, EV_ADD | EV_ENABLE | EV_ONESHOT, 0, 0, 0);
+ if (kevent (threadpool_io->kqueue.fd, kqueue_event, 1, NULL, 0, NULL) == -1)
+ g_warning ("kqueue_thread_create_socket_async_results: kevent (read) failed, error (%d) %s", errno, g_strerror (errno));
+ }
+ if (kqueue_event->filter == EVFILT_WRITE && (events & MONO_POLLOUT) != 0) {
+ EV_SET (kqueue_event, fd, EVFILT_WRITE, EV_ADD | EV_ENABLE | EV_ONESHOT, 0, 0, 0);
+ if (kevent (threadpool_io->kqueue.fd, kqueue_event, 1, NULL, 0, NULL) == -1)
+ g_warning ("kqueue_thread_create_socket_async_results: kevent (write) failed, error (%d) %s", errno, g_strerror (errno));
+ }
+ }
+
+ return TRUE;
+}
+
+#endif
+
+#define POLL_NEVENTS 1024
+
+static inline void
+POLL_INIT_FD (mono_pollfd *poll_fd, gint fd, gint events)
+{
+ poll_fd->fd = fd;
+ poll_fd->events = events;
+ poll_fd->revents = 0;
+}
+
+static gboolean
+poll_init (void)
+{
+ guint i;
+
+ threadpool_io->poll.fds_max = 1;
+ threadpool_io->poll.fds_size = POLL_NEVENTS;
+ threadpool_io->poll.fds = g_new0 (mono_pollfd, threadpool_io->poll.fds_size);
+
+ POLL_INIT_FD (threadpool_io->poll.fds, threadpool_io->wakeup_pipes [0], MONO_POLLIN);
+ for (i = threadpool_io->poll.fds_max; i < threadpool_io->poll.fds_size; ++i)
+ POLL_INIT_FD (threadpool_io->poll.fds + i, -1, 0);
+
+ return TRUE;
+}
+
+static void
+poll_cleanup (void)
+{
+ g_free (threadpool_io->poll.fds);
+}
+
+static void
+poll_update (gint fd, gint events, gboolean is_new)
+{
+ ThreadPoolIOUpdate *update;
+
+ mono_mutex_lock (&threadpool_io->updates_lock);
+ threadpool_io->updates_size += 1;
+ threadpool_io->updates = g_renew (ThreadPoolIOUpdate, threadpool_io->updates, threadpool_io->updates_size);
+
+ update = &threadpool_io->updates [threadpool_io->updates_size - 1];
+ update->fd = fd;
+ POLL_INIT_FD (&update->poll.fd, fd, events);
+ mono_mutex_unlock (&threadpool_io->updates_lock);
+
+ polling_thread_wakeup ();
+}
+
+static gint
+poll_mark_bad_fds (mono_pollfd *poll_fds, gint poll_fds_size)
+{
+ gint i;
+ gint ret;
+ gint ready = 0;
+ mono_pollfd *poll_fd;
+
+ for (i = 0; i < poll_fds_size; i++) {
+ poll_fd = poll_fds + i;
+ if (poll_fd->fd == -1)
+ continue;
+
+ ret = mono_poll (poll_fd, 1, 0);
+ if (ret == 1)
+ ready++;
+ if (ret == -1) {
+#if !defined(HOST_WIN32)
+ if (errno == EBADF)
+#else
+ if (WSAGetLastError () == WSAEBADF)
+#endif
+ {
+ poll_fd->revents |= MONO_POLLNVAL;
+ ready++;
+ }
+ }
+ }
+
+ return ready;
+}
+
+static void
+poll_thread_add_update (ThreadPoolIOUpdate *update)
+{
+ gboolean found = FALSE;
+ gint j, k;
+
+ for (j = 1; j < threadpool_io->poll.fds_size; ++j) {
+ mono_pollfd *poll_fd = threadpool_io->poll.fds + j;
+ if (poll_fd->fd == update->poll.fd.fd) {
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (!found) {
+ for (j = 1; j < threadpool_io->poll.fds_size; ++j) {
+ mono_pollfd *poll_fd = threadpool_io->poll.fds + j;
+ if (poll_fd->fd == -1)
+ break;
+ }
+ }
+
+ if (j == threadpool_io->poll.fds_size) {
+ threadpool_io->poll.fds_size += POLL_NEVENTS;
+ threadpool_io->poll.fds = g_renew (mono_pollfd, threadpool_io->poll.fds, threadpool_io->poll.fds_size);
+ for (k = j; k < threadpool_io->poll.fds_size; ++k)
+ POLL_INIT_FD (threadpool_io->poll.fds + k, -1, 0);
+ }
+
+ POLL_INIT_FD (threadpool_io->poll.fds + j, update->poll.fd.fd, update->poll.fd.events);
+
+ if (j >= threadpool_io->poll.fds_max)
+ threadpool_io->poll.fds_max = j + 1;
+}
+
+static gint
+poll_thread_wait_for_event (void)
+{
+ gint ready;
+
+ ready = mono_poll (threadpool_io->poll.fds, threadpool_io->poll.fds_max, -1);
+ if (ready == -1) {
+ /*
+ * Apart from EINTR, we only check EBADF, for the rest:
+ * EINVAL: mono_poll() 'protects' us from descriptor
+ * numbers above the limit if using select() by marking
+ * then as MONO_POLLERR. If a system poll() is being
+ * used, the number of descriptor we're passing will not
+ * be over sysconf(_SC_OPEN_MAX), as the error would have
+ * happened when opening.
+ *
+ * EFAULT: we own the memory pointed by pfds.
+ * ENOMEM: we're doomed anyway
+ *
+ */
+#if !defined(HOST_WIN32)
+ switch (errno)
+#else
+ switch (WSAGetLastError ())
+#endif
+ {
+#if !defined(HOST_WIN32)
+ case EINTR:
+#else
+ case WSAEINTR:
+#endif
+ check_for_interruption_critical ();
+ ready = 0;
+ break;
+#if !defined(HOST_WIN32)
+ case EBADF:
+#else
+ case WSAEBADF:
+#endif
+ ready = poll_mark_bad_fds (threadpool_io->poll.fds, threadpool_io->poll.fds_max);
+ break;
+ default:
+#if !defined(HOST_WIN32)
+ g_warning ("poll_thread_wait_for_event: mono_poll () failed, error (%d) %s", errno, g_strerror (errno));
+#else
+ g_warning ("poll_thread_wait_for_event: mono_poll () failed, error (%d)\n", WSAGetLastError ());
+#endif
+ break;
+ }
+ }
+
+ return ready;
+}
+
+static inline gint
+poll_thread_get_fd_at (guint i)
+{
+ return threadpool_io->poll.fds [i].fd;
+}
+
+static gboolean
+poll_thread_create_socket_async_results (gint fd, mono_pollfd *poll_fd, MonoMList **list)
+{
+ g_assert (poll_fd);
+ g_assert (list);
+
+ if (fd == -1 || poll_fd->revents == 0)
+ return FALSE;
+
+ if (!*list) {
+ POLL_INIT_FD (poll_fd, -1, 0);
+ } else {
+ if ((poll_fd->revents & (MONO_POLLIN | MONO_POLLERR | MONO_POLLHUP | MONO_POLLNVAL)) != 0) {
+ MonoSocketAsyncResult *io_event = get_state (list, MONO_POLLIN);
+ if (io_event)
+ mono_threadpool_io_enqueue_socket_async_result (((MonoObject*) io_event)->vtable->domain, io_event);
+ }
+ if ((poll_fd->revents & (MONO_POLLOUT | MONO_POLLERR | MONO_POLLHUP | MONO_POLLNVAL)) != 0) {
+ MonoSocketAsyncResult *io_event = get_state (list, MONO_POLLOUT);
+ if (io_event)
+ mono_threadpool_io_enqueue_socket_async_result (((MonoObject*) io_event)->vtable->domain, io_event);
+ }
+
+ poll_fd->events = get_events (*list);
+ }
+
+ return TRUE;
+}
+
+static void
+polling_thread (gpointer data)
+{
+ io_thread_status = STATUS_INITIALIZED;
+
+ for (;;) {
+ guint i;
+ guint max;
+ gint ready = 0;
+
+ mono_gc_set_skip_thread (TRUE);
+
+ mono_mutex_lock (&threadpool_io->updates_lock);
+ for (i = 0; i < threadpool_io->updates_size; ++i) {
+ switch (threadpool_io->backend) {
+#if defined(HAVE_EPOLL)
+ case BACKEND_EPOLL:
+ epoll_thread_add_update (&threadpool_io->updates [i]);
+ break;
+#elif defined(HAVE_KQUEUE)
+ case BACKEND_KQUEUE:
+ kqueue_thread_add_update (&threadpool_io->updates [i]);
+ break;
+#endif
+ case BACKEND_POLL:
+ poll_thread_add_update (&threadpool_io->updates [i]);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ }
+ if (threadpool_io->updates_size > 0) {
+ threadpool_io->updates_size = 0;
+ threadpool_io->updates = g_renew (ThreadPoolIOUpdate, threadpool_io->updates, threadpool_io->updates_size);
+ }
+ mono_mutex_unlock (&threadpool_io->updates_lock);
+
+ switch (threadpool_io->backend) {
+#if defined(HAVE_EPOLL)
+ case BACKEND_EPOLL:
+ ready = epoll_thread_wait_for_event ();
+ break;
+#elif defined(HAVE_KQUEUE)
+ case BACKEND_KQUEUE:
+ ready = kqueue_thread_wait_for_event ();
+ break;
+#endif
+ case BACKEND_POLL:
+ ready = poll_thread_wait_for_event ();
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ mono_gc_set_skip_thread (FALSE);
+
+ if (ready == -1 || mono_runtime_is_shutting_down ())
+ break;
+
+ switch (threadpool_io->backend) {
+#if defined(HAVE_EPOLL)
+ case BACKEND_EPOLL:
+ max = EPOLL_NEVENTS;
+ break;
+#elif defined(HAVE_KQUEUE)
+ case BACKEND_KQUEUE:
+ max = KQUEUE_NEVENTS;
+ break;
+#endif
+ case BACKEND_POLL:
+ max = threadpool_io->poll.fds_max;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ mono_mutex_lock (&threadpool_io->states_lock);
+ for (i = 0; i < max && ready > 0; ++i) {
+ MonoMList *list;
+ gboolean created;
+ gint fd;
+
+ switch (threadpool_io->backend) {
+#if defined(HAVE_EPOLL)
+ case BACKEND_EPOLL:
+ fd = epoll_thread_get_fd_at (i);
+ break;
+#elif defined(HAVE_KQUEUE)
+ case BACKEND_KQUEUE:
+ fd = kqueue_thread_get_fd_at (i);
+ break;
+#endif
+ case BACKEND_POLL:
+ fd = poll_thread_get_fd_at (i);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ if (fd == threadpool_io->wakeup_pipes [0]) {
+ polling_thread_drain_wakeup_pipes ();
+ ready -= 1;
+ continue;
+ }
+
+ list = mono_g_hash_table_lookup (threadpool_io->states, GINT_TO_POINTER (fd));
+
+ switch (threadpool_io->backend) {
+#if defined(HAVE_EPOLL)
+ case BACKEND_EPOLL:
+ created = epoll_thread_create_socket_async_results (fd, &threadpool_io->epoll.events [i], &list);
+ break;
+#elif defined(HAVE_KQUEUE)
+ case BACKEND_KQUEUE:
+ created = kqueue_thread_create_socket_async_results (fd, &threadpool_io->kqueue.events [i], &list);
+ break;
+#endif
+ case BACKEND_POLL:
+ created = poll_thread_create_socket_async_results (fd, &threadpool_io->poll.fds [i], &list);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ if (!created)
+ continue;
+
+ if (list)
+ mono_g_hash_table_replace (threadpool_io->states, GINT_TO_POINTER (fd), list);
+ else
+ mono_g_hash_table_remove (threadpool_io->states, GINT_TO_POINTER (fd));
+
+ ready -= 1;
+ }
+ mono_mutex_unlock (&threadpool_io->states_lock);
+ }
+
+ io_thread_status = STATUS_CLEANED_UP;
+}
+
+static void
+wakeup_pipes_init (void)
+{
+#if !defined(HOST_WIN32)
+ if (pipe (threadpool_io->wakeup_pipes) == -1)
+ g_error ("wakeup_pipes_init: pipe () failed, error (%d) %s\n", errno, g_strerror (errno));
+ if (fcntl (threadpool_io->wakeup_pipes [0], F_SETFL, O_NONBLOCK) == -1)
+ g_error ("wakeup_pipes_init: fcntl () failed, error (%d) %s\n", errno, g_strerror (errno));
+#else
+ struct sockaddr_in client;
+ struct sockaddr_in server;
+ SOCKET server_sock;
+ gulong arg;
+ gint size;
+
+ server_sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ g_assert (server_sock != INVALID_SOCKET);
+ threadpool_io->wakeup_pipes [1] = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ g_assert (threadpool_io->wakeup_pipes [1] != INVALID_SOCKET);
+
+ server.sin_family = AF_INET;
+ server.sin_addr.s_addr = inet_addr ("127.0.0.1");
+ server.sin_port = 0;
+ if (bind (server_sock, (SOCKADDR*) &server, sizeof (server)) == SOCKET_ERROR) {
+ closesocket (server_sock);
+ g_error ("wakeup_pipes_init: bind () failed, error (%d)\n", WSAGetLastError ());
+ }
+
+ size = sizeof (server);
+ if (getsockname (server_sock, (SOCKADDR*) &server, &size) == SOCKET_ERROR) {
+ closesocket (server_sock);
+ g_error ("wakeup_pipes_init: getsockname () failed, error (%d)\n", WSAGetLastError ());
+ }
+ if (listen (server_sock, 1024) == SOCKET_ERROR) {
+ closesocket (server_sock);
+ g_error ("wakeup_pipes_init: listen () failed, error (%d)\n", WSAGetLastError ());
+ }
+ if (connect ((SOCKET) threadpool_io->wakeup_pipes [1], (SOCKADDR*) &server, sizeof (server)) == SOCKET_ERROR) {
+ closesocket (server_sock);
+ g_error ("wakeup_pipes_init: connect () failed, error (%d)\n", WSAGetLastError ());
+ }
+
+ size = sizeof (client);
+ threadpool_io->wakeup_pipes [0] = accept (server_sock, (SOCKADDR *) &client, &size);
+ g_assert (threadpool_io->wakeup_pipes [0] != INVALID_SOCKET);
+
+ arg = 1;
+ if (ioctlsocket (threadpool_io->wakeup_pipes [0], FIONBIO, &arg) == SOCKET_ERROR) {
+ closesocket (threadpool_io->wakeup_pipes [0]);
+ closesocket (server_sock);
+ g_error ("wakeup_pipes_init: ioctlsocket () failed, error (%d)\n", WSAGetLastError ());
+ }
+
+ closesocket (server_sock);
+#endif
+}
+
+static void
+ensure_initialized (void)
+{
+ if (io_status >= STATUS_INITIALIZED)
+ return;
+ if (io_status == STATUS_INITIALIZING || InterlockedCompareExchange (&io_status, STATUS_INITIALIZING, STATUS_NOT_INITIALIZED) != STATUS_NOT_INITIALIZED) {
+ while (io_status == STATUS_INITIALIZING)
+ mono_thread_info_yield ();
+ g_assert (io_status >= STATUS_INITIALIZED);
+ return;
+ }
+
+ g_assert (!threadpool_io);
+ threadpool_io = g_new0 (ThreadPoolIO, 1);
+ g_assert (threadpool_io);
+
+ threadpool_io->states = mono_g_hash_table_new_type (g_direct_hash, g_direct_equal, MONO_HASH_VALUE_GC);
+ MONO_GC_REGISTER_ROOT_FIXED (threadpool_io->states);
+ mono_mutex_init (&threadpool_io->states_lock);
+
+ threadpool_io->updates = NULL;
+ threadpool_io->updates_size = 0;
+ mono_mutex_init (&threadpool_io->updates_lock);
+
+#if defined(HAVE_EPOLL)
+ threadpool_io->backend = BACKEND_EPOLL;
+#elif defined(HAVE_KQUEUE)
+ threadpool_io->backend = BACKEND_KQUEUE;
+#else
+ threadpool_io->backend = BACKEND_POLL;
+#endif
+ if (g_getenv ("MONO_DISABLE_AIO") != NULL)
+ threadpool_io->backend = BACKEND_POLL;
+
+ wakeup_pipes_init ();
+
+retry_init_backend:
+ switch (threadpool_io->backend) {
+#if defined(HAVE_EPOLL)
+ case BACKEND_EPOLL:
+ if (!epoll_init ()) {
+ threadpool_io->backend = BACKEND_POLL;
+ goto retry_init_backend;
+ }
+ break;
+#elif defined(HAVE_KQUEUE)
+ case BACKEND_KQUEUE:
+ if (!kqueue_init ()) {
+ threadpool_io->backend = BACKEND_POLL;
+ goto retry_init_backend;
+ }
+ break;
+#endif
+ case BACKEND_POLL:
+ if (!poll_init ())
+ g_error ("ensure_initialized: poll_init () failed");
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ if (!mono_thread_create_internal (mono_get_root_domain (), polling_thread, NULL, TRUE, SMALL_STACK))
+ g_error ("ensure_initialized: mono_thread_create_internal () failed");
+
+ io_thread_status = STATUS_INITIALIZING;
+ mono_memory_write_barrier ();
+
+ io_status = STATUS_INITIALIZED;
+}
+
+static void
+ensure_cleanedup (void)
+{
+ if (io_status == STATUS_NOT_INITIALIZED && InterlockedCompareExchange (&io_status, STATUS_CLEANED_UP, STATUS_NOT_INITIALIZED) == STATUS_NOT_INITIALIZED)
+ return;
+ if (io_status == STATUS_INITIALIZING) {
+ while (io_status == STATUS_INITIALIZING)
+ mono_thread_info_yield ();
+ }
+ if (io_status == STATUS_CLEANED_UP)
+ return;
+ if (io_status == STATUS_CLEANING_UP || InterlockedCompareExchange (&io_status, STATUS_CLEANING_UP, STATUS_INITIALIZED) != STATUS_INITIALIZED) {
+ while (io_status == STATUS_CLEANING_UP)
+ mono_thread_info_yield ();
+ g_assert (io_status == STATUS_CLEANED_UP);
+ return;
+ }
+
+ /* we make the assumption along the code that we are
+ * cleaning up only if the runtime is shutting down */
+ g_assert (mono_runtime_is_shutting_down ());
+
+ polling_thread_wakeup ();
+ while (io_thread_status != STATUS_CLEANED_UP)
+ usleep (1000);
+
+ MONO_GC_UNREGISTER_ROOT (threadpool_io->states);
+ mono_g_hash_table_destroy (threadpool_io->states);
+ mono_mutex_destroy (&threadpool_io->states_lock);
+
+ g_free (threadpool_io->updates);
+ mono_mutex_destroy (&threadpool_io->updates_lock);
+
+ switch (threadpool_io->backend) {
+#if defined(HAVE_EPOLL)
+ case BACKEND_EPOLL:
+ epoll_cleanup ();
+ break;
+#elif defined(HAVE_KQUEUE)
+ case BACKEND_KQUEUE:
+ kqueue_cleanup ();
+ break;
+#endif
+ case BACKEND_POLL:
+ poll_cleanup ();
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+#if !defined(HOST_WIN32)
+ close (threadpool_io->wakeup_pipes [0]);
+ close (threadpool_io->wakeup_pipes [1]);
+#else
+ closesocket (threadpool_io->wakeup_pipes [0]);
+ closesocket (threadpool_io->wakeup_pipes [1]);
+#endif
+
+ g_assert (threadpool_io);
+ g_free (threadpool_io);
+ threadpool_io = NULL;
+ g_assert (!threadpool_io);
+
+ io_status = STATUS_CLEANED_UP;
+}
+
+static gboolean
+is_socket_async_callback (MonoImage *system_image, MonoClass *class)
+{
+ MonoClass *socket_async_callback_class = NULL;
+
+ socket_async_callback_class = mono_class_from_name (system_image, "System.Net.Sockets", "SocketAsyncCallback");
+ g_assert (socket_async_callback_class);
+
+ return class == socket_async_callback_class;
+}
+
+static gboolean
+is_async_read_handler (MonoImage *system_image, MonoClass *class)
+{
+ MonoClass *process_class = NULL;
+
+ process_class = mono_class_from_name (system_image, "System.Diagnostics", "Process");
+ g_assert (process_class);
+
+ return class->nested_in && class->nested_in == process_class && strcmp (class->name, "AsyncReadHandler") == 0;
+}
+
+gboolean
+mono_threadpool_ms_is_io (MonoObject *target, MonoObject *state)
+{
+ MonoImage *system_image;
+ MonoSocketAsyncResult *sockares;
+
+ system_image = mono_image_loaded ("System");
+ if (!system_image)
+ return FALSE;
+
+ if (!is_socket_async_callback (system_image, target->vtable->klass) && !is_async_read_handler (system_image, target->vtable->klass))
+ return FALSE;
+
+ sockares = (MonoSocketAsyncResult*) state;
+ if (sockares->operation < AIO_OP_FIRST || sockares->operation >= AIO_OP_LAST)
+ return FALSE;
+
+ return TRUE;
+}
+
+void
+mono_threadpool_ms_io_cleanup (void)
+{
+ ensure_cleanedup ();
+}
+
+MonoAsyncResult *
+mono_threadpool_ms_io_add (MonoAsyncResult *ares, MonoSocketAsyncResult *sockares)
+{
+ MonoMList *list;
+ gboolean is_new;
+ gint events;
+ gint fd;
+
+ g_assert (ares);
+ g_assert (sockares);
+
+ if (mono_runtime_is_shutting_down ())
+ return NULL;
+
+ ensure_initialized ();
+
+ MONO_OBJECT_SETREF (sockares, ares, ares);
+
+ fd = GPOINTER_TO_INT (sockares->handle);
+
+ mono_mutex_lock (&threadpool_io->states_lock);
+ g_assert (threadpool_io->states);
+
+ list = mono_g_hash_table_lookup (threadpool_io->states, GINT_TO_POINTER (fd));
+ is_new = list == NULL;
+ list = mono_mlist_append (list, (MonoObject*) sockares);
+ mono_g_hash_table_replace (threadpool_io->states, sockares->handle, list);
+
+ events = get_events (list);
+
+ switch (threadpool_io->backend) {
+#if defined(HAVE_EPOLL)
+ case BACKEND_EPOLL: {
+ epoll_update (fd, events, is_new);
+ break;
+ }
+#elif defined(HAVE_KQUEUE)
+ case BACKEND_KQUEUE: {
+ kqueue_update (fd, events, is_new);
+ break;
+ }
+#endif
+ case BACKEND_POLL: {
+ poll_update (fd, events, is_new);
+ break;
+ }
+ default:
+ g_assert_not_reached ();
+ }
+
+ mono_mutex_unlock (&threadpool_io->states_lock);
+
+ return ares;
+}
+
+void
+mono_threadpool_ms_io_remove_socket (int fd)
+{
+ MonoMList *list;
+
+ if (io_status != STATUS_INITIALIZED)
+ return;
+
+ mono_mutex_lock (&threadpool_io->states_lock);
+ g_assert (threadpool_io->states);
+ list = mono_g_hash_table_lookup (threadpool_io->states, GINT_TO_POINTER (fd));
+ if (list)
+ mono_g_hash_table_remove (threadpool_io->states, GINT_TO_POINTER (fd));
+ mono_mutex_unlock (&threadpool_io->states_lock);
+
+ while (list) {
+ MonoSocketAsyncResult *sockares, *sockares2;
+
+ sockares = (MonoSocketAsyncResult*) mono_mlist_get_data (list);
+ if (sockares->operation == AIO_OP_RECEIVE)
+ sockares->operation = AIO_OP_RECV_JUST_CALLBACK;
+ else if (sockares->operation == AIO_OP_SEND)
+ sockares->operation = AIO_OP_SEND_JUST_CALLBACK;
+
+ sockares2 = get_state (&list, MONO_POLLIN);
+ if (sockares2)
+ mono_threadpool_io_enqueue_socket_async_result (((MonoObject*) sockares2)->vtable->domain, sockares2);
+
+ if (!list)
+ break;
+
+ sockares2 = get_state (&list, MONO_POLLOUT);
+ if (sockares2)
+ mono_threadpool_io_enqueue_socket_async_result (((MonoObject*) sockares2)->vtable->domain, sockares2);
+ }
+}
+
+static gboolean
+remove_sockstate_for_domain (gpointer key, gpointer value, gpointer user_data)
+{
+ MonoMList *list;
+ gboolean remove = FALSE;
+
+ for (list = value; list; list = mono_mlist_next (list)) {
+ MonoObject *data = mono_mlist_get_data (list);
+ if (mono_object_domain (data) == user_data) {
+ remove = TRUE;
+ mono_mlist_set_data (list, NULL);
+ }
+ }
+
+ //FIXME is there some sort of additional unregistration we need to perform here?
+ return remove;
+}
+
+void
+mono_threadpool_ms_io_remove_domain_jobs (MonoDomain *domain)
+{
+ if (io_status == STATUS_INITIALIZED) {
+ mono_mutex_lock (&threadpool_io->states_lock);
+ mono_g_hash_table_foreach_remove (threadpool_io->states, remove_sockstate_for_domain, domain);
+ mono_mutex_unlock (&threadpool_io->states_lock);
+ }
+}
+
+void
+mono_threadpool_io_enqueue_socket_async_result (MonoDomain *domain, MonoSocketAsyncResult *sockares)
+{
+ MonoImage *system_image;
+ MonoClass *socket_runtime_work_item_class;
+ MonoSocketRuntimeWorkItem *srwi;
+
+ g_assert (sockares);
+
+ system_image = mono_image_loaded ("System");
+ g_assert (system_image);
+
+ socket_runtime_work_item_class = mono_class_from_name (system_image, "System.Net.Sockets", "MonoSocketRuntimeWorkItem");
+ g_assert (socket_runtime_work_item_class);
+
+ srwi = (MonoSocketRuntimeWorkItem*) mono_object_new (domain, socket_runtime_work_item_class);
+ MONO_OBJECT_SETREF (srwi, socket_async_result, sockares);
+
+ mono_threadpool_ms_enqueue_work_item (domain, (MonoObject*) srwi);
+}
+
+void
+ves_icall_System_Net_Sockets_MonoSocketRuntimeWorkItem_ExecuteWorkItem (MonoSocketRuntimeWorkItem *rwi)
+{
+ MonoSocketAsyncResult *sockares;
+ MonoAsyncResult *ares;
+ MonoObject *exc = NULL;
+
+ g_assert (rwi);
+
+ sockares = rwi->socket_async_result;
+ g_assert (sockares);
+ g_assert (sockares->ares);
+
+ switch (sockares->operation) {
+ case AIO_OP_RECEIVE:
+ sockares->total = ves_icall_System_Net_Sockets_Socket_Receive_internal ((SOCKET) (gssize) sockares->handle, sockares->buffer, sockares->offset,
+ sockares->size, sockares->socket_flags, &sockares->error);
+ break;
+ case AIO_OP_SEND:
+ sockares->total = ves_icall_System_Net_Sockets_Socket_Send_internal ((SOCKET) (gssize) sockares->handle, sockares->buffer, sockares->offset,
+ sockares->size, sockares->socket_flags, &sockares->error);
+ break;
+ }
+
+ ares = sockares->ares;
+ g_assert (ares);
+
+ mono_async_result_invoke (ares, &exc);
+
+ if (sockares->completed && sockares->callback) {
+ MonoAsyncResult *cb_ares;
+
+ /* Don't call mono_async_result_new() to avoid capturing the context */
+ cb_ares = (MonoAsyncResult*) mono_object_new (mono_domain_get (), mono_defaults.asyncresult_class);
+ MONO_OBJECT_SETREF (cb_ares, async_delegate, sockares->callback);
+ MONO_OBJECT_SETREF (cb_ares, async_state, (MonoObject*) sockares);
+
+ mono_threadpool_ms_enqueue_async_result (mono_domain_get (), cb_ares);
+ }
+
+ if (exc)
+ mono_raise_exception ((MonoException*) exc);
+}
+
+#else
+
+gboolean
+mono_threadpool_ms_is_io (MonoObject *target, MonoObject *state)
+{
+ return FALSE;
+}
+
+void
+mono_threadpool_ms_io_cleanup (void)
+{
+ g_assert_not_reached ();
+}
+
+MonoAsyncResult *
+mono_threadpool_ms_io_add (MonoAsyncResult *ares, MonoSocketAsyncResult *sockares)
+{
+ g_assert_not_reached ();
+}
+
+void
+mono_threadpool_ms_io_remove_socket (int fd)
+{
+ g_assert_not_reached ();
+}
+
+void
+mono_threadpool_ms_io_remove_domain_jobs (MonoDomain *domain)
+{
+ g_assert_not_reached ();
+}
+
+void
+mono_threadpool_io_enqueue_socket_async_result (MonoDomain *domain, MonoSocketAsyncResult *sockares)
+{
+ g_assert_not_reached ();
+}
+
+void
+ves_icall_System_Net_Sockets_MonoSocketRuntimeWorkItem_ExecuteWorkItem (MonoSocketRuntimeWorkItem *rwi)
+{
+ g_assert_not_reached ();
+}
+
+#endif
\ No newline at end of file
--- /dev/null
+#ifndef _MONO_THREADPOOL_IO_MS_H_
+#define _MONO_THREADPOOL_IO_MS_H_
+
+#include <config.h>
+#include <glib.h>
+
+#include <mono/metadata/object-internals.h>
+#include <mono/metadata/socket-io.h>
+
+typedef struct _MonoSocketRuntimeWorkItem MonoSocketRuntimeWorkItem;
+
+gboolean
+mono_threadpool_ms_is_io (MonoObject *target, MonoObject *state);
+
+MonoAsyncResult *
+mono_threadpool_ms_io_add (MonoAsyncResult *ares, MonoSocketAsyncResult *sockares);
+void
+mono_threadpool_ms_io_remove_socket (int fd);
+void
+mono_threadpool_ms_io_remove_domain_jobs (MonoDomain *domain);
+void
+mono_threadpool_ms_io_cleanup (void);
+
+void
+mono_threadpool_io_enqueue_socket_async_result (MonoDomain *domain, MonoSocketAsyncResult *sockares);
+
+void
+ves_icall_System_Net_Sockets_MonoSocketRuntimeWorkItem_ExecuteWorkItem (MonoSocketRuntimeWorkItem *rwi);
+
+#endif /* _MONO_THREADPOOL_IO_MS_H_ */
\ No newline at end of file
--- /dev/null
+/*
+ * threadpool-ms.c: Microsoft threadpool runtime support
+ *
+ * Author:
+ * Ludovic Henry (ludovic.henry@xamarin.com)
+ *
+ * Copyright 2015 Xamarin, Inc (http://www.xamarin.com)
+ */
+
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+// Files:
+// - src/vm/comthreadpool.cpp
+// - src/vm/win32threadpoolcpp
+// - src/vm/threadpoolrequest.cpp
+// - src/vm/hillclimbing.cpp
+//
+// Ported from C++ to C and adjusted to Mono runtime
+
+#include <stdlib.h>
+#include <math.h>
+#include <config.h>
+#include <glib.h>
+
+#if !defined (HAVE_COMPLEX_H)
+#include <../../support/libm/complex.h>
+#else
+#include <complex.h>
+#endif
+
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/object.h>
+#include <mono/metadata/object-internals.h>
+#include <mono/metadata/threadpool-ms.h>
+#include <mono/metadata/threadpool-ms-io.h>
+#include <mono/metadata/threadpool-internals.h>
+#include <mono/utils/atomic.h>
+#include <mono/utils/mono-compiler.h>
+#include <mono/utils/mono-proclib.h>
+#include <mono/utils/mono-threads.h>
+#include <mono/utils/mono-time.h>
+#include <mono/utils/mono-rand.h>
+
+#define CPU_USAGE_LOW 80
+#define CPU_USAGE_HIGH 95
+
+#define MONITOR_INTERVAL 100 // ms
+
+/* The exponent to apply to the gain. 1.0 means to use linear gain,
+ * higher values will enhance large moves and damp small ones.
+ * default: 2.0 */
+#define HILL_CLIMBING_GAIN_EXPONENT 2.0
+
+/* The 'cost' of a thread. 0 means drive for increased throughput regardless
+ * of thread count, higher values bias more against higher thread counts.
+ * default: 0.15 */
+#define HILL_CLIMBING_BIAS 0.15
+
+#define HILL_CLIMBING_WAVE_PERIOD 4
+#define HILL_CLIMBING_MAX_WAVE_MAGNITUDE 20
+#define HILL_CLIMBING_WAVE_MAGNITUDE_MULTIPLIER 1.0
+#define HILL_CLIMBING_WAVE_HISTORY_SIZE 8
+#define HILL_CLIMBING_TARGET_SIGNAL_TO_NOISE_RATIO 3.0
+#define HILL_CLIMBING_MAX_CHANGE_PER_SECOND 4
+#define HILL_CLIMBING_MAX_CHANGE_PER_SAMPLE 20
+#define HILL_CLIMBING_SAMPLE_INTERVAL_LOW 10
+#define HILL_CLIMBING_SAMPLE_INTERVAL_HIGH 200
+#define HILL_CLIMBING_ERROR_SMOOTHING_FACTOR 0.01
+#define HILL_CLIMBING_MAX_SAMPLE_ERROR_PERCENT 0.15
+
+/* Keep in sync with System.Threading.RuntimeWorkItem */
+struct _MonoRuntimeWorkItem {
+ MonoObject object;
+ MonoAsyncResult *async_result;
+};
+
+typedef union {
+ struct {
+ gint16 max_working; /* determined by heuristic */
+ gint16 active; /* working or waiting on thread_work_sem; warm threads */
+ gint16 working;
+ gint16 parked;
+ } _;
+ gint64 as_gint64;
+} ThreadPoolCounter;
+
+typedef struct {
+ MonoDomain *domain;
+ gint32 outstanding_request;
+} ThreadPoolDomain;
+
+typedef struct {
+ gint32 wave_period;
+ gint32 samples_to_measure;
+ gdouble target_throughput_ratio;
+ gdouble target_signal_to_noise_ratio;
+ gdouble max_change_per_second;
+ gdouble max_change_per_sample;
+ gint32 max_thread_wave_magnitude;
+ gint32 sample_interval_low;
+ gdouble thread_magnitude_multiplier;
+ gint32 sample_interval_high;
+ gdouble throughput_error_smoothing_factor;
+ gdouble gain_exponent;
+ gdouble max_sample_error;
+
+ gdouble current_control_setting;
+ gint64 total_samples;
+ gint16 last_thread_count;
+ gdouble elapsed_since_last_change;
+ gdouble completions_since_last_change;
+
+ gdouble average_throughput_noise;
+
+ gdouble *samples;
+ gdouble *thread_counts;
+
+ guint32 current_sample_interval;
+ gpointer random_interval_generator;
+
+ gint32 accumulated_completion_count;
+ gdouble accumulated_sample_duration;
+} ThreadPoolHillClimbing;
+
+typedef struct {
+ ThreadPoolCounter counters;
+
+ GPtrArray *domains; // ThreadPoolDomain* []
+ mono_mutex_t domains_lock;
+
+ GPtrArray *working_threads; // MonoInternalThread* []
+ mono_mutex_t working_threads_lock;
+
+ GPtrArray *parked_threads; // mono_cond_t* []
+ mono_mutex_t parked_threads_lock;
+
+ gint32 heuristic_completions;
+ guint32 heuristic_sample_start;
+ guint32 heuristic_last_dequeue; // ms
+ guint32 heuristic_last_adjustment; // ms
+ guint32 heuristic_adjustment_interval; // ms
+ ThreadPoolHillClimbing heuristic_hill_climbing;
+ mono_mutex_t heuristic_lock;
+
+ gint32 limit_worker_min;
+ gint32 limit_worker_max;
+ gint32 limit_io_min;
+ gint32 limit_io_max;
+
+ MonoCpuUsageState *cpu_usage_state;
+ gint32 cpu_usage;
+
+ /* suspended by the debugger */
+ gboolean suspended;
+} ThreadPool;
+
+typedef enum {
+ TRANSITION_WARMUP,
+ TRANSITION_INITIALIZING,
+ TRANSITION_RANDOM_MOVE,
+ TRANSITION_CLIMBING_MOVE,
+ TRANSITION_CHANGE_POINT,
+ TRANSITION_STABILIZING,
+ TRANSITION_STARVATION,
+ TRANSITION_THREAD_TIMED_OUT,
+ TRANSITION_UNDEFINED,
+} ThreadPoolHeuristicStateTransition;
+
+enum {
+ MONITOR_STATUS_REQUESTED,
+ MONITOR_STATUS_WAITING_FOR_REQUEST,
+ MONITOR_STATUS_NOT_RUNNING,
+};
+
+static gint32 status = STATUS_NOT_INITIALIZED;
+static gint32 monitor_status = MONITOR_STATUS_NOT_RUNNING;
+
+static ThreadPool* threadpool;
+
+#define COUNTER_CHECK(counter) \
+ do { \
+ g_assert (counter._.max_working > 0); \
+ g_assert (counter._.active >= 0); \
+ } while (0)
+
+#define COUNTER_READ() ((ThreadPoolCounter) InterlockedRead64 (&threadpool->counters.as_gint64))
+
+#define COUNTER_ATOMIC(var,block) \
+ do { \
+ ThreadPoolCounter __old; \
+ do { \
+ g_assert (threadpool); \
+ (var) = __old = COUNTER_READ (); \
+ { block; } \
+ COUNTER_CHECK (var); \
+ } while (InterlockedCompareExchange64 (&threadpool->counters.as_gint64, (var).as_gint64, __old.as_gint64) != __old.as_gint64); \
+ } while (0)
+
+#define COUNTER_TRY_ATOMIC(res,var,block) \
+ do { \
+ ThreadPoolCounter __old; \
+ do { \
+ g_assert (threadpool); \
+ (var) = __old = COUNTER_READ (); \
+ (res) = FALSE; \
+ { block; } \
+ COUNTER_CHECK (var); \
+ (res) = InterlockedCompareExchange64 (&threadpool->counters.as_gint64, (var).as_gint64, __old.as_gint64) == __old.as_gint64; \
+ } while (0); \
+ } while (0)
+
+static gpointer
+rand_create (void)
+{
+ mono_rand_open ();
+ return mono_rand_init (NULL, 0);
+}
+
+static guint32
+rand_next (gpointer *handle, guint32 min, guint32 max)
+{
+ guint32 val;
+ if (!mono_rand_try_get_uint32 (handle, &val, min, max)) {
+ // FIXME handle error
+ g_assert_not_reached ();
+ }
+ return val;
+}
+
+static void
+rand_free (gpointer handle)
+{
+ mono_rand_close (handle);
+}
+
+static void
+ensure_initialized (gboolean *enable_worker_tracking)
+{
+ ThreadPoolHillClimbing *hc;
+ const char *threads_per_cpu_env;
+ gint threads_per_cpu;
+ gint threads_count;
+
+ if (enable_worker_tracking) {
+ // TODO implement some kind of switch to have the possibily to use it
+ *enable_worker_tracking = FALSE;
+ }
+
+ if (status >= STATUS_INITIALIZED)
+ return;
+ if (status == STATUS_INITIALIZING || InterlockedCompareExchange (&status, STATUS_INITIALIZING, STATUS_NOT_INITIALIZED) != STATUS_NOT_INITIALIZED) {
+ while (status == STATUS_INITIALIZING)
+ mono_thread_info_yield ();
+ g_assert (status >= STATUS_INITIALIZED);
+ return;
+ }
+
+ g_assert (!threadpool);
+ threadpool = g_new0 (ThreadPool, 1);
+ g_assert (threadpool);
+
+ threadpool->domains = g_ptr_array_new ();
+ mono_mutex_init_recursive (&threadpool->domains_lock);
+
+ threadpool->parked_threads = g_ptr_array_new ();
+ mono_mutex_init (&threadpool->parked_threads_lock);
+
+ threadpool->working_threads = g_ptr_array_new ();
+ mono_mutex_init (&threadpool->working_threads_lock);
+
+ threadpool->heuristic_adjustment_interval = 10;
+ mono_mutex_init (&threadpool->heuristic_lock);
+
+ mono_rand_open ();
+
+ hc = &threadpool->heuristic_hill_climbing;
+
+ hc->wave_period = HILL_CLIMBING_WAVE_PERIOD;
+ hc->max_thread_wave_magnitude = HILL_CLIMBING_MAX_WAVE_MAGNITUDE;
+ hc->thread_magnitude_multiplier = (gdouble) HILL_CLIMBING_WAVE_MAGNITUDE_MULTIPLIER;
+ hc->samples_to_measure = hc->wave_period * HILL_CLIMBING_WAVE_HISTORY_SIZE;
+ hc->target_throughput_ratio = (gdouble) HILL_CLIMBING_BIAS;
+ hc->target_signal_to_noise_ratio = (gdouble) HILL_CLIMBING_TARGET_SIGNAL_TO_NOISE_RATIO;
+ hc->max_change_per_second = (gdouble) HILL_CLIMBING_MAX_CHANGE_PER_SECOND;
+ hc->max_change_per_sample = (gdouble) HILL_CLIMBING_MAX_CHANGE_PER_SAMPLE;
+ hc->sample_interval_low = HILL_CLIMBING_SAMPLE_INTERVAL_LOW;
+ hc->sample_interval_high = HILL_CLIMBING_SAMPLE_INTERVAL_HIGH;
+ hc->throughput_error_smoothing_factor = (gdouble) HILL_CLIMBING_ERROR_SMOOTHING_FACTOR;
+ hc->gain_exponent = (gdouble) HILL_CLIMBING_GAIN_EXPONENT;
+ hc->max_sample_error = (gdouble) HILL_CLIMBING_MAX_SAMPLE_ERROR_PERCENT;
+ hc->current_control_setting = 0;
+ hc->total_samples = 0;
+ hc->last_thread_count = 0;
+ hc->average_throughput_noise = 0;
+ hc->elapsed_since_last_change = 0;
+ hc->accumulated_completion_count = 0;
+ hc->accumulated_sample_duration = 0;
+ hc->samples = g_new0 (gdouble, hc->samples_to_measure);
+ hc->thread_counts = g_new0 (gdouble, hc->samples_to_measure);
+ hc->random_interval_generator = rand_create ();
+ hc->current_sample_interval = rand_next (&hc->random_interval_generator, hc->sample_interval_low, hc->sample_interval_high);
+
+ if (!(threads_per_cpu_env = g_getenv ("MONO_THREADS_PER_CPU")))
+ threads_per_cpu = 1;
+ else
+ threads_per_cpu = CLAMP (atoi (threads_per_cpu_env), 1, 50);
+
+ threads_count = mono_cpu_count () * threads_per_cpu;
+
+ threadpool->limit_worker_min = threadpool->limit_io_min = threads_count;
+ threadpool->limit_worker_max = threadpool->limit_io_max = threads_count * 100;
+
+ threadpool->counters._.max_working = threadpool->limit_worker_min;
+
+ threadpool->cpu_usage_state = g_new0 (MonoCpuUsageState, 1);
+
+ threadpool->suspended = FALSE;
+
+ status = STATUS_INITIALIZED;
+}
+
+static void
+ensure_cleanedup (void)
+{
+ if (status == STATUS_NOT_INITIALIZED && InterlockedCompareExchange (&status, STATUS_CLEANED_UP, STATUS_NOT_INITIALIZED) == STATUS_NOT_INITIALIZED)
+ return;
+ if (status == STATUS_INITIALIZING) {
+ while (status == STATUS_INITIALIZING)
+ mono_thread_info_yield ();
+ }
+ if (status == STATUS_CLEANED_UP)
+ return;
+ if (status == STATUS_CLEANING_UP || InterlockedCompareExchange (&status, STATUS_CLEANING_UP, STATUS_INITIALIZED) != STATUS_INITIALIZED) {
+ while (status == STATUS_CLEANING_UP)
+ mono_thread_info_yield ();
+ g_assert (status == STATUS_CLEANED_UP);
+ return;
+ }
+
+ /* we make the assumption along the code that we are
+ * cleaning up only if the runtime is shutting down */
+ g_assert (mono_runtime_is_shutting_down ());
+
+ /* Unpark all worker threads */
+ mono_mutex_lock (&threadpool->parked_threads_lock);
+ for (;;) {
+ guint i;
+ ThreadPoolCounter counter = COUNTER_READ ();
+ if (counter._.active == 0 && counter._.parked == 0)
+ break;
+ if (counter._.active == 1) {
+ MonoInternalThread *thread = mono_thread_internal_current ();
+ if (thread->threadpool_thread) {
+ /* if there is only one active thread
+ * left and it's the current one */
+ break;
+ }
+ }
+ for (i = 0; i < threadpool->parked_threads->len; ++i) {
+ mono_cond_t *cond = (mono_cond_t*) g_ptr_array_index (threadpool->parked_threads, i);
+ mono_cond_signal (cond);
+ }
+ mono_mutex_unlock (&threadpool->parked_threads_lock);
+ usleep (1000);
+ mono_mutex_lock (&threadpool->parked_threads_lock);
+ }
+ mono_mutex_unlock (&threadpool->parked_threads_lock);
+
+ while (monitor_status != MONITOR_STATUS_NOT_RUNNING)
+ usleep (1000);
+
+ g_ptr_array_free (threadpool->domains, TRUE);
+ mono_mutex_destroy (&threadpool->domains_lock);
+
+ g_ptr_array_free (threadpool->parked_threads, TRUE);
+ mono_mutex_destroy (&threadpool->parked_threads_lock);
+
+ g_ptr_array_free (threadpool->working_threads, TRUE);
+ mono_mutex_destroy (&threadpool->working_threads_lock);
+
+ mono_mutex_destroy (&threadpool->heuristic_lock);
+ g_free (threadpool->heuristic_hill_climbing.samples);
+ g_free (threadpool->heuristic_hill_climbing.thread_counts);
+ rand_free (threadpool->heuristic_hill_climbing.random_interval_generator);
+
+ g_free (threadpool->cpu_usage_state);
+
+ g_assert (threadpool);
+ g_free (threadpool);
+ threadpool = NULL;
+ g_assert (!threadpool);
+
+ status = STATUS_CLEANED_UP;
+}
+
+void
+mono_threadpool_ms_enqueue_work_item (MonoDomain *domain, MonoObject *work_item)
+{
+ static MonoClass *threadpool_class = NULL;
+ static MonoMethod *unsafe_queue_custom_work_item_method = NULL;
+ MonoDomain *current_domain;
+ MonoBoolean f;
+ gpointer args [2];
+
+ g_assert (work_item);
+
+ if (!threadpool_class)
+ threadpool_class = mono_class_from_name (mono_defaults.corlib, "System.Threading", "ThreadPool");
+ g_assert (threadpool_class);
+
+ if (!unsafe_queue_custom_work_item_method)
+ unsafe_queue_custom_work_item_method = mono_class_get_method_from_name (threadpool_class, "UnsafeQueueCustomWorkItem", 2);
+ g_assert (unsafe_queue_custom_work_item_method);
+
+ f = FALSE;
+
+ args [0] = (gpointer) work_item;
+ args [1] = (gpointer) mono_value_box (domain, mono_defaults.boolean_class, &f);
+
+ current_domain = mono_domain_get ();
+ if (current_domain == domain) {
+ mono_runtime_invoke (unsafe_queue_custom_work_item_method, NULL, args, NULL);
+ } else {
+ mono_thread_push_appdomain_ref (domain);
+ if (mono_domain_set (domain, FALSE)) {
+ mono_runtime_invoke (unsafe_queue_custom_work_item_method, NULL, args, NULL);
+ mono_domain_set (current_domain, TRUE);
+ }
+ mono_thread_pop_appdomain_ref ();
+ }
+}
+
+void
+mono_threadpool_ms_enqueue_async_result (MonoDomain *domain, MonoAsyncResult *ares)
+{
+ static MonoClass *runtime_work_item_class = NULL;
+ MonoRuntimeWorkItem *rwi;
+
+ g_assert (ares);
+
+ if (!runtime_work_item_class)
+ runtime_work_item_class = mono_class_from_name (mono_defaults.corlib, "System.Threading", "MonoRuntimeWorkItem");
+ g_assert (runtime_work_item_class);
+
+ rwi = (MonoRuntimeWorkItem*) mono_object_new (domain, runtime_work_item_class);
+ MONO_OBJECT_SETREF (rwi, async_result, ares);
+
+ mono_threadpool_ms_enqueue_work_item (domain, (MonoObject*) rwi);
+}
+
+static void
+domain_add (ThreadPoolDomain *tpdomain)
+{
+ guint i, len;
+
+ g_assert (tpdomain);
+
+ mono_mutex_lock (&threadpool->domains_lock);
+ len = threadpool->domains->len;
+ for (i = 0; i < len; ++i) {
+ if (g_ptr_array_index (threadpool->domains, i) == tpdomain)
+ break;
+ }
+ if (i == len)
+ g_ptr_array_add (threadpool->domains, tpdomain);
+ mono_mutex_unlock (&threadpool->domains_lock);
+}
+
+static gboolean
+domain_remove (ThreadPoolDomain *tpdomain)
+{
+ gboolean res;
+
+ g_assert (tpdomain);
+
+ mono_mutex_lock (&threadpool->domains_lock);
+ res = g_ptr_array_remove (threadpool->domains, tpdomain);
+ mono_mutex_unlock (&threadpool->domains_lock);
+
+ return res;
+}
+
+static ThreadPoolDomain *
+domain_get_or_create (MonoDomain *domain)
+{
+ ThreadPoolDomain *tpdomain = NULL;
+ guint i;
+
+ g_assert (domain);
+
+ mono_mutex_lock (&threadpool->domains_lock);
+ for (i = 0; i < threadpool->domains->len; ++i) {
+ ThreadPoolDomain *tmp = g_ptr_array_index (threadpool->domains, i);
+ if (tmp->domain == domain) {
+ tpdomain = tmp;
+ break;
+ }
+ }
+ if (!tpdomain) {
+ tpdomain = g_new0 (ThreadPoolDomain, 1);
+ tpdomain->domain = domain;
+ domain_add (tpdomain);
+ }
+ mono_mutex_unlock (&threadpool->domains_lock);
+ return tpdomain;
+}
+
+static gboolean
+domain_any_has_request ()
+{
+ gboolean res = FALSE;
+ guint i;
+
+ mono_mutex_lock (&threadpool->domains_lock);
+ for (i = 0; i < threadpool->domains->len; ++i) {
+ ThreadPoolDomain *tmp = g_ptr_array_index (threadpool->domains, i);
+ if (tmp->outstanding_request > 0) {
+ res = TRUE;
+ break;
+ }
+ }
+ mono_mutex_unlock (&threadpool->domains_lock);
+ return res;
+}
+
+static ThreadPoolDomain *
+domain_get_next (ThreadPoolDomain *current)
+{
+ ThreadPoolDomain *tpdomain = NULL;
+ guint len;
+
+ mono_mutex_lock (&threadpool->domains_lock);
+ len = threadpool->domains->len;
+ if (len > 0) {
+ guint i, current_idx = -1;
+ if (current) {
+ for (i = 0; i < len; ++i) {
+ if (current == g_ptr_array_index (threadpool->domains, i)) {
+ current_idx = i;
+ break;
+ }
+ }
+ g_assert (current_idx >= 0);
+ }
+ for (i = current_idx + 1; i < len + current_idx + 1; ++i) {
+ ThreadPoolDomain *tmp = g_ptr_array_index (threadpool->domains, i % len);
+ if (tmp->outstanding_request > 0) {
+ tpdomain = tmp;
+ tpdomain->outstanding_request --;
+ g_assert (tpdomain->outstanding_request >= 0);
+ break;
+ }
+ }
+ }
+ mono_mutex_unlock (&threadpool->domains_lock);
+ return tpdomain;
+}
+
+static void
+worker_park (void)
+{
+ mono_cond_t cond;
+ mono_cond_init (&cond, NULL);
+
+ mono_mutex_lock (&threadpool->parked_threads_lock);
+ g_ptr_array_add (threadpool->parked_threads, &cond);
+ mono_cond_wait (&cond, &threadpool->parked_threads_lock);
+ g_ptr_array_remove (threadpool->parked_threads, &cond);
+ mono_mutex_unlock (&threadpool->parked_threads_lock);
+
+ mono_cond_destroy (&cond);
+}
+
+static gboolean
+worker_try_unpark (void)
+{
+ gboolean res = FALSE;
+ guint len;
+
+ mono_mutex_lock (&threadpool->parked_threads_lock);
+ len = threadpool->parked_threads->len;
+ if (len > 0) {
+ mono_cond_t *cond = (mono_cond_t*) g_ptr_array_index (threadpool->parked_threads, len - 1);
+ mono_cond_signal (cond);
+ res = TRUE;
+ }
+ mono_mutex_unlock (&threadpool->parked_threads_lock);
+ return res;
+}
+
+static void
+worker_thread (gpointer data)
+{
+ static MonoClass *threadpool_wait_callback_class = NULL;
+ static MonoMethod *perform_wait_callback_method = NULL;
+ MonoInternalThread *thread;
+ ThreadPoolDomain *tpdomain;
+ ThreadPoolCounter counter;
+ gboolean retire = FALSE;
+
+ g_assert (status >= STATUS_INITIALIZED);
+
+ tpdomain = data;
+ g_assert (tpdomain);
+ g_assert (tpdomain->domain);
+
+ if (mono_runtime_is_shutting_down () || mono_domain_is_unloading (tpdomain->domain)) {
+ COUNTER_ATOMIC (counter, { counter._.active --; });
+ return;
+ }
+
+ if (!threadpool_wait_callback_class)
+ threadpool_wait_callback_class = mono_class_from_name (mono_defaults.corlib, "System.Threading.Microsoft", "_ThreadPoolWaitCallback");
+ g_assert (threadpool_wait_callback_class);
+
+ if (!perform_wait_callback_method)
+ perform_wait_callback_method = mono_class_get_method_from_name (threadpool_wait_callback_class, "PerformWaitCallback", 0);
+ g_assert (perform_wait_callback_method);
+
+ g_assert (threadpool);
+
+ thread = mono_thread_internal_current ();
+ g_assert (thread);
+
+ mono_mutex_lock (&threadpool->domains_lock);
+
+ do {
+ guint i, c;
+
+ g_assert (tpdomain);
+ g_assert (tpdomain->domain);
+
+ tpdomain->domain->threadpool_jobs ++;
+
+ mono_mutex_unlock (&threadpool->domains_lock);
+
+ mono_mutex_lock (&threadpool->working_threads_lock);
+ g_ptr_array_add (threadpool->working_threads, thread);
+ mono_mutex_unlock (&threadpool->working_threads_lock);
+
+ COUNTER_ATOMIC (counter, { counter._.working ++; });
+
+ mono_thread_push_appdomain_ref (tpdomain->domain);
+ if (mono_domain_set (tpdomain->domain, FALSE)) {
+ MonoObject *exc = NULL;
+ MonoObject *res = mono_runtime_invoke (perform_wait_callback_method, NULL, NULL, &exc);
+ if (exc)
+ mono_internal_thread_unhandled_exception (exc);
+ else if (res && *(MonoBoolean*) mono_object_unbox (res) == FALSE)
+ retire = TRUE;
+
+ mono_thread_clr_state (thread , ~ThreadState_Background);
+ if (!mono_thread_test_state (thread , ThreadState_Background))
+ ves_icall_System_Threading_Thread_SetState (thread, ThreadState_Background);
+ }
+ mono_thread_pop_appdomain_ref ();
+
+ COUNTER_ATOMIC (counter, { counter._.working --; });
+
+ mono_mutex_lock (&threadpool->working_threads_lock);
+ g_ptr_array_remove_fast (threadpool->working_threads, thread);
+ mono_mutex_unlock (&threadpool->working_threads_lock);
+
+ mono_mutex_lock (&threadpool->domains_lock);
+
+ tpdomain->domain->threadpool_jobs --;
+ g_assert (tpdomain->domain->threadpool_jobs >= 0);
+
+ if (tpdomain->domain->threadpool_jobs == 0 && mono_domain_is_unloading (tpdomain->domain)) {
+ gboolean removed = domain_remove (tpdomain);
+ g_assert (removed);
+ if (tpdomain->domain->cleanup_semaphore)
+ ReleaseSemaphore (tpdomain->domain->cleanup_semaphore, 1, NULL);
+ g_free (tpdomain);
+ tpdomain = NULL;
+ }
+
+ for (i = 0, c = 5; i < c; ++i) {
+ if (mono_runtime_is_shutting_down ())
+ break;
+
+ if (!retire) {
+ tpdomain = domain_get_next (tpdomain);
+ if (tpdomain)
+ break;
+ }
+
+ if (i < c - 1) {
+ gboolean park = TRUE;
+
+ COUNTER_ATOMIC (counter, {
+ if (counter._.active <= counter._.max_working) {
+ park = FALSE;
+ break;
+ }
+ counter._.active --;
+ counter._.parked ++;
+ });
+
+ if (park) {
+ mono_mutex_unlock (&threadpool->domains_lock);
+ worker_park ();
+ mono_mutex_lock (&threadpool->domains_lock);
+
+ COUNTER_ATOMIC (counter, {
+ counter._.active ++;
+ counter._.parked --;
+ });
+ }
+ }
+
+ retire = FALSE;
+ }
+ } while (tpdomain && !mono_runtime_is_shutting_down ());
+
+ mono_mutex_unlock (&threadpool->domains_lock);
+
+ COUNTER_ATOMIC (counter, { counter._.active --; });
+}
+
+static gboolean
+worker_try_create (ThreadPoolDomain *tpdomain)
+{
+ g_assert (tpdomain);
+ g_assert (tpdomain->domain);
+
+ return mono_thread_create_internal (tpdomain->domain, worker_thread, tpdomain, TRUE, 0) != NULL;
+}
+
+static void monitor_ensure_running (void);
+
+static gboolean
+worker_request (MonoDomain *domain)
+{
+ ThreadPoolDomain *tpdomain;
+ ThreadPoolCounter counter;
+
+ g_assert (domain);
+ g_assert (threadpool);
+
+ if (mono_runtime_is_shutting_down () || mono_domain_is_unloading (domain))
+ return FALSE;
+
+ mono_mutex_lock (&threadpool->domains_lock);
+ tpdomain = domain_get_or_create (domain);
+ g_assert (tpdomain);
+ tpdomain->outstanding_request ++;
+ mono_mutex_unlock (&threadpool->domains_lock);
+
+ if (threadpool->suspended)
+ return FALSE;
+
+ monitor_ensure_running ();
+
+ if (worker_try_unpark ())
+ return TRUE;
+
+ COUNTER_ATOMIC (counter, {
+ if (counter._.active >= counter._.max_working)
+ return FALSE;
+ counter._.active ++;
+ });
+
+ if (worker_try_create (tpdomain))
+ return TRUE;
+
+ COUNTER_ATOMIC (counter, { counter._.active --; });
+ return FALSE;
+}
+
+static gboolean
+monitor_should_keep_running (void)
+{
+ g_assert (monitor_status == MONITOR_STATUS_WAITING_FOR_REQUEST || monitor_status == MONITOR_STATUS_REQUESTED);
+
+ if (InterlockedExchange (&monitor_status, MONITOR_STATUS_WAITING_FOR_REQUEST) == MONITOR_STATUS_WAITING_FOR_REQUEST) {
+ if (mono_runtime_is_shutting_down () || !domain_any_has_request ()) {
+ if (InterlockedExchange (&monitor_status, MONITOR_STATUS_NOT_RUNNING) == MONITOR_STATUS_WAITING_FOR_REQUEST)
+ return FALSE;
+ }
+ }
+
+ g_assert (monitor_status == MONITOR_STATUS_WAITING_FOR_REQUEST || monitor_status == MONITOR_STATUS_REQUESTED);
+
+ return TRUE;
+}
+
+static gboolean
+monitor_sufficient_delay_since_last_dequeue (void)
+{
+ guint32 threshold;
+
+ g_assert (threadpool);
+
+ if (threadpool->cpu_usage < CPU_USAGE_LOW) {
+ threshold = MONITOR_INTERVAL;
+ } else {
+ ThreadPoolCounter counter = COUNTER_READ ();
+ threshold = counter._.max_working * MONITOR_INTERVAL * 2;
+ }
+
+ return mono_msec_ticks () >= threadpool->heuristic_last_dequeue + threshold;
+}
+
+static void hill_climbing_force_change (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition);
+
+static void
+monitor_thread (void)
+{
+ MonoInternalThread *current_thread = mono_thread_internal_current ();
+ guint i;
+
+ mono_cpu_usage (threadpool->cpu_usage_state);
+
+ do {
+ MonoInternalThread *thread;
+ gboolean all_waitsleepjoin = TRUE;
+ gint32 interval_left = MONITOR_INTERVAL;
+ gint32 awake = 0; /* number of spurious awakes we tolerate before doing a round of rebalancing */
+
+ g_assert (monitor_status != MONITOR_STATUS_NOT_RUNNING);
+
+ do {
+ guint32 ts;
+
+ if (mono_runtime_is_shutting_down ())
+ break;
+
+ ts = mono_msec_ticks ();
+ if (SleepEx (interval_left, TRUE) == 0)
+ break;
+ interval_left -= mono_msec_ticks () - ts;
+
+ if ((current_thread->state & (ThreadState_StopRequested | ThreadState_SuspendRequested)) != 0)
+ mono_thread_interruption_checkpoint ();
+ } while (interval_left > 0 && ++awake < 10);
+
+ if (threadpool->suspended)
+ continue;
+
+ if (mono_runtime_is_shutting_down () || !domain_any_has_request ())
+ continue;
+
+ mono_mutex_lock (&threadpool->working_threads_lock);
+ for (i = 0; i < threadpool->working_threads->len; ++i) {
+ thread = g_ptr_array_index (threadpool->working_threads, i);
+ if ((thread->state & ThreadState_WaitSleepJoin) == 0) {
+ all_waitsleepjoin = FALSE;
+ break;
+ }
+ }
+ mono_mutex_unlock (&threadpool->working_threads_lock);
+
+ if (all_waitsleepjoin) {
+ ThreadPoolCounter counter;
+ COUNTER_ATOMIC (counter, { counter._.max_working ++; });
+ hill_climbing_force_change (counter._.max_working, TRANSITION_STARVATION);
+ }
+
+ threadpool->cpu_usage = mono_cpu_usage (threadpool->cpu_usage_state);
+
+ if (monitor_sufficient_delay_since_last_dequeue ()) {
+ for (i = 0; i < 5; ++i) {
+ ThreadPoolDomain *tpdomain;
+ ThreadPoolCounter counter;
+ gboolean success;
+
+ if (mono_runtime_is_shutting_down ())
+ break;
+
+ if (worker_try_unpark ())
+ break;
+
+ COUNTER_TRY_ATOMIC (success, counter, {
+ if (counter._.active >= counter._.max_working)
+ break;
+ counter._.active ++;
+ });
+
+ if (!success)
+ continue;
+
+ tpdomain = domain_get_next (NULL);
+ if (tpdomain && worker_try_create (tpdomain))
+ break;
+
+ COUNTER_ATOMIC (counter, { counter._.active --; });
+ }
+ }
+ } while (monitor_should_keep_running ());
+}
+
+static void
+monitor_ensure_running (void)
+{
+ for (;;) {
+ switch (monitor_status) {
+ case MONITOR_STATUS_REQUESTED:
+ return;
+ case MONITOR_STATUS_WAITING_FOR_REQUEST:
+ InterlockedCompareExchange (&monitor_status, MONITOR_STATUS_REQUESTED, MONITOR_STATUS_WAITING_FOR_REQUEST);
+ break;
+ case MONITOR_STATUS_NOT_RUNNING:
+ if (InterlockedCompareExchange (&monitor_status, MONITOR_STATUS_REQUESTED, MONITOR_STATUS_NOT_RUNNING) == MONITOR_STATUS_NOT_RUNNING) {
+ if (!mono_thread_create_internal (mono_get_root_domain (), monitor_thread, NULL, TRUE, SMALL_STACK))
+ monitor_status = MONITOR_STATUS_NOT_RUNNING;
+ return;
+ }
+ break;
+ default: g_assert_not_reached ();
+ }
+ }
+}
+
+static void
+hill_climbing_change_thread_count (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition)
+{
+ ThreadPoolHillClimbing *hc;
+
+ g_assert (threadpool);
+
+ hc = &threadpool->heuristic_hill_climbing;
+
+ hc->last_thread_count = new_thread_count;
+ hc->current_sample_interval = rand_next (&hc->random_interval_generator, hc->sample_interval_low, hc->sample_interval_high);
+ hc->elapsed_since_last_change = 0;
+ hc->completions_since_last_change = 0;
+}
+
+static void
+hill_climbing_force_change (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition)
+{
+ ThreadPoolHillClimbing *hc;
+
+ g_assert (threadpool);
+
+ hc = &threadpool->heuristic_hill_climbing;
+
+ if (new_thread_count != hc->last_thread_count) {
+ hc->current_control_setting += new_thread_count - hc->last_thread_count;
+ hill_climbing_change_thread_count (new_thread_count, transition);
+ }
+}
+
+static double complex
+hill_climbing_get_wave_component (gdouble *samples, guint sample_count, gdouble period)
+{
+ ThreadPoolHillClimbing *hc;
+ gdouble w, cosine, sine, coeff, q0, q1, q2;
+ guint i;
+
+ g_assert (threadpool);
+ g_assert (sample_count >= period);
+ g_assert (period >= 2);
+
+ hc = &threadpool->heuristic_hill_climbing;
+
+ w = 2.0 * M_PI / period;
+ cosine = cos (w);
+ sine = sin (w);
+ coeff = 2.0 * cosine;
+ q0 = q1 = q2 = 0;
+
+ for (i = 0; i < sample_count; ++i) {
+ q0 = coeff * q1 - q2 + samples [(hc->total_samples - sample_count + i) % hc->samples_to_measure];
+ q2 = q1;
+ q1 = q0;
+ }
+
+ return ((q1 - q2 * cosine) + (q2 * sine) * I) / ((gdouble) sample_count);
+}
+
+static gint16
+hill_climbing_update (gint16 current_thread_count, guint32 sample_duration, gint32 completions, guint32 *adjustment_interval)
+{
+ ThreadPoolHillClimbing *hc;
+ ThreadPoolHeuristicStateTransition transition;
+ gdouble throughput;
+ gdouble throughput_error_estimate;
+ gdouble confidence;
+ gdouble move;
+ gdouble gain;
+ gint sample_index;
+ gint sample_count;
+ gint new_thread_wave_magnitude;
+ gint new_thread_count;
+ double complex thread_wave_component;
+ double complex throughput_wave_component;
+ double complex ratio;
+
+ g_assert (threadpool);
+ g_assert (adjustment_interval);
+
+ hc = &threadpool->heuristic_hill_climbing;
+
+ /* If someone changed the thread count without telling us, update our records accordingly. */
+ if (current_thread_count != hc->last_thread_count)
+ hill_climbing_force_change (current_thread_count, TRANSITION_INITIALIZING);
+
+ /* Update the cumulative stats for this thread count */
+ hc->elapsed_since_last_change += sample_duration;
+ hc->completions_since_last_change += completions;
+
+ /* Add in any data we've already collected about this sample */
+ sample_duration += hc->accumulated_sample_duration;
+ completions += hc->accumulated_completion_count;
+
+ /* We need to make sure we're collecting reasonably accurate data. Since we're just counting the end
+ * of each work item, we are goinng to be missing some data about what really happened during the
+ * sample interval. The count produced by each thread includes an initial work item that may have
+ * started well before the start of the interval, and each thread may have been running some new
+ * work item for some time before the end of the interval, which did not yet get counted. So
+ * our count is going to be off by +/- threadCount workitems.
+ *
+ * The exception is that the thread that reported to us last time definitely wasn't running any work
+ * at that time, and the thread that's reporting now definitely isn't running a work item now. So
+ * we really only need to consider threadCount-1 threads.
+ *
+ * Thus the percent error in our count is +/- (threadCount-1)/numCompletions.
+ *
+ * We cannot rely on the frequency-domain analysis we'll be doing later to filter out this error, because
+ * of the way it accumulates over time. If this sample is off by, say, 33% in the negative direction,
+ * then the next one likely will be too. The one after that will include the sum of the completions
+ * we missed in the previous samples, and so will be 33% positive. So every three samples we'll have
+ * two "low" samples and one "high" sample. This will appear as periodic variation right in the frequency
+ * range we're targeting, which will not be filtered by the frequency-domain translation. */
+ if (hc->total_samples > 0 && ((current_thread_count - 1.0) / completions) >= hc->max_sample_error) {
+ /* Not accurate enough yet. Let's accumulate the data so
+ * far, and tell the ThreadPool to collect a little more. */
+ hc->accumulated_sample_duration = sample_duration;
+ hc->accumulated_completion_count = completions;
+ *adjustment_interval = 10;
+ return current_thread_count;
+ }
+
+ /* We've got enouugh data for our sample; reset our accumulators for next time. */
+ hc->accumulated_sample_duration = 0;
+ hc->accumulated_completion_count = 0;
+
+ /* Add the current thread count and throughput sample to our history. */
+ throughput = ((gdouble) completions) / sample_duration;
+
+ sample_index = hc->total_samples % hc->samples_to_measure;
+ hc->samples [sample_index] = throughput;
+ hc->thread_counts [sample_index] = current_thread_count;
+ hc->total_samples ++;
+
+ /* Set up defaults for our metrics. */
+ thread_wave_component = 0;
+ throughput_wave_component = 0;
+ throughput_error_estimate = 0;
+ ratio = 0;
+ confidence = 0;
+
+ transition = TRANSITION_WARMUP;
+
+ /* How many samples will we use? It must be at least the three wave periods we're looking for, and it must also
+ * be a whole multiple of the primary wave's period; otherwise the frequency we're looking for will fall between
+ * two frequency bands in the Fourier analysis, and we won't be able to measure it accurately. */
+ sample_count = ((gint) MIN (hc->total_samples - 1, hc->samples_to_measure) / hc->wave_period) * hc->wave_period;
+
+ if (sample_count > hc->wave_period) {
+ guint i;
+ gdouble average_throughput;
+ gdouble average_thread_count;
+ gdouble sample_sum = 0;
+ gdouble thread_sum = 0;
+
+ /* Average the throughput and thread count samples, so we can scale the wave magnitudes later. */
+ for (i = 0; i < sample_count; ++i) {
+ guint j = (hc->total_samples - sample_count + i) % hc->samples_to_measure;
+ sample_sum += hc->samples [j];
+ thread_sum += hc->thread_counts [j];
+ }
+
+ average_throughput = sample_sum / sample_count;
+ average_thread_count = thread_sum / sample_count;
+
+ if (average_throughput > 0 && average_thread_count > 0) {
+ gdouble noise_for_confidence, adjacent_period_1, adjacent_period_2;
+
+ /* Calculate the periods of the adjacent frequency bands we'll be using to
+ * measure noise levels. We want the two adjacent Fourier frequency bands. */
+ adjacent_period_1 = sample_count / (((gdouble) sample_count) / ((gdouble) hc->wave_period) + 1);
+ adjacent_period_2 = sample_count / (((gdouble) sample_count) / ((gdouble) hc->wave_period) - 1);
+
+ /* Get the the three different frequency components of the throughput (scaled by average
+ * throughput). Our "error" estimate (the amount of noise that might be present in the
+ * frequency band we're really interested in) is the average of the adjacent bands. */
+ throughput_wave_component = hill_climbing_get_wave_component (hc->samples, sample_count, hc->wave_period) / average_throughput;
+ throughput_error_estimate = cabs (hill_climbing_get_wave_component (hc->samples, sample_count, adjacent_period_1) / average_throughput);
+
+ if (adjacent_period_2 <= sample_count) {
+ throughput_error_estimate = MAX (throughput_error_estimate, cabs (hill_climbing_get_wave_component (
+ hc->samples, sample_count, adjacent_period_2) / average_throughput));
+ }
+
+ /* Do the same for the thread counts, so we have something to compare to. We don't
+ * measure thread count noise, because there is none; these are exact measurements. */
+ thread_wave_component = hill_climbing_get_wave_component (hc->thread_counts, sample_count, hc->wave_period) / average_thread_count;
+
+ /* Update our moving average of the throughput noise. We'll use this
+ * later as feedback to determine the new size of the thread wave. */
+ if (hc->average_throughput_noise == 0) {
+ hc->average_throughput_noise = throughput_error_estimate;
+ } else {
+ hc->average_throughput_noise = (hc->throughput_error_smoothing_factor * throughput_error_estimate)
+ + ((1.0 + hc->throughput_error_smoothing_factor) * hc->average_throughput_noise);
+ }
+
+ if (cabs (thread_wave_component) > 0) {
+ /* Adjust the throughput wave so it's centered around the target wave,
+ * and then calculate the adjusted throughput/thread ratio. */
+ ratio = (throughput_wave_component - (hc->target_throughput_ratio * thread_wave_component)) / thread_wave_component;
+ transition = TRANSITION_CLIMBING_MOVE;
+ } else {
+ ratio = 0;
+ transition = TRANSITION_STABILIZING;
+ }
+
+ noise_for_confidence = MAX (hc->average_throughput_noise, throughput_error_estimate);
+ if (noise_for_confidence > 0) {
+ confidence = cabs (thread_wave_component) / noise_for_confidence / hc->target_signal_to_noise_ratio;
+ } else {
+ /* there is no noise! */
+ confidence = 1.0;
+ }
+ }
+ }
+
+ /* We use just the real part of the complex ratio we just calculated. If the throughput signal
+ * is exactly in phase with the thread signal, this will be the same as taking the magnitude of
+ * the complex move and moving that far up. If they're 180 degrees out of phase, we'll move
+ * backward (because this indicates that our changes are having the opposite of the intended effect).
+ * If they're 90 degrees out of phase, we won't move at all, because we can't tell wether we're
+ * having a negative or positive effect on throughput. */
+ move = creal (ratio);
+ move = CLAMP (move, -1.0, 1.0);
+
+ /* Apply our confidence multiplier. */
+ move *= CLAMP (confidence, -1.0, 1.0);
+
+ /* Now apply non-linear gain, such that values around zero are attenuated, while higher values
+ * are enhanced. This allows us to move quickly if we're far away from the target, but more slowly
+ * if we're getting close, giving us rapid ramp-up without wild oscillations around the target. */
+ gain = hc->max_change_per_second * sample_duration;
+ move = pow (fabs (move), hc->gain_exponent) * (move >= 0.0 ? 1 : -1) * gain;
+ move = MIN (move, hc->max_change_per_sample);
+
+ /* If the result was positive, and CPU is > 95%, refuse the move. */
+ if (move > 0.0 && threadpool->cpu_usage > CPU_USAGE_HIGH)
+ move = 0.0;
+
+ /* Apply the move to our control setting. */
+ hc->current_control_setting += move;
+
+ /* Calculate the new thread wave magnitude, which is based on the moving average we've been keeping of the
+ * throughput error. This average starts at zero, so we'll start with a nice safe little wave at first. */
+ new_thread_wave_magnitude = (gint)(0.5 + (hc->current_control_setting * hc->average_throughput_noise
+ * hc->target_signal_to_noise_ratio * hc->thread_magnitude_multiplier * 2.0));
+ new_thread_wave_magnitude = CLAMP (new_thread_wave_magnitude, 1, hc->max_thread_wave_magnitude);
+
+ /* Make sure our control setting is within the ThreadPool's limits. */
+ hc->current_control_setting = CLAMP (hc->current_control_setting, threadpool->limit_worker_min, threadpool->limit_worker_max - new_thread_wave_magnitude);
+
+ /* Calculate the new thread count (control setting + square wave). */
+ new_thread_count = (gint)(hc->current_control_setting + new_thread_wave_magnitude * ((hc->total_samples / (hc->wave_period / 2)) % 2));
+
+ /* Make sure the new thread count doesn't exceed the ThreadPool's limits. */
+ new_thread_count = CLAMP (new_thread_count, threadpool->limit_worker_min, threadpool->limit_worker_max);
+
+ if (new_thread_count != current_thread_count)
+ hill_climbing_change_thread_count (new_thread_count, transition);
+
+ if (creal (ratio) < 0.0 && new_thread_count == threadpool->limit_worker_min)
+ *adjustment_interval = (gint)(0.5 + hc->current_sample_interval * (10.0 * MAX (-1.0 * creal (ratio), 1.0)));
+ else
+ *adjustment_interval = hc->current_sample_interval;
+
+ return new_thread_count;
+}
+
+static void
+heuristic_notify_work_completed (void)
+{
+ g_assert (threadpool);
+
+ InterlockedIncrement (&threadpool->heuristic_completions);
+ threadpool->heuristic_last_dequeue = mono_msec_ticks ();
+}
+
+static gboolean
+heuristic_should_adjust ()
+{
+ g_assert (threadpool);
+
+ if (threadpool->heuristic_last_dequeue > threadpool->heuristic_last_adjustment + threadpool->heuristic_adjustment_interval) {
+ ThreadPoolCounter counter = COUNTER_READ ();
+ if (counter._.active <= counter._.max_working)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void
+heuristic_adjust ()
+{
+ g_assert (threadpool);
+
+ if (mono_mutex_trylock (&threadpool->heuristic_lock) == 0) {
+ gint32 completions = InterlockedExchange (&threadpool->heuristic_completions, 0);
+ guint32 sample_end = mono_msec_ticks ();
+ guint32 sample_duration = sample_end - threadpool->heuristic_sample_start;
+
+ if (sample_duration >= threadpool->heuristic_adjustment_interval / 2) {
+ ThreadPoolCounter counter;
+ gint16 new_thread_count;
+
+ counter = COUNTER_READ ();
+ new_thread_count = hill_climbing_update (counter._.max_working, sample_duration, completions, &threadpool->heuristic_adjustment_interval);
+
+ COUNTER_ATOMIC (counter, { counter._.max_working = new_thread_count; });
+
+ if (new_thread_count > counter._.max_working)
+ worker_request (mono_domain_get ());
+
+ threadpool->heuristic_sample_start = sample_end;
+ threadpool->heuristic_last_adjustment = mono_msec_ticks ();
+ }
+
+ mono_mutex_unlock (&threadpool->heuristic_lock);
+ }
+}
+
+void
+mono_threadpool_ms_cleanup (void)
+{
+#ifndef DISABLE_SOCKETS
+ mono_threadpool_ms_io_cleanup ();
+#endif
+ ensure_cleanedup ();
+}
+
+MonoAsyncResult *
+mono_threadpool_ms_add (MonoObject *target, MonoMethodMessage *msg, MonoDelegate *async_callback, MonoObject *state)
+{
+ static MonoClass *async_call_klass = NULL;
+ MonoDomain *domain;
+ MonoAsyncResult *ares;
+ MonoAsyncCall *ac;
+
+ if (!async_call_klass)
+ async_call_klass = mono_class_from_name (mono_defaults.corlib, "System", "MonoAsyncCall");
+ g_assert (async_call_klass);
+
+ ensure_initialized (NULL);
+
+ domain = mono_domain_get ();
+
+ ac = (MonoAsyncCall*) mono_object_new (domain, async_call_klass);
+ MONO_OBJECT_SETREF (ac, msg, msg);
+ MONO_OBJECT_SETREF (ac, state, state);
+
+ if (async_callback) {
+ MONO_OBJECT_SETREF (ac, cb_method, mono_get_delegate_invoke (((MonoObject*) async_callback)->vtable->klass));
+ MONO_OBJECT_SETREF (ac, cb_target, async_callback);
+ }
+
+ ares = mono_async_result_new (domain, NULL, ac->state, NULL, (MonoObject*) ac);
+ MONO_OBJECT_SETREF (ares, async_delegate, target);
+
+#ifndef DISABLE_SOCKETS
+ if (mono_threadpool_ms_is_io (target, state))
+ return mono_threadpool_ms_io_add (ares, (MonoSocketAsyncResult*) state);
+#endif
+
+ mono_threadpool_ms_enqueue_async_result (domain, ares);
+ return ares;
+}
+
+MonoObject *
+mono_threadpool_ms_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc)
+{
+ MonoAsyncCall *ac;
+
+ g_assert (exc);
+ g_assert (out_args);
+
+ *exc = NULL;
+ *out_args = NULL;
+
+ /* check if already finished */
+ mono_monitor_enter ((MonoObject*) ares);
+
+ if (ares->endinvoke_called) {
+ *exc = (MonoObject*) mono_get_exception_invalid_operation (NULL);
+ mono_monitor_exit ((MonoObject*) ares);
+ return NULL;
+ }
+
+ MONO_OBJECT_SETREF (ares, endinvoke_called, 1);
+
+ /* wait until we are really finished */
+ if (ares->completed) {
+ mono_monitor_exit ((MonoObject *) ares);
+ } else {
+ gpointer wait_event;
+ if (ares->handle) {
+ wait_event = mono_wait_handle_get_handle ((MonoWaitHandle*) ares->handle);
+ } else {
+ wait_event = CreateEvent (NULL, TRUE, FALSE, NULL);
+ g_assert(wait_event);
+ MONO_OBJECT_SETREF (ares, handle, (MonoObject*) mono_wait_handle_new (mono_object_domain (ares), wait_event));
+ }
+ mono_monitor_exit ((MonoObject*) ares);
+ WaitForSingleObjectEx (wait_event, INFINITE, TRUE);
+ }
+
+ ac = (MonoAsyncCall*) ares->object_data;
+ g_assert (ac);
+
+ *exc = ac->msg->exc; /* FIXME: GC add write barrier */
+ *out_args = ac->out_args;
+ return ac->res;
+}
+
+gboolean
+mono_threadpool_ms_remove_domain_jobs (MonoDomain *domain, int timeout)
+{
+ gboolean res = TRUE;
+ guint32 start;
+ gpointer sem;
+
+ g_assert (domain);
+ g_assert (timeout >= -1);
+
+ if (timeout != -1)
+ start = mono_msec_ticks ();
+
+#ifndef DISABLE_SOCKETS
+ mono_threadpool_ms_io_remove_domain_jobs (domain);
+ if (timeout != -1) {
+ timeout -= mono_msec_ticks () - start;
+ if (timeout < 0)
+ return FALSE;
+ }
+#endif
+ /*
+ * There might be some threads out that could be about to execute stuff from the given domain.
+ * We avoid that by setting up a semaphore to be pulsed by the thread that reaches zero.
+ */
+ sem = domain->cleanup_semaphore = CreateSemaphore (NULL, 0, 1, NULL);
+
+ /*
+ * The memory barrier here is required to have global ordering between assigning to cleanup_semaphone
+ * and reading threadpool_jobs. Otherwise this thread could read a stale version of threadpool_jobs
+ * and wait forever.
+ */
+ mono_memory_write_barrier ();
+
+ while (domain->threadpool_jobs) {
+ WaitForSingleObject (sem, timeout);
+ if (timeout != -1) {
+ timeout -= mono_msec_ticks () - start;
+ if (timeout <= 0) {
+ res = FALSE;
+ break;
+ }
+ }
+ }
+
+ domain->cleanup_semaphore = NULL;
+ CloseHandle (sem);
+
+ return res;
+}
+
+void
+mono_threadpool_ms_suspend (void)
+{
+ threadpool->suspended = TRUE;
+}
+
+void
+mono_threadpool_ms_resume (void)
+{
+ threadpool->suspended = FALSE;
+}
+
+void
+ves_icall_System_Threading_MonoRuntimeWorkItem_ExecuteWorkItem (MonoRuntimeWorkItem *rwi)
+{
+ MonoAsyncResult *ares;
+ MonoObject *exc = NULL;
+
+ g_assert (rwi);
+ ares = rwi->async_result;
+ g_assert (ares);
+
+ mono_async_result_invoke (ares, &exc);
+ if (exc)
+ mono_raise_exception ((MonoException*) exc);
+}
+
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_GetAvailableThreadsNative (gint *worker_threads, gint *completion_port_threads)
+{
+ if (!worker_threads || !completion_port_threads)
+ return;
+
+ ensure_initialized (NULL);
+
+ *worker_threads = threadpool->limit_worker_max;
+ *completion_port_threads = threadpool->limit_io_max;
+}
+
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_GetMinThreadsNative (gint *worker_threads, gint *completion_port_threads)
+{
+ if (!worker_threads || !completion_port_threads)
+ return;
+
+ ensure_initialized (NULL);
+
+ *worker_threads = threadpool->limit_worker_min;
+ *completion_port_threads = threadpool->limit_io_min;
+}
+
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_GetMaxThreadsNative (gint *worker_threads, gint *completion_port_threads)
+{
+ if (!worker_threads || !completion_port_threads)
+ return;
+
+ ensure_initialized (NULL);
+
+ *worker_threads = threadpool->limit_worker_max;
+ *completion_port_threads = threadpool->limit_io_max;
+}
+
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_SetMinThreadsNative (gint worker_threads, gint completion_port_threads)
+{
+ ensure_initialized (NULL);
+
+ if (worker_threads <= 0 || worker_threads > threadpool->limit_worker_max)
+ return FALSE;
+ if (completion_port_threads <= 0 || completion_port_threads > threadpool->limit_io_max)
+ return FALSE;
+
+ threadpool->limit_worker_max = worker_threads;
+ threadpool->limit_io_max = completion_port_threads;
+
+ return TRUE;
+}
+
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative (gint worker_threads, gint completion_port_threads)
+{
+ gint cpu_count = mono_cpu_count ();
+
+ ensure_initialized (NULL);
+
+ if (worker_threads < threadpool->limit_worker_min || worker_threads < cpu_count)
+ return FALSE;
+ if (completion_port_threads < threadpool->limit_io_min || completion_port_threads < cpu_count)
+ return FALSE;
+
+ threadpool->limit_worker_max = worker_threads;
+ threadpool->limit_io_max = completion_port_threads;
+
+ return TRUE;
+}
+
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (gboolean *enable_worker_tracking)
+{
+ ensure_initialized (enable_worker_tracking);
+}
+
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete (void)
+{
+ ThreadPoolCounter counter;
+
+ if (mono_domain_is_unloading (mono_domain_get ()) || mono_runtime_is_shutting_down ())
+ return FALSE;
+
+ heuristic_notify_work_completed ();
+
+ if (heuristic_should_adjust ())
+ heuristic_adjust ();
+
+ counter = COUNTER_READ ();
+ return counter._.active <= counter._.max_working;
+}
+
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemProgressNative (void)
+{
+ heuristic_notify_work_completed ();
+
+ if (heuristic_should_adjust ())
+ heuristic_adjust ();
+}
+
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (gboolean is_working)
+{
+ // TODO
+ mono_raise_exception (mono_get_exception_not_implemented (NULL));
+}
+
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_RequestWorkerThread (void)
+{
+ return worker_request (mono_domain_get ());
+}
+
+gboolean G_GNUC_UNUSED
+ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped)
+{
+ /* This copy the behavior of the current Mono implementation */
+ mono_raise_exception (mono_get_exception_not_implemented (NULL));
+ return FALSE;
+}
+
+gboolean G_GNUC_UNUSED
+ves_icall_System_Threading_Microsoft_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle)
+{
+ /* This copy the behavior of the current Mono implementation */
+ return TRUE;
+}
+
+gboolean G_GNUC_UNUSED
+ves_icall_System_Threading_Microsoft_ThreadPool_IsThreadPoolHosted (void)
+{
+ return FALSE;
+}
--- /dev/null
+#ifndef _MONO_THREADPOOL_MICROSOFT_H_
+#define _MONO_THREADPOOL_MICROSOFT_H_
+
+#include <config.h>
+#include <glib.h>
+
+#include <mono/metadata/exception.h>
+
+#define SMALL_STACK (sizeof (gpointer) * 32 * 1024)
+
+enum {
+ STATUS_NOT_INITIALIZED,
+ STATUS_INITIALIZING,
+ STATUS_INITIALIZED,
+ STATUS_CLEANING_UP,
+ STATUS_CLEANED_UP,
+};
+
+typedef struct _MonoRuntimeWorkItem MonoRuntimeWorkItem;
+typedef struct _MonoNativeOverlapped MonoNativeOverlapped;
+
+static void G_GNUC_UNUSED
+mono_threadpool_ms_init (void)
+{
+ /* Initialization is done lazily */
+}
+
+static void G_GNUC_UNUSED
+mono_threadpool_ms_init_tls (void)
+{
+ /* The WSQ is now implemented in managed */
+}
+
+void
+mono_threadpool_ms_cleanup (void);
+
+MonoAsyncResult *
+mono_threadpool_ms_add (MonoObject *target, MonoMethodMessage *msg, MonoDelegate *async_callback, MonoObject *state);
+MonoObject *
+mono_threadpool_ms_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc);
+
+gboolean
+mono_threadpool_ms_remove_domain_jobs (MonoDomain *domain, int timeout);
+
+void
+mono_threadpool_ms_suspend (void);
+void
+mono_threadpool_ms_resume (void);
+
+static gboolean G_GNUC_UNUSED
+mono_threadpool_ms_is_queue_array (MonoArray *arr)
+{
+ /* The queue is in managed code */
+ return FALSE;
+}
+
+void
+ves_icall_System_Threading_MonoRuntimeWorkItem_ExecuteWorkItem (MonoRuntimeWorkItem *rwi);
+
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_GetAvailableThreadsNative (gint *worker_threads, gint *completion_port_threads);
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_GetMinThreadsNative (gint *worker_threads, gint *completion_port_threads);
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_GetMaxThreadsNative (gint *worker_threads, gint *completion_port_threads);
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_SetMinThreadsNative (gint worker_threads, gint completion_port_threads);
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative (gint worker_threads, gint completion_port_threads);
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (gboolean *enable_worker_tracking);
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete (void);
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemProgressNative (void);
+void
+ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (gboolean is_working);
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_RequestWorkerThread (void);
+
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped);
+
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle);
+
+gboolean
+ves_icall_System_Threading_Microsoft_ThreadPool_IsThreadPoolHosted (void);
+
+/* Internals */
+
+void
+mono_threadpool_ms_enqueue_async_result (MonoDomain *domain, MonoAsyncResult *async_result);
+void
+mono_threadpool_ms_enqueue_work_item (MonoDomain *domain, MonoObject *work_item);
+
+#endif // _MONO_THREADPOOL_MICROSOFT_H_
#include <mono/metadata/mono-cq.h>
#include <mono/metadata/mono-wsq.h>
#include <mono/metadata/mono-ptr-array.h>
+#include <mono/metadata/object-internals.h>
#include <mono/io-layer/io-layer.h>
#include <mono/utils/mono-time.h>
#include <mono/utils/mono-proclib.h>
#endif
#include "threadpool.h"
-#include "threadpool-microsoft.h"
+#include "threadpool-ms.h"
+#include "threadpool-ms-io.h"
static gboolean
use_ms_threadpool (void)
#define THREAD_WANTS_A_BREAK(t) ((t->state & (ThreadState_StopRequested | \
ThreadState_SuspendRequested)) != 0)
-#define SMALL_STACK (128 * (sizeof (gpointer) / 4) * 1024)
-
/* DEBUG: prints tp data every 2s */
#undef DEBUG
static SocketIOData socket_io_data;
-/* Keep in sync with the System.MonoAsyncCall class which provides GC tracking */
-typedef struct {
- MonoObject object;
- MonoMethodMessage *msg;
- MonoMethod *cb_method;
- MonoDelegate *cb_target;
- MonoObject *state;
- MonoObject *res;
- MonoArray *out_args;
-} ASyncCall;
-
typedef struct {
MonoSemType lock;
MonoCQ *queue; /* GC root */
};
// #include <mono/metadata/tpool-poll.c>
+gpointer tp_poll_init (SocketIOData *data);
+
#ifdef HAVE_EPOLL
#include <mono/metadata/tpool-epoll.c>
#elif defined(USE_KQUEUE_FOR_THREADPOOL)
return klass->image == mono_defaults.corlib;
}
-/*
- * Note that we call it is_socket_type() where 'socket' refers to the image
- * that contains the System.Net.Sockets.Socket type.
-*/
-static gboolean
-is_socket_type (MonoDomain *domain, MonoClass *klass)
-{
- return is_system_type (domain, klass);
-}
-
#define check_type_cached(domain, ASSEMBLY, _class, _namespace, _name, loc) do { \
if (*loc) \
return *loc == _class; \
#define check_corlib_type_cached(domain, _class, _namespace, _name, loc) check_type_cached (domain, corlib, _class, _namespace, _name, loc)
-#define check_socket_type_cached(domain, _class, _namespace, _name, loc) check_type_cached (domain, socket, _class, _namespace, _name, loc)
-
#define check_system_type_cached(domain, _class, _namespace, _name, loc) check_type_cached (domain, system, _class, _namespace, _name, loc)
static gboolean
check_corlib_type_cached (domain, klass, "System.Runtime.Remoting.Messaging", "AsyncResult", &domain->corlib_asyncresult_class);
}
-static gboolean
-is_socket (MonoDomain *domain, MonoClass *klass)
-{
- check_socket_type_cached (domain, klass, "System.Net.Sockets", "Socket", &domain->socket_class);
-}
-
static gboolean
is_socketasyncresult (MonoDomain *domain, MonoClass *klass)
{
- return (klass->nested_in &&
- is_socket (domain, klass->nested_in) &&
- !strcmp (klass->name, "SocketAsyncResult"));
+ static MonoClass *socket_async_result_klass = NULL;
+ check_system_type_cached (domain, klass, "System.Net.Sockets", "SocketAsyncResult", &socket_async_result_klass);
}
static gboolean
is_socketasynccall (MonoDomain *domain, MonoClass *klass)
{
- return (klass->nested_in &&
- is_socket (domain, klass->nested_in) &&
- !strcmp (klass->name, "SocketAsyncCall"));
+ static MonoClass *socket_async_callback_klass = NULL;
+ check_system_type_cached (domain, klass, "System.Net.Sockets", "SocketAsyncCallback", &socket_async_callback_klass);
}
static gboolean
MonoObject *ares;
if (use_ms_threadpool ()) {
- mono_thread_pool_ms_remove_socket (sock);
+#ifndef DISABLE_SOCKETS
+ mono_threadpool_ms_io_remove_socket (sock);
+#endif
return;
}
static MonoObject *
mono_async_invoke (ThreadPool *tp, MonoAsyncResult *ares)
{
- ASyncCall *ac = (ASyncCall *)ares->object_data;
- MonoObject *res, *exc = NULL;
- MonoArray *out_args = NULL;
- HANDLE wait_event = NULL;
- MonoInternalThread *thread = mono_thread_internal_current ();
+ MonoObject *exc = NULL;
- if (ares->execution_context) {
- /* use captured ExecutionContext (if available) */
- MONO_OBJECT_SETREF (ares, original_context, mono_thread_get_execution_context ());
- mono_thread_set_execution_context (ares->execution_context);
- } else {
- ares->original_context = NULL;
- }
-
- if (ac == NULL) {
- /* Fast path from ThreadPool.*QueueUserWorkItem */
- void *pa = ares->async_state;
- /* The debugger needs this */
- thread->async_invoke_method = ((MonoDelegate*)ares->async_delegate)->method;
- res = mono_runtime_delegate_invoke (ares->async_delegate, &pa, &exc);
- thread->async_invoke_method = NULL;
- } else {
- MonoObject *cb_exc = NULL;
-
- ac->msg->exc = NULL;
- res = mono_message_invoke (ares->async_delegate, ac->msg, &exc, &out_args);
- MONO_OBJECT_SETREF (ac, res, res);
- MONO_OBJECT_SETREF (ac, msg->exc, exc);
- MONO_OBJECT_SETREF (ac, out_args, out_args);
-
- mono_monitor_enter ((MonoObject *) ares);
- ares->completed = 1;
- if (ares->handle != NULL)
- wait_event = mono_wait_handle_get_handle ((MonoWaitHandle *) ares->handle);
- mono_monitor_exit ((MonoObject *) ares);
- /* notify listeners */
- if (wait_event != NULL)
- SetEvent (wait_event);
-
- /* call async callback if cb_method != null*/
- if (ac != NULL && ac->cb_method) {
- void *pa = &ares;
- cb_exc = NULL;
- thread->async_invoke_method = ac->cb_method;
- mono_runtime_invoke (ac->cb_method, ac->cb_target, pa, &cb_exc);
- thread->async_invoke_method = NULL;
- exc = cb_exc;
- } else {
- exc = NULL;
- }
- }
-
- /* restore original thread execution context if flow isn't suppressed, i.e. non null */
- if (ares->original_context) {
- mono_thread_set_execution_context (ares->original_context);
- ares->original_context = NULL;
- }
+ mono_async_result_invoke (ares, &exc);
#if DEBUG
InterlockedDecrement (&tp->njobs);
mono_thread_pool_init_tls (void)
{
if (use_ms_threadpool ()) {
- mono_thread_pool_ms_init_tls ();
+ mono_threadpool_ms_init_tls ();
return;
}
int result;
if (use_ms_threadpool ()) {
- mono_thread_pool_ms_init ();
+ mono_threadpool_ms_init ();
return;
}
MonoAsyncResult *ares;
ares = create_simple_asyncresult (target, (MonoObject *) state);
+
+ if (use_ms_threadpool ()) {
+#ifndef DISABLE_SOCKETS
+ mono_threadpool_ms_io_add (ares, state);
+#endif
+ return;
+ }
+
socket_io_add (ares, state);
}
{
MonoDomain *domain;
MonoAsyncResult *ares;
- ASyncCall *ac;
+ MonoAsyncCall *ac;
- if (use_ms_threadpool ()) {
- return mono_thread_pool_ms_add (target, msg, async_callback, state);
- }
+ if (use_ms_threadpool ())
+ return mono_threadpool_ms_add (target, msg, async_callback, state);
domain = mono_domain_get ();
- ac = (ASyncCall*)mono_object_new (domain, async_call_klass);
+ ac = (MonoAsyncCall*)mono_object_new (domain, async_call_klass);
MONO_OBJECT_SETREF (ac, msg, msg);
MONO_OBJECT_SETREF (ac, state, state);
MonoObject *
mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc)
{
- ASyncCall *ac;
+ MonoAsyncCall *ac;
HANDLE wait_event;
if (use_ms_threadpool ()) {
- return mono_thread_pool_ms_finish (ares, out_args, exc);
+ return mono_threadpool_ms_finish (ares, out_args, exc);
}
*exc = NULL;
mono_monitor_exit ((MonoObject *) ares);
}
- ac = (ASyncCall *) ares->object_data;
+ ac = (MonoAsyncCall *) ares->object_data;
g_assert (ac != NULL);
*exc = ac->msg->exc; /* FIXME: GC add write barrier */
*out_args = ac->out_args;
mono_thread_pool_cleanup (void)
{
if (use_ms_threadpool ()) {
- mono_thread_pool_ms_cleanup ();
+ mono_threadpool_ms_cleanup ();
return;
}
guint32 start_time;
if (use_ms_threadpool ()) {
- return mono_thread_pool_ms_remove_domain_jobs (domain, timeout);
+ return mono_threadpool_ms_remove_domain_jobs (domain, timeout);
}
result = TRUE;
mono_thread_pool_is_queue_array (MonoArray *o)
{
if (use_ms_threadpool ()) {
- return mono_thread_pool_ms_is_queue_array (o);
+ return mono_threadpool_ms_is_queue_array (o);
}
// gpointer obj = o;
mono_thread_pool_suspend (void)
{
if (use_ms_threadpool ()) {
- mono_thread_pool_ms_suspend ();
+ mono_threadpool_ms_suspend ();
return;
}
suspended = TRUE;
mono_thread_pool_resume (void)
{
if (use_ms_threadpool ()) {
- mono_thread_pool_ms_resume ();
+ mono_threadpool_ms_resume ();
return;
}
suspended = FALSE;
}
/* This needs to be called even if handle_remove () fails */
if (mono_thread_cleanup_fn)
- mono_thread_cleanup_fn (thread->tid);
+ mono_thread_cleanup_fn ((MonoNativeThreadId)thread->tid);
return;
}
mono_release_type_locks (thread);
thread->appdomain_refs = NULL;
if (mono_thread_cleanup_fn)
- mono_thread_cleanup_fn (thread->tid);
+ mono_thread_cleanup_fn ((MonoNativeThreadId)thread->tid);
if (mono_gc_is_moving ()) {
MONO_GC_UNREGISTER_ROOT (thread->thread_pinning_ref);
* starts
*/
create_flags = CREATE_SUSPENDED;
+
+ MONO_PREPARE_BLOCKING
thread_handle = mono_threads_create_thread ((LPTHREAD_START_ROUTINE)start_wrapper, start_info,
stack_size, create_flags, &tid);
+ MONO_FINISH_BLOCKING
+
if (thread_handle == NULL) {
/* The thread couldn't be created, so throw an exception */
mono_threads_lock ();
if (!handle_store (thread, FALSE))
return FALSE;
+ MONO_PREPARE_BLOCKING
mono_thread_info_resume (tid);
+ MONO_FINISH_BLOCKING
if (internal->start_notify) {
/*
*/
THREAD_DEBUG (g_message ("%s: (%"G_GSIZE_FORMAT") waiting for thread %p (%"G_GSIZE_FORMAT") to start", __func__, GetCurrentThreadId (), internal, (gsize)internal->tid));
+ MONO_PREPARE_BLOCKING
WaitForSingleObjectEx (internal->start_notify, INFINITE, FALSE);
+ MONO_FINISH_BLOCKING
+
CloseHandle (internal->start_notify);
internal->start_notify = NULL;
}
while (TRUE) {
mono_thread_set_state (thread, ThreadState_WaitSleepJoin);
+ MONO_PREPARE_BLOCKING
res = SleepEx(ms,TRUE);
+ MONO_FINISH_BLOCKING
mono_thread_clr_state (thread, ThreadState_WaitSleepJoin);
mono_thread_set_state (cur_thread, ThreadState_WaitSleepJoin);
+ MONO_PREPARE_BLOCKING
ret=WaitForSingleObjectEx (thread, ms, TRUE);
+ MONO_FINISH_BLOCKING
mono_thread_clr_state (cur_thread, ThreadState_WaitSleepJoin);
start = (ms == -1) ? 0 : mono_100ns_ticks ();
do {
- if (multiple)
+ MONO_PREPARE_BLOCKING
+ if (multiple)
ret = WaitForMultipleObjectsEx (numhandles, handles, waitall, wait, alertable);
else
ret = WaitForSingleObjectEx (handles [0], ms, alertable);
+ MONO_FINISH_BLOCKING
if (ret != WAIT_IO_COMPLETION)
break;
mono_thread_set_state (thread, ThreadState_WaitSleepJoin);
+ MONO_PREPARE_BLOCKING
ret = SignalObjectAndWait (toSignal, toWait, ms, TRUE);
+ MONO_FINISH_BLOCKING
mono_thread_clr_state (thread, ThreadState_WaitSleepJoin);
static void tp_poll_modify (gpointer p, int fd, int operation, int events, gboolean is_new);
static void tp_poll_wait (gpointer p);
+gpointer tp_poll_init (SocketIOData *data);
+
gpointer
tp_poll_init (SocketIOData *data)
{
if NACL_CODEGEN
for i in $(regtests); do echo "running test $$i"; $(RUNTIME) $$i --exclude 'NaClDisable' || exit 1; done
else
- -($(RUNTIME) --regression $(regtests); echo $$? > regressionexitcode.out) | ./emitnunit.pl
+ -($(RUNTIME) --regression $(regtests); echo $$? > regressionexitcode.out) | $(srcdir)/emitnunit.pl
exit $$(cat regressionexitcode.out)
endif
check-seq-points: mono $(regtests)
rm -f TestResults_op_il_seq_point.xml
- for i in $(regtests); do ./test_op_il_seq_point.sh $$i || (./test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
- for i in $(regtests); do ./test_op_il_seq_point.sh $$i --aot || (./test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
- ./test_op_il_seq_point_headerfooter.sh
+ for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
+ for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i --aot || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
+ $(srcdir)/test_op_il_seq_point_headerfooter.sh
gctest: mono gc-test.exe
MONO_DEBUG_OPTIONS=clear-nursery-at-gc $(RUNTIME) --regression gc-test.exe
CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
EXTRA_DIST = TestDriver.cs \
genmdesc.pl \
+ emitnunit.pl \
$(test_sources) \
$(x86_sources) cpu-x86.md \
$(amd64_sources) cpu-amd64.md \
+++ /dev/null
-Mini is the new JIT compiler for Mono.
+++ /dev/null
-* use a pool of MBState structures to speedup monoburg instead of using a
- mempool.
-* the decode tables in the burg-generated could use short instead of int
- (this should save about 1 KB)
-* track the use of ESP, so that we can avoid the x86_lea in the epilog
-
-
-Other Ideas:
-
-* the ORP people avoids optimizations inside catch handlers - just to save
- memory (for example allocation of strings - instead they allocate strings when
- the code is executed (like the --shared option)). But there are only a few
- functions using catch handlers, so I consider this a minor issue.
-
-* some performance critical functions should be inlined. These include:
- - mono_mempool_alloc and mono_mempool_alloc0
- - EnterCriticalSection and LeaveCriticalSection
- - TlsSetValue
- - mono_metadata_row_col
- - mono_g_hash_table_lookup
- - mono_domain_get
-
-* if a function which involves locking is called from another function which
- acquires the same lock, it might be useful to create a separate _inner
- version of the function which does not re-acquire the lock. This is a perf
- win only if the function is called a lot of times, like mono_get_method.
-
-* we can avoid calls to class init trampolines if the are multiple calls to the
- same trampoline in the same basic block. See:
-
- http://bugzilla.ximian.com/show_bug.cgi?id=51096
-
-Usability
----------
-
-* Remove the various optimization list of flags description, have an
- extra --help-optimizations flag.
-
-* Remove the various graph options, have a separate --help-graph for
- that list.
-
-Cleanup
--------
-
-Clean up the usage of the various CEE_/OP_ constants inside the JIT.
-
-Currently, there are the 5 variants for each opcode:
-- CEE_...
-- OP_...
-- OP_I...
-- OP_L...
-- OP_P...
-
-Some opcodes have some variants, while others don't.
-
-They are used as follows:
-- In method_to_ir, CEE_ means the IL opcode ie. without operand size information
-- In the rules inside the .brg files CEE_ means the same as OP_I..., since
- long opcodes were transformed into OP_L.... by method_to_ir.
-- In the IR emitted by the rules inside the .brg files, CEE_ means the same as
- OP_P..., since it is usually generated for pointer manipulation.
-- In mono_arch_emit_opcode, CEE_ means OP_P....
-
-As can be seen above, this is a mess. A proposed solution would be the
-following:
-
-- In method_to_ir, transform CEE_ opcodes into the appropriate OP_I/OP_L
- opcodes.
-- Get rid of the OP_P opcodes, and use the OP_... opcodes instead, since the
- two usually means the same.
-- In the IR emitted by the burg rules, use the OP_... opcodes instead of the
- CEE and OP_P opcodes.
-
-Using these rules would ensure that the same opcode means the same thing in
-all parts of the JIT.
-
-
typedef struct MonoAotStats {
int ccount, mcount, lmfcount, abscount, gcount, ocount, genericcount;
- int code_size, info_size, ex_info_size, unwind_info_size, got_size, class_info_size, got_info_size, plt_size;
+ gint64 code_size, info_size, ex_info_size, unwind_info_size, got_size, class_info_size, got_info_size, plt_size;
int methods_without_got_slots, direct_calls, all_calls, llvm_count;
int got_slots, offsets_size;
int got_slot_types [MONO_PATCH_INFO_NONE];
encode_klass_ref (acfg, container->owner.klass, p, &p);
} else {
encode_value (par->gshared_constraint, p, &p);
+ if (par->gshared_constraint) {
+ const char *name = mono_generic_param_name (par);
+
+ if (name) {
+ int len = strlen (name);
+
+ encode_value (len, p, &p);
+ memcpy (p, name, len);
+ p += len;
+ } else {
+ encode_value (0, p, &p);
+ }
+ }
}
} else if (klass->byval_arg.type == MONO_TYPE_PTR) {
encode_value (MONO_AOT_TYPEREF_PTR, p, &p);
get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info)
{
MonoPltEntry *res;
+ gboolean synchronized = FALSE;
+ static int synchronized_symbol_idx;
if (!is_plt_patch (patch_info))
return NULL;
* wrapper.
*/
res = NULL;
+ synchronized = TRUE;
}
if (!res) {
res->symbol = get_plt_symbol (acfg, res->plt_offset, patch_info);
if (acfg->aot_opts.write_symbols)
res->debug_sym = get_plt_entry_debug_sym (acfg, res->ji, acfg->plt_entry_debug_sym_cache);
+ if (synchronized) {
+ /* Avoid duplicate symbols because we don't cache */
+ res->symbol = g_strdup_printf ("%s_%d", res->symbol, synchronized_symbol_idx);
+ if (res->debug_sym)
+ res->debug_sym = g_strdup_printf ("%s_%d", res->debug_sym, synchronized_symbol_idx);
+ synchronized_symbol_idx ++;
+ }
if (res->debug_sym)
res->llvm_symbol = g_strdup_printf ("%s_%s_llvm", res->symbol, res->debug_sym);
else
p += len + 1;
break;
}
+ case MONO_PATCH_INFO_VIRT_METHOD:
+ encode_klass_ref (acfg, patch_info->data.virt_method->klass, p, &p);
+ encode_method_ref (acfg, patch_info->data.virt_method->method, p, &p);
+ break;
default:
g_warning ("unable to handle jump info %d", patch_info->type);
g_assert_not_reached ();
mono_arch_get_throw_corlib_exception (&info, TRUE);
emit_trampoline (acfg, acfg->got_offset, info);
+#ifdef MONO_ARCH_HAVE_SDB_TRAMPOLINES
+ mono_arch_create_sdb_trampoline (TRUE, &info, TRUE);
+ emit_trampoline (acfg, acfg->got_offset, info);
+ mono_arch_create_sdb_trampoline (FALSE, &info, TRUE);
+ emit_trampoline (acfg, acfg->got_offset, info);
+#endif
+
#ifdef MONO_ARCH_GSHAREDVT_SUPPORTED
mono_arch_get_gsharedvt_trampoline (&info, TRUE);
if (info) {
// By design aot-runtime decode_exception_debug_info is not able to load sequence point debug data from a file.
// As it is not possible to load debug data from a file its is also not possible to store it in a file.
gboolean method_seq_points_to_file = acfg->aot_opts.gen_seq_points_file &&
- cfg->gen_seq_points && !cfg->gen_seq_points_debug_data;
+ cfg->gen_seq_points && !cfg->gen_sdb_seq_points;
gboolean method_seq_points_to_binary = cfg->gen_seq_points && !method_seq_points_to_file;
emit_exception_debug_info (acfg, cfg, method_seq_points_to_binary);
seq_point_data_init (&sp_data, acfg->nmethods);
seq_points_to_file = TRUE;
}
- seq_point_data_add (&sp_data, cfg->method->token, cfg->seq_point_info);
+ seq_point_data_add (&sp_data, cfg->method->token, cfg->method_index, cfg->seq_point_info);
}
} else {
offsets [i] = 0;
mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
{
MonoImage *image = ass->image;
- int i, res, all_sizes;
+ int i, res;
+ gint64 all_sizes;
MonoAotCompile *acfg;
char *outfile_name, *tmp_outfile_name, *p;
char llvm_stats_msg [256];
MonoDebugOptions *opt = mini_get_debug_options ();
opt->mdb_optimizations = TRUE;
- opt->gen_seq_points_debug_data = TRUE;
+ opt->gen_sdb_seq_points = TRUE;
if (!mono_debug_enabled ()) {
aot_printerrf (acfg, "The soft-debug AOT option requires the --debug option.\n");
all_sizes = acfg->stats.code_size + acfg->stats.info_size + acfg->stats.ex_info_size + acfg->stats.unwind_info_size + acfg->stats.class_info_size + acfg->stats.got_info_size + acfg->stats.offsets_size + acfg->stats.plt_size;
aot_printf (acfg, "Code: %d(%d%%) Info: %d(%d%%) Ex Info: %d(%d%%) Unwind Info: %d(%d%%) Class Info: %d(%d%%) PLT: %d(%d%%) GOT Info: %d(%d%%) Offsets: %d(%d%%) GOT: %d\n",
- acfg->stats.code_size, acfg->stats.code_size * 100 / all_sizes,
- acfg->stats.info_size, acfg->stats.info_size * 100 / all_sizes,
- acfg->stats.ex_info_size, acfg->stats.ex_info_size * 100 / all_sizes,
- acfg->stats.unwind_info_size, acfg->stats.unwind_info_size * 100 / all_sizes,
- acfg->stats.class_info_size, acfg->stats.class_info_size * 100 / all_sizes,
- acfg->stats.plt_size ? acfg->stats.plt_size : acfg->plt_offset, acfg->stats.plt_size ? acfg->stats.plt_size * 100 / all_sizes : 0,
- acfg->stats.got_info_size, acfg->stats.got_info_size * 100 / all_sizes,
- acfg->stats.offsets_size, acfg->stats.offsets_size * 100 / all_sizes,
+ (int)acfg->stats.code_size, (int)(acfg->stats.code_size * 100 / all_sizes),
+ (int)acfg->stats.info_size, (int)(acfg->stats.info_size * 100 / all_sizes),
+ (int)acfg->stats.ex_info_size, (int)(acfg->stats.ex_info_size * 100 / all_sizes),
+ (int)acfg->stats.unwind_info_size, (int)(acfg->stats.unwind_info_size * 100 / all_sizes),
+ (int)acfg->stats.class_info_size, (int)(acfg->stats.class_info_size * 100 / all_sizes),
+ acfg->stats.plt_size ? (int)acfg->stats.plt_size : (int)acfg->plt_offset, acfg->stats.plt_size ? (int)(acfg->stats.plt_size * 100 / all_sizes) : 0,
+ (int)acfg->stats.got_info_size, (int)(acfg->stats.got_info_size * 100 / all_sizes),
+ (int)acfg->stats.offsets_size, (int)(acfg->stats.offsets_size * 100 / all_sizes),
(int)(acfg->got_offset * sizeof (gpointer)));
aot_printf (acfg, "Compiled: %d/%d (%d%%)%s, No GOT slots: %d (%d%%), Direct calls: %d (%d%%)\n",
acfg->stats.ccount, acfg->stats.mcount, acfg->stats.mcount ? (acfg->stats.ccount * 100) / acfg->stats.mcount : 100,
#include "mini.h"
#include "seq-points.h"
#include "version.h"
+#include "debugger-agent.h"
#ifndef DISABLE_AOT
int num = decode_value (p, &p);
gboolean has_container = decode_value (p, &p);
MonoTypeEnum gshared_constraint = 0;
+ char *par_name = NULL;
if (has_container) {
gboolean is_method = decode_value (p, &p);
}
} else {
gshared_constraint = decode_value (p, &p);
+ if (gshared_constraint) {
+ int len = decode_value (p, &p);
+ if (len) {
+ par_name = mono_image_alloc (module->assembly->image, len + 1);
+ memcpy (par_name, p, len);
+ p += len;
+ par_name [len] = '\0';
+ }
+ }
}
t = g_new0 (MonoType, 1);
// FIXME:
par->image = mono_defaults.corlib;
t->data.generic_param = par;
+ if (par_name)
+ ((MonoGenericParamFull*)par)->info.name = par_name;
}
// FIXME: Maybe use types directly to avoid
int atype = decode_value (p, &p);
ref->method = mono_gc_get_managed_allocator_by_type (atype);
- g_assert (ref->method);
+ if (!ref->method) {
+ fprintf (stderr, "Error: No managed allocator, but we need one for AOT.\nAre you using non-standard GC options?\n");
+ exit (1);
+ }
break;
}
case MONO_WRAPPER_WRITE_BARRIER:
p = amodule->mono_eh_frame;
- /* p points to data emitted by LLVM in DwarfException::EmitMonoEHFrame () */
+ /* p points to data emitted by LLVM in DwarfMonoException::EmitMonoEHFrame () */
/* Header */
version = *p;
jei->try_start = ei [i].try_start;
jei->try_end = ei [i].try_end;
jei->handler_start = ei [i].handler_start;
+ jei->clause_index = clause_index;
/* Make sure we transition to thumb when a handler starts */
if (amodule->thumb_end && (guint8*)jei->handler_start < amodule->thumb_end)
gint32 cindex2 = read32 (type_info [j]);
if (cindex2 == nesting_cindex) {
- /*
- * The try interval comes from the nested clause, everything else from the
- * nesting clause.
- */
memcpy (&jinfo->clauses [nindex], &jinfo->clauses [j], sizeof (MonoJitExceptionInfo));
jinfo->clauses [nindex].try_start = jinfo->clauses [i].try_start;
jinfo->clauses [nindex].try_end = jinfo->clauses [i].try_end;
+ jinfo->clauses [nindex].handler_start = jinfo->clauses [i].handler_start;
+ jinfo->clauses [nindex].exvar_offset = jinfo->clauses [i].exvar_offset;
nindex ++;
}
}
ji->data.target = s;
break;
}
+ case MONO_PATCH_INFO_VIRT_METHOD: {
+ MonoJumpInfoVirtMethod *info = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoVirtMethod));
+
+ info->klass = decode_klass_ref (aot_module, p, &p);
+ g_assert (info->klass);
+ info->method = decode_resolve_method_ref (aot_module, p, &p);
+ g_assert (info->method);
+
+ ji->data.target = info;
+ break;
+ }
default:
g_warning ("unhandled type %d", ji->type);
g_assert_not_reached ();
return index;
}
+guint32
+mono_aot_find_method_index (MonoMethod *method)
+{
+ MonoAotModule *out_amodule;
+ return find_aot_method (method, &out_amodule);
+}
+
/*
* mono_aot_get_method:
*
target = mono_create_ftnptr_malloc (target);
} else if (!strcmp (ji->data.name, "mono_thread_get_and_clear_pending_exception")) {
target = mono_thread_get_and_clear_pending_exception;
+ } else if (!strcmp (ji->data.name, "debugger_agent_single_step_from_context")) {
+ target = debugger_agent_single_step_from_context;
+ } else if (!strcmp (ji->data.name, "debugger_agent_breakpoint_from_context")) {
+ target = debugger_agent_breakpoint_from_context;
} else if (strstr (ji->data.name, "generic_trampoline_")) {
target = mono_aot_get_trampoline (ji->data.name);
} else if (aot_jit_icall_hash && g_hash_table_lookup (aot_jit_icall_hash, ji->data.name)) {
tailcall: len:120 clob:c
br: len:6
label: len:0
-seq_point: len:31 clob:c
+seq_point: len:46 clob:c
il_seq_point: len:0
long_add: dest:i src1:i src2:i len:3 clob:1 nacl:6
float_sub: dest:f src1:f src2:f len:6
fmove: dest:f src1:f len:4
move_f_to_i4: dest:i src1:f len:4
-move_i4_to_f: dest:f src1:i len:4
+move_i4_to_f: dest:f src1:i len:8
move_f_to_i8: dest:i src1:f len:4
-move_i8_to_f: dest:f src1:i len:4
+move_i8_to_f: dest:f src1:i len:8
i8const: dest:i len:20
icompare: src1:i src2:i len:4
icompare_imm: src1:i len:18
breakpoints_init ();
suspend_init ();
- mini_get_debug_options ()->gen_seq_points_debug_data = TRUE;
+ mini_get_debug_options ()->gen_sdb_seq_points = TRUE;
/*
* This is needed because currently we don't handle liveness info.
*/
dbg_unlock ();
if (res->domain == NULL) {
- DEBUG_PRINTF (0, "ERR_UNLOADED, id=%d, type=%d.\n", id, type);
+ DEBUG_PRINTF (1, "ERR_UNLOADED, id=%d, type=%d.\n", id, type);
*err = ERR_UNLOADED;
return NULL;
}
}
static void
-process_breakpoint_inner (DebuggerTlsData *tls)
+process_breakpoint_inner (DebuggerTlsData *tls, gboolean from_signal)
{
MonoJitInfo *ji;
guint8 *ip;
/*
* Skip the instruction causing the breakpoint signal.
*/
- mono_arch_skip_breakpoint (ctx, ji);
+ if (from_signal)
+ mono_arch_skip_breakpoint (ctx, ji);
if (method->wrapper_type || tls->disable_breakpoints)
return;
/* Process a breakpoint/single step event after resuming from a signal handler */
static void
-process_signal_event (void (*func) (DebuggerTlsData*))
+process_signal_event (void (*func) (DebuggerTlsData*, gboolean))
{
DebuggerTlsData *tls;
MonoThreadUnwindState orig_restore_state;
memcpy (&orig_restore_state, &tls->restore_state, sizeof (MonoThreadUnwindState));
mono_thread_state_init_from_monoctx (&tls->restore_state, &tls->handler_ctx);
- func (tls);
+ func (tls, TRUE);
/* This is called when resuming from a signal handler, so it shouldn't return */
memcpy (&ctx, &tls->restore_state.ctx, sizeof (MonoContext));
}
static void
-process_single_step_inner (DebuggerTlsData *tls)
+process_single_step_inner (DebuggerTlsData *tls, gboolean from_signal)
{
MonoJitInfo *ji;
guint8 *ip;
ip = MONO_CONTEXT_GET_IP (ctx);
/* Skip the instruction causing the single step */
- mono_arch_skip_single_step (ctx);
+ if (from_signal)
+ mono_arch_skip_single_step (ctx);
if (suspend_count > 0) {
process_suspend (tls, ctx);
memcpy (&orig_restore_state, &tls->restore_state, sizeof (MonoThreadUnwindState));
mono_thread_state_init_from_monoctx (&tls->restore_state, ctx);
- process_single_step_inner (tls);
+ process_single_step_inner (tls, FALSE);
memcpy (ctx, &tls->restore_state.ctx, sizeof (MonoContext));
memcpy (&tls->restore_state, &orig_restore_state, sizeof (MonoThreadUnwindState));
memcpy (&orig_restore_state, &tls->restore_state, sizeof (MonoContext));
mono_thread_state_init_from_monoctx (&tls->restore_state, ctx);
- process_breakpoint_inner (tls);
+ process_breakpoint_inner (tls, FALSE);
memcpy (ctx, &tls->restore_state.ctx, sizeof (MonoContext));
memcpy (&tls->restore_state, &orig_restore_state, sizeof (MonoThreadUnwindState));
if (ss_req->nframes == 0)
ss_req->nframes = nframes;
+
+ if ((ss_req->depth == STEP_DEPTH_OVER) && (!sp && !parent_sp)) {
+ DEBUG_PRINTF (1, "[dbg] No parent frame for step over, transition to step into.\n");
+ /*
+ * This is needed since if we leave managed code, and later return to it, step over
+ * is not going to stop.
+ * This approach is a bit ugly, since we change the step depth, but it only affects
+ * clients who reuse the same step request, and only in this special case.
+ */
+ ss_req->depth = STEP_DEPTH_INTO;
+ }
+
if (ss_req->depth == STEP_DEPTH_OVER) {
/* Need to stop in catch clauses as well */
for (i = 0; i < nframes; ++i) {
g_assert_not_reached ();
}
+void
+debugger_agent_single_step_from_context (MonoContext *ctx)
+{
+ g_assert_not_reached ();
+}
+
+void
+debugger_agent_breakpoint_from_context (MonoContext *ctx)
+{
+ g_assert_not_reached ();
+}
+
#endif
nacl_global_codeman_validate(&start, 256, &code);
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
if (info)
*info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
nacl_global_codeman_validate(&start, kMaxCodeSize, &code);
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
if (info)
*info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
g_assert ((code - start) < kMaxCodeSize);
nacl_global_codeman_validate(&start, kMaxCodeSize, &code);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
if (info)
*info = mono_tramp_info_create (tramp_name, start, code - start, ji, unwind_ops);
g_assert ((code - start) < kMaxCodeSize);
nacl_global_codeman_validate(&start, kMaxCodeSize, &code);
+ mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
if (info)
*info = mono_tramp_info_create ("throw_pending_exception", start, code - start, ji, unwind_ops);
g_assert ((code - start) <= kMaxCodeSize);
nacl_global_codeman_validate(&start, kMaxCodeSize, &code);
+ mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
saved = start;
return (MonoContinuationRestore)saved;
g_assert ((code - start) < sizeof(start));
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
return start;
}
g_assert ((code - start) < sizeof(start));
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
return start;
}
g_assert ((code - start) < size);
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
return start;
}
start = code = mono_global_codeman_reserve (size);
mips_break (code, 0xfd);
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
return start;
}
g_assert ((code - start) <= size);
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
if (info)
*info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
g_assert ((code - start) < size);
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
if (info)
*info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
ppc_break (code);
g_assert ((code - start) <= size);
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
if (info)
*info = mono_tramp_info_create (corlib ? "throw_corlib_exception" : (rethrow ? "rethrow_exception" : "throw_exception"), start, code - start, ji, unwind_ops);
g_assert ((code - start) < SZ_THROW);
+ mono_arch_flush_icache(start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
if (info)
*info = mono_tramp_info_create ("call_filter",
start, code - start, ji,
s390_break (code);
g_assert ((code - start) < size);
+ mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
if (info)
*info = mono_tramp_info_create (corlib ? "throw_corlib_exception"
: (rethrow ? "rethrow_exception"
/* return */
x86_ret (code);
+ mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
return start;
}
g_slist_free (unwind_ops);
}
+ mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
return start;
}
g_slist_free (unwind_ops);
}
+ mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
g_assert ((code - start) < kMaxCodeSize);
return start;
}
g_slist_free (unwind_ops);
}
+ mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
return start;
}
g_slist_free (unwind_ops);
}
+ mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
return start;
}
return 0;
}
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static void dummy () {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static int div_zero_llvm_inner (int i) {
+ try {
+ // This call make use avoid the 'handler without invoke' restriction in the llvm backend
+ dummy ();
+ return 5 / i;
+ } catch (Exception ex) {
+ return 0;
+ }
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static long div_zero_llvm_inner_long (long l) {
+ try {
+ dummy ();
+ return (long)5 / l;
+ } catch (Exception ex) {
+ return 0;
+ }
+ }
+
+ public static int test_0_div_zero_llvm () {
+ long r = div_zero_llvm_inner (0);
+ if (r != 0)
+ return 1;
+ r = div_zero_llvm_inner_long (0);
+ if (r != 0)
+ return 2;
+ return 0;
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static int div_overflow_llvm_inner (int i) {
+ try {
+ dummy ();
+ return Int32.MinValue / i;
+ } catch (Exception ex) {
+ return 0;
+ }
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static long div_overflow_llvm_inner_long (long l) {
+ try {
+ dummy ();
+ return Int64.MinValue / l;
+ } catch (Exception ex) {
+ return 0;
+ }
+ }
+
+ public static int test_0_div_overflow_llvm () {
+ long r = div_overflow_llvm_inner (-1);
+ if (r != 0)
+ return 1;
+ r = div_overflow_llvm_inner_long ((long)-1);
+ if (r != 0)
+ return 2;
+ return 0;
+ }
+
public static int return_55 () {
return 55;
}
return 2;
}
- /* MarshalByRefObject prevents the methods from being inlined */
- class ThrowClass : MarshalByRefObject {
- public static void rethrow1 () {
- throw new Exception ();
- }
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void rethrow1 () {
+ throw new Exception ();
+ }
- public static void rethrow2 () {
- rethrow1 ();
- /* This disables tailcall opts */
- Console.WriteLine ();
- }
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void rethrow2 () {
+ rethrow1 ();
+ /* This disables tailcall opts */
+ Console.WriteLine ();
}
public static int test_0_rethrow_stacktrace () {
// Check that rethrowing an exception preserves the original stack trace
try {
try {
- ThrowClass.rethrow2 ();
+ rethrow2 ();
}
catch (Exception ex) {
// Check that each catch clause has its own exception variable
MyClass<FooStruct2>.foo ();
return 0;
}
+
+ enum AnEnum {
+ A,
+ B
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static string constrained_tostring<T> (T t) {
+ return t.ToString ();
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static bool constrained_equals<T> (T t1, T t2) {
+ var c = EqualityComparer<T>.Default;
+
+ return c.Equals (t1, t2);
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static int constrained_gethashcode<T> (T t) {
+ return t.GetHashCode ();
+ }
+
+ public static int test_0_constrained_partial_sharing () {
+ string s;
+
+ s = constrained_tostring<int> (5);
+ if (s != "5")
+ return 1;
+ s = constrained_tostring<AnEnum> (AnEnum.B);
+ if (s != "B")
+ return 2;
+
+ if (!constrained_equals<int> (1, 1))
+ return 3;
+ if (constrained_equals<int> (1, 2))
+ return 4;
+ if (!constrained_equals<AnEnum> (AnEnum.A, AnEnum.A))
+ return 5;
+ if (constrained_equals<AnEnum> (AnEnum.A, AnEnum.B))
+ return 6;
+
+ int i = constrained_gethashcode<int> (5);
+ if (i != 5)
+ return 7;
+ i = constrained_gethashcode<AnEnum> (AnEnum.B);
+ if (i != 1)
+ return 8;
+ return 0;
+ }
}
#if !MOBILE
} while (0)
#define NEW_SEQ_POINT(cfg,dest,il_offset,intr_loc) do { \
- MONO_INST_NEW ((cfg), (dest), cfg->gen_seq_points_debug_data ? OP_SEQ_POINT : OP_IL_SEQ_POINT); \
+ MONO_INST_NEW ((cfg), (dest), cfg->gen_sdb_seq_points ? OP_SEQ_POINT : OP_IL_SEQ_POINT); \
(dest)->inst_imm = (il_offset); \
(dest)->flags = intr_loc ? MONO_INST_SINGLE_STEP_LOC : 0; \
} while (0)
context.method_inst = mono_method_get_context (method)->method_inst;
res = mono_class_inflate_generic_method_checked (res, &context, &error);
- mono_error_raise_exception (&error);
+ if (!mono_error_ok (&error)) {
+ mono_error_set_pending_exception (&error);
+ return NULL;
+ }
}
/* An rgctx wrapper is added by the trampolines no need to do it here */
gpointer res;
res = mono_ldtoken_checked (image, token, &handle_class, context, &error);
- mono_error_raise_exception (&error);
+ if (!mono_error_ok (&error)) {
+ mono_error_set_pending_exception (&error);
+ return NULL;
+ }
mono_class_init (handle_class);
return res;
{
MonoError error;
MonoClass *klass = mono_class_get_checked (mono_defaults.corlib, MONO_TOKEN_TYPE_DEF | idx, &error);
- mono_error_raise_exception (&error);
+
+ if (!mono_error_ok (&error)) {
+ mono_error_set_pending_exception (&error);
+ return NULL;
+ }
return mono_object_new (mono_domain_get (), klass);
}
gpointer new_args [16];
m = constrained_gsharedvt_call_setup (mp, cmethod, klass, &this_arg);
+ if (!m)
+ return NULL;
if (args && deref_arg) {
new_args [0] = *(gpointer*)args [0];
args = new_args;
}
else {
/* Try dead code elimination */
- if ((var != cfg->ret) && !(var->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT)) && ((ins->opcode == OP_ICONST) || (ins->opcode == OP_I8CONST) || (ins->opcode == OP_R8CONST)) && !(var->flags & MONO_INST_VOLATILE)) {
+ if (!cfg->disable_deadce_vars && (var != cfg->ret) && !(var->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT)) && ((ins->opcode == OP_ICONST) || (ins->opcode == OP_I8CONST) || (ins->opcode == OP_R8CONST)) && !(var->flags & MONO_INST_VOLATILE)) {
LIVENESS_DEBUG (printf ("\tdead def of R%d, eliminated\n", ins->dreg));
NULLIFY_INS (ins);
return;
gshared_failure (MonoCompile *cfg, int opcode, const char *file, int line)
{
if (cfg->verbose_level > 2) \
- printf ("sharing failed for method %s.%s.%s/%d opcode %s line %d\n", cfg->current_method->klass->name_space, cfg->current_method->klass->name, cfg->current_method->name, cfg->current_method->signature->param_count, mono_opcode_name ((opcode)), __LINE__);
+ printf ("sharing failed for method %s.%s.%s/%d opcode %s line %d\n", cfg->current_method->klass->name_space, cfg->current_method->klass->name, cfg->current_method->name, cfg->current_method->signature->param_count, mono_opcode_name ((opcode)), line);
mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED);
}
else
return ((i + 1) << 8) | MONO_REGION_CATCH | clause->flags;
}
+ }
+ for (i = 0; i < header->num_clauses; ++i) {
+ clause = &header->clauses [i];
if (MONO_OFFSET_IN_CLAUSE (clause, offset))
return ((i + 1) << 8) | clause->flags;
if (cfg->compile_llvm)
return FALSE;
#endif
- if (cfg->gen_seq_points_debug_data || cfg->disable_direct_icalls)
+ if (cfg->gen_sdb_seq_points || cfg->disable_direct_icalls)
return FALSE;
return TRUE;
}
return emit_rgctx_fetch (cfg, rgctx, entry);
}
+/*
+ * emit_get_rgctx_virt_method:
+ *
+ * Return data for method VIRT_METHOD for a receiver of type KLASS.
+ */
+static MonoInst*
+emit_get_rgctx_virt_method (MonoCompile *cfg, int context_used,
+ MonoClass *klass, MonoMethod *virt_method, MonoRgctxInfoType rgctx_type)
+{
+ MonoJumpInfoVirtMethod *info;
+ MonoJumpInfoRgctxEntry *entry;
+ MonoInst *rgctx;
+
+ info = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfoVirtMethod));
+ info->klass = klass;
+ info->method = virt_method;
+
+ entry = mono_patch_info_rgctx_entry_new (cfg->mempool, cfg->current_method, context_used & MONO_GENERIC_CONTEXT_USED_METHOD, MONO_PATCH_INFO_VIRT_METHOD, info, rgctx_type);
+ rgctx = emit_get_rgctx (cfg, cfg->current_method, context_used);
+
+ return emit_rgctx_fetch (cfg, rgctx, entry);
+}
static MonoInst*
emit_get_rgctx_gsharedvt_method (MonoCompile *cfg, int context_used,
cfg->stat_cil_code_size += header->code_size;
seq_points = cfg->gen_seq_points && cfg->method == method;
-#ifdef PLATFORM_ANDROID
- seq_points &= cfg->method->wrapper_type == MONO_WRAPPER_NONE;
-#endif
if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) {
/* We could hit a seq point before attaching to the JIT (#8338) */
seq_points = FALSE;
}
- if (cfg->gen_seq_points_debug_data && cfg->method == method) {
+ if (cfg->gen_sdb_seq_points && cfg->method == method) {
minfo = mono_debug_lookup_method (method);
if (minfo) {
int i, n_il_offsets;
gboolean skip_ret = FALSE;
gboolean delegate_invoke = FALSE;
gboolean direct_icall = FALSE;
+ gboolean constrained_partial_call = FALSE;
MonoMethod *cil_method;
CHECK_OPSIZE (5);
if ((constrained_class->byval_arg.type == MONO_TYPE_VAR || constrained_class->byval_arg.type == MONO_TYPE_MVAR) && cfg->generic_sharing_context) {
if (!mini_is_gsharedvt_klass (cfg, constrained_class)) {
g_assert (!cmethod->klass->valuetype);
- if (!mini_type_is_reference (cfg, &constrained_class->byval_arg)) {
- /* FIXME: gshared type constrained to a primitive type */
- GENERIC_SHARING_FAILURE (CEE_CALL);
- }
+ if (!mini_type_is_reference (cfg, &constrained_class->byval_arg))
+ constrained_partial_call = TRUE;
}
}
/*
* We have the `constrained.' prefix opcode.
*/
- if (constrained_class->valuetype && (cmethod->klass == mono_defaults.object_class || cmethod->klass == mono_defaults.enum_class->parent || cmethod->klass == mono_defaults.enum_class)) {
+ if (constrained_partial_call) {
+ gboolean need_box = TRUE;
+
+ /*
+ * The receiver is a valuetype, but the exact type is not known at compile time. This means the
+ * called method is not known at compile time either. The called method could end up being
+ * one of the methods on the parent classes (object/valuetype/enum), in which case we need
+ * to box the receiver.
+ * A simple solution would be to box always and make a normal virtual call, but that would
+ * be bad performance wise.
+ */
+ if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE && cmethod->klass->generic_class) {
+ /*
+ * The parent classes implement no generic interfaces, so the called method will be a vtype method, so no boxing neccessary.
+ */
+ need_box = FALSE;
+ }
+
+ if (need_box) {
+ MonoInst *box_type;
+ MonoBasicBlock *is_ref_bb, *end_bb;
+ MonoInst *nonbox_call;
+
+ /*
+ * Determine at runtime whenever the called method is defined on object/valuetype/enum, and emit a boxing call
+ * if needed.
+ * FIXME: It is possible to inline the called method in a lot of cases, i.e. for T_INT,
+ * the no-box case goes to a method in Int32, while the box case goes to a method in Enum.
+ */
+ addr = emit_get_rgctx_virt_method (cfg, mono_class_check_context_used (constrained_class), constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_CODE);
+
+ NEW_BBLOCK (cfg, is_ref_bb);
+ NEW_BBLOCK (cfg, end_bb);
+
+ box_type = emit_get_rgctx_virt_method (cfg, mono_class_check_context_used (constrained_class), constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE);
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, box_type->dreg, 1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_IBEQ, is_ref_bb);
+
+ /* Non-ref case */
+ nonbox_call = (MonoInst*)mono_emit_calli (cfg, fsig, sp, addr, NULL, NULL);
+
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, end_bb);
+
+ /* Ref case */
+ MONO_START_BB (cfg, is_ref_bb);
+ EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, ins, &constrained_class->byval_arg, sp [0]->dreg, 0);
+ ins->klass = constrained_class;
+ sp [0] = handle_box (cfg, ins, constrained_class, mono_class_check_context_used (constrained_class), &bblock);
+ ins = (MonoInst*)mono_emit_calli (cfg, fsig, sp, addr, NULL, NULL);
+
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, end_bb);
+
+ MONO_START_BB (cfg, end_bb);
+ bblock = end_bb;
+
+ nonbox_call->dreg = ins->dreg;
+ } else {
+ g_assert (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE);
+ addr = emit_get_rgctx_virt_method (cfg, mono_class_check_context_used (constrained_class), constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_CODE);
+ ins = (MonoInst*)mono_emit_calli (cfg, fsig, sp, addr, NULL, NULL);
+ }
+ goto call_end;
+ } else if (constrained_class->valuetype && (cmethod->klass == mono_defaults.object_class || cmethod->klass == mono_defaults.enum_class->parent || cmethod->klass == mono_defaults.enum_class)) {
/*
* The type parameter is instantiated as a valuetype,
* but that type doesn't override the method we're
}
/* Add a sequence point for method entry/exit events */
- if (cfg->gen_seq_points_debug_data) {
+ if (seq_points && cfg->gen_sdb_seq_points) {
NEW_SEQ_POINT (cfg, ins, METHOD_ENTRY_IL_OFFSET, FALSE);
MONO_ADD_INS (init_localsbb, ins);
NEW_SEQ_POINT (cfg, ins, METHOD_EXIT_IL_OFFSET, FALSE);
#define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f))
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
/* Under windows, the calling convention is never stdcall */
#define CALLCONV_IS_STDCALL(call_conv) (FALSE)
#else
/* The size of the single step instruction causing the actual fault */
static int single_step_fault_size;
+/* The single step trampoline */
+static gpointer ss_trampoline;
+
/* Offset between fp and the first argument in the callee */
#define ARGS_OFFSET 16
#define GP_SCRATCH_REG AMD64_R11
#define DEBUG(a) if (cfg->verbose_level > 1) a
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
static AMD64_Reg_No param_regs [] = { AMD64_RCX, AMD64_RDX, AMD64_R8, AMD64_R9 };
static AMD64_Reg_No return_regs [] = { AMD64_RAX, AMD64_RDX };
}
}
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
#define FLOAT_PARAM_REGS 4
#else
#define FLOAT_PARAM_REGS 8
break;
case MONO_TYPE_R4:
case MONO_TYPE_R8:
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
class2 = ARG_CLASS_INTEGER;
#else
class2 = ARG_CLASS_SSE;
klass = mono_class_from_mono_type (type);
size = mini_type_stack_size_full (gsctx, &klass->byval_arg, NULL, sig->pinvoke);
-#ifndef HOST_WIN32
+#ifndef TARGET_WIN32
if (!sig->pinvoke && ((is_return && (size == 8)) || (!is_return && (size <= 16)))) {
/* We pass and return vtypes of size 8 in a register */
} else if (!sig->pinvoke || (size == 0) || (size > 16)) {
g_assert (info);
g_assert (fields);
-#ifndef HOST_WIN32
+#ifndef TARGET_WIN32
if (info->native_size > 16) {
ainfo->offset = *stack_size;
*stack_size += ALIGN_TO (info->native_size, 8);
gr = 0;
fr = 0;
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
/* Reserve space where the callee can save the argument registers */
stack_size = 4 * sizeof (mgreg_t);
#endif
ArgInfo *ainfo = &cinfo->args [sig->hasthis + i];
MonoType *ptype;
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
/* The float param registers and other param registers must be the same index on Windows x64.*/
if (gr > fr)
fr = gr;
#ifndef __native_client_codegen__
regs = g_list_prepend (regs, (gpointer)AMD64_R15);
#endif
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
regs = g_list_prepend (regs, (gpointer)AMD64_RDI);
regs = g_list_prepend (regs, (gpointer)AMD64_RSI);
#endif
}
}
- if (cfg->gen_seq_points_debug_data) {
+ if (cfg->gen_sdb_seq_points) {
MonoInst *ins;
if (cfg->compile_aot) {
MonoInst *ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
ins->flags |= MONO_INST_VOLATILE;
cfg->arch.seq_point_info_var = ins;
+
+ ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
+ ins->flags |= MONO_INST_VOLATILE;
+ cfg->arch.ss_tramp_var = ins;
}
ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
if (cfg->method->save_lmf) {
cfg->lmf_ir = TRUE;
-#if !defined(HOST_WIN32)
+#if !defined(TARGET_WIN32)
if (mono_get_lmf_tls_offset () != -1 && !optimize_for_xen)
cfg->lmf_ir_mono_lmf = TRUE;
#endif
static inline guint8*
emit_call (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointer data, gboolean win64_adjust_stack)
{
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
if (win64_adjust_stack)
amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 32);
#endif
code = emit_call_body (cfg, code, patch_type, data);
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
if (win64_adjust_stack)
amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 32);
#endif
int sreg = tree->sreg1;
int need_touch = FALSE;
-#if defined(HOST_WIN32)
+#if defined(TARGET_WIN32)
need_touch = TRUE;
#elif defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK)
if (!tree->flags & MONO_INST_INIT)
guint8*
mono_amd64_emit_tls_get (guint8* code, int dreg, int tls_offset)
{
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
if (tls_offset < 64) {
x86_prefix (code, X86_GS_PREFIX);
amd64_mov_reg_mem (code, dreg, (tls_offset * 8) + 0x1480, 8);
static guint8*
amd64_emit_tls_set (guint8 *code, int sreg, int tls_offset)
{
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
g_assert_not_reached ();
#elif defined(__APPLE__)
x86_prefix (code, X86_GS_PREFIX);
amd64_emit_tls_set_reg (guint8 *code, int sreg, int offset_reg)
{
/* offset_reg contains a value translated by mono_arch_translate_tls_offset () */
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
g_assert_not_reached ();
#elif defined(__APPLE__)
x86_prefix (code, X86_GS_PREFIX);
case OP_SEQ_POINT: {
int i;
- /*
- * Read from the single stepping trigger page. This will cause a
- * SIGSEGV when single stepping is enabled.
- * We do this _before_ the breakpoint, so single stepping after
- * a breakpoint is hit will step to the next IL offset.
- */
if (ins->flags & MONO_INST_SINGLE_STEP_LOC) {
- MonoInst *var = cfg->arch.ss_trigger_page_var;
+ if (cfg->compile_aot) {
+ MonoInst *var = cfg->arch.ss_tramp_var;
+ guint8 *label;
+
+ /* Load ss_tramp_var */
+ amd64_mov_reg_membase (code, AMD64_R11, var->inst_basereg, var->inst_offset, 8);
+ /* Load the trampoline address */
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 0, 8);
+ /* Call it if it is non-null */
+ amd64_test_reg_reg (code, AMD64_R11, AMD64_R11);
+ label = code;
+ amd64_branch8 (code, X86_CC_Z, 0, FALSE);
+ amd64_call_reg (code, AMD64_R11);
+ amd64_patch (label, code);
+ } else {
+ /*
+ * Read from the single stepping trigger page. This will cause a
+ * SIGSEGV when single stepping is enabled.
+ * We do this _before_ the breakpoint, so single stepping after
+ * a breakpoint is hit will step to the next IL offset.
+ */
+ MonoInst *var = cfg->arch.ss_trigger_page_var;
- amd64_mov_reg_membase (code, AMD64_R11, var->inst_basereg, var->inst_offset, 8);
- amd64_alu_membase_imm_size (code, X86_CMP, AMD64_R11, 0, 0, 4);
+ amd64_mov_reg_membase (code, AMD64_R11, var->inst_basereg, var->inst_offset, 8);
+ amd64_alu_membase_imm_size (code, X86_CMP, AMD64_R11, 0, 0, 4);
+ }
}
/*
guint32 offset = code - cfg->native_code;
guint32 val;
MonoInst *info_var = cfg->arch.seq_point_info_var;
+ guint8 *label;
/* Load info var */
amd64_mov_reg_membase (code, AMD64_R11, info_var->inst_basereg, info_var->inst_offset, 8);
val = ((offset) * sizeof (guint8*)) + MONO_STRUCT_OFFSET (SeqPointInfo, bp_addrs);
- /* Load the info->bp_addrs [offset], which is either a valid address or the address of a trigger page */
+ /* Load the info->bp_addrs [offset], which is either NULL or the address of the breakpoint trampoline */
amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, val, 8);
- amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 0, 8);
+ amd64_test_reg_reg (code, AMD64_R11, AMD64_R11);
+ label = code;
+ amd64_branch8 (code, X86_CC_Z, 0, FALSE);
+ /* Call the trampoline */
+ amd64_call_reg (code, AMD64_R11);
+ amd64_patch (label, code);
} else {
/*
* A placeholder for a possible breakpoint inserted by
mono_emit_unwind_op_def_cfa_offset (cfg, code, cfa_offset);
mono_emit_unwind_op_offset (cfg, code, AMD64_RBP, - cfa_offset);
async_exc_point (code);
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
mono_arch_unwindinfo_add_push_nonvol (&cfg->arch.unwindinfo, cfg->native_code, code, AMD64_RBP);
#endif
/* These are handled automatically by the stack marking code */
amd64_mov_reg_reg (code, AMD64_RBP, AMD64_RSP, sizeof(mgreg_t));
mono_emit_unwind_op_def_cfa_reg (cfg, code, AMD64_RBP);
async_exc_point (code);
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
mono_arch_unwindinfo_add_set_fpreg (&cfg->arch.unwindinfo, cfg->native_code, code, AMD64_RBP);
#endif
}
/* Allocate stack frame */
if (alloc_size) {
/* See mono_emit_stack_alloc */
-#if defined(HOST_WIN32) || defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK)
+#if defined(TARGET_WIN32) || defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK)
guint32 remaining_size = alloc_size;
/*FIXME handle unbounded code expansion, we should use a loop in case of more than X interactions*/
guint32 required_code_size = ((remaining_size / 0x1000) + 1) * 10; /*10 is the max size of amd64_alu_reg_imm + amd64_test_membase_reg*/
mono_emit_unwind_op_def_cfa_offset (cfg, code, cfa_offset);
}
async_exc_point (code);
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
if (cfg->arch.omit_fp)
mono_arch_unwindinfo_add_alloc_stack (&cfg->arch.unwindinfo, cfg->native_code, code, 0x1000);
#endif
mono_emit_unwind_op_def_cfa_offset (cfg, code, cfa_offset);
async_exc_point (code);
}
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
if (cfg->arch.omit_fp)
mono_arch_unwindinfo_add_alloc_stack (&cfg->arch.unwindinfo, cfg->native_code, code, remaining_size);
#endif
}
}
- if (cfg->gen_seq_points_debug_data) {
+ if (cfg->gen_sdb_seq_points) {
MonoInst *info_var = cfg->arch.seq_point_info_var;
/* Initialize seq_point_info_var */
amd64_mov_membase_reg (code, info_var->inst_basereg, info_var->inst_offset, AMD64_R11, 8);
}
- /* Initialize ss_trigger_page_var */
- ins = cfg->arch.ss_trigger_page_var;
-
- g_assert (ins->opcode == OP_REGOFFSET);
-
if (cfg->compile_aot) {
+ /* Initialize ss_tramp_var */
+ ins = cfg->arch.ss_tramp_var;
+ g_assert (ins->opcode == OP_REGOFFSET);
+
amd64_mov_reg_membase (code, AMD64_R11, info_var->inst_basereg, info_var->inst_offset, 8);
- amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, MONO_STRUCT_OFFSET (SeqPointInfo, ss_trigger_page), 8);
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, MONO_STRUCT_OFFSET (SeqPointInfo, ss_tramp_addr), 8);
+ amd64_mov_membase_reg (code, ins->inst_basereg, ins->inst_offset, AMD64_R11, 8);
} else {
+ /* Initialize ss_trigger_page_var */
+ ins = cfg->arch.ss_trigger_page_var;
+
+ g_assert (ins->opcode == OP_REGOFFSET);
+
amd64_mov_reg_imm (code, AMD64_R11, (guint64)ss_trigger_page);
+ amd64_mov_membase_reg (code, ins->inst_basereg, ins->inst_offset, AMD64_R11, 8);
}
- amd64_mov_membase_reg (code, ins->inst_basereg, ins->inst_offset, AMD64_R11, 8);
}
cfg->code_len = code - cfg->native_code;
/* We have to shift the arguments left */
amd64_mov_reg_reg (code, AMD64_RAX, AMD64_ARG_REG1, 8);
for (i = 0; i < param_count; ++i) {
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
if (i < 3)
amd64_mov_reg_reg (code, param_regs [i], param_regs [i + 1], 8);
else
}
nacl_global_codeman_validate (&start, 64, &code);
+ mono_arch_flush_icache (start, code - start);
if (code_len)
*code_len = code - start;
SeqPointInfo *info = mono_arch_get_seq_point_info (mono_domain_get (), ji->code_start);
g_assert (info->bp_addrs [native_offset] == 0);
- info->bp_addrs [native_offset] = bp_trigger_page;
+ info->bp_addrs [native_offset] = mini_get_breakpoint_trampoline ();
} else {
/*
* In production, we will use int3 (has to fix the size in the md
guint32 native_offset = ip - (guint8*)ji->code_start;
SeqPointInfo *info = mono_arch_get_seq_point_info (mono_domain_get (), ji->code_start);
- g_assert (info->bp_addrs [native_offset] == 0);
- info->bp_addrs [native_offset] = info;
+ info->bp_addrs [native_offset] = NULL;
} else {
for (i = 0; i < breakpoint_size; ++i)
x86_nop (code);
mono_arch_skip_breakpoint (MonoContext *ctx, MonoJitInfo *ji)
{
if (ji->from_aot) {
- /* amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 0, 8) */
- MONO_CONTEXT_SET_IP (ctx, (guint8*)MONO_CONTEXT_GET_IP (ctx) + 3);
+ /* The breakpoint instruction is a call */
} else {
MONO_CONTEXT_SET_IP (ctx, (guint8*)MONO_CONTEXT_GET_IP (ctx) + breakpoint_fault_size);
}
mono_arch_start_single_stepping (void)
{
mono_mprotect (ss_trigger_page, mono_pagesize (), 0);
+ ss_trampoline = mini_get_single_step_trampoline ();
}
/*
mono_arch_stop_single_stepping (void)
{
mono_mprotect (ss_trigger_page, mono_pagesize (), MONO_MMAP_READ);
+ ss_trampoline = NULL;
}
/*
{
SeqPointInfo *info;
MonoJitInfo *ji;
- int i;
// FIXME: Add a free function
// FIXME: Optimize the size
info = g_malloc0 (sizeof (SeqPointInfo) + (ji->code_size * sizeof (gpointer)));
- info->ss_trigger_page = ss_trigger_page;
- info->bp_trigger_page = bp_trigger_page;
- /* Initialize to a valid address */
- for (i = 0; i < ji->code_size; ++i)
- info->bp_addrs [i] = info;
+ info->ss_tramp_addr = &ss_trampoline;
mono_domain_lock (domain);
g_hash_table_insert (domain_jit_info (domain)->arch_seq_points,
#endif
gpointer seq_point_info_var;
gpointer ss_trigger_page_var;
+ gpointer ss_tramp_var;
gpointer lmf_var;
} MonoCompileArch;
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
#define PARAM_REGS 4
#else
#define PARAM_REGS 6
/* Structure used by the sequence points in AOTed code */
typedef struct {
- gpointer ss_trigger_page;
- gpointer bp_trigger_page;
+ gpointer ss_tramp_addr;
gpointer bp_addrs [MONO_ZERO_LEN_ARRAY];
} SeqPointInfo;
#define MONO_CONTEXT_SET_LLVM_EXC_REG(ctx, exc) do { (ctx)->rax = (gsize)exc; } while (0)
+#define MONO_CONTEXT_SET_LLVM_EH_SELECTOR_REG(ctx, sel) do { (ctx)->rdx = (gsize)(sel); } while (0)
#define MONO_ARCH_INIT_TOP_LMF_ENTRY(lmf)
#define MONO_ARCH_NOMAP32BIT 1
#endif
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
#define MONO_AMD64_ARG_REG1 AMD64_RCX
#define MONO_AMD64_ARG_REG2 AMD64_RDX
#define MONO_AMD64_ARG_REG3 AMD64_R8
#define MONO_ARCH_HAVE_OP_TAIL_CALL 1
#define MONO_ARCH_HAVE_TRANSLATE_TLS_OFFSET 1
#define MONO_ARCH_HAVE_DUMMY_INIT 1
+#define MONO_ARCH_HAVE_SDB_TRAMPOLINES 1
#if defined(TARGET_OSX) || defined(__linux__)
#define MONO_ARCH_HAVE_TLS_GET_REG 1
extern MonoBreakpointInfo mono_breakpoint_info [MONO_BREAKPOINT_ARRAY_SIZE];
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
void mono_arch_unwindinfo_add_push_nonvol (gpointer* monoui, gpointer codebegin, gpointer nextip, guchar reg );
void mono_arch_unwindinfo_add_set_fpreg (gpointer* monoui, gpointer codebegin, gpointer nextip, guchar reg );
}
}
- if (cfg->gen_seq_points_debug_data) {
+ if (cfg->gen_sdb_seq_points) {
if (cfg->soft_breakpoints) {
MonoInst *ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
ins->flags |= MONO_INST_VOLATILE;
}
else
MONO_OBJECT_SETREF (sf, method, mono_method_get_object (domain, method, NULL));
+
+ sf->method_index = ji->from_aot ? mono_aot_find_method_index (method) : 0xffffff;
sf->method_address = (gsize) ji->code_start;
sf->native_offset = (char *)ip - (char *)ji->code_start;
*((gpointer *)(gpointer)((char *)MONO_CONTEXT_GET_BP (ctx) + ei->exvar_offset)) = ex_obj;
}
+#ifdef MONO_CONTEXT_SET_LLVM_EH_SELECTOR_REG
+ /*
+ * Pass the original il clause index to the landing pad so it can
+ * branch to the landing pad associated with the il clause.
+ * This is needed because llvm compiled code assumes that the EH
+ * code always branches to the innermost landing pad.
+ */
+ if (ji->from_llvm)
+ MONO_CONTEXT_SET_LLVM_EH_SELECTOR_REG (ctx, ei->clause_index);
+#endif
+
mono_debugger_agent_begin_exception_filter (mono_ex, ctx, &initial_ctx);
filtered = call_filter (ctx, ei->data.filter);
mono_debugger_agent_end_exception_filter (mono_ex, ctx, &initial_ctx);
}
}
+#ifdef MONO_CONTEXT_SET_LLVM_EH_SELECTOR_REG
+ if (ji->from_llvm)
+ MONO_CONTEXT_SET_LLVM_EH_SELECTOR_REG (ctx, ei->clause_index);
+#endif
+
if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
/*
* Filter clauses should only be run in the
if (sigctx)
mono_sigctx_to_monoctx (sigctx, &ctx->ctx);
else
-#if MONO_ARCH_HAS_MONO_CONTEXT && !defined(MONO_CROSS_COMPILE)
+#if defined(MONO_CROSS_COMPILE)
+ ctx->valid = FALSE; //A cross compiler doesn't need to suspend.
+#elif MONO_ARCH_HAS_MONO_CONTEXT
MONO_CONTEXT_GET_CURRENT (ctx->ctx);
#else
g_error ("Use a null sigctx requires a working mono-context");
#include "mini.h"
-//#define ALLOW_PARTIAL_SHARING TRUE
-#define ALLOW_PARTIAL_SHARING FALSE
+#define ALLOW_PARTIAL_SHARING TRUE
+//#define ALLOW_PARTIAL_SHARING FALSE
#if 0
#define DEBUG(...) __VA_ARGS__
g_assert (mono_error_ok (&error));
return isig;
}
+ case MONO_RGCTX_INFO_VIRT_METHOD_CODE:
+ case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: {
+ MonoJumpInfoVirtMethod *info = data;
+ MonoJumpInfoVirtMethod *res;
+ MonoType *t;
+ MonoDomain *domain = mono_domain_get ();
+ MonoError error;
+
+ // FIXME: Temporary
+ res = mono_domain_alloc0 (domain, sizeof (MonoJumpInfoVirtMethod));
+ t = mono_class_inflate_generic_type (&info->klass->byval_arg, context);
+ res->klass = mono_class_from_mono_type (t);
+ mono_metadata_free_type (t);
+ res->method = mono_class_inflate_generic_method_checked (info->method, context, &error);
+ g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
+
+ return res;
+ }
default:
g_assert_not_reached ();
}
addr = mono_compile_method (data);
return mini_add_method_trampoline (NULL, data, addr, mono_method_needs_static_rgctx_invoke (data, FALSE), FALSE);
}
+ case MONO_RGCTX_INFO_VIRT_METHOD_CODE: {
+ MonoJumpInfoVirtMethod *info = data;
+ MonoClass *iface_class = info->method->klass;
+ MonoMethod *method;
+ int ioffset, slot;
+ gpointer addr;
+
+ mono_class_setup_vtable (info->klass);
+ // FIXME: Check type load
+ if (iface_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ ioffset = mono_class_interface_offset (info->klass, iface_class);
+ g_assert (ioffset != -1);
+ } else {
+ ioffset = 0;
+ }
+ slot = mono_method_get_vtable_slot (info->method);
+ g_assert (slot != -1);
+ g_assert (info->klass->vtable);
+ method = info->klass->vtable [ioffset + slot];
+
+ addr = mono_compile_method (method);
+ return mini_add_method_trampoline (NULL, method, addr, mono_method_needs_static_rgctx_invoke (method, FALSE), FALSE);
+ }
+ case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: {
+ MonoJumpInfoVirtMethod *info = data;
+ MonoClass *iface_class = info->method->klass;
+ MonoMethod *method;
+ MonoClass *impl_class;
+ int ioffset, slot;
+
+ mono_class_setup_vtable (info->klass);
+ // FIXME: Check type load
+ if (iface_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ ioffset = mono_class_interface_offset (info->klass, iface_class);
+ g_assert (ioffset != -1);
+ } else {
+ ioffset = 0;
+ }
+ slot = mono_method_get_vtable_slot (info->method);
+ g_assert (slot != -1);
+ g_assert (info->klass->vtable);
+ method = info->klass->vtable [ioffset + slot];
+
+ impl_class = method->klass;
+ if (MONO_TYPE_IS_REFERENCE (&impl_class->byval_arg))
+ return GUINT_TO_POINTER (1);
+ else if (mono_class_is_nullable (impl_class))
+ return GUINT_TO_POINTER (2);
+ else
+ return GUINT_TO_POINTER (0);
+ }
#ifndef DISABLE_REMOTING
case MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK:
return mono_compile_method (mono_marshal_get_remoting_invoke_with_check (data));
case MONO_RGCTX_INFO_BZERO: return "BZERO";
case MONO_RGCTX_INFO_NULLABLE_CLASS_BOX: return "NULLABLE_CLASS_BOX";
case MONO_RGCTX_INFO_NULLABLE_CLASS_UNBOX: return "NULLABLE_CLASS_UNBOX";
+ case MONO_RGCTX_INFO_VIRT_METHOD_CODE: return "VIRT_METHOD_CODE";
+ case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: return "VIRT_METHOD_BOX_TYPE";
default:
return "<UNKNOWN RGCTX INFO TYPE>";
}
case MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE_VIRT:
case MONO_RGCTX_INFO_SIG_GSHAREDVT_OUT_TRAMPOLINE_CALLI:
return data1 == data2;
+ case MONO_RGCTX_INFO_VIRT_METHOD_CODE:
+ case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: {
+ MonoJumpInfoVirtMethod *info1 = data1;
+ MonoJumpInfoVirtMethod *info2 = data2;
+
+ return info1->klass == info2->klass && info1->method == info2->method;
+ }
default:
g_assert_not_reached ();
}
/* Callbacks installed by mono */
AllocCodeMemoryCb *alloc_cb;
DlSymCb *dlsym_cb;
+ ExceptionTableCb *exception_cb;
MonoJITMemoryManager ();
~MonoJITMemoryManager ();
unsigned char *TableEnd,
unsigned char* FrameRegister)
{
+ exception_cb (FrameRegister);
}
#else
virtual void NotifyFunctionEmitted(const Function &F,
void *Code, size_t Size,
const EmittedFunctionDetails &Details) {
- /*
- * X86TargetMachine::setCodeModelForJIT() sets the code model to Large on amd64,
- * which means the JIT will generate calls of the form
- * mov reg, <imm>
- * call *reg
- * Our trampoline code can't patch this. Passing CodeModel::Small to createJIT
- * doesn't seem to work, we need Default. A discussion is here:
- * http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-December/027999.html
- * There seems to no way to get the TargeMachine used by an EE either, so we
- * install a profiler hook and reset the code model here.
- * This should be inside an ifdef, but we can't include our config.h either,
- * since its definitions conflict with LLVM's config.h.
- * The LLVM mono branch contains a workaround.
- */
emitted_cb (wrap (&F), Code, (char*)Code + Size);
}
};
MonoJITMemoryManager *mono_mm = new MonoJITMemoryManager ();
mono_mm->alloc_cb = alloc_cb;
mono_mm->dlsym_cb = dlsym_cb;
+ mono_mm->exception_cb = exception_cb;
mono_ee->mm = mono_mm;
/*
g_assert (EE);
mono_ee->EE = EE;
- EE->InstallExceptionTableRegister (exception_cb);
MonoJITEventListener *listener = new MonoJITEventListener (emitted_cb);
EE->RegisterJITEventListener (listener);
mono_ee->listener = listener;
MonoMethodSignature *sig;
GSList *builders;
GHashTable *region_to_handler;
+ GHashTable *clause_to_handler;
LLVMBuilderRef alloca_builder;
LLVMValueRef last_alloca;
LLVMValueRef rgctx_arg;
LLVMValueRef dbg_md;
MonoDebugMethodInfo *minfo;
char temp_name [32];
+ /* For every clause, the clauses it is nested in */
+ GSList **nested_in;
+ LLVMValueRef ex_var;
} EmitContext;
typedef struct {
*/
if (t->type == MONO_TYPE_U1 || t->type == MONO_TYPE_U2 || t->type == MONO_TYPE_CHAR || t->type == MONO_TYPE_BOOLEAN)
v = LLVMBuildZExt (ctx->builder, v, LLVMInt32Type (), "");
+ else if (t->type == MONO_TYPE_I1 || t->type == MONO_TYPE_I2)
+ v = LLVMBuildSExt (ctx->builder, v, LLVMInt32Type (), "");
else if (t->type == MONO_TYPE_U8)
v = LLVMBuildZExt (ctx->builder, v, LLVMInt64Type (), "");
}
LLVMSetSection (used, "llvm.metadata");
}
+static void
+emit_div_check (EmitContext *ctx, LLVMBuilderRef builder, MonoBasicBlock *bb, MonoInst *ins, LLVMValueRef lhs, LLVMValueRef rhs)
+{
+ gboolean need_div_check = FALSE;
+
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ need_div_check = TRUE;
+#endif
+ if (bb->region)
+ /* LLVM doesn't know that these can throw an exception since they are not called through an intrinsic */
+ need_div_check = TRUE;
+
+ if (!need_div_check)
+ return;
+
+ switch (ins->opcode) {
+ case OP_IDIV:
+ case OP_LDIV:
+ case OP_IREM:
+ case OP_LREM:
+ case OP_IDIV_UN:
+ case OP_LDIV_UN:
+ case OP_IREM_UN:
+ case OP_LREM_UN:
+ case OP_IDIV_IMM:
+ case OP_LDIV_IMM:
+ case OP_IREM_IMM:
+ case OP_LREM_IMM:
+ case OP_IDIV_UN_IMM:
+ case OP_LDIV_UN_IMM:
+ case OP_IREM_UN_IMM:
+ case OP_LREM_UN_IMM: {
+ LLVMValueRef cmp;
+ gboolean is_signed = (ins->opcode == OP_IDIV || ins->opcode == OP_LDIV || ins->opcode == OP_IREM || ins->opcode == OP_LREM ||
+ ins->opcode == OP_IDIV_IMM || ins->opcode == OP_LDIV_IMM || ins->opcode == OP_IREM_IMM || ins->opcode == OP_LREM_IMM);
+
+ cmp = LLVMBuildICmp (builder, LLVMIntEQ, rhs, LLVMConstInt (LLVMTypeOf (rhs), 0, FALSE), "");
+ emit_cond_system_exception (ctx, bb, "DivideByZeroException", cmp);
+ CHECK_FAILURE (ctx);
+ builder = ctx->builder;
+
+ /* b == -1 && a == 0x80000000 */
+ if (is_signed) {
+ LLVMValueRef c = (LLVMTypeOf (lhs) == LLVMInt32Type ()) ? LLVMConstInt (LLVMTypeOf (lhs), 0x80000000, FALSE) : LLVMConstInt (LLVMTypeOf (lhs), 0x8000000000000000LL, FALSE);
+ LLVMValueRef cond1 = LLVMBuildICmp (builder, LLVMIntEQ, rhs, LLVMConstInt (LLVMTypeOf (rhs), -1, FALSE), "");
+ LLVMValueRef cond2 = LLVMBuildICmp (builder, LLVMIntEQ, lhs, c, "");
+
+ cmp = LLVMBuildICmp (builder, LLVMIntEQ, LLVMBuildAnd (builder, cond1, cond2, ""), LLVMConstInt (LLVMInt1Type (), 1, FALSE), "");
+ emit_cond_system_exception (ctx, bb, "OverflowException", cmp);
+ CHECK_FAILURE (ctx);
+ builder = ctx->builder;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ FAILURE:
+ return;
+}
+
/*
* emit_entry_bb:
*
static void
emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
{
- int i, pindex;
+ int i, j, pindex;
MonoCompile *cfg = ctx->cfg;
MonoMethodSignature *sig = ctx->sig;
LLVMCallInfo *linfo = ctx->linfo;
set_metadata_flag (rgctx_alloc, "mono.this");
}
+ /* Compute nesting between clauses */
+ ctx->nested_in = mono_mempool_alloc0 (cfg->mempool, sizeof (GSList*) * cfg->header->num_clauses);
+ for (i = 0; i < cfg->header->num_clauses; ++i) {
+ for (j = 0; j < cfg->header->num_clauses; ++j) {
+ MonoExceptionClause *clause1 = &cfg->header->clauses [i];
+ MonoExceptionClause *clause2 = &cfg->header->clauses [j];
+
+ if (i != j && clause1->try_offset >= clause2->try_offset && clause1->handler_offset <= clause2->handler_offset)
+ ctx->nested_in [i] = g_slist_prepend_mempool (cfg->mempool, ctx->nested_in [i], GINT_TO_POINTER (j));
+ }
+ }
+
/*
* For finally clauses, create an indicator variable telling OP_ENDFINALLY whenever
* it needs to continue normally, or return back to the exception handling system.
*/
for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
- if (bb->region != -1 && (bb->flags & BB_EXCEPTION_HANDLER))
- g_hash_table_insert (ctx->region_to_handler, GUINT_TO_POINTER (mono_get_block_region_notry (cfg, bb->region)), bb);
- if (bb->region != -1 && (bb->flags & BB_EXCEPTION_HANDLER) && bb->in_scount == 0) {
- char name [128];
+ int clause_index;
+ char name [128];
+
+ if (!(bb->region != -1 && (bb->flags & BB_EXCEPTION_HANDLER)))
+ continue;
+
+ clause_index = MONO_REGION_CLAUSE_INDEX (bb->region);
+ g_hash_table_insert (ctx->region_to_handler, GUINT_TO_POINTER (mono_get_block_region_notry (cfg, bb->region)), bb);
+ g_hash_table_insert (ctx->clause_to_handler, GINT_TO_POINTER (clause_index), bb);
+
+ if (bb->in_scount == 0) {
LLVMValueRef val;
sprintf (name, "finally_ind_bb%d", bb->block_num);
LLVMBuildStore (builder, LLVMConstInt (LLVMInt32Type (), 0, FALSE), val);
ctx->bblocks [bb->block_num].finally_ind = val;
-
- /*
- * Create a new bblock which CALL_HANDLER can branch to, because branching to the
- * LLVM bblock containing the call to llvm.eh.selector causes problems for the
- * LLVM optimizer passes.
- */
- sprintf (name, "BB_%d_CALL_HANDLER_TARGET", bb->block_num);
- ctx->bblocks [bb->block_num].call_handler_target_bb = LLVMAppendBasicBlock (ctx->lmethod, name);
+ } else {
+ /* Create a variable to hold the exception var */
+ if (!ctx->ex_var)
+ ctx->ex_var = LLVMBuildAlloca (builder, ObjRefType (), "exvar");
}
+
+ /*
+ * Create a new bblock which CALL_HANDLER/landing pads can branch to, because branching to the
+ * LLVM bblock containing a landing pad causes problems for the
+ * LLVM optimizer passes.
+ */
+ sprintf (name, "BB_%d_CALL_HANDLER_TARGET", bb->block_num);
+ ctx->bblocks [bb->block_num].call_handler_target_bb = LLVMAppendBasicBlock (ctx->lmethod, name);
}
FAILURE:
return;
}
+static void
+emit_handler_start (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef builder)
+{
+ MonoCompile *cfg = ctx->cfg;
+ LLVMValueRef *values = ctx->values;
+ LLVMModuleRef module = ctx->module;
+ BBInfo *bblocks = ctx->bblocks;
+ LLVMTypeRef i8ptr;
+ LLVMValueRef personality;
+ LLVMValueRef landing_pad;
+ LLVMBasicBlockRef target_bb;
+ MonoInst *exvar;
+ static gint32 mapping_inited;
+ static int ti_generator;
+ char ti_name [128];
+ MonoClass **ti;
+ LLVMValueRef type_info;
+ int clause_index;
+ GSList *l;
+
+ // <resultval> = landingpad <somety> personality <type> <pers_fn> <clause>+
+
+ if (cfg->compile_aot) {
+ /* Use a dummy personality function */
+ personality = LLVMGetNamedFunction (module, "mono_aot_personality");
+ g_assert (personality);
+ } else {
+ personality = LLVMGetNamedFunction (module, "mono_personality");
+ if (InterlockedCompareExchange (&mapping_inited, 1, 0) == 0)
+ LLVMAddGlobalMapping (ctx->lmodule->ee, personality, mono_personality);
+ }
+
+ i8ptr = LLVMPointerType (LLVMInt8Type (), 0);
+
+ clause_index = (mono_get_block_region_notry (cfg, bb->region) >> 8) - 1;
+
+ /*
+ * Create the type info
+ */
+ sprintf (ti_name, "type_info_%d", ti_generator);
+ ti_generator ++;
+
+ if (cfg->compile_aot) {
+ /* decode_eh_frame () in aot-runtime.c will decode this */
+ type_info = LLVMAddGlobal (module, LLVMInt32Type (), ti_name);
+ LLVMSetInitializer (type_info, LLVMConstInt (LLVMInt32Type (), clause_index, FALSE));
+
+ /*
+ * These symbols are not really used, the clause_index is embedded into the EH tables generated by DwarfMonoException in LLVM.
+ */
+ LLVMSetLinkage (type_info, LLVMInternalLinkage);
+ } else {
+ /*
+ * After the cfg mempool is freed, the type info will point to stale memory,
+ * but this is not a problem, since we decode it once in exception_cb during
+ * compilation.
+ */
+ ti = mono_mempool_alloc (cfg->mempool, sizeof (gint32));
+ *(gint32*)ti = clause_index;
+
+ type_info = LLVMAddGlobal (module, i8ptr, ti_name);
+
+ LLVMAddGlobalMapping (ctx->lmodule->ee, type_info, ti);
+ }
+
+ {
+ LLVMTypeRef members [2], ret_type;
+
+ members [0] = i8ptr;
+ members [1] = LLVMInt32Type ();
+ ret_type = LLVMStructType (members, 2, FALSE);
+
+ landing_pad = LLVMBuildLandingPad (builder, ret_type, personality, 1, "");
+ LLVMAddClause (landing_pad, type_info);
+
+ /* Store the exception into the exvar */
+ if (ctx->ex_var)
+ LLVMBuildStore (builder, convert (ctx, LLVMBuildExtractValue (builder, landing_pad, 0, "ex_obj"), ObjRefType ()), ctx->ex_var);
+ }
+
+ /*
+ * LLVM throw sites are associated with a one landing pad, and LLVM generated
+ * code expects control to be transferred to this landing pad even in the
+ * presence of nested clauses. The landing pad needs to branch to the landing
+ * pads belonging to nested clauses based on the selector value returned by
+ * the landing pad instruction, which is passed to the landing pad in a
+ * register by the EH code.
+ */
+ target_bb = bblocks [bb->block_num].call_handler_target_bb;
+ g_assert (target_bb);
+
+ /*
+ * Branch to the correct landing pad
+ */
+ LLVMValueRef ex_selector = LLVMBuildExtractValue (builder, landing_pad, 1, "ex_selector");
+ LLVMValueRef switch_ins = LLVMBuildSwitch (builder, ex_selector, target_bb, 0);
+
+ for (l = ctx->nested_in [clause_index]; l; l = l->next) {
+ int nesting_clause_index = GPOINTER_TO_INT (l->data);
+ MonoBasicBlock *handler_bb;
+
+ handler_bb = g_hash_table_lookup (ctx->clause_to_handler, GINT_TO_POINTER (nesting_clause_index));
+ g_assert (handler_bb);
+
+ g_assert (ctx->bblocks [handler_bb->block_num].call_handler_target_bb);
+ LLVMAddCase (switch_ins, LLVMConstInt (LLVMInt32Type (), nesting_clause_index, FALSE), ctx->bblocks [handler_bb->block_num].call_handler_target_bb);
+ }
+
+ /* 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->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];
+
+ // 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);
+ }
+ }
+}
+
static void
process_bb (EmitContext *ctx, MonoBasicBlock *bb)
{
CHECK_FAILURE (ctx);
if (bb->flags & BB_EXCEPTION_HANDLER) {
- LLVMTypeRef i8ptr;
- LLVMValueRef personality;
- LLVMBasicBlockRef target_bb;
- MonoInst *exvar;
- static gint32 mapping_inited;
- static int ti_generator;
- char ti_name [128];
- MonoClass **ti;
- LLVMValueRef type_info;
- int clause_index;
-
if (!bblocks [bb->block_num].invoke_target) {
/*
* LLVM asserts if llvm.eh.selector is called from a bblock which
LLVM_FAILURE (ctx, "handler without invokes");
}
- // <resultval> = landingpad <somety> personality <type> <pers_fn> <clause>+
-
- if (cfg->compile_aot) {
- /* Use a dummy personality function */
- personality = LLVMGetNamedFunction (module, "mono_aot_personality");
- g_assert (personality);
- } else {
- personality = LLVMGetNamedFunction (module, "mono_personality");
- if (InterlockedCompareExchange (&mapping_inited, 1, 0) == 0)
- LLVMAddGlobalMapping (ctx->lmodule->ee, personality, mono_personality);
- }
-
- i8ptr = LLVMPointerType (LLVMInt8Type (), 0);
-
- clause_index = (mono_get_block_region_notry (cfg, bb->region) >> 8) - 1;
-
- /*
- * Create the type info
- */
- sprintf (ti_name, "type_info_%d", ti_generator);
- ti_generator ++;
-
- if (cfg->compile_aot) {
- /* decode_eh_frame () in aot-runtime.c will decode this */
- type_info = LLVMAddGlobal (module, LLVMInt32Type (), ti_name);
- LLVMSetInitializer (type_info, LLVMConstInt (LLVMInt32Type (), clause_index, FALSE));
-
- /*
- * These symbols are not really used, the clause_index is embedded into the EH tables generated by DwarfMonoException in LLVM.
- */
- LLVMSetLinkage (type_info, LLVMInternalLinkage);
-
- /*
- * Enabling this causes llc to crash:
- * http://llvm.org/bugs/show_bug.cgi?id=6102
- */
- //LLVM_FAILURE (ctx, "aot+clauses");
-#ifdef TARGET_ARM
- // test_0_invalid_unbox_arrays () fails
- LLVM_FAILURE (ctx, "aot+clauses");
-#endif
- } else {
- /*
- * After the cfg mempool is freed, the type info will point to stale memory,
- * but this is not a problem, since we decode it once in exception_cb during
- * compilation.
- */
- ti = mono_mempool_alloc (cfg->mempool, sizeof (gint32));
- *(gint32*)ti = clause_index;
-
- type_info = LLVMAddGlobal (module, i8ptr, ti_name);
-
- LLVMAddGlobalMapping (ctx->lmodule->ee, type_info, ti);
- }
-
- {
- LLVMTypeRef members [2], ret_type;
- LLVMValueRef landing_pad;
-
- members [0] = i8ptr;
- members [1] = LLVMInt32Type ();
- ret_type = LLVMStructType (members, 2, FALSE);
-
- landing_pad = LLVMBuildLandingPad (builder, ret_type, personality, 1, "");
- LLVMAddClause (landing_pad, type_info);
-
- /* Store the exception into the 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]);
-
- values [exvar->dreg] = LLVMBuildExtractValue (builder, landing_pad, 0, "ex_obj");
- emit_volatile_store (ctx, exvar->dreg);
- }
- }
-
- /* Start a new bblock which CALL_HANDLER can branch to */
- target_bb = bblocks [bb->block_num].call_handler_target_bb;
- if (target_bb) {
- LLVMBuildBr (builder, target_bb);
-
- ctx->builder = builder = create_builder (ctx);
- LLVMPositionBuilderAtEnd (ctx->builder, target_bb);
-
- ctx->bblocks [bb->block_num].end_bblock = target_bb;
- }
+ emit_handler_start (ctx, bb, builder);
+ CHECK_FAILURE (ctx);
+ builder = ctx->builder;
}
has_terminator = FALSE;
lhs = convert (ctx, lhs, regtype_to_llvm_type (spec [MONO_INST_DEST]));
rhs = convert (ctx, rhs, regtype_to_llvm_type (spec [MONO_INST_DEST]));
-#ifdef MONO_ARCH_NEED_DIV_CHECK
- switch (ins->opcode) {
- case OP_IDIV:
- case OP_LDIV:
- case OP_IREM:
- case OP_LREM:
- case OP_IDIV_UN:
- case OP_LDIV_UN:
- case OP_IREM_UN:
- case OP_LREM_UN: {
- LLVMValueRef cmp;
-
- cmp = LLVMBuildICmp (builder, LLVMIntEQ, rhs, LLVMConstInt (LLVMTypeOf (rhs), 0, FALSE), "");
- emit_cond_system_exception (ctx, bb, "DivideByZeroException", cmp);
- CHECK_FAILURE (ctx);
- builder = ctx->builder;
- break;
- }
- default:
- break;
- }
-#endif
+ emit_div_check (ctx, builder, bb, ins, lhs, rhs);
+ CHECK_FAILURE (ctx);
+ builder = ctx->builder;
switch (ins->opcode) {
case OP_IADD:
imm = LLVMConstInt (LLVMInt32Type (), ins->inst_imm, FALSE);
}
+ emit_div_check (ctx, builder, bb, ins, lhs, imm);
+ CHECK_FAILURE (ctx);
+ builder = ctx->builder;
+
#if SIZEOF_VOID_P == 4
if (ins->opcode == OP_LSHL_IMM || ins->opcode == OP_LSHR_IMM || ins->opcode == OP_LSHR_UN_IMM)
imm = LLVMConstInt (LLVMInt32Type (), ins->inst_imm, FALSE);
void
mono_llvm_check_method_supported (MonoCompile *cfg)
{
- MonoMethodHeader *header = cfg->header;
- MonoExceptionClause *clause;
- int i;
+ int i, j;
if (cfg->method->save_lmf) {
cfg->exception_message = g_strdup ("lmf");
if (cfg->disable_llvm)
return;
-#if 1
- for (i = 0; i < header->num_clauses; ++i) {
- clause = &header->clauses [i];
-
- if (i > 0 && clause->try_offset <= header->clauses [i - 1].handler_offset + header->clauses [i - 1].handler_len) {
- /*
- * FIXME: Some tests still fail with nested clauses.
- */
- cfg->exception_message = g_strdup ("nested clauses");
- cfg->disable_llvm = TRUE;
- break;
+ /*
+ * Nested clauses where one of the clauses is a finally clause is
+ * not supported, because LLVM can't figure out the control flow,
+ * probably because we resume exception handling by calling our
+ * own function instead of using the 'resume' llvm instruction.
+ */
+ for (i = 0; i < cfg->header->num_clauses; ++i) {
+ for (j = 0; j < cfg->header->num_clauses; ++j) {
+ MonoExceptionClause *clause1 = &cfg->header->clauses [i];
+ MonoExceptionClause *clause2 = &cfg->header->clauses [j];
+
+ if (i != j && clause1->try_offset >= clause2->try_offset && clause1->handler_offset <= clause2->handler_offset &&
+ (clause1->flags == MONO_EXCEPTION_CLAUSE_FINALLY || clause2->flags == MONO_EXCEPTION_CLAUSE_FINALLY)) {
+ cfg->exception_message = g_strdup ("nested clauses");
+ cfg->disable_llvm = TRUE;
+ break;
+ }
}
}
if (cfg->disable_llvm)
return;
-#endif
/* FIXME: */
if (cfg->method->dynamic) {
ctx->values = values;
ctx->region_to_handler = g_hash_table_new (NULL, NULL);
+ ctx->clause_to_handler = g_hash_table_new (NULL, NULL);
if (cfg->compile_aot) {
ctx->lmodule = &aot_module;
g_ptr_array_free (phi_values, TRUE);
g_free (ctx->bblocks);
g_hash_table_destroy (ctx->region_to_handler);
+ g_hash_table_destroy (ctx->clause_to_handler);
g_free (method_name);
g_ptr_array_free (bblock_list, TRUE);
cfg->llvm_ex_info [i].flags = clause->flags;
cfg->llvm_ex_info [i].data.catch_class = clause->data.catch_class;
+ cfg->llvm_ex_info [i].clause_index = clause_index;
}
/*
* For nested clauses, the LLVM produced exception info associates the try interval with
* the innermost handler, while mono expects it to be associated with all nesting clauses.
+ * So add new clauses which use the IL info (catch class etc.) from the nesting clause,
+ * and everything else from the nested clause.
*/
- /* FIXME: These should be order with the normal clauses */
nindex = ei_len;
for (i = 0; i < ei_len; ++i) {
for (j = 0; j < ei_len; ++j) {
MonoExceptionClause *clause2 = &cfg->header->clauses [cindex2];
if (cindex1 != cindex2 && clause1->try_offset >= clause2->try_offset && clause1->handler_offset <= clause2->handler_offset) {
- /*
- * The try interval comes from the nested clause, everything else from the
- * nesting clause.
- */
memcpy (&cfg->llvm_ex_info [nindex], &cfg->llvm_ex_info [j], sizeof (MonoJitExceptionInfo));
cfg->llvm_ex_info [nindex].try_start = cfg->llvm_ex_info [i].try_start;
cfg->llvm_ex_info [nindex].try_end = cfg->llvm_ex_info [i].try_end;
+ cfg->llvm_ex_info [nindex].handler_start = cfg->llvm_ex_info [i].handler_start;
+ cfg->llvm_ex_info [nindex].exvar_offset = cfg->llvm_ex_info [i].exvar_offset;
nindex ++;
}
}
//memcpy (info->locals_types, oinfo->locals_types, info->nlocals * sizeof (MonoType*));
break;
}
+ case MONO_PATCH_INFO_VIRT_METHOD: {
+ MonoJumpInfoVirtMethod *info;
+ MonoJumpInfoVirtMethod *oinfo;
+
+ oinfo = patch_info->data.virt_method;
+ info = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoVirtMethod));
+ res->data.virt_method = info;
+ memcpy (info, oinfo, sizeof (MonoJumpInfoVirtMethod));
+ break;
+ }
default:
break;
}
return (ji->type << 8) | (gsize)ji->data.del_tramp->klass | (gsize)ji->data.del_tramp->method | (gsize)ji->data.del_tramp->virtual;
case MONO_PATCH_INFO_LDSTR_LIT:
return g_str_hash (ji->data.target);
+ case MONO_PATCH_INFO_VIRT_METHOD: {
+ MonoJumpInfoVirtMethod *info = ji->data.virt_method;
+
+ return (ji->type << 8) | (gssize)info->klass | (gssize)info->method;
+ }
default:
printf ("info type: %d\n", ji->type);
mono_print_ji (ji); printf ("\n");
return ji1->data.del_tramp->klass == ji2->data.del_tramp->klass && ji1->data.del_tramp->method == ji2->data.del_tramp->method && ji1->data.del_tramp->virtual == ji2->data.del_tramp->virtual;
case MONO_PATCH_INFO_CASTCLASS_CACHE:
return ji1->data.index == ji2->data.index;
+ case MONO_PATCH_INFO_VIRT_METHOD:
+ return ji1->data.virt_method->klass == ji2->data.virt_method->klass && ji1->data.virt_method->method == ji2->data.virt_method->method;
default:
if (ji1->data.target != ji2->data.target)
return 0;
slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, info, entry->info_type, mono_method_get_context (entry->method));
break;
}
+ case MONO_PATCH_INFO_VIRT_METHOD: {
+ MonoJumpInfoVirtMethod *info;
+ MonoJumpInfoVirtMethod *oinfo = entry->data->data.virt_method;
+
+ info = g_malloc0 (sizeof (MonoJumpInfoVirtMethod));
+ memcpy (info, oinfo, sizeof (MonoJumpInfoVirtMethod));
+ slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, info, entry->info_type, mono_method_get_context (entry->method));
+ break;
+ }
default:
g_assert_not_reached ();
break;
else if (!strcmp (arg, "explicit-null-checks"))
debug_options.explicit_null_checks = TRUE;
else if (!strcmp (arg, "gen-seq-points"))
- debug_options.gen_seq_points_debug_data = TRUE;
+ debug_options.gen_sdb_seq_points = TRUE;
else if (!strcmp (arg, "gen-compact-seq-points"))
debug_options.gen_seq_points_compact_data = TRUE;
else if (!strcmp (arg, "init-stacks"))
mono_unwind_init ();
+#ifdef XDEBUG_ENABLED
if (g_getenv ("MONO_XDEBUG")) {
const char *xdebug_opts = g_getenv ("MONO_XDEBUG");
mono_xdebug_init (xdebug_opts);
mono_dont_free_domains = TRUE;
mono_using_xdebug = TRUE;
}
+#endif
#ifdef ENABLE_LLVM
if (mono_use_llvm) {
return nullified_class_init_trampoline;
}
+
+/*
+ * mini_get_single_step_trampoline:
+ *
+ * Return a trampoline which calls debugger_agent_single_step_from_context ().
+ */
+gpointer
+mini_get_single_step_trampoline (void)
+{
+ static gpointer trampoline;
+
+ if (!trampoline) {
+ gpointer tramp;
+
+ if (mono_aot_only) {
+ tramp = mono_aot_get_trampoline ("sdb_single_step_trampoline");
+ } else {
+#ifdef MONO_ARCH_HAVE_SDB_TRAMPOLINES
+ MonoTrampInfo *info;
+ tramp = mono_arch_create_sdb_trampoline (TRUE, &info, FALSE);
+ mono_tramp_info_register (info);
+#else
+ tramp = NULL;
+ g_assert_not_reached ();
+#endif
+ }
+ mono_memory_barrier ();
+ trampoline = tramp;
+ }
+
+ return trampoline;
+}
+
+/*
+ * mini_get_breakpoint_trampoline:
+ *
+ * Return a trampoline which calls debugger_agent_breakpoint_from_context ().
+ */
+gpointer
+mini_get_breakpoint_trampoline (void)
+{
+ static gpointer trampoline;
+
+ if (!trampoline) {
+ gpointer tramp;
+
+ if (mono_aot_only) {
+ tramp = mono_aot_get_trampoline ("sdb_breakpoint_trampoline");
+ } else {
+#ifdef MONO_ARCH_HAVE_SDB_TRAMPOLINES
+ MonoTrampInfo *info;
+ tramp = mono_arch_create_sdb_trampoline (FALSE, &info, FALSE);
+ mono_tramp_info_register (info);
+#else
+ tramp = NULL;
+ g_assert_not_reached ();
+#endif
+ }
+ mono_memory_barrier ();
+ trampoline = tramp;
+ }
+
+ return trampoline;
+}
if (cfg->opt & MONO_OPT_PEEPHOLE)
mono_arch_peephole_pass_2 (cfg, bb);
- if (cfg->gen_seq_points && !cfg->gen_seq_points_debug_data)
+ if (cfg->gen_seq_points && !cfg->gen_sdb_seq_points)
bb_deduplicate_op_il_seq_points (cfg, bb);
}
#endif
/* Allocate the code into a separate memory pool so it can be freed */
cfg->dynamic_info = g_new0 (MonoJitDynamicMethodInfo, 1);
- cfg->dynamic_info->code_mp = mono_code_manager_new_dynamic ();
+ cfg->dynamic_info->code_mp = mono_code_manager_new_dynamic (cfg->thunk_area);
mono_domain_lock (cfg->domain);
mono_dynamic_code_hash_insert (cfg->domain, cfg->method, cfg->dynamic_info);
mono_domain_unlock (cfg->domain);
cfg->full_aot = full_aot;
cfg->skip_visibility = method->skip_visibility;
cfg->orig_method = method;
- cfg->gen_seq_points = debug_options.gen_seq_points_compact_data || debug_options.gen_seq_points_debug_data;
- cfg->gen_seq_points_debug_data = debug_options.gen_seq_points_debug_data;
+ cfg->gen_seq_points = debug_options.gen_seq_points_compact_data || debug_options.gen_sdb_seq_points;
+ cfg->gen_sdb_seq_points = debug_options.gen_sdb_seq_points;
+
+#ifdef PLATFORM_ANDROID
+ if (cfg->method->wrapper_type != MONO_WRAPPER_NONE) {
+ /* FIXME: Why is this needed */
+ cfg->gen_seq_points = FALSE;
+ cfg->gen_sdb_seq_points = FALSE;
+ }
+#endif
cfg->explicit_null_checks = debug_options.explicit_null_checks;
cfg->soft_breakpoints = debug_options.soft_breakpoints;
#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 110
+#define MONO_AOT_FILE_VERSION 112
//TODO: This is x86/amd64 specific.
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
/* The address of Nullable<T>.Box () */
MONO_RGCTX_INFO_NULLABLE_CLASS_BOX,
MONO_RGCTX_INFO_NULLABLE_CLASS_UNBOX,
+ /* MONO_PATCH_INFO_VCALL_METHOD */
+ MONO_RGCTX_INFO_VIRT_METHOD_CODE,
+ /*
+ * MONO_PATCH_INFO_VCALL_METHOD
+ * Same as MONO_RGCTX_INFO_CLASS_BOX_TYPE, but for the class
+ * which implements the method.
+ */
+ MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE
} MonoRgctxInfoType;
typedef struct _MonoRuntimeGenericContextInfoTemplate {
typedef struct MonoJumpInfoGSharedVtCall MonoJumpInfoGSharedVtCall;
+/*
+ * Represents the method which is called when a virtual call is made to METHOD
+ * on a receiver of type KLASS.
+ */
+typedef struct {
+ /* Receiver class */
+ MonoClass *klass;
+ /* Virtual method */
+ MonoMethod *method;
+} MonoJumpInfoVirtMethod;
+
typedef struct MonoJumpInfo MonoJumpInfo;
struct MonoJumpInfo {
MonoJumpInfo *next;
MonoGSharedVtMethodInfo *gsharedvt_method;
MonoMethodSignature *sig;
MonoDelegateClassMethodPair *del_tramp;
+ /* MONO_PATCH_INFO_VIRT_METHOD */
+ MonoJumpInfoVirtMethod *virt_method;
} data;
};
-/* Contains information describing an rgctx entry */
+/*
+ * Contains information for computing the
+ * property given by INFO_TYPE of the runtime
+ * object described by DATA.
+ */
struct MonoJumpInfoRgctxEntry {
MonoMethod *method;
gboolean in_mrgctx;
guint keep_cil_nops : 1;
guint gen_seq_points : 1;
/* Generate seq points for use by the debugger */
- guint gen_seq_points_debug_data : 1;
+ guint gen_sdb_seq_points : 1;
guint explicit_null_checks : 1;
guint compute_gc_maps : 1;
guint soft_breakpoints : 1;
GHashTable *token_info_hash;
MonoCompileArch arch;
guint32 inline_depth;
+ /* Size of memory reserved for thunks */
+ int thunk_area;
guint32 exception_type; /* MONO_EXCEPTION_* */
guint32 exception_data;
char* exception_message;
* Whenever data such as next sequence points and flags is required.
* Next sequence points and flags are required by the debugger agent.
*/
- gboolean gen_seq_points_debug_data;
+ gboolean gen_sdb_seq_points;
gboolean gen_seq_points_compact_data;
gboolean explicit_null_checks;
/*
void mono_aot_handle_pagefault (void *ptr);
void mono_aot_register_jit_icall (const char *name, gpointer addr);
void* mono_aot_readonly_field_override (MonoClassField *field);
+guint32 mono_aot_find_method_index (MonoMethod *method);
/* This is an exported function */
MONO_API void mono_aot_register_globals (gpointer *globals);
char* mono_get_generic_trampoline_name (MonoTrampolineType tramp_type);
char* mono_get_rgctx_fetch_trampoline_name (int slot);
gpointer mini_get_nullified_class_init_trampoline (void);
+gpointer mini_get_single_step_trampoline (void);
+gpointer mini_get_breakpoint_trampoline (void);
gpointer mini_add_method_trampoline (MonoMethod *orig_method, MonoMethod *m, gpointer compiled_method, gboolean add_static_rgctx_tramp, gboolean add_unbox_tramp);
gboolean mini_jit_info_is_gsharedvt (MonoJitInfo *ji);
gpointer mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboolean aot);
gpointer mono_arch_create_generic_class_init_trampoline (MonoTrampInfo **info, gboolean aot);
gpointer mono_arch_get_nullified_class_init_trampoline (MonoTrampInfo **info);
+guint8* mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gboolean aot);
gpointer mono_arch_create_monitor_enter_trampoline (MonoTrampInfo **info, gboolean is_v4, gboolean aot);
gpointer mono_arch_create_monitor_exit_trampoline (MonoTrampInfo **info, gboolean aot);
guint8 *mono_arch_create_llvm_native_thunk (MonoDomain *domain, guint8* addr) MONO_LLVM_INTERNAL;
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;
+#ifdef __linux__
+#define XDEBUG_ENABLED 1
+#endif
+
#ifdef __linux__
/* maybe enable also for other systems? */
#define ENABLE_JIT_MAP 1
+++ /dev/null
-;; -*- Prcs -*-
-(Created-By-Prcs-Version 1 3 2)
-(Project-Description "The mono SSA-based JIT.")
-(Project-Version mini 0 3)
-(Parent-Version mini 0 2)
-(Version-Log "")
-(New-Version-Log "")
-(Checkin-Time "Sat, 21 Sep 2002 12:11:29 +0200")
-(Checkin-Login lupus)
-(Populate-Ignore ())
-(Project-Keywords)
-(Files
-;; This is a comment. Fill in files here.
-;; For example: (prcs/checkout.cc ())
-
-;; Files added by populate at Sat, 08 Jun 2002 17:27:56 +0200,
-;; to version 0.0(w), by lupus:
-
- (regalloc.c (mini/0_regalloc.c 1.1 664))
- (cfold.c (mini/1_cfold.c 1.1 664))
- (mini-x86.c (mini/2_mini-x86.c 1.2 664))
- (mini.h (mini/3_mini.h 1.3 664))
- (makefile (mini/4_makefile 1.3 664))
- (test.cs (mini/5_test.cs 1.1 664))
- (mini.c (mini/6_mini.c 1.3 664))
-)
-(Merge-Parents)
-(New-Merge-Parents)
PATCH_INFO(METHOD_CODE_SLOT, "method_code_slot")
PATCH_INFO(LDSTR_LIT, "ldstr_lit")
PATCH_INFO(GC_NURSERY_START, "gc_nursery_start")
+PATCH_INFO(VIRT_METHOD, "virt_method")
PATCH_INFO(NONE, "none")
GSList **next = NULL;
SeqPoint* seq_points;
GByteArray* array;
- gboolean has_debug_data = cfg->gen_seq_points_debug_data;
+ gboolean has_debug_data = cfg->gen_sdb_seq_points;
if (!cfg->seq_points)
return;
without a OP_LDADDR.
*/
-#ifdef MONO_ARCH_SIMD_INTRINSICS
+#if defined (MONO_ARCH_SIMD_INTRINSICS)
+
+#if defined (DISABLE_JIT)
+
+void
+mono_simd_intrinsics_init (void)
+{
+}
+
+#else
//#define IS_DEBUG_ON(cfg) (0)
return NULL;
}
-#endif
+#endif /* DISABLE_JIT */
+#endif /* MONO_ARCH_SIMD_INTRINSICS */
#include "mini.h"
#include "mini-amd64.h"
+#include "debugger-agent.h"
#if defined(__native_client_codegen__) && defined(__native_client__)
#include <malloc.h>
#include <nacl/nacl_dyncode.h>
#endif
+#define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1))
+
#define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f))
/*
gboolean disp_32bit = ((((gint64)addr - (gint64)orig_code)) < (1 << 30)) && ((((gint64)addr - (gint64)orig_code)) > -(1 << 30));
if ((((guint64)(addr)) >> 32) != 0 && !disp_32bit) {
-#ifdef MONO_ARCH_NOMAP32BIT
- /* Print some diagnostics */
- MonoJitInfo *ji = mono_jit_info_table_find (mono_domain_get (), (char*)orig_code);
- if (ji)
- fprintf (stderr, "At %s, offset 0x%zx\n", mono_method_full_name (jinfo_get_method (ji), TRUE), (guint8*)orig_code - (guint8*)ji->code_start);
- fprintf (stderr, "Addr: %p\n", addr);
- ji = mono_jit_info_table_find (mono_domain_get (), (char*)addr);
- if (ji)
- fprintf (stderr, "Callee: %s\n", mono_method_full_name (jinfo_get_method (ji), TRUE));
- g_assert_not_reached ();
-#else
/*
- * This might happen when calling AOTed code. Create a thunk.
+ * This might happen with LLVM or when calling AOTed code. Create a thunk.
*/
guint8 *thunk_start, *thunk_code;
g_assert ((((guint64)(addr)) >> 32) == 0);
mono_arch_flush_icache (thunk_start, thunk_code - thunk_start);
mono_profiler_code_buffer_new (thunk_start, thunk_code - thunk_start, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
-#endif
}
if (can_write) {
InterlockedExchange ((gint32*)(orig_code - 4), ((gint64)addr - (gint64)orig_code));
status_offset = MONO_THREADS_SYNC_MEMBER_OFFSET (status_offset);
nest_offset = MONO_THREADS_SYNC_MEMBER_OFFSET (nest_offset);
- tramp_size = 96;
+ tramp_size = 128;
code = buf = mono_global_codeman_reserve (tramp_size);
return *(guint32*)(plt_entry + 6);
#endif
}
+
+/*
+ * mono_arch_create_sdb_trampoline:
+ *
+ * Return a trampoline which captures the current context, passes it to
+ * debugger_agent_single_step_from_context ()/debugger_agent_breakpoint_from_context (),
+ * then restores the (potentially changed) context.
+ */
+guint8*
+mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gboolean aot)
+{
+ int tramp_size = 256;
+ int framesize, ctx_offset, cfa_offset;
+ guint8 *code, *buf;
+ GSList *unwind_ops = NULL;
+ MonoJumpInfo *ji = NULL;
+
+ code = buf = mono_global_codeman_reserve (tramp_size);
+
+ framesize = sizeof (MonoContext);
+ framesize = ALIGN_TO (framesize, MONO_ARCH_FRAME_ALIGNMENT);
+
+ // CFA = sp + 8
+ cfa_offset = 8;
+ mono_add_unwind_op_def_cfa (unwind_ops, code, buf, AMD64_RSP, 8);
+ // IP saved at CFA - 8
+ mono_add_unwind_op_offset (unwind_ops, code, buf, AMD64_RIP, -cfa_offset);
+
+ amd64_push_reg (code, AMD64_RBP);
+ cfa_offset += sizeof(mgreg_t);
+ mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, cfa_offset);
+ mono_add_unwind_op_offset (unwind_ops, code, buf, AMD64_RBP, - cfa_offset);
+
+ amd64_mov_reg_reg (code, AMD64_RBP, AMD64_RSP, sizeof(mgreg_t));
+ mono_add_unwind_op_def_cfa_reg (unwind_ops, code, buf, AMD64_RBP);
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, framesize);
+
+ ctx_offset = 0;
+
+ /* Initialize a MonoContext structure on the stack */
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rax), AMD64_RAX, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rbx), AMD64_RBX, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rcx), AMD64_RCX, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rdx), AMD64_RDX, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rsi), AMD64_RSI, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rdi), AMD64_RDI, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r8), AMD64_R8, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r9), AMD64_R9, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r10), AMD64_R10, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r11), AMD64_R11, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r12), AMD64_R12, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r13), AMD64_R13, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r14), AMD64_R14, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r15), AMD64_R15, sizeof (mgreg_t));
+
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, 0, sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rbp), AMD64_R11, sizeof (mgreg_t));
+ amd64_lea_membase (code, AMD64_R11, AMD64_RBP, 2 * sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rsp), AMD64_R11, sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, sizeof (mgreg_t), sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rip), AMD64_R11, sizeof (mgreg_t));
+
+ /* Call the single step/breakpoint function in sdb */
+ amd64_lea_membase (code, AMD64_ARG_REG1, AMD64_RSP, ctx_offset);
+
+ if (aot) {
+ if (single_step)
+ code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "debugger_agent_single_step_from_context");
+ else
+ code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "debugger_agent_breakpoint_from_context");
+ amd64_call_reg (code, AMD64_R11);
+ } else {
+ if (single_step)
+ amd64_call_code (code, debugger_agent_single_step_from_context);
+ else
+ amd64_call_code (code, debugger_agent_breakpoint_from_context);
+ }
+
+ /* Restore registers from ctx */
+ amd64_mov_reg_membase (code, AMD64_RAX, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rax), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_RBX, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rbx), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_RCX, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rcx), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_RDX, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rdx), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_RSI, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rsi), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_RDI, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rdi), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_R8, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r8), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_R9, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r9), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_R10, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r10), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r11), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_R12, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r12), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_R13, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r13), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_R14, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r14), sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_R15, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, r15), sizeof (mgreg_t));
+
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rbp), sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RBP, 0, AMD64_R11, sizeof (mgreg_t));
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RSP, ctx_offset + MONO_STRUCT_OFFSET (MonoContext, rip), sizeof (mgreg_t));
+ amd64_mov_membase_reg (code, AMD64_RBP, sizeof (mgreg_t), AMD64_R11, sizeof (mgreg_t));
+
+ amd64_leave (code);
+ amd64_ret (code);
+
+ mono_arch_flush_icache (code, code - buf);
+ g_assert (code - buf <= tramp_size);
+
+ if (info) {
+ const char *tramp_name = single_step ? "sdb_single_step_trampoline" : "sdb_breakpoint_trampoline";
+ *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+ }
+
+ return buf;
+}
72, 73, 74, 75, 76, 77, 78, 79,
};
#elif defined (TARGET_X86)
-#ifdef __APPLE__
/*
- * LLVM seems to generate unwind info where esp is encoded as 5, and ebp as 4, ie see this line:
- * def ESP : RegisterWithSubRegs<"esp", [SP]>, DwarfRegNum<[-2, 5, 4]>;
- * in lib/Target/X86/X86RegisterInfo.td in the llvm sources.
+ * ebp and esp are swapped:
+ * http://lists.cs.uiuc.edu/pipermail/lldb-dev/2014-January/003101.html
*/
static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 5, 4, 6, 7, 8 };
-#else
-static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
-#endif
/* + 1 is for IP */
#define NUM_REGS X86_NREG + 1
#define DWARF_DATA_ALIGN (-4)
* http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
*/
+ /* This is generated by JITDwarfEmitter::EmitEHFrame () */
+
*type_info = NULL;
*this_reg = -1;
*this_offset = -1;
res->this_reg = -1;
res->this_offset = -1;
- /* fde points to data emitted by LLVM in DwarfException::EmitMonoEHFrame () */
+ /* fde points to data emitted by LLVM in DwarfMonoException::EmitMonoEHFrame () */
p = fde;
has_aug = *p;
p ++;
vtune_lib = libmono-profiler-vtune.la
endif
-lib_LTLIBRARIES = libmono-profiler-cov.la libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la $(vtune_lib)
+lib_LTLIBRARIES = libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la $(vtune_lib)
if PLATFORM_DARWIN
libmono_profiler_log_la_LDFLAGS = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
-libmono_profiler_cov_la_LDFLAGS = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
endif
if PLATFORM_ANDROID
libmono_profiler_log_la_LDFLAGS = -avoid-version
LIBMONO=$(top_builddir)/mono/mini/libmonosgen-$(API_VER).la
endif
-libmono_profiler_cov_la_SOURCES = mono-cov.c
-libmono_profiler_cov_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
libmono_profiler_aot_la_SOURCES = mono-profiler-aot.c
libmono_profiler_aot_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
-#libmono_profiler_logging_la_SOURCES = mono-profiler-logging.c
-#libmono_profiler_logging_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
libmono_profiler_iomap_la_SOURCES = mono-profiler-iomap.c
libmono_profiler_iomap_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
libmono_profiler_log_la_SOURCES = proflog.c
check-local: testlog
endif
-EXTRA_DIST=utils.c utils.h proflog.h log-profiler.txt perf_event.h \
+EXTRA_DIST=utils.c utils.h proflog.h perf_event.h \
$(PLOG_TESTS_SRC) ptestrunner.pl
return "monitor/lock";
case MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE:
return "delegate invoke";
+ case MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING:
+ return "exception handling";
default:
return "unspecified";
}
+++ /dev/null
-# The Mono log profiler
-
-The Mono *log* profiler can be used to collect a lot of information about
-a program running in the Mono runtime. This data can be used (both while the process
-is running and later) to do analyses of the program behaviour, determine
-resource usage, performance issues or even look for particular execution patterns.
-
-This is accomplished by logging the events provided by the Mono runtime through the
-profiling interface and periodically writing them to a file which can be later
-inspected with the command line *mprof-report* program or with a GUI (not developed yet).
-
-The events collected include (among others):
-
-* method enter and leave
-* object allocation
-* garbage collection
-* JIT compilation
-* metadata loading
-* lock contention
-* exceptions
-
-In addition, the profiler can periodically collect info about all the objects
-present in the heap at the end of a garbage collection (this is called heap shot
-and currently implemented only for the sgen garbage collector).
-Another available profiler mode is the *sampling* or *statistical* mode:
-periodically the program is sampled and the information about what the program was
-busy with is saved. This allows to get information about the program behaviour
-without degrading its performance too much (usually less than 10%).
-
-## Basic profiler usage
-
-The simpler way to use the profiler is the following:
-
-`mono --profile=log program.exe`
-
-At the end of the execution the file *output.mlpd* will be found in the current
-directory. A summary report of the data can be printed by running:
-
-`mprof-report output.mlpd`
-
-With this invocation a huge amount of data is collected about the program execution
-and collecting and saving this data can significantly slow down program execution.
-If saving the profiling data is not needed, a report can be generated directly with:
-
-`mono --profile=log:report program.exe`
-
-If the information about allocations is not of interest, it can be excluded:
-
-`mono --profile=log:noalloc program.exe`
-
-On the other hand, if method call timing is not important, while allocations are,
-the needed info can be gathered with:
-
-`mono --profile=log:nocalls program.exe`
-
-You will still be able to inspect information about the sequence of calls that lead
-to each allocation because at each object allocation a stack trace is collected if
-full enter/leave information is not available.
-
-To periodically collect heap shots (and exclude method and allocation events) use the
-following options (making sure you run with the sgen garbage collector):
-
-`mono --gc=sgen --profile=log:heapshot program.exe`
-
-To perform a sampling profiler run, use the *sample* option:
-
-`mono --profile=log:sample program.exe`
-
-## Profiler option documentation
-
-By default the *log* profiler will gather all the events provided by the Mono runtime
-and write them to a file named *output.mlpd*. When no option is specified, it
-is equivalent to using:
-
-`--profile=log:calls,alloc,output=output.mlpd,maxframes=8,calldepth=100`
-
-The following options can be used to modify this default behaviour. Each option
-is separated from the next by a `,` character, with no spaces and all the options
-are included after the *log:* profile module specifier.
-
-* *help*: display concise help info about each available option
-
-* *[no]alloc*: *noalloc* disables collecting object allocation info, *alloc* enables
-it if it was disabled by another option like *heapshot*.
-
-* *[no]calls*: *nocalls* disables collecting method enter and leave events. When this
-option is used at each object allocation and at some other events (like lock contentions
-and exception throws) a stack trace is collected by default. See the *maxframes* option to
-control this behaviour. *calls* enables method enter/leave events if they were disabled
-by another option like *heapshot*.
-
-* *heapshot[=MODE]*: collect heap shot data at each major collection. The frequency of the
-heap shots can be changed with the *MODE* parameter. When this option is used
-allocation events and method enter/leave events are not recorded by default: if they
-are needed, they need to be enabled explicitly.
-The optional parameter *MODE* can modify the default heap shot frequency.
-heapshot can be used multiple times with different modes: in that case a heap shot is
-taken if either of the conditions are met.
-MODE can be one of:
- * *NUM*ms: perform a heap shot if at least *NUM* milliseconds passed since
- the last one.
- * *NUM*gc: perform a heap shot every *NUM* major garbage collections
- * *ondemand*: perform a heap shot when such a command is sent to the
- control port
-
-* *sample[=TYPE[/FREQ]]*: collect statistical samples of the program behaviour. The
-default is to collect a 1000 times per second the instruction pointer. This is
-equivalent to the value "cycles/1000" for *TYPE*. On some systems, like with recent
-Linux kernels, it is possible to cause the sampling to happen for other events
-provided by the performance counters of the cpu. In this case, *TYPE* can be one of:
- * *cycles*: processor cycles
- * *instr*: executed instructions
- * *cacherefs*: cache references
- * *cachemiss*: cache misses
- * *branches*: executed branches
- * *branchmiss*: mispredicted branches
-
-* *time=TIMER*: use the TIMER timestamp mode. TIMER can have the following values:
- * *fast*: a usually faster but possibly more inaccurate timer
-
-* *maxframes=NUM*: when a stack trace needs to be performed, collect *NUM* frames
-at the most. The default is 8.
-
-* *calldepth=NUM*: ignore method enter/leave events when the call chain depth is
-bigger than NUM.
-
-* *zip*: automatically compress the output data in gzip format.
-
-* *output=OUTSPEC*: instead of writing the profiling data to the output.mlpd file,
-substitute *%p* in *OUTSPEC* with the current process id and *%t* with the current
-date and time, then do according to *OUTSPEC*:
- * if *OUTSPEC* begins with a *|* character, execute the rest as a program
- and feed the data to its standard input
- * if *OUTSPEC* begins with a *-* character, use the rest of OUTSPEC as
- the filename, but force overwrite any existing file by that name
- * if *OUTSPEC* begins with a *#* character, use the rest of OUTSPEC as a
- file descriptor and feed the data to it.
- * 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.
-
-* *report*: the profiling data is sent to mprof-report, which will print a summary
-report. This is equivalent to the option: `output=mprof-report -`. If the *output*
-option is specified as well, the report will be written to the output file instead of
-the console.
-
-* *port=PORT*: specify the tcp/ip port to use for the listening command server.
-Currently not available for windows.
-This server is started for example when heapshot=ondemand is used: it will read
-commands line by line. The following commands are available:
- * *heapshot*: perform a heapshot as soon as possible
-
-## Analyzing the profile data
-
-Currently there is a command line program (*mprof-report*) to analyze the
-data produced by the profiler. This is ran automatically when the *report*
-profiler option is used.
-Simply run:
-
-`mprof-report output.mlpd`
-
-to see a summary report of the data included in the file.
-
-### Trace information for events
-
-Often it is important for some events, like allocations, lock contention
-and exception throws to know where they happened. Or we may want to see
-what sequence of calls leads to a particular method invocation. To see this
-info invoke mprof-report as follows:
-
-`mprof-report --traces output.mlpd`
-
-The maximum number of methods in each stack trace can be specified with the
-*--maxframes=NUM* option:
-
-`mprof-report --traces --maxframes=4 output.mlpd`
-
-The stack trace info will be available if method enter/leave events have been
-recorded or if stack trace collection wasn't explicitly disabled with the
-*maxframes=0* profiler option. Note that the profiler will collect up to 8
-frames by default at specific events when the *nocalls* option is used, so
-in that case, if more stack frames are required in mprof-report, a bigger
-value for maxframes when profiling must be used, too.
-
-The *--traces* option also controls the reverse reference feature in the heapshot
-report: for each class it reports how many references to objects of that class
-come from other classes.
-
-### Sort order for methods and allocations
-
-When a list of methods is printed the default sort order is based on the total time
-spent in the method. This time is wall clock time (that is, it includes the time
-spent, for example, in a sleep call, even if actual cpu time would be basically 0).
-Also, if the method has been ran on different threads, the time will be a sum
-of the time used in each thread.
-
-To change the sort order, use the option:
-
-`--method-sort=MODE`
-
-where *MODE* can be:
-
-* *self*: amount of time spent in the method itself and not in its callees
-* *calls*: the number of method invocations
-* *total*: the total time spent in the method.
-
-Object allocation lists are sorted by default depending on the total amount
-of bytes used by each type.
-
-To change the sort order of object allocations, use the option:
-
-`--alloc-sort=MODE`
-
-where *MODE* can be:
-
-* *count*: the number of allocated objects of the given type
-* *bytes*: the total number of bytes used by objects of the given type
-
-### Selecting what data to report
-
-The profiler by default collects data about many runtime subsystems and mprof-report
-prints a summary of all the subsystems that are found in the data file. It is possible
-to tell mprof-report to only show information about some of them with the following
-option:
-
-`--reports=R1[,R2...]`
-
-where the report names R1, R2 etc. can be:
-
-* *header*: information about program startup and profiler version
-* *jit*: JIT compiler information
-* *sample*: statistical sampling information
-* *gc*: garbage collection information
-* *alloc*: object allocation information
-* *call*: method profiling information
-* *metadata*: metadata events like image loads
-* *exception*: exception throw and handling information
-* *monitor*: lock contention information
-* *thread*: thread information
-* *heapshot*: live heap usage at heap shots
-
-It is possible to limit some of the data displayed to a timeframe of the
-program execution with the option:
-
-`--time=FROM-TO`
-
-where *FROM* and *TO* are seconds since application startup (they can be
-floating point numbers).
-
-Another interesting option is to consider only events happening on a particular
-thread with the following option:
-
-`--thread=THREADID`
-
-where *THREADID* is one of the numbers listed in the thread summary report
-(or a thread name when present).
-
-By default long lists of methods or other information like object allocations
-are limited to the most important data. To increase the amount of information
-printed you can use the option:
-
-`--verbose`
-
-### Track individual objects
-
-Instead of printing the usual reports from the profiler data, it is possible
-to track some interesting information about some specific object addresses.
-The objects are selected based on their address with the *--track* option as follows:
-
-`--track=0xaddr1[,0xaddr2,...]`
-
-The reported info (if available in the data file), will be class name, size,
-creation time, stack trace of creation (with the *--traces* option), etc.
-If heapshot data is available it will be possible to also track what other objects
-reference one of the listed addresses.
-
-The object addresses can be gathered either from the profiler report in some
-cases (like in the monitor lock report), from the live application or they can
-be selected with the *--find=FINDSPEC* option. FINDSPEC can be one of the
-following:
-
-* *S:SIZE*: where the object is selected if it's size is at least *SIZE*
-* *T:NAME*: where the object is selected if *NAME* partially matches its class name
-
-This option can be specified multiple times with one of the different kinds
-of FINDSPEC. For example, the following:
-
-`--find=S:10000 --find=T:Byte[]`
-
-will find all the byte arrays that are at least 10000 bytes in size.
-
-Note that with a moving garbage collector the object address can change, so
-you may need to track the changed address manually. It can also happen that
-multiple objects are allocated at the same address, so the output from this
-option can become large.
-
-### Saving a profiler report
-
-By default mprof-report will print the summary data to the console.
-To print it to a file, instead, use the option:
-
-`--out=FILENAME`
-
-## Dealing with profiler slowness
-
-If the profiler needs to collect lots of data, the execution of the program will
-slow down significantly, usually 10 to 20 times slower. There are several
-ways to reduce the impact of the profiler on the program execution.
-
-### Use the statistical sampling mode
-
-Statistical sampling allows executing a program under the profiler with minimal
-performance overhead (usually less than 10%). This mode allows checking where
-the program is spending most of it's execution time without significantly
-perturbing its behaviour.
-
-### Collect less data
-
-Collecting method enter/leave events can be very expensive, especially in programs
-that perform many millions of tiny calls. The profiler option *nocalls* can be
-used to avoid collecting this data or it can be limited to only a few call levels
-with the *calldepth* option.
-
-Object allocation information is expensive as well, though much less than
-method enter/leave events. If it's not needed, it can be skipped with the
-*noalloc* profiler option. Note that when method enter/leave events are
-discarded, by default stack traces are collected at each allocation and this
-can be expensive as well. The impact of stack trace information can be reduced
-by setting a low value with the *maxframes* option or by eliminating them
-completely, by setting it to 0.
-
-The other major source of data is the heapshot profiler option: especially
-if the managed heap is big, since every object needs to be inspected. The *MODE*
-parameter of the *heapshot* option can be used to reduce the frequency of the heap
-shots.
-
-### Reduce the timestamp overhead
-
-On many operating systems or architectures what actually slows down profiling
-is the function provided by the system to get timestamp information.
-The *time=fast* profiler option can be usually used to speed up this operation,
-but, depending on the system, time accounting may have some level of approximation
-(though statistically the data should be still fairly valuable).
-
-## Dealing with the size of the data files
-
-When collecting a lot of information about a profiled program, huge data
-files can be generated. There are a few ways to minimize the amount of data,
-for example by not collecting some of the more space-consuming information
-or by compressing the information on the fly or by just generating a summary
-report.
-
-### Reducing the amount of data
-
-Method enter/leave events can be excluded completely with the *nocalls* option
-or they can be limited to just a few levels of calls with the *calldepth* option.
-For example, the option:
-
-`calldepth=10`
-
-will ignore the method events when there are more than 10 managed stack frames.
-This is very useful for programs that have deep recursion or for programs that
-perform many millions of tiny calls deep enough in the call stack. The optimal
-number for the calldepth option depends on the program and it needs to be balanced
-between providing enough profiling information and allowing fast execution speed.
-
-Note that by default, if method events are not recorded at all, the profiler will
-collect stack trace information at events like allocations. To avoid gathering this
-data, use the *maxframes=0* profiler option.
-
-Allocation events can be eliminated with the *noalloc* option.
-
-Heap shot data can also be huge: by default it is collected at each major collection.
-To reduce the frequency, you can specify a heapshot mode: for example to collect
-every 5 collections (including major and minor):
-
-`heapshot=5gc`
-
-or when at least 5 seconds passed since the last heap shot:
-
-`heapshot=5000ms`
-
-### Compressing the data
-
-To reduce the amout of disk space used by the data, the data can be compressed
-either after it has been generated with the gzip command:
-
-`gzip -9 output.mlpd`
-
-or it can be compressed automatically by using the *zip* profiler option. Note
-that in this case there could be a significant slowdown of the profiled program.
-
-The mprof-report program will tranparently deal with either compressed or
-uncompressed data files.
-
-### Generating only a summary report
-
-Often it's enough to look at the profiler summary report to diagnose an issue and in this
-case it's possible to avoid saving the profiler data file to disk. This can be
-accomplished with the *report* profiler option, which will basically send the data
-to the mprof-report program for display.
-
-To have more control of what summary information is reported (or to use a completely
-different program to decode the profiler data), the *output* profiler option can be
-used, with `|` as the first character: the rest of the output name will be
-executed as a program with the data fed in on the standard input.
-
-For example, to print only the Monitor summary with stack trace information, you
-could use it like this:
-
-`output=|mprof-report --reports=monitor --traces -`
-
+++ /dev/null
-/*
- * mono-co.c: Coverage profiler
- *
-
- * Copyright 2008-2009 Novell, Inc (http://www.novell.com)
- */
-#include <mono/metadata/profiler.h>
-#include <mono/metadata/tokentype.h>
-#include <mono/metadata/tabledefs.h>
-#include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/assembly.h>
-#include <string.h>
-#include <glib.h>
-
-/*
- * Coverage profiler. Compile with:
- * gcc -Wall -shared -o mono-profiler-cov.so mono-cov.c `pkg-config --cflags --libs mono`
- * Install the binary where the dynamic loader can find it (/usr/local/lib, for example,
- * or set the env var LD_LIBRARY_PATH to the directory where the file is).
- * Then run mono with:
- * mono --profile=cov:yourassembly test_suite.exe
- * mono --profile=cov:yourassembly/namespace test_suite.exe
- */
-
-struct _MonoProfiler {
- GHashTable *hash;
- char* assembly_name;
- char* class_name;
- MonoAssembly *assembly;
- GList *bb_coverage;
-};
-
-static void
-get_assembly (MonoAssembly* ass, MonoProfiler *prof)
-{
- if (strcmp (prof->assembly_name, mono_image_get_name (mono_assembly_get_image (ass))) == 0)
- prof->assembly = ass;
-}
-
-static void
-coverage_callback (MonoProfiler *prof, const MonoProfileCoverageEntry *entry)
-{
- char* cmsg;
-
- if (entry->counter)
- return;
-
- if (entry->filename) {
- cmsg = g_strdup_printf ("offset 0x%04x (%s: line: %d, col: %d)",
- entry->iloffset, entry->filename, entry->line, entry->col);
- } else {
- cmsg = g_strdup_printf ("offset 0x%04x", entry->iloffset);
- }
- prof->bb_coverage = g_list_append (prof->bb_coverage, cmsg);
-}
-
-static void
-check_partial_coverage (MonoProfiler *prof, MonoMethod *method)
-{
- GList *tmp;
-
- mono_profiler_coverage_get (prof, method, coverage_callback);
- if (prof->bb_coverage) {
- char *name = mono_method_full_name (method, TRUE);
- g_print ("Partial coverage: %s\n", name);
- g_free (name);
- for (tmp = prof->bb_coverage; tmp; tmp = tmp->next) {
- g_print ("\t%s\n", (char*)tmp->data);
- g_free (tmp->data);
- }
- g_list_free (prof->bb_coverage);
- prof->bb_coverage = NULL;
- }
-}
-
-/* called at the end of the program */
-static void
-cov_shutdown (MonoProfiler *prof)
-{
- MonoImage *image;
- MonoMethod *method;
- int i;
- char *name;
-
- mono_assembly_foreach ((GFunc)get_assembly, prof);
- if (!prof->assembly) {
- g_print ("Assembly '%s' was not loaded\n", prof->assembly_name);
- return;
- }
- image = mono_assembly_get_image (prof->assembly);
- for (i = 1; i <= mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
- MonoClass *klass;
- method = mono_get_method (image, i | MONO_TOKEN_METHOD_DEF, NULL);
- if (!method)
- continue;
- if ((mono_method_get_flags (method, NULL) & METHOD_ATTRIBUTE_ABSTRACT))
- continue;
- /* FIXME: handle icalls, runtime calls and synchronized methods */
- if (prof->class_name && *prof->class_name) {
- klass = mono_method_get_class (method);
- if (!strstr (mono_class_get_name (klass), prof->class_name) && !strstr (mono_class_get_namespace (klass), prof->class_name))
- continue;
- }
- /*g_print ("check %s::%s, %p\n", method->klass->name, method->name, method);*/
- if (g_hash_table_lookup (prof->hash, method)) {
- /* the method was executed: check it was fully covered */
- check_partial_coverage (prof, method);
- continue;
- }
- name = mono_method_full_name (method, TRUE);
- g_print ("Not covered: %s\n", name);
- g_free (name);
- }
-}
-
-static void
-cov_method_enter (MonoProfiler *prof, MonoMethod *method)
-{
- /*g_print ("enter %s::%s, %p\n", method->klass->name, method->name, method);*/
- g_hash_table_insert (prof->hash, method, GINT_TO_POINTER (1));
-}
-
-static void
-cov_method_leave (MonoProfiler *prof, MonoMethod *method)
-{
-}
-
-static gboolean
-cov_coverage_filter(MonoProfiler *prof, MonoMethod *method)
-{
- return TRUE;
-}
-
-void
-mono_profiler_startup (const char *desc);
-
-/* the entry point */
-void
-mono_profiler_startup (const char *desc)
-{
- MonoProfiler *prof;
-
- prof = g_new0 (MonoProfiler, 1);
- prof->hash = g_hash_table_new (NULL, NULL);
- if (strncmp ("cov:", desc, 4) == 0 && desc [4]) {
- char *cname;
- prof->assembly_name = g_strdup (desc + 4);
- cname = strchr (prof->assembly_name, '/');
- if (cname) {
- *cname = 0;
- prof->class_name = cname + 1;
- }
- } else {
- prof->assembly_name = g_strdup ("mscorlib");
- }
-
- mono_profiler_install (prof, cov_shutdown);
-
- mono_profiler_install_enter_leave (cov_method_enter, cov_method_leave);
- mono_profiler_install_coverage_filter (cov_coverage_filter);
- mono_profiler_set_events (MONO_PROFILE_ENTER_LEAVE | MONO_PROFILE_COVERAGE);
-}
-
-
+++ /dev/null
-/*
- * mono-profiler-logging.c: Logging profiler for Mono.
- *
- * Author:
- * Massimiliano Mantione (massi@ximian.com)
- *
- * Copyright 2008-2009 Novell, Inc (http://www.novell.com)
- */
-#include <config.h>
-#include <mono/metadata/profiler.h>
-#include <mono/metadata/class.h>
-#include <mono/metadata/metadata-internals.h>
-#include <mono/metadata/class-internals.h>
-#include <mono/metadata/assembly.h>
-#include <mono/metadata/loader.h>
-#include <mono/metadata/threads.h>
-#include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/mono-gc.h>
-#include <mono/utils/mono-tls.h>
-#include <mono/io-layer/atomic.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <glib.h>
-
-#include <dlfcn.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#define HAS_OPROFILE 0
-
-#if (HAS_OPROFILE)
-#include <libopagent.h>
-#endif
-
-// Needed for heap analysis
-extern gboolean mono_object_is_alive (MonoObject* obj);
-
-typedef enum {
- MONO_PROFILER_FILE_BLOCK_KIND_INTRO = 1,
- MONO_PROFILER_FILE_BLOCK_KIND_END = 2,
- MONO_PROFILER_FILE_BLOCK_KIND_MAPPING = 3,
- MONO_PROFILER_FILE_BLOCK_KIND_LOADED = 4,
- MONO_PROFILER_FILE_BLOCK_KIND_UNLOADED = 5,
- MONO_PROFILER_FILE_BLOCK_KIND_EVENTS = 6,
- MONO_PROFILER_FILE_BLOCK_KIND_STATISTICAL = 7,
- MONO_PROFILER_FILE_BLOCK_KIND_HEAP_DATA = 8,
- MONO_PROFILER_FILE_BLOCK_KIND_HEAP_SUMMARY = 9,
- MONO_PROFILER_FILE_BLOCK_KIND_DIRECTIVES = 10
-} MonoProfilerFileBlockKind;
-
-typedef enum {
- MONO_PROFILER_DIRECTIVE_END = 0,
- MONO_PROFILER_DIRECTIVE_ALLOCATIONS_CARRY_CALLER = 1,
- MONO_PROFILER_DIRECTIVE_ALLOCATIONS_HAVE_STACK = 2,
- MONO_PROFILER_DIRECTIVE_ALLOCATIONS_CARRY_ID = 3,
- MONO_PROFILER_DIRECTIVE_LOADED_ELEMENTS_CARRY_ID = 4,
- MONO_PROFILER_DIRECTIVE_CLASSES_CARRY_ASSEMBLY_ID = 5,
- MONO_PROFILER_DIRECTIVE_METHODS_CARRY_WRAPPER_FLAG = 6,
- MONO_PROFILER_DIRECTIVE_LAST
-} MonoProfilerDirectives;
-
-
-#define MONO_PROFILER_LOADED_EVENT_MODULE 1
-#define MONO_PROFILER_LOADED_EVENT_ASSEMBLY 2
-#define MONO_PROFILER_LOADED_EVENT_APPDOMAIN 4
-#define MONO_PROFILER_LOADED_EVENT_SUCCESS 8
-#define MONO_PROFILER_LOADED_EVENT_FAILURE 16
-
-typedef enum {
- MONO_PROFILER_EVENT_DATA_TYPE_OTHER = 0,
- MONO_PROFILER_EVENT_DATA_TYPE_METHOD = 1,
- MONO_PROFILER_EVENT_DATA_TYPE_CLASS = 2
-} MonoProfilerEventDataType;
-
-typedef struct _ProfilerEventData {
- union {
- gpointer address;
- gsize number;
- } data;
- unsigned int data_type:2;
- unsigned int code:4;
- unsigned int kind:1;
- unsigned int value:25;
-} ProfilerEventData;
-
-#define EVENT_VALUE_BITS (25)
-#define MAX_EVENT_VALUE ((1<<EVENT_VALUE_BITS)-1)
-
-typedef enum {
- MONO_PROFILER_EVENT_METHOD_JIT = 0,
- MONO_PROFILER_EVENT_METHOD_FREED = 1,
- MONO_PROFILER_EVENT_METHOD_CALL = 2,
- MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER = 3,
- MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER = 4
-} MonoProfilerMethodEvents;
-typedef enum {
- MONO_PROFILER_EVENT_CLASS_LOAD = 0,
- MONO_PROFILER_EVENT_CLASS_UNLOAD = 1,
- MONO_PROFILER_EVENT_CLASS_EXCEPTION = 2,
- MONO_PROFILER_EVENT_CLASS_MONITOR = 3,
- MONO_PROFILER_EVENT_CLASS_ALLOCATION = 4
-} MonoProfilerClassEvents;
-typedef enum {
- MONO_PROFILER_EVENT_RESULT_SUCCESS = 0,
- MONO_PROFILER_EVENT_RESULT_FAILURE = 4
-} MonoProfilerEventResult;
-#define MONO_PROFILER_EVENT_RESULT_MASK MONO_PROFILER_EVENT_RESULT_FAILURE
-typedef enum {
- MONO_PROFILER_EVENT_THREAD = 1,
- MONO_PROFILER_EVENT_GC_COLLECTION = 2,
- MONO_PROFILER_EVENT_GC_MARK = 3,
- MONO_PROFILER_EVENT_GC_SWEEP = 4,
- MONO_PROFILER_EVENT_GC_RESIZE = 5,
- MONO_PROFILER_EVENT_GC_STOP_WORLD = 6,
- MONO_PROFILER_EVENT_GC_START_WORLD = 7,
- MONO_PROFILER_EVENT_JIT_TIME_ALLOCATION = 8,
- MONO_PROFILER_EVENT_STACK_SECTION = 9,
- MONO_PROFILER_EVENT_ALLOCATION_OBJECT_ID = 10,
- MONO_PROFILER_EVENT_OBJECT_MONITOR = 11
-} MonoProfilerEvents;
-typedef enum {
- MONO_PROFILER_EVENT_KIND_START = 0,
- MONO_PROFILER_EVENT_KIND_END = 1
-} MonoProfilerEventKind;
-
-#define MONO_PROFILER_GET_CURRENT_TIME(t) {\
- struct timeval current_time;\
- gettimeofday (¤t_time, NULL);\
- (t) = (((guint64)current_time.tv_sec) * 1000000) + current_time.tv_usec;\
-} while (0)
-
-static gboolean use_fast_timer = FALSE;
-
-#if (defined(__i386__) || defined(__x86_64__)) && ! defined(HOST_WIN32)
-
-#if defined(__i386__)
-static const guchar cpuid_impl [] = {
- 0x55, /* push %ebp */
- 0x89, 0xe5, /* mov %esp,%ebp */
- 0x53, /* push %ebx */
- 0x8b, 0x45, 0x08, /* mov 0x8(%ebp),%eax */
- 0x0f, 0xa2, /* cpuid */
- 0x50, /* push %eax */
- 0x8b, 0x45, 0x10, /* mov 0x10(%ebp),%eax */
- 0x89, 0x18, /* mov %ebx,(%eax) */
- 0x8b, 0x45, 0x14, /* mov 0x14(%ebp),%eax */
- 0x89, 0x08, /* mov %ecx,(%eax) */
- 0x8b, 0x45, 0x18, /* mov 0x18(%ebp),%eax */
- 0x89, 0x10, /* mov %edx,(%eax) */
- 0x58, /* pop %eax */
- 0x8b, 0x55, 0x0c, /* mov 0xc(%ebp),%edx */
- 0x89, 0x02, /* mov %eax,(%edx) */
- 0x5b, /* pop %ebx */
- 0xc9, /* leave */
- 0xc3, /* ret */
-};
-
-typedef void (*CpuidFunc) (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx);
-
-static int
-cpuid (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx) {
- int have_cpuid = 0;
-#ifndef _MSC_VER
- __asm__ __volatile__ (
- "pushfl\n"
- "popl %%eax\n"
- "movl %%eax, %%edx\n"
- "xorl $0x200000, %%eax\n"
- "pushl %%eax\n"
- "popfl\n"
- "pushfl\n"
- "popl %%eax\n"
- "xorl %%edx, %%eax\n"
- "andl $0x200000, %%eax\n"
- "movl %%eax, %0"
- : "=r" (have_cpuid)
- :
- : "%eax", "%edx"
- );
-#else
- __asm {
- pushfd
- pop eax
- mov edx, eax
- xor eax, 0x200000
- push eax
- popfd
- pushfd
- pop eax
- xor eax, edx
- and eax, 0x200000
- mov have_cpuid, eax
- }
-#endif
- if (have_cpuid) {
- CpuidFunc func = (CpuidFunc) cpuid_impl;
- func (id, p_eax, p_ebx, p_ecx, p_edx);
- /*
- * We use this approach because of issues with gcc and pic code, see:
- * http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7329
- __asm__ __volatile__ ("cpuid"
- : "=a" (*p_eax), "=b" (*p_ebx), "=c" (*p_ecx), "=d" (*p_edx)
- : "a" (id));
- */
- return 1;
- }
- return 0;
-}
-
-static void detect_fast_timer (void) {
- int p_eax, p_ebx, p_ecx, p_edx;
-
- if (cpuid (0x1, &p_eax, &p_ebx, &p_ecx, &p_edx)) {
- if (p_edx & 0x10) {
- use_fast_timer = TRUE;
- } else {
- use_fast_timer = FALSE;
- }
- } else {
- use_fast_timer = FALSE;
- }
-}
-#endif
-
-#if defined(__x86_64__)
-static void detect_fast_timer (void) {
- guint32 op = 0x1;
- guint32 eax,ebx,ecx,edx;
- __asm__ __volatile__ ("cpuid" : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "a"(op));
- if (edx & 0x10) {
- use_fast_timer = TRUE;
- } else {
- use_fast_timer = FALSE;
- }
-}
-#endif
-
-static __inline__ guint64 rdtsc(void) {
- guint32 hi, lo;
- __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
- return ((guint64) lo) | (((guint64) hi) << 32);
-}
-#define MONO_PROFILER_GET_CURRENT_COUNTER(c) {\
- if (use_fast_timer) {\
- (c) = rdtsc ();\
- } else {\
- MONO_PROFILER_GET_CURRENT_TIME ((c));\
- }\
-} while (0)
-#else
-static void detect_fast_timer (void) {
- use_fast_timer = FALSE;
-}
-#define MONO_PROFILER_GET_CURRENT_COUNTER(c) MONO_PROFILER_GET_CURRENT_TIME ((c))
-#endif
-
-
-#define CLASS_LAYOUT_PACKED_BITMAP_SIZE 64
-#define CLASS_LAYOUT_NOT_INITIALIZED (0xFFFF)
-typedef enum {
- HEAP_CODE_NONE = 0,
- HEAP_CODE_OBJECT = 1,
- HEAP_CODE_FREE_OBJECT_CLASS = 2,
- HEAP_CODE_MASK = 3
-} HeapProfilerJobValueCode;
-typedef struct _MonoProfilerClassData {
- union {
- guint64 compact;
- guint8 *extended;
- } bitmap;
- struct {
- guint16 slots;
- guint16 references;
- } layout;
-} MonoProfilerClassData;
-
-typedef struct _MonoProfilerMethodData {
- gpointer code_start;
- guint32 code_size;
-} MonoProfilerMethodData;
-
-typedef struct _ClassIdMappingElement {
- char *name;
- guint32 id;
- MonoClass *klass;
- struct _ClassIdMappingElement *next_unwritten;
- MonoProfilerClassData data;
-} ClassIdMappingElement;
-
-typedef struct _MethodIdMappingElement {
- char *name;
- guint32 id;
- MonoMethod *method;
- struct _MethodIdMappingElement *next_unwritten;
- MonoProfilerMethodData data;
-} MethodIdMappingElement;
-
-typedef struct _ClassIdMapping {
- GHashTable *table;
- ClassIdMappingElement *unwritten;
- guint32 next_id;
-} ClassIdMapping;
-
-typedef struct _MethodIdMapping {
- GHashTable *table;
- MethodIdMappingElement *unwritten;
- guint32 next_id;
-} MethodIdMapping;
-
-typedef struct _LoadedElement {
- char *name;
- guint64 load_start_counter;
- guint64 load_end_counter;
- guint64 unload_start_counter;
- guint64 unload_end_counter;
- guint32 id;
- guint8 loaded;
- guint8 load_written;
- guint8 unloaded;
- guint8 unload_written;
-} LoadedElement;
-struct _ProfilerCodeBufferArray;
-typedef struct _ProfilerCodeBuffer {
- gpointer start;
- gpointer end;
- struct {
- union {
- MonoMethod *method;
- MonoClass *klass;
- void *data;
- struct _ProfilerCodeBufferArray *sub_buffers;
- } data;
- guint16 value;
- guint16 type;
- } info;
-} ProfilerCodeBuffer;
-
-#define PROFILER_CODE_BUFFER_ARRAY_SIZE 64
-typedef struct _ProfilerCodeBufferArray {
- int level;
- int number_of_buffers;
- ProfilerCodeBuffer buffers [PROFILER_CODE_BUFFER_ARRAY_SIZE];
-} ProfilerCodeBufferArray;
-
-typedef struct _ProfilerCodeChunk {
- gpointer start;
- gpointer end;
- gboolean destroyed;
- ProfilerCodeBufferArray *buffers;
-} ProfilerCodeChunk;
-
-typedef struct _ProfilerCodeChunks {
- int capacity;
- int number_of_chunks;;
- ProfilerCodeChunk *chunks;
-} ProfilerCodeChunks;
-
-
-#define PROFILER_HEAP_SHOT_OBJECT_BUFFER_SIZE 1024
-#define PROFILER_HEAP_SHOT_HEAP_BUFFER_SIZE 4096
-#define PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE 4096
-
-typedef struct _ProfilerHeapShotObjectBuffer {
- struct _ProfilerHeapShotObjectBuffer *next;
- MonoObject **next_free_slot;
- MonoObject **end;
- MonoObject **first_unprocessed_slot;
- MonoObject *buffer [PROFILER_HEAP_SHOT_OBJECT_BUFFER_SIZE];
-} ProfilerHeapShotObjectBuffer;
-
-typedef struct _ProfilerHeapShotHeapBuffer {
- struct _ProfilerHeapShotHeapBuffer *next;
- struct _ProfilerHeapShotHeapBuffer *previous;
- MonoObject **start_slot;
- MonoObject **end_slot;
- MonoObject *buffer [PROFILER_HEAP_SHOT_HEAP_BUFFER_SIZE];
-} ProfilerHeapShotHeapBuffer;
-
-typedef struct _ProfilerHeapShotHeapBuffers {
- ProfilerHeapShotHeapBuffer *buffers;
- ProfilerHeapShotHeapBuffer *last;
- ProfilerHeapShotHeapBuffer *current;
- MonoObject **first_free_slot;
-} ProfilerHeapShotHeapBuffers;
-
-
-typedef struct _ProfilerHeapShotWriteBuffer {
- struct _ProfilerHeapShotWriteBuffer *next;
- gpointer buffer [PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE];
-} ProfilerHeapShotWriteBuffer;
-
-typedef struct _ProfilerHeapShotClassSummary {
- struct {
- guint32 instances;
- guint32 bytes;
- } reachable;
- struct {
- guint32 instances;
- guint32 bytes;
- } unreachable;
-} ProfilerHeapShotClassSummary;
-
-typedef struct _ProfilerHeapShotCollectionSummary {
- ProfilerHeapShotClassSummary *per_class_data;
- guint32 capacity;
-} ProfilerHeapShotCollectionSummary;
-
-typedef struct _ProfilerHeapShotWriteJob {
- struct _ProfilerHeapShotWriteJob *next;
- struct _ProfilerHeapShotWriteJob *next_unwritten;
- gpointer *start;
- gpointer *cursor;
- gpointer *end;
- ProfilerHeapShotWriteBuffer *buffers;
- ProfilerHeapShotWriteBuffer **last_next;
- guint32 full_buffers;
- gboolean heap_shot_was_requested;
- guint64 start_counter;
- guint64 start_time;
- guint64 end_counter;
- guint64 end_time;
- guint32 collection;
- ProfilerHeapShotCollectionSummary summary;
- gboolean dump_heap_data;
-} ProfilerHeapShotWriteJob;
-
-typedef struct _ProfilerThreadStack {
- guint32 capacity;
- guint32 top;
- guint32 last_saved_top;
- guint32 last_written_frame;
- MonoMethod **stack;
- guint8 *method_is_jitted;
- guint32 *written_frames;
-} ProfilerThreadStack;
-
-typedef struct _ProfilerPerThreadData {
- ProfilerEventData *events;
- ProfilerEventData *next_free_event;
- ProfilerEventData *next_unreserved_event;
- ProfilerEventData *end_event;
- ProfilerEventData *first_unwritten_event;
- ProfilerEventData *first_unmapped_event;
- guint64 start_event_counter;
- guint64 last_event_counter;
- gsize thread_id;
- ProfilerHeapShotObjectBuffer *heap_shot_object_buffers;
- ProfilerThreadStack stack;
- struct _ProfilerPerThreadData* next;
-} ProfilerPerThreadData;
-
-typedef struct _ProfilerStatisticalHit {
- gpointer *address;
- MonoDomain *domain;
-} ProfilerStatisticalHit;
-
-typedef struct _ProfilerStatisticalData {
- ProfilerStatisticalHit *hits;
- unsigned int next_free_index;
- unsigned int end_index;
- unsigned int first_unwritten_index;
-} ProfilerStatisticalData;
-
-typedef struct _ProfilerUnmanagedSymbol {
- guint32 offset;
- guint32 size;
- guint32 id;
- guint32 index;
-} ProfilerUnmanagedSymbol;
-
-struct _ProfilerExecutableFile;
-struct _ProfilerExecutableFileSectionRegion;
-
-typedef struct _ProfilerExecutableMemoryRegionData {
- gpointer start;
- gpointer end;
- guint32 file_offset;
- char *file_name;
- guint32 id;
- gboolean is_new;
-
- struct _ProfilerExecutableFile *file;
- struct _ProfilerExecutableFileSectionRegion *file_region_reference;
- guint32 symbols_count;
- guint32 symbols_capacity;
- ProfilerUnmanagedSymbol *symbols;
-} ProfilerExecutableMemoryRegionData;
-
-typedef struct _ProfilerExecutableMemoryRegions {
- ProfilerExecutableMemoryRegionData **regions;
- guint32 regions_capacity;
- guint32 regions_count;
- guint32 next_id;
- guint32 next_unmanaged_function_id;
-} ProfilerExecutableMemoryRegions;
-
-/* Start of ELF definitions */
-#define EI_NIDENT 16
-typedef guint16 ElfHalf;
-typedef guint32 ElfWord;
-typedef gsize ElfAddr;
-typedef gsize ElfOff;
-
-typedef struct {
- unsigned char e_ident[EI_NIDENT];
- ElfHalf e_type;
- ElfHalf e_machine;
- ElfWord e_version;
- ElfAddr e_entry;
- ElfOff e_phoff;
- ElfOff e_shoff; // Section header table
- ElfWord e_flags;
- ElfHalf e_ehsize; // Header size
- ElfHalf e_phentsize;
- ElfHalf e_phnum;
- ElfHalf e_shentsize; // Section header entry size
- ElfHalf e_shnum; // Section header entries number
- ElfHalf e_shstrndx; // String table index
-} ElfHeader;
-
-#if (SIZEOF_VOID_P == 4)
-typedef struct {
- ElfWord sh_name;
- ElfWord sh_type;
- ElfWord sh_flags;
- ElfAddr sh_addr; // Address in memory
- ElfOff sh_offset; // Offset in file
- ElfWord sh_size;
- ElfWord sh_link;
- ElfWord sh_info;
- ElfWord sh_addralign;
- ElfWord sh_entsize;
-} ElfSection;
-typedef struct {
- ElfWord st_name;
- ElfAddr st_value;
- ElfWord st_size;
- unsigned char st_info; // Use ELF32_ST_TYPE to get symbol type
- unsigned char st_other;
- ElfHalf st_shndx; // Or one of SHN_ABS, SHN_COMMON or SHN_UNDEF.
-} ElfSymbol;
-#elif (SIZEOF_VOID_P == 8)
-typedef struct {
- ElfWord sh_name;
- ElfWord sh_type;
- ElfOff sh_flags;
- ElfAddr sh_addr; // Address in memory
- ElfOff sh_offset; // Offset in file
- ElfOff sh_size;
- ElfWord sh_link;
- ElfWord sh_info;
- ElfOff sh_addralign;
- ElfOff sh_entsize;
-} ElfSection;
-typedef struct {
- ElfWord st_name;
- unsigned char st_info; // Use ELF_ST_TYPE to get symbol type
- unsigned char st_other;
- ElfHalf st_shndx; // Or one of SHN_ABS, SHN_COMMON or SHN_UNDEF.
- ElfAddr st_value;
- ElfAddr st_size;
-} ElfSymbol;
-#else
-#error Bad size of void pointer
-#endif
-
-
-#define ELF_ST_BIND(i) ((i)>>4)
-#define ELF_ST_TYPE(i) ((i)&0xf)
-
-
-typedef enum {
- EI_MAG0 = 0,
- EI_MAG1 = 1,
- EI_MAG2 = 2,
- EI_MAG3 = 3,
- EI_CLASS = 4,
- EI_DATA = 5
-} ElfIdentFields;
-
-typedef enum {
- ELF_FILE_TYPE_NONE = 0,
- ELF_FILE_TYPE_REL = 1,
- ELF_FILE_TYPE_EXEC = 2,
- ELF_FILE_TYPE_DYN = 3,
- ELF_FILE_TYPE_CORE = 4
-} ElfFileType;
-
-typedef enum {
- ELF_CLASS_NONE = 0,
- ELF_CLASS_32 = 1,
- ELF_CLASS_64 = 2
-} ElfIdentClass;
-
-typedef enum {
- ELF_DATA_NONE = 0,
- ELF_DATA_LSB = 1,
- ELF_DATA_MSB = 2
-} ElfIdentData;
-
-typedef enum {
- ELF_SHT_NULL = 0,
- ELF_SHT_PROGBITS = 1,
- ELF_SHT_SYMTAB = 2,
- ELF_SHT_STRTAB = 3,
- ELF_SHT_RELA = 4,
- ELF_SHT_HASH = 5,
- ELF_SHT_DYNAMIC = 6,
- ELF_SHT_NOTE = 7,
- ELF_SHT_NOBITS = 8,
- ELF_SHT_REL = 9,
- ELF_SHT_SHLIB = 10,
- ELF_SHT_DYNSYM = 11
-} ElfSectionType;
-
-typedef enum {
- ELF_STT_NOTYPE = 0,
- ELF_STT_OBJECT = 1,
- ELF_STT_FUNC = 2,
- ELF_STT_SECTION = 3,
- ELF_STT_FILE = 4
-} ElfSymbolType;
-
-typedef enum {
- ELF_SHF_WRITE = 1,
- ELF_SHF_ALLOC = 2,
- ELF_SHF_EXECINSTR = 4,
-} ElfSectionFlags;
-
-#define ELF_SHN_UNDEF 0
-#define ELF_SHN_LORESERVE 0xff00
-#define ELF_SHN_LOPROC 0xff00
-#define ELF_SHN_HIPROC 0xff1f
-#define ELF_SHN_ABS 0xfff1
-#define ELF_SHN_COMMON 0xfff2
-#define ELF_SHN_HIRESERVE 0xffff
-/* End of ELF definitions */
-
-typedef struct _ProfilerExecutableFileSectionRegion {
- ProfilerExecutableMemoryRegionData *region;
- guint8 *section_address;
- gsize section_offset;
-} ProfilerExecutableFileSectionRegion;
-
-typedef struct _ProfilerExecutableFile {
- guint32 reference_count;
-
- /* Used for mmap and munmap */
- int fd;
- guint8 *data;
- size_t length;
-
- /* File data */
- ElfHeader *header;
- guint8 *symbols_start;
- guint32 symbols_count;
- guint32 symbol_size;
- const char *symbols_string_table;
- const char *main_string_table;
-
- ProfilerExecutableFileSectionRegion *section_regions;
-
- struct _ProfilerExecutableFile *next_new_file;
-} ProfilerExecutableFile;
-
-typedef struct _ProfilerExecutableFiles {
- GHashTable *table;
- ProfilerExecutableFile *new_files;
-} ProfilerExecutableFiles;
-
-
-#define CLEANUP_WRITER_THREAD() do {profiler->writer_thread_terminated = TRUE;} while (0)
-#define CHECK_WRITER_THREAD() (! profiler->writer_thread_terminated)
-
-#ifndef HOST_WIN32
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <semaphore.h>
-
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-
-#define MUTEX_TYPE pthread_mutex_t
-#define INITIALIZE_PROFILER_MUTEX() pthread_mutex_init (&(profiler->mutex), NULL)
-#define DELETE_PROFILER_MUTEX() pthread_mutex_destroy (&(profiler->mutex))
-#define LOCK_PROFILER() do {/*LOG_WRITER_THREAD ("LOCK_PROFILER");*/ pthread_mutex_lock (&(profiler->mutex));} while (0)
-#define UNLOCK_PROFILER() do {/*LOG_WRITER_THREAD ("UNLOCK_PROFILER");*/ pthread_mutex_unlock (&(profiler->mutex));} while (0)
-
-#define THREAD_TYPE pthread_t
-#define CREATE_WRITER_THREAD(f) pthread_create (&(profiler->data_writer_thread), NULL, ((void*(*)(void*))f), NULL)
-#define CREATE_USER_THREAD(f) pthread_create (&(profiler->user_thread), NULL, ((void*(*)(void*))f), NULL)
-#define EXIT_THREAD() pthread_exit (NULL);
-#define WAIT_WRITER_THREAD() do {\
- if (CHECK_WRITER_THREAD ()) {\
- pthread_join (profiler->data_writer_thread, NULL);\
- }\
-} while (0)
-#define CURRENT_THREAD_ID() (gsize) pthread_self ()
-
-#ifndef HAVE_KW_THREAD
-static pthread_key_t pthread_profiler_key;
-static pthread_once_t profiler_pthread_once = PTHREAD_ONCE_INIT;
-static void
-make_pthread_profiler_key (void) {
- (void) pthread_key_create (&pthread_profiler_key, NULL);
-}
-#define LOOKUP_PROFILER_THREAD_DATA() ((ProfilerPerThreadData*) pthread_getspecific (pthread_profiler_key))
-#define SET_PROFILER_THREAD_DATA(x) (void) pthread_setspecific (pthread_profiler_key, (x))
-#define ALLOCATE_PROFILER_THREAD_DATA() (void) pthread_once (&profiler_pthread_once, make_pthread_profiler_key)
-#define FREE_PROFILER_THREAD_DATA() (void) pthread_key_delete (pthread_profiler_key)
-#endif
-
-#define EVENT_TYPE sem_t
-#define WRITER_EVENT_INIT() do {\
- sem_init (&(profiler->enable_data_writer_event), 0, 0);\
- sem_init (&(profiler->wake_data_writer_event), 0, 0);\
- sem_init (&(profiler->done_data_writer_event), 0, 0);\
-} while (0)
-#define WRITER_EVENT_DESTROY() do {\
- sem_destroy (&(profiler->enable_data_writer_event));\
- sem_destroy (&(profiler->wake_data_writer_event));\
- sem_destroy (&(profiler->done_data_writer_event));\
-} while (0)
-#define WRITER_EVENT_WAIT() (void) sem_wait (&(profiler->wake_data_writer_event))
-#define WRITER_EVENT_RAISE() (void) sem_post (&(profiler->wake_data_writer_event))
-#define WRITER_EVENT_ENABLE_WAIT() (void) sem_wait (&(profiler->enable_data_writer_event))
-#define WRITER_EVENT_ENABLE_RAISE() (void) sem_post (&(profiler->enable_data_writer_event))
-#define WRITER_EVENT_DONE_WAIT() do {\
- if (CHECK_WRITER_THREAD ()) {\
- (void) sem_wait (&(profiler->done_data_writer_event));\
- }\
-} while (0)
-#define WRITER_EVENT_DONE_RAISE() (void) sem_post (&(profiler->done_data_writer_event))
-
-#if 0
-#define FILE_HANDLE_TYPE FILE*
-#define OPEN_FILE() profiler->file = fopen (profiler->file_name, "wb");
-#define WRITE_BUFFER(b,s) fwrite ((b), 1, (s), profiler->file)
-#define FLUSH_FILE() fflush (profiler->file)
-#define CLOSE_FILE() fclose (profiler->file)
-#else
-#define FILE_HANDLE_TYPE int
-#define OPEN_FILE() profiler->file = open (profiler->file_name, O_WRONLY|O_CREAT|O_TRUNC, 0664);
-#define WRITE_BUFFER(b,s) write (profiler->file, (b), (s))
-#define FLUSH_FILE() fsync (profiler->file)
-#define CLOSE_FILE() close (profiler->file)
-#endif
-
-#else
-
-#include <windows.h>
-
-#define MUTEX_TYPE CRITICAL_SECTION
-#define INITIALIZE_PROFILER_MUTEX() InitializeCriticalSection (&(profiler->mutex))
-#define DELETE_PROFILER_MUTEX() DeleteCriticalSection (&(profiler->mutex))
-#define LOCK_PROFILER() EnterCriticalSection (&(profiler->mutex))
-#define UNLOCK_PROFILER() LeaveCriticalSection (&(profiler->mutex))
-
-#define THREAD_TYPE HANDLE
-#define CREATE_WRITER_THREAD(f) CreateThread (NULL, (1*1024*1024), (f), NULL, 0, NULL);
-#define EXIT_THREAD() ExitThread (0);
-#define WAIT_WRITER_THREAD() do {\
- if (CHECK_WRITER_THREAD ()) {\
- WaitForSingleObject (profiler->data_writer_thread, INFINITE);\
- }\
-} while (0)
-#define CURRENT_THREAD_ID() (gsize) GetCurrentThreadId ()
-
-#ifndef HAVE_KW_THREAD
-static MonoNativeTlsKey profiler_thread_id;
-#define LOOKUP_PROFILER_THREAD_DATA() ((ProfilerPerThreadData*)mono_native_tls_get_value (profiler_thread_id))
-#define SET_PROFILER_THREAD_DATA(x) mono_native_tls_set_value (profiler_thread_id, (x));
-#define ALLOCATE_PROFILER_THREAD_DATA() mono_native_tls_alloc (profiler_thread_id, NULL)
-#define FREE_PROFILER_THREAD_DATA() mono_native_tls_free (profiler_thread_id)
-#endif
-
-#define EVENT_TYPE HANDLE
-#define WRITER_EVENT_INIT() (void) do {\
- profiler->enable_data_writer_event = CreateEvent (NULL, FALSE, FALSE, NULL);\
- profiler->wake_data_writer_event = CreateEvent (NULL, FALSE, FALSE, NULL);\
- profiler->done_data_writer_event = CreateEvent (NULL, FALSE, FALSE, NULL);\
-} while (0)
-#define WRITER_EVENT_DESTROY() CloseHandle (profiler->statistical_data_writer_event)
-#define WRITER_EVENT_INIT() (void) do {\
- CloseHandle (profiler->enable_data_writer_event);\
- CloseHandle (profiler->wake_data_writer_event);\
- CloseHandle (profiler->done_data_writer_event);\
-} while (0)
-#define WRITER_EVENT_WAIT() WaitForSingleObject (profiler->wake_data_writer_event, INFINITE)
-#define WRITER_EVENT_RAISE() SetEvent (profiler->wake_data_writer_event)
-#define WRITER_EVENT_ENABLE_WAIT() WaitForSingleObject (profiler->enable_data_writer_event, INFINITE)
-#define WRITER_EVENT_ENABLE_RAISE() SetEvent (profiler->enable_data_writer_event)
-#define WRITER_EVENT_DONE_WAIT() do {\
- if (CHECK_WRITER_THREAD ()) {\
- WaitForSingleObject (profiler->done_data_writer_event, INFINITE);\
- }\
-} while (0)
-#define WRITER_EVENT_DONE_RAISE() SetEvent (profiler->done_data_writer_event)
-
-#define FILE_HANDLE_TYPE FILE*
-#define OPEN_FILE() profiler->file = fopen (profiler->file_name, "wb");
-#define WRITE_BUFFER(b,s) fwrite ((b), 1, (s), profiler->file)
-#define FLUSH_FILE() fflush (profiler->file)
-#define CLOSE_FILE() fclose (profiler->file);
-
-#endif
-
-#ifdef HAVE_KW_THREAD
-static __thread ProfilerPerThreadData * tls_profiler_per_thread_data;
-#define LOOKUP_PROFILER_THREAD_DATA() ((ProfilerPerThreadData*) tls_profiler_per_thread_data)
-#define SET_PROFILER_THREAD_DATA(x) tls_profiler_per_thread_data = (x)
-#define ALLOCATE_PROFILER_THREAD_DATA() /* nop */
-#define FREE_PROFILER_THREAD_DATA() /* nop */
-#endif
-
-#define GET_PROFILER_THREAD_DATA(data) do {\
- ProfilerPerThreadData *_result = LOOKUP_PROFILER_THREAD_DATA ();\
- if (!_result) {\
- _result = profiler_per_thread_data_new (profiler->per_thread_buffer_size);\
- LOCK_PROFILER ();\
- _result->next = profiler->per_thread_data;\
- profiler->per_thread_data = _result;\
- UNLOCK_PROFILER ();\
- SET_PROFILER_THREAD_DATA (_result);\
- }\
- (data) = _result;\
-} while (0)
-
-#define PROFILER_FILE_WRITE_BUFFER_SIZE (profiler->write_buffer_size)
-typedef struct _ProfilerFileWriteBuffer {
- struct _ProfilerFileWriteBuffer *next;
- guint8 buffer [MONO_ZERO_LEN_ARRAY];
-} ProfilerFileWriteBuffer;
-
-#define CHECK_PROFILER_ENABLED() do {\
- if (! profiler->profiler_enabled)\
- return;\
-} while (0)
-struct _MonoProfiler {
- MUTEX_TYPE mutex;
-
- MonoProfileFlags flags;
- gboolean profiler_enabled;
- char *file_name;
- char *file_name_suffix;
- FILE_HANDLE_TYPE file;
-
- guint64 start_time;
- guint64 start_counter;
- guint64 end_time;
- guint64 end_counter;
-
- guint64 last_header_counter;
-
- MethodIdMapping *methods;
- ClassIdMapping *classes;
-
- guint32 loaded_element_next_free_id;
- GHashTable *loaded_assemblies;
- GHashTable *loaded_modules;
- GHashTable *loaded_appdomains;
-
- guint32 per_thread_buffer_size;
- guint32 statistical_buffer_size;
- ProfilerPerThreadData* per_thread_data;
- ProfilerStatisticalData *statistical_data;
- ProfilerStatisticalData *statistical_data_ready;
- ProfilerStatisticalData *statistical_data_second_buffer;
- int statistical_call_chain_depth;
- MonoProfilerCallChainStrategy statistical_call_chain_strategy;
-
- ProfilerCodeChunks code_chunks;
-
- THREAD_TYPE data_writer_thread;
- THREAD_TYPE user_thread;
- EVENT_TYPE enable_data_writer_event;
- EVENT_TYPE wake_data_writer_event;
- EVENT_TYPE done_data_writer_event;
- gboolean terminate_writer_thread;
- gboolean writer_thread_terminated;
-
- ProfilerFileWriteBuffer *write_buffers;
- ProfilerFileWriteBuffer *current_write_buffer;
- int write_buffer_size;
- int current_write_position;
- int full_write_buffers;
-
- ProfilerHeapShotWriteJob *heap_shot_write_jobs;
- ProfilerHeapShotHeapBuffers heap;
-
- int command_port;
-
- int dump_next_heap_snapshots;
- gboolean heap_shot_was_requested;
- guint32 garbage_collection_counter;
-
- ProfilerExecutableMemoryRegions *executable_regions;
- ProfilerExecutableFiles executable_files;
-
- struct {
-#if (HAS_OPROFILE)
- gboolean oprofile;
-#endif
- gboolean jit_time;
- gboolean unreachable_objects;
- gboolean collection_summary;
- gboolean report_gc_events;
- gboolean heap_shot;
- gboolean track_stack;
- gboolean track_calls;
- gboolean save_allocation_caller;
- gboolean save_allocation_stack;
- gboolean allocations_carry_id;
- } action_flags;
-};
-static MonoProfiler *profiler;
-
-static void
-enable_profiler (void) {
- profiler->profiler_enabled = TRUE;
-}
-
-static void flush_everything (void);
-
-static void
-disable_profiler (void) {
- profiler->profiler_enabled = FALSE;
- flush_everything ();
-}
-
-static void
-request_heap_snapshot (void) {
- profiler->heap_shot_was_requested = TRUE;
- mono_gc_collect (mono_gc_max_generation ());
-}
-
-#define DEBUG_LOAD_EVENTS 0
-#define DEBUG_MAPPING_EVENTS 0
-#define DEBUG_LOGGING_PROFILER 0
-#define DEBUG_HEAP_PROFILER 0
-#define DEBUG_CLASS_BITMAPS 0
-#define DEBUG_STATISTICAL_PROFILER 0
-#define DEBUG_WRITER_THREAD 0
-#define DEBUG_USER_THREAD 0
-#define DEBUG_FILE_WRITES 0
-#if (DEBUG_LOGGING_PROFILER || DEBUG_STATISTICAL_PROFILER || DEBUG_HEAP_PROFILER || DEBUG_WRITER_THREAD || DEBUG_FILE_WRITES)
-#define LOG_WRITER_THREAD(m) printf ("WRITER-THREAD-LOG %s\n", m)
-#else
-#define LOG_WRITER_THREAD(m)
-#endif
-#if (DEBUG_LOGGING_PROFILER || DEBUG_STATISTICAL_PROFILER || DEBUG_HEAP_PROFILER || DEBUG_USER_THREAD || DEBUG_FILE_WRITES)
-#define LOG_USER_THREAD(m) printf ("USER-THREAD-LOG %s\n", m)
-#else
-#define LOG_USER_THREAD(m)
-#endif
-
-#if DEBUG_LOGGING_PROFILER
-static int event_counter = 0;
-#define EVENT_MARK() printf ("[EVENT:%d]", ++ event_counter)
-#endif
-
-static void
-thread_stack_initialize_empty (ProfilerThreadStack *stack) {
- stack->capacity = 0;
- stack->top = 0;
- stack->last_saved_top = 0;
- stack->last_written_frame = 0;
- stack->stack = NULL;
- stack->method_is_jitted = NULL;
- stack->written_frames = NULL;
-}
-
-static void
-thread_stack_free (ProfilerThreadStack *stack) {
- stack->capacity = 0;
- stack->top = 0;
- stack->last_saved_top = 0;
- stack->last_written_frame = 0;
- if (stack->stack != NULL) {
- g_free (stack->stack);
- stack->stack = NULL;
- }
- if (stack->method_is_jitted != NULL) {
- g_free (stack->method_is_jitted);
- stack->method_is_jitted = NULL;
- }
- if (stack->written_frames != NULL) {
- g_free (stack->written_frames);
- stack->written_frames = NULL;
- }
-}
-
-static void
-thread_stack_initialize (ProfilerThreadStack *stack, guint32 capacity) {
- stack->capacity = capacity;
- stack->top = 0;
- stack->last_saved_top = 0;
- stack->last_written_frame = 0;
- stack->stack = g_new0 (MonoMethod*, capacity);
- stack->method_is_jitted = g_new0 (guint8, capacity);
- stack->written_frames = g_new0 (guint32, capacity);
-}
-
-static void
-thread_stack_push_jitted (ProfilerThreadStack *stack, MonoMethod* method, gboolean method_is_jitted) {
- if (stack->top >= stack->capacity) {
- MonoMethod **old_stack = stack->stack;
- guint8 *old_method_is_jitted = stack->method_is_jitted;
- guint32 *old_written_frames = stack->written_frames;
- guint32 top = stack->top;
- guint32 last_saved_top = stack->last_saved_top;
- guint32 last_written_frame = stack->last_written_frame;
- thread_stack_initialize (stack, stack->capacity * 2);
- memcpy (stack->stack, old_stack, top * sizeof (MonoMethod*));
- memcpy (stack->method_is_jitted, old_method_is_jitted, top * sizeof (guint8));
- memcpy (stack->written_frames, old_written_frames, top * sizeof (guint32));
- g_free (old_stack);
- g_free (old_method_is_jitted);
- g_free (old_written_frames);
- stack->top = top;
- stack->last_saved_top = last_saved_top;
- stack->last_written_frame = last_written_frame;
- }
- stack->stack [stack->top] = method;
- stack->method_is_jitted [stack->top] = method_is_jitted;
- stack->top ++;
-}
-
-static inline void
-thread_stack_push (ProfilerThreadStack *stack, MonoMethod* method) {
- thread_stack_push_jitted (stack, method, FALSE);
-}
-
-static MonoMethod*
-thread_stack_pop (ProfilerThreadStack *stack) {
- if (stack->top > 0) {
- stack->top --;
- if (stack->last_saved_top > stack->top) {
- stack->last_saved_top = stack->top;
- }
- return stack->stack [stack->top];
- } else {
- return NULL;
- }
-}
-
-static MonoMethod*
-thread_stack_top (ProfilerThreadStack *stack) {
- if (stack->top > 0) {
- return stack->stack [stack->top - 1];
- } else {
- return NULL;
- }
-}
-
-static gboolean
-thread_stack_top_is_jitted (ProfilerThreadStack *stack) {
- if (stack->top > 0) {
- return stack->method_is_jitted [stack->top - 1];
- } else {
- return FALSE;
- }
-}
-
-static MonoMethod*
-thread_stack_index_from_top (ProfilerThreadStack *stack, int index) {
- if (stack->top > index) {
- return stack->stack [stack->top - (index + 1)];
- } else {
- return NULL;
- }
-}
-
-static gboolean
-thread_stack_index_from_top_is_jitted (ProfilerThreadStack *stack, int index) {
- if (stack->top > index) {
- return stack->method_is_jitted [stack->top - (index + 1)];
- } else {
- return FALSE;
- }
-}
-
-static inline void
-thread_stack_push_safely (ProfilerThreadStack *stack, MonoMethod* method) {
- if (stack->stack != NULL) {
- thread_stack_push (stack, method);
- }
-}
-
-static inline void
-thread_stack_push_jitted_safely (ProfilerThreadStack *stack, MonoMethod* method, gboolean method_is_jitted) {
- if (stack->stack != NULL) {
- thread_stack_push_jitted (stack, method, method_is_jitted);
- }
-}
-
-static inline int
-thread_stack_count_unsaved_frames (ProfilerThreadStack *stack) {
- int result = stack->top - stack->last_saved_top;
- return (result > 0) ? result : 0;
-}
-
-static inline int
-thread_stack_get_last_written_frame (ProfilerThreadStack *stack) {
- return stack->last_written_frame;
-}
-
-static inline void
-thread_stack_set_last_written_frame (ProfilerThreadStack *stack, int last_written_frame) {
- stack->last_written_frame = last_written_frame;
-}
-
-static inline guint32
-thread_stack_written_frame_at_index (ProfilerThreadStack *stack, int index) {
- return stack->written_frames [index];
-}
-
-static inline void
-thread_stack_write_frame_at_index (ProfilerThreadStack *stack, int index, guint32 method_id_and_is_jitted) {
- stack->written_frames [index] = method_id_and_is_jitted;
-}
-
-static ClassIdMappingElement*
-class_id_mapping_element_get (MonoClass *klass) {
- return g_hash_table_lookup (profiler->classes->table, (gconstpointer) klass);
-}
-
-static MethodIdMappingElement*
-method_id_mapping_element_get (MonoMethod *method) {
- return g_hash_table_lookup (profiler->methods->table, (gconstpointer) method);
-}
-
-#define BITS_TO_BYTES(v) do {\
- (v) += 7;\
- (v) &= ~7;\
- (v) >>= 3;\
-} while (0)
-
-static ClassIdMappingElement*
-class_id_mapping_element_new (MonoClass *klass) {
- ClassIdMappingElement *result = g_new (ClassIdMappingElement, 1);
-
- result->name = mono_type_full_name (mono_class_get_type (klass));
- result->klass = klass;
- result->next_unwritten = profiler->classes->unwritten;
- profiler->classes->unwritten = result;
- result->id = profiler->classes->next_id;
- profiler->classes->next_id ++;
-
- result->data.bitmap.compact = 0;
- result->data.layout.slots = CLASS_LAYOUT_NOT_INITIALIZED;
- result->data.layout.references = CLASS_LAYOUT_NOT_INITIALIZED;
-
- g_hash_table_insert (profiler->classes->table, klass, result);
-
-#if (DEBUG_MAPPING_EVENTS)
- printf ("Created new CLASS mapping element \"%s\" (%p)[%d]\n", result->name, klass, result->id);
-#endif
- return result;
-}
-
-static void
-class_id_mapping_element_build_layout_bitmap (MonoClass *klass, ClassIdMappingElement *klass_id) {
- MonoClass *parent_class = mono_class_get_parent (klass);
- int number_of_reference_fields = 0;
- int max_offset_of_reference_fields = 0;
- ClassIdMappingElement *parent_id;
- gpointer iter;
- MonoClassField *field;
-
-#if (DEBUG_CLASS_BITMAPS)
- printf ("class_id_mapping_element_build_layout_bitmap: building layout for class %s.%s: ", mono_class_get_namespace (klass), mono_class_get_name (klass));
-#endif
-
- if (parent_class != NULL) {
- parent_id = class_id_mapping_element_get (parent_class);
- g_assert (parent_id != NULL);
-
- if (parent_id->data.layout.slots == CLASS_LAYOUT_NOT_INITIALIZED) {
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[recursively building bitmap for father class]\n");
-#endif
- class_id_mapping_element_build_layout_bitmap (parent_class, parent_id);
- }
- } else {
- parent_id = NULL;
- }
-
- iter = NULL;
- while ((field = mono_class_get_fields (klass, &iter)) != NULL) {
- MonoType* field_type = mono_field_get_type (field);
- // For now, skip static fields
- if (mono_field_get_flags (field) & 0x0010 /*FIELD_ATTRIBUTE_STATIC*/)
- continue;
-
- if (MONO_TYPE_IS_REFERENCE (field_type)) {
- int field_offset = mono_field_get_offset (field) - sizeof (MonoObject);
- if (field_offset > max_offset_of_reference_fields) {
- max_offset_of_reference_fields = field_offset;
- }
- number_of_reference_fields ++;
- } else {
- MonoClass *field_class = mono_class_from_mono_type (field_type);
- if (field_class && mono_class_is_valuetype (field_class)) {
- ClassIdMappingElement *field_id = class_id_mapping_element_get (field_class);
- g_assert (field_id != NULL);
-
- if (field_id->data.layout.slots == CLASS_LAYOUT_NOT_INITIALIZED) {
- if (field_id != klass_id) {
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[recursively building bitmap for field %s]\n", mono_field_get_name (field));
-#endif
- class_id_mapping_element_build_layout_bitmap (field_class, field_id);
- } else {
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[breaking recursive bitmap build for field %s]", mono_field_get_name (field));
-
-#endif
- klass_id->data.bitmap.compact = 0;
- klass_id->data.layout.slots = 0;
- klass_id->data.layout.references = 0;
- }
- }
-
- if (field_id->data.layout.references > 0) {
- int field_offset = mono_field_get_offset (field) - sizeof (MonoObject);
- int max_offset_reference_in_field = (field_id->data.layout.slots - 1) * sizeof (gpointer);
-
- if ((field_offset + max_offset_reference_in_field) > max_offset_of_reference_fields) {
- max_offset_of_reference_fields = field_offset + max_offset_reference_in_field;
- }
-
- number_of_reference_fields += field_id->data.layout.references;
- }
- }
- }
- }
-
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[allocating bitmap for class %s.%s (references %d, max offset %d, slots %d)]", mono_class_get_namespace (klass), mono_class_get_name (klass), number_of_reference_fields, max_offset_of_reference_fields, (int)(max_offset_of_reference_fields / sizeof (gpointer)) + 1);
-#endif
- if ((number_of_reference_fields == 0) && ((parent_id == NULL) || (parent_id->data.layout.references == 0))) {
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[no references at all]");
-#endif
- klass_id->data.bitmap.compact = 0;
- klass_id->data.layout.slots = 0;
- klass_id->data.layout.references = 0;
- } else {
- if ((parent_id != NULL) && (parent_id->data.layout.references > 0)) {
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[parent %s.%s has %d references in %d slots]", mono_class_get_namespace (parent_class), mono_class_get_name (parent_class), parent_id->data.layout.references, parent_id->data.layout.slots);
-#endif
- klass_id->data.layout.slots = parent_id->data.layout.slots;
- klass_id->data.layout.references = parent_id->data.layout.references;
- } else {
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[no references from parent]");
-#endif
- klass_id->data.layout.slots = 0;
- klass_id->data.layout.references = 0;
- }
-
- if (number_of_reference_fields > 0) {
- klass_id->data.layout.slots += ((max_offset_of_reference_fields / sizeof (gpointer)) + 1);
- klass_id->data.layout.references += number_of_reference_fields;
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[adding data, going to %d references in %d slots]", klass_id->data.layout.references, klass_id->data.layout.slots);
-#endif
- }
-
- if (klass_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[zeroing bitmap]");
-#endif
- klass_id->data.bitmap.compact = 0;
- if ((parent_id != NULL) && (parent_id->data.layout.references > 0)) {
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[copying compact father bitmap]");
-#endif
- klass_id->data.bitmap.compact = parent_id->data.bitmap.compact;
- }
- } else {
- int size_of_bitmap = klass_id->data.layout.slots;
- BITS_TO_BYTES (size_of_bitmap);
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[allocating %d bytes for bitmap]", size_of_bitmap);
-#endif
- klass_id->data.bitmap.extended = g_malloc0 (size_of_bitmap);
- if ((parent_id != NULL) && (parent_id->data.layout.references > 0)) {
- int size_of_father_bitmap = parent_id->data.layout.slots;
- if (size_of_father_bitmap <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
- int father_slot;
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[copying %d bits from father bitmap]", size_of_father_bitmap);
-#endif
- for (father_slot = 0; father_slot < size_of_father_bitmap; father_slot ++) {
- if (parent_id->data.bitmap.compact & (((guint64)1) << father_slot)) {
- klass_id->data.bitmap.extended [father_slot >> 3] |= (1 << (father_slot & 7));
- }
- }
- } else {
- BITS_TO_BYTES (size_of_father_bitmap);
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[copying %d bytes from father bitmap]", size_of_father_bitmap);
-#endif
- memcpy (klass_id->data.bitmap.extended, parent_id->data.bitmap.extended, size_of_father_bitmap);
- }
- }
- }
- }
-
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[starting filling iteration]\n");
-#endif
- iter = NULL;
- while ((field = mono_class_get_fields (klass, &iter)) != NULL) {
- MonoType* field_type = mono_field_get_type (field);
- // For now, skip static fields
- if (mono_field_get_flags (field) & 0x0010 /*FIELD_ATTRIBUTE_STATIC*/)
- continue;
-
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[Working on field %s]", mono_field_get_name (field));
-#endif
- if (MONO_TYPE_IS_REFERENCE (field_type)) {
- int field_offset = mono_field_get_offset (field) - sizeof (MonoObject);
- int field_slot;
- g_assert ((field_offset % sizeof (gpointer)) == 0);
- field_slot = field_offset / sizeof (gpointer);
- if (klass_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
- klass_id->data.bitmap.compact |= (((guint64)1) << field_slot);
- } else {
- klass_id->data.bitmap.extended [field_slot >> 3] |= (1 << (field_slot & 7));
- }
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[reference at offset %d, slot %d]", field_offset, field_slot);
-#endif
- } else {
- MonoClass *field_class = mono_class_from_mono_type (field_type);
- if (field_class && mono_class_is_valuetype (field_class)) {
- ClassIdMappingElement *field_id = class_id_mapping_element_get (field_class);
- int field_offset;
- int field_slot;
-
- g_assert (field_id != NULL);
- field_offset = mono_field_get_offset (field) - sizeof (MonoObject);
- g_assert ((field_id->data.layout.references == 0) || ((field_offset % sizeof (gpointer)) == 0));
- field_slot = field_offset / sizeof (gpointer);
-#if (DEBUG_CLASS_BITMAPS)
- printf ("[value type at offset %d, slot %d, with %d references in %d slots]", field_offset, field_slot, field_id->data.layout.references, field_id->data.layout.slots);
-#endif
-
- if (field_id->data.layout.references > 0) {
- int sub_field_slot;
- if (field_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
- for (sub_field_slot = 0; sub_field_slot < field_id->data.layout.slots; sub_field_slot ++) {
- if (field_id->data.bitmap.compact & (((guint64)1) << sub_field_slot)) {
- int actual_slot = field_slot + sub_field_slot;
- if (klass_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
- klass_id->data.bitmap.compact |= (((guint64)1) << actual_slot);
- } else {
- klass_id->data.bitmap.extended [actual_slot >> 3] |= (1 << (actual_slot & 7));
- }
- }
- }
- } else {
- for (sub_field_slot = 0; sub_field_slot < field_id->data.layout.slots; sub_field_slot ++) {
- if (field_id->data.bitmap.extended [sub_field_slot >> 3] & (1 << (sub_field_slot & 7))) {
- int actual_slot = field_slot + sub_field_slot;
- if (klass_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
- klass_id->data.bitmap.compact |= (((guint64)1) << actual_slot);
- } else {
- klass_id->data.bitmap.extended [actual_slot >> 3] |= (1 << (actual_slot & 7));
- }
- }
- }
- }
- }
- }
- }
- }
-#if (DEBUG_CLASS_BITMAPS)
- do {
- int slot;
- printf ("\nLayot of class \"%s.%s\": references %d, slots %d, bitmap {", mono_class_get_namespace (klass), mono_class_get_name (klass), klass_id->data.layout.references, klass_id->data.layout.slots);
- for (slot = 0; slot < klass_id->data.layout.slots; slot ++) {
- if (klass_id->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
- if (klass_id->data.bitmap.compact & (((guint64)1) << slot)) {
- printf (" 1");
- } else {
- printf (" 0");
- }
- } else {
- if (klass_id->data.bitmap.extended [slot >> 3] & (1 << (slot & 7))) {
- printf (" 1");
- } else {
- printf (" 0");
- }
-; }
-
- }
- printf (" }\n");
-
- } while (0);
-#endif
-}
-
-static MethodIdMappingElement*
-method_id_mapping_element_new (MonoMethod *method) {
- MethodIdMappingElement *result = g_new (MethodIdMappingElement, 1);
- char *signature = mono_signature_get_desc (mono_method_signature (method), TRUE);
-
- result->name = g_strdup_printf ("%s (%s)", mono_method_get_name (method), signature);
- g_free (signature);
- result->method = method;
- result->next_unwritten = profiler->methods->unwritten;
- profiler->methods->unwritten = result;
- result->id = profiler->methods->next_id;
- profiler->methods->next_id ++;
- g_hash_table_insert (profiler->methods->table, method, result);
-
- result->data.code_start = NULL;
- result->data.code_size = 0;
-
-#if (DEBUG_MAPPING_EVENTS)
- printf ("Created new METHOD mapping element \"%s\" (%p)[%d]\n", result->name, method, result->id);
-#endif
- return result;
-}
-
-
-static void
-method_id_mapping_element_destroy (gpointer element) {
- MethodIdMappingElement *e = (MethodIdMappingElement*) element;
- if (e->name)
- g_free (e->name);
- g_free (element);
-}
-
-static void
-class_id_mapping_element_destroy (gpointer element) {
- ClassIdMappingElement *e = (ClassIdMappingElement*) element;
- if (e->name)
- g_free (e->name);
- if ((e->data.layout.slots != CLASS_LAYOUT_NOT_INITIALIZED) && (e->data.layout.slots > CLASS_LAYOUT_PACKED_BITMAP_SIZE))
- g_free (e->data.bitmap.extended);
- g_free (element);
-}
-
-static MethodIdMapping*
-method_id_mapping_new (void) {
- MethodIdMapping *result = g_new (MethodIdMapping, 1);
- //result->table = g_hash_table_new_full (mono_aligned_addr_hash, NULL, NULL, method_id_mapping_element_destroy);
- result->table = g_hash_table_new_full (g_direct_hash, NULL, NULL, method_id_mapping_element_destroy);
- result->unwritten = NULL;
- result->next_id = 1;
- return result;
-}
-
-static ClassIdMapping*
-class_id_mapping_new (void) {
- ClassIdMapping *result = g_new (ClassIdMapping, 1);
- //result->table = g_hash_table_new_full (mono_aligned_addr_hash, NULL, NULL, class_id_mapping_element_destroy);
- result->table = g_hash_table_new_full (g_direct_hash, NULL, NULL, class_id_mapping_element_destroy);
- result->unwritten = NULL;
- result->next_id = 1;
- return result;
-}
-
-static void
-method_id_mapping_destroy (MethodIdMapping *map) {
- g_hash_table_destroy (map->table);
- g_free (map);
-}
-
-static void
-class_id_mapping_destroy (ClassIdMapping *map) {
- g_hash_table_destroy (map->table);
- g_free (map);
-}
-
-#if (DEBUG_LOAD_EVENTS)
-static void
-print_load_event (const char *event_name, GHashTable *table, gpointer item, LoadedElement *element);
-#endif
-
-static LoadedElement*
-loaded_element_load_start (GHashTable *table, gpointer item) {
- LoadedElement *element = g_new0 (LoadedElement, 1);
- element->id = profiler->loaded_element_next_free_id;
- profiler->loaded_element_next_free_id ++;
-#if (DEBUG_LOAD_EVENTS)
- print_load_event ("LOAD START", table, item, element);
-#endif
- MONO_PROFILER_GET_CURRENT_COUNTER (element->load_start_counter);
- g_hash_table_insert (table, item, element);
- return element;
-}
-
-static LoadedElement*
-loaded_element_load_end (GHashTable *table, gpointer item, char *name) {
- LoadedElement *element = g_hash_table_lookup (table, item);
-#if (DEBUG_LOAD_EVENTS)
- print_load_event ("LOAD END", table, item, element);
-#endif
- g_assert (element != NULL);
- MONO_PROFILER_GET_CURRENT_COUNTER (element->load_end_counter);
- element->name = name;
- element->loaded = TRUE;
- return element;
-}
-
-static LoadedElement*
-loaded_element_unload_start (GHashTable *table, gpointer item) {
- LoadedElement *element = g_hash_table_lookup (table, item);
-#if (DEBUG_LOAD_EVENTS)
- print_load_event ("UNLOAD START", table, item, element);
-#endif
- g_assert (element != NULL);
- MONO_PROFILER_GET_CURRENT_COUNTER (element->unload_start_counter);
- return element;
-}
-
-static LoadedElement*
-loaded_element_unload_end (GHashTable *table, gpointer item) {
- LoadedElement *element = g_hash_table_lookup (table, item);
-#if (DEBUG_LOAD_EVENTS)
- print_load_event ("UNLOAD END", table, item, element);
-#endif
- g_assert (element != NULL);
- MONO_PROFILER_GET_CURRENT_COUNTER (element->unload_end_counter);
- element->unloaded = TRUE;
- return element;
-}
-
-static LoadedElement*
-loaded_element_find (GHashTable *table, gpointer item) {
- LoadedElement *element = g_hash_table_lookup (table, item);
- return element;
-}
-
-static guint32
-loaded_element_get_id (GHashTable *table, gpointer item) {
- LoadedElement *element = loaded_element_find (table, item);
- if (element != NULL) {
- return element->id;
- } else {
- return 0;
- }
-}
-
-static void
-loaded_element_destroy (gpointer element) {
- if (((LoadedElement*)element)->name)
- g_free (((LoadedElement*)element)->name);
- g_free (element);
-}
-
-#if (DEBUG_LOAD_EVENTS)
-static void
-print_load_event (const char *event_name, GHashTable *table, gpointer item, LoadedElement *element) {
- const char* item_name;
- char* item_info;
-
- if (table == profiler->loaded_assemblies) {
- //item_info = g_strdup_printf("ASSEMBLY %p (dynamic %d)", item, mono_image_is_dynamic (mono_assembly_get_image((MonoAssembly*)item)));
- item_info = g_strdup_printf("ASSEMBLY %p", item);
- } else if (table == profiler->loaded_modules) {
- //item_info = g_strdup_printf("MODULE %p (dynamic %d)", item, mono_image_is_dynamic ((MonoImage*)item));
- item_info = g_strdup_printf("MODULE %p", item);
- } else if (table == profiler->loaded_appdomains) {
- item_info = g_strdup_printf("APPDOMAIN %p (id %d)", item, mono_domain_get_id ((MonoDomain*)item));
- } else {
- item_info = NULL;
- g_assert_not_reached ();
- }
-
- if (element != NULL) {
- item_name = element->name;
- } else {
- item_name = "<NULL>";
- }
-
- printf ("%s EVENT for %s (%s [id %d])\n", event_name, item_info, item_name, element->id);
- g_free (item_info);
-}
-#endif
-
-static void
-profiler_heap_shot_object_buffers_destroy (ProfilerHeapShotObjectBuffer *buffer) {
- while (buffer != NULL) {
- ProfilerHeapShotObjectBuffer *next = buffer->next;
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_object_buffers_destroy: destroyed buffer %p (%p-%p)\n", buffer, & (buffer->buffer [0]), buffer->end);
-#endif
- g_free (buffer);
- buffer = next;
- }
-}
-
-static ProfilerHeapShotObjectBuffer*
-profiler_heap_shot_object_buffer_new (ProfilerPerThreadData *data) {
- ProfilerHeapShotObjectBuffer *buffer;
- ProfilerHeapShotObjectBuffer *result = g_new (ProfilerHeapShotObjectBuffer, 1);
- result->next_free_slot = & (result->buffer [0]);
- result->end = & (result->buffer [PROFILER_HEAP_SHOT_OBJECT_BUFFER_SIZE]);
- result->first_unprocessed_slot = & (result->buffer [0]);
- result->next = data->heap_shot_object_buffers;
- data->heap_shot_object_buffers = result;
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_object_buffer_new: created buffer %p (%p-%p)\n", result, result->next_free_slot, result->end);
-#endif
- for (buffer = result; buffer != NULL; buffer = buffer->next) {
- ProfilerHeapShotObjectBuffer *last = buffer->next;
- if ((last != NULL) && (last->first_unprocessed_slot == last->end)) {
- buffer->next = NULL;
- profiler_heap_shot_object_buffers_destroy (last);
- }
- }
-
- return result;
-}
-
-static ProfilerHeapShotWriteJob*
-profiler_heap_shot_write_job_new (gboolean heap_shot_was_requested, gboolean dump_heap_data, guint32 collection) {
- ProfilerHeapShotWriteJob *job = g_new (ProfilerHeapShotWriteJob, 1);
- job->next = NULL;
- job->next_unwritten = NULL;
-
- if (profiler->action_flags.unreachable_objects || dump_heap_data) {
- job->buffers = g_new (ProfilerHeapShotWriteBuffer, 1);
- job->buffers->next = NULL;
- job->last_next = & (job->buffers->next);
- job->start = & (job->buffers->buffer [0]);
- job->cursor = job->start;
- job->end = & (job->buffers->buffer [PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE]);
- } else {
- job->buffers = NULL;
- job->last_next = NULL;
- job->start = NULL;
- job->cursor = NULL;
- job->end = NULL;
- }
- job->full_buffers = 0;
-
- if (profiler->action_flags.collection_summary) {
- job->summary.capacity = profiler->classes->next_id;
- job->summary.per_class_data = g_new0 (ProfilerHeapShotClassSummary, job->summary.capacity);
- } else {
- job->summary.capacity = 0;
- job->summary.per_class_data = NULL;
- }
-
- job->heap_shot_was_requested = heap_shot_was_requested;
- job->collection = collection;
- job->dump_heap_data = dump_heap_data;
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_job_new: created job %p with buffer %p(%p-%p) (collection %d, dump %d)\n", job, job->buffers, job->start, job->end, collection, dump_heap_data);
-#endif
- return job;
-}
-
-static gboolean
-profiler_heap_shot_write_job_has_data (ProfilerHeapShotWriteJob *job) {
- return ((job->buffers != NULL) || (job->summary.capacity > 0));
-}
-
-static void
-profiler_heap_shot_write_job_add_buffer (ProfilerHeapShotWriteJob *job, gpointer value) {
- ProfilerHeapShotWriteBuffer *buffer = g_new (ProfilerHeapShotWriteBuffer, 1);
- buffer->next = NULL;
- *(job->last_next) = buffer;
- job->last_next = & (buffer->next);
- job->full_buffers ++;
- buffer->buffer [0] = value;
- job->start = & (buffer->buffer [0]);
- job->cursor = & (buffer->buffer [1]);
- job->end = & (buffer->buffer [PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE]);
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_job_add_buffer: in job %p, added buffer %p(%p-%p) with value %p at address %p (cursor now %p)\n", job, buffer, job->start, job->end, value, &(buffer->buffer [0]), job->cursor);
- do {
- ProfilerHeapShotWriteBuffer *current_buffer;
- for (current_buffer = job->buffers; current_buffer != NULL; current_buffer = current_buffer->next) {
- printf ("profiler_heap_shot_write_job_add_buffer: now job %p has buffer %p\n", job, current_buffer);
- }
- } while (0);
-#endif
-}
-
-static void
-profiler_heap_shot_write_job_free_buffers (ProfilerHeapShotWriteJob *job) {
- ProfilerHeapShotWriteBuffer *buffer = job->buffers;
-
- while (buffer != NULL) {
- ProfilerHeapShotWriteBuffer *next = buffer->next;
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_job_free_buffers: in job %p, freeing buffer %p\n", job, buffer);
-#endif
- g_free (buffer);
- buffer = next;
- }
-
- job->buffers = NULL;
-
- if (job->summary.per_class_data != NULL) {
- g_free (job->summary.per_class_data);
- job->summary.per_class_data = NULL;
- }
- job->summary.capacity = 0;
-}
-
-static void
-profiler_heap_shot_write_block (ProfilerHeapShotWriteJob *job);
-
-static void
-profiler_process_heap_shot_write_jobs (void) {
- gboolean done = FALSE;
-
- while (!done) {
- ProfilerHeapShotWriteJob *current_job = profiler->heap_shot_write_jobs;
- ProfilerHeapShotWriteJob *previous_job = NULL;
- ProfilerHeapShotWriteJob *next_job;
-
- done = TRUE;
- while (current_job != NULL) {
- next_job = current_job->next_unwritten;
-
- if (next_job != NULL) {
- if (profiler_heap_shot_write_job_has_data (current_job)) {
- done = FALSE;
- }
- if (! profiler_heap_shot_write_job_has_data (next_job)) {
- current_job->next_unwritten = NULL;
- next_job = NULL;
- }
- } else {
- if (profiler_heap_shot_write_job_has_data (current_job)) {
- LOG_WRITER_THREAD ("profiler_process_heap_shot_write_jobs: writing...");
- profiler_heap_shot_write_block (current_job);
- LOG_WRITER_THREAD ("profiler_process_heap_shot_write_jobs: done");
- if (previous_job != NULL) {
- previous_job->next_unwritten = NULL;
- }
- }
- }
-
- previous_job = current_job;
- current_job = next_job;
- }
- }
-}
-
-static void
-profiler_free_heap_shot_write_jobs (void) {
- ProfilerHeapShotWriteJob *current_job = profiler->heap_shot_write_jobs;
- ProfilerHeapShotWriteJob *next_job;
-
- if (current_job != NULL) {
- while (current_job->next_unwritten != NULL) {
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_free_heap_shot_write_jobs: job %p must not be freed\n", current_job);
-#endif
- current_job = current_job->next_unwritten;
- }
-
- next_job = current_job->next;
- current_job->next = NULL;
- current_job = next_job;
-
- while (current_job != NULL) {
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_free_heap_shot_write_jobs: job %p will be freed\n", current_job);
-#endif
- next_job = current_job->next;
- profiler_heap_shot_write_job_free_buffers (current_job);
- g_free (current_job);
- current_job = next_job;
- }
- }
-}
-
-static void
-profiler_destroy_heap_shot_write_jobs (void) {
- ProfilerHeapShotWriteJob *current_job = profiler->heap_shot_write_jobs;
- ProfilerHeapShotWriteJob *next_job;
-
- while (current_job != NULL) {
- next_job = current_job->next;
- profiler_heap_shot_write_job_free_buffers (current_job);
- g_free (current_job);
- current_job = next_job;
- }
-}
-
-static void
-profiler_add_heap_shot_write_job (ProfilerHeapShotWriteJob *job) {
- job->next = profiler->heap_shot_write_jobs;
- job->next_unwritten = job->next;
- profiler->heap_shot_write_jobs = job;
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_add_heap_shot_write_job: added job %p\n", job);
-#endif
-}
-
-#if DEBUG_HEAP_PROFILER
-#define STORE_ALLOCATED_OBJECT_MESSAGE1(d,o) printf ("STORE_ALLOCATED_OBJECT[TID %ld]: storing object %p at address %p\n", (d)->thread_id, (o), (d)->heap_shot_object_buffers->next_free_slot)
-#define STORE_ALLOCATED_OBJECT_MESSAGE2(d,o) printf ("STORE_ALLOCATED_OBJECT[TID %ld]: storing object %p at address %p in new buffer %p\n", (d)->thread_id, (o), buffer->next_free_slot, buffer)
-#else
-#define STORE_ALLOCATED_OBJECT_MESSAGE1(d,o)
-#define STORE_ALLOCATED_OBJECT_MESSAGE2(d,o)
-#endif
-#define STORE_ALLOCATED_OBJECT(d,o) do {\
- if ((d)->heap_shot_object_buffers->next_free_slot < (d)->heap_shot_object_buffers->end) {\
- STORE_ALLOCATED_OBJECT_MESSAGE1 ((d), (o));\
- *((d)->heap_shot_object_buffers->next_free_slot) = (o);\
- (d)->heap_shot_object_buffers->next_free_slot ++;\
- } else {\
- ProfilerHeapShotObjectBuffer *buffer = profiler_heap_shot_object_buffer_new (d);\
- STORE_ALLOCATED_OBJECT_MESSAGE2 ((d), (o));\
- *((buffer)->next_free_slot) = (o);\
- (buffer)->next_free_slot ++;\
- }\
-} while (0)
-
-static ProfilerPerThreadData*
-profiler_per_thread_data_new (guint32 buffer_size)
-{
- ProfilerPerThreadData *data = g_new (ProfilerPerThreadData, 1);
-
- data->events = g_new0 (ProfilerEventData, buffer_size);
- data->next_free_event = data->events;
- data->next_unreserved_event = data->events;
- data->end_event = data->events + (buffer_size - 1);
- data->first_unwritten_event = data->events;
- data->first_unmapped_event = data->events;
- MONO_PROFILER_GET_CURRENT_COUNTER (data->start_event_counter);
- data->last_event_counter = data->start_event_counter;
- data->thread_id = CURRENT_THREAD_ID ();
- data->heap_shot_object_buffers = NULL;
- if ((profiler->action_flags.unreachable_objects == TRUE) ||
- (profiler->action_flags.heap_shot == TRUE) ||
- (profiler->action_flags.collection_summary == TRUE)) {
- profiler_heap_shot_object_buffer_new (data);
- }
- if (profiler->action_flags.track_stack) {
- thread_stack_initialize (&(data->stack), 64);
- } else {
- thread_stack_initialize_empty (&(data->stack));
- }
- return data;
-}
-
-static void
-profiler_per_thread_data_destroy (ProfilerPerThreadData *data) {
- g_free (data->events);
- profiler_heap_shot_object_buffers_destroy (data->heap_shot_object_buffers);
- thread_stack_free (&(data->stack));
- g_free (data);
-}
-
-static ProfilerStatisticalData*
-profiler_statistical_data_new (MonoProfiler *profiler) {
- int buffer_size = profiler->statistical_buffer_size * (profiler->statistical_call_chain_depth + 1);
- ProfilerStatisticalData *data = g_new (ProfilerStatisticalData, 1);
-
- data->hits = g_new0 (ProfilerStatisticalHit, buffer_size);
- data->next_free_index = 0;
- data->end_index = profiler->statistical_buffer_size;
- data->first_unwritten_index = 0;
-
- return data;
-}
-
-static void
-profiler_statistical_data_destroy (ProfilerStatisticalData *data) {
- g_free (data->hits);
- g_free (data);
-}
-
-static ProfilerCodeBufferArray*
-profiler_code_buffer_array_new (ProfilerCodeBufferArray *child) {
- ProfilerCodeBufferArray *result = g_new0 (ProfilerCodeBufferArray, 1);
- if (child == NULL) {
- result->level = 0;
- } else {
- result->level = child->level + 1;
- result->number_of_buffers = 1;
- result->buffers [0].info.data.sub_buffers = child;
- result->buffers [0].start = child->buffers [0].start;
- result->buffers [0].end = child->buffers [child->number_of_buffers - 1].end;
- }
- return result;
-}
-
-static void
-profiler_code_buffer_array_destroy (ProfilerCodeBufferArray *buffers) {
- if (buffers->level > 0) {
- int i;
- for (i = 0; i < buffers->number_of_buffers; i++) {
- ProfilerCodeBufferArray *sub_buffers = buffers->buffers [i].info.data.sub_buffers;
- profiler_code_buffer_array_destroy (sub_buffers);
- }
- }
- g_free (buffers);
-}
-
-static gboolean
-profiler_code_buffer_array_is_full (ProfilerCodeBufferArray *buffers) {
- while (buffers->level > 0) {
- ProfilerCodeBufferArray *next;
- if (buffers->number_of_buffers < PROFILER_CODE_BUFFER_ARRAY_SIZE) {
- return FALSE;
- }
- next = buffers->buffers [PROFILER_CODE_BUFFER_ARRAY_SIZE - 1].info.data.sub_buffers;
- if (next->level < (buffers->level - 1)) {
- return FALSE;
- }
- buffers = next;
- }
- return (buffers->number_of_buffers == PROFILER_CODE_BUFFER_ARRAY_SIZE);
-}
-
-static ProfilerCodeBufferArray*
-profiler_code_buffer_add (ProfilerCodeBufferArray *buffers, gpointer *buffer, int size, MonoProfilerCodeBufferType type, void *data) {
- if (buffers == NULL) {
- buffers = profiler_code_buffer_array_new (NULL);
- }
-
- if (profiler_code_buffer_array_is_full (buffers)) {
- ProfilerCodeBufferArray *new_slot = profiler_code_buffer_add (NULL, buffer, size, type, data);
- buffers = profiler_code_buffer_array_new (buffers);
- buffers->buffers [buffers->number_of_buffers].info.data.sub_buffers = new_slot;
- buffers->buffers [buffers->number_of_buffers].start = new_slot->buffers [0].start;
- buffers->buffers [buffers->number_of_buffers].end = new_slot->buffers [new_slot->number_of_buffers - 1].end;
- buffers->number_of_buffers ++;
- } else if (buffers->level > 0) {
- ProfilerCodeBufferArray *new_slot = profiler_code_buffer_add (buffers->buffers [buffers->number_of_buffers - 1].info.data.sub_buffers, buffer, size, type, data);
- buffers->buffers [buffers->number_of_buffers - 1].info.data.sub_buffers = new_slot;
- buffers->buffers [buffers->number_of_buffers - 1].start = new_slot->buffers [0].start;
- buffers->buffers [buffers->number_of_buffers - 1].end = new_slot->buffers [new_slot->number_of_buffers - 1].end;
- } else {
- buffers->buffers [buffers->number_of_buffers].start = buffer;
- buffers->buffers [buffers->number_of_buffers].end = (((guint8*) buffer) + size);
- buffers->buffers [buffers->number_of_buffers].info.type = type;
- switch (type) {
- case MONO_PROFILER_CODE_BUFFER_UNKNOWN:
- buffers->buffers [buffers->number_of_buffers].info.data.data = NULL;
- break;
- case MONO_PROFILER_CODE_BUFFER_METHOD:
- buffers->buffers [buffers->number_of_buffers].info.data.method = data;
- break;
- default:
- buffers->buffers [buffers->number_of_buffers].info.type = MONO_PROFILER_CODE_BUFFER_UNKNOWN;
- buffers->buffers [buffers->number_of_buffers].info.data.data = NULL;
- }
- buffers->number_of_buffers ++;
- }
- return buffers;
-}
-
-static ProfilerCodeBuffer*
-profiler_code_buffer_find (ProfilerCodeBufferArray *buffers, gpointer *address) {
- if (buffers != NULL) {
- ProfilerCodeBuffer *result = NULL;
- do {
- int low = 0;
- int high = buffers->number_of_buffers - 1;
-
- while (high != low) {
- int middle = low + ((high - low) >> 1);
-
- if ((guint8*) address < (guint8*) buffers->buffers [low].start) {
- return NULL;
- }
- if ((guint8*) address >= (guint8*) buffers->buffers [high].end) {
- return NULL;
- }
-
- if ((guint8*) address < (guint8*) buffers->buffers [middle].start) {
- high = middle - 1;
- if (high < low) {
- high = low;
- }
- } else if ((guint8*) address >= (guint8*) buffers->buffers [middle].end) {
- low = middle + 1;
- if (low > high) {
- low = high;
- }
- } else {
- high = middle;
- low = middle;
- }
- }
-
- if (((guint8*) address >= (guint8*) buffers->buffers [low].start) && ((guint8*) address < (guint8*) buffers->buffers [low].end)) {
- if (buffers->level == 0) {
- result = & (buffers->buffers [low]);
- } else {
- buffers = buffers->buffers [low].info.data.sub_buffers;
- }
- } else {
- return NULL;
- }
- } while (result == NULL);
- return result;
- } else {
- return NULL;
- }
-}
-
-static void
-profiler_code_chunk_initialize (ProfilerCodeChunk *chunk, gpointer memory, gsize size) {
- chunk->buffers = profiler_code_buffer_array_new (NULL);
- chunk->destroyed = FALSE;
- chunk->start = memory;
- chunk->end = ((guint8*)memory) + size;
-}
-
-static void
-profiler_code_chunk_cleanup (ProfilerCodeChunk *chunk) {
- if (chunk->buffers != NULL) {
- profiler_code_buffer_array_destroy (chunk->buffers);
- chunk->buffers = NULL;
- }
- chunk->start = NULL;
- chunk->end = NULL;
-}
-
-static void
-profiler_code_chunks_initialize (ProfilerCodeChunks *chunks) {
- chunks->capacity = 32;
- chunks->chunks = g_new0 (ProfilerCodeChunk, 32);
- chunks->number_of_chunks = 0;
-}
-
-static void
-profiler_code_chunks_cleanup (ProfilerCodeChunks *chunks) {
- int i;
- for (i = 0; i < chunks->number_of_chunks; i++) {
- profiler_code_chunk_cleanup (& (chunks->chunks [i]));
- }
- chunks->capacity = 0;
- chunks->number_of_chunks = 0;
- g_free (chunks->chunks);
- chunks->chunks = NULL;
-}
-
-static int
-compare_code_chunks (const void* c1, const void* c2) {
- ProfilerCodeChunk *chunk1 = (ProfilerCodeChunk*) c1;
- ProfilerCodeChunk *chunk2 = (ProfilerCodeChunk*) c2;
- return ((guint8*) chunk1->end < (guint8*) chunk2->start) ? -1 : (((guint8*) chunk1->start >= (guint8*) chunk2->end) ? 1 : 0);
-}
-
-static int
-compare_address_and_code_chunk (const void* a, const void* c) {
- gpointer address = (gpointer) a;
- ProfilerCodeChunk *chunk = (ProfilerCodeChunk*) c;
- return ((guint8*) address < (guint8*) chunk->start) ? -1 : (((guint8*) address >= (guint8*) chunk->end) ? 1 : 0);
-}
-
-static void
-profiler_code_chunks_sort (ProfilerCodeChunks *chunks) {
- qsort (chunks->chunks, chunks->number_of_chunks, sizeof (ProfilerCodeChunk), compare_code_chunks);
-}
-
-static ProfilerCodeChunk*
-profiler_code_chunk_find (ProfilerCodeChunks *chunks, gpointer address) {
- return bsearch (address, chunks->chunks, chunks->number_of_chunks, sizeof (ProfilerCodeChunk), compare_address_and_code_chunk);
-}
-
-static ProfilerCodeChunk*
-profiler_code_chunk_new (ProfilerCodeChunks *chunks, gpointer memory, gsize size) {
- ProfilerCodeChunk *result;
-
- if (chunks->number_of_chunks == chunks->capacity) {
- ProfilerCodeChunk *new_chunks = g_new0 (ProfilerCodeChunk, chunks->capacity * 2);
- memcpy (new_chunks, chunks->chunks, chunks->capacity * sizeof (ProfilerCodeChunk));
- chunks->capacity *= 2;
- g_free (chunks->chunks);
- chunks->chunks = new_chunks;
- }
-
- result = & (chunks->chunks [chunks->number_of_chunks]);
- chunks->number_of_chunks ++;
- profiler_code_chunk_initialize (result, memory, size);
- profiler_code_chunks_sort (chunks);
- return result;
-}
-
-static int
-profiler_code_chunk_to_index (ProfilerCodeChunks *chunks, ProfilerCodeChunk *chunk) {
- return (int) (chunk - chunks->chunks);
-}
-
-static void
-profiler_code_chunk_remove (ProfilerCodeChunks *chunks, ProfilerCodeChunk *chunk) {
- int index = profiler_code_chunk_to_index (chunks, chunk);
-
- profiler_code_chunk_cleanup (chunk);
- if ((index >= 0) && (index < chunks->number_of_chunks)) {
- memmove (chunk, chunk + 1, (chunks->number_of_chunks - index) * sizeof (ProfilerCodeChunk));
- }
-}
-
-/* This assumes the profiler lock is held */
-static ProfilerCodeBuffer*
-profiler_code_buffer_from_address (MonoProfiler *prof, gpointer address) {
- ProfilerCodeChunks *chunks = & (prof->code_chunks);
-
- ProfilerCodeChunk *chunk = profiler_code_chunk_find (chunks, address);
- if (chunk != NULL) {
- return profiler_code_buffer_find (chunk->buffers, address);
- } else {
- return NULL;
- }
-}
-
-static void
-profiler_code_chunk_new_callback (MonoProfiler *prof, gpointer address, int size) {
- ProfilerCodeChunks *chunks = & (prof->code_chunks);
-
- if (prof->code_chunks.chunks != NULL) {
- LOCK_PROFILER ();
- profiler_code_chunk_new (chunks, address, size);
- UNLOCK_PROFILER ();
- }
-}
-
-static void
-profiler_code_chunk_destroy_callback (MonoProfiler *prof, gpointer address) {
- ProfilerCodeChunks *chunks = & (prof->code_chunks);
- ProfilerCodeChunk *chunk;
-
- if (prof->code_chunks.chunks != NULL) {
- LOCK_PROFILER ();
- chunk = profiler_code_chunk_find (chunks, address);
- if (chunk != NULL) {
- profiler_code_chunk_remove (chunks, chunk);
- }
- UNLOCK_PROFILER ();
- }
-}
-
-static void
-profiler_code_buffer_new_callback (MonoProfiler *prof, gpointer address, int size, MonoProfilerCodeBufferType type, void *data) {
- ProfilerCodeChunks *chunks = & (prof->code_chunks);
- ProfilerCodeChunk *chunk;
-
- if (prof->code_chunks.chunks != NULL) {
- LOCK_PROFILER ();
- chunk = profiler_code_chunk_find (chunks, address);
- if (chunk != NULL) {
- chunk->buffers = profiler_code_buffer_add (chunk->buffers, address, size, type, data);
- }
- UNLOCK_PROFILER ();
- }
-}
-
-static void
-profiler_add_write_buffer (void) {
- if (profiler->current_write_buffer->next == NULL) {
- profiler->current_write_buffer->next = g_malloc (sizeof (ProfilerFileWriteBuffer) + PROFILER_FILE_WRITE_BUFFER_SIZE);
- profiler->current_write_buffer->next->next = NULL;
-
- //printf ("Added next buffer %p, to buffer %p\n", profiler->current_write_buffer->next, profiler->current_write_buffer);
-
- }
- profiler->current_write_buffer = profiler->current_write_buffer->next;
- profiler->current_write_position = 0;
- profiler->full_write_buffers ++;
-}
-
-static void
-profiler_free_write_buffers (void) {
- ProfilerFileWriteBuffer *current_buffer = profiler->write_buffers;
- while (current_buffer != NULL) {
- ProfilerFileWriteBuffer *next_buffer = current_buffer->next;
-
- //printf ("Freeing write buffer %p, next is %p\n", current_buffer, next_buffer);
-
- g_free (current_buffer);
- current_buffer = next_buffer;
- }
-}
-
-#define WRITE_BYTE(b) do {\
- if (profiler->current_write_position >= PROFILER_FILE_WRITE_BUFFER_SIZE) {\
- profiler_add_write_buffer ();\
- }\
- profiler->current_write_buffer->buffer [profiler->current_write_position] = (b);\
- profiler->current_write_position ++;\
-} while (0)
-
-#if (DEBUG_FILE_WRITES)
-static int bytes_written = 0;
-#endif
-
-static void
-write_current_block (guint16 code) {
- guint32 size = (profiler->full_write_buffers * PROFILER_FILE_WRITE_BUFFER_SIZE) + profiler->current_write_position;
- ProfilerFileWriteBuffer *current_buffer = profiler->write_buffers;
- guint64 current_counter;
- guint32 counter_delta;
- guint8 header [10];
-
- MONO_PROFILER_GET_CURRENT_COUNTER (current_counter);
- if (profiler->last_header_counter != 0) {
- counter_delta = current_counter - profiler->last_header_counter;
- } else {
- counter_delta = 0;
- }
- profiler->last_header_counter = current_counter;
-
- header [0] = code & 0xff;
- header [1] = (code >> 8) & 0xff;
- header [2] = size & 0xff;
- header [3] = (size >> 8) & 0xff;
- header [4] = (size >> 16) & 0xff;
- header [5] = (size >> 24) & 0xff;
- header [6] = counter_delta & 0xff;
- header [7] = (counter_delta >> 8) & 0xff;
- header [8] = (counter_delta >> 16) & 0xff;
- header [9] = (counter_delta >> 24) & 0xff;
-
-#if (DEBUG_FILE_WRITES)
- printf ("write_current_block: writing header (code %d) at offset %d\n", code, bytes_written);
- bytes_written += 10;
-#endif
- WRITE_BUFFER (& (header [0]), 10);
-
- while ((current_buffer != NULL) && (profiler->full_write_buffers > 0)) {
-#if (DEBUG_FILE_WRITES)
- printf ("write_current_block: writing buffer (size %d)\n", PROFILER_FILE_WRITE_BUFFER_SIZE);
- bytes_written += PROFILER_FILE_WRITE_BUFFER_SIZE;
-#endif
- WRITE_BUFFER (& (current_buffer->buffer [0]), PROFILER_FILE_WRITE_BUFFER_SIZE);
- profiler->full_write_buffers --;
- current_buffer = current_buffer->next;
- }
- if (profiler->current_write_position > 0) {
-#if (DEBUG_FILE_WRITES)
- printf ("write_current_block: writing last buffer (size %d)\n", profiler->current_write_position);
- bytes_written += profiler->current_write_position;
-#endif
- WRITE_BUFFER (& (current_buffer->buffer [0]), profiler->current_write_position);
- }
- FLUSH_FILE ();
-#if (DEBUG_FILE_WRITES)
- printf ("write_current_block: buffers flushed (file size %d)\n", bytes_written);
-#endif
-
- profiler->current_write_buffer = profiler->write_buffers;
- profiler->current_write_position = 0;
- profiler->full_write_buffers = 0;
-}
-
-
-#define SEVEN_BITS_MASK (0x7f)
-#define EIGHT_BIT_MASK (0x80)
-
-static void
-write_uint32 (guint32 value) {
- while (value > SEVEN_BITS_MASK) {
- WRITE_BYTE (value & SEVEN_BITS_MASK);
- value >>= 7;
- }
- WRITE_BYTE (value | EIGHT_BIT_MASK);
-}
-static void
-write_uint64 (guint64 value) {
- while (value > SEVEN_BITS_MASK) {
- WRITE_BYTE (value & SEVEN_BITS_MASK);
- value >>= 7;
- }
- WRITE_BYTE (value | EIGHT_BIT_MASK);
-}
-static void
-write_string (const char *string) {
- while (*string != 0) {
- WRITE_BYTE (*string);
- string ++;
- }
- WRITE_BYTE (0);
-}
-
-static void write_clock_data (void);
-static void
-write_directives_block (gboolean start) {
- write_clock_data ();
-
- if (start) {
- if (profiler->action_flags.save_allocation_caller) {
- write_uint32 (MONO_PROFILER_DIRECTIVE_ALLOCATIONS_CARRY_CALLER);
- }
- if (profiler->action_flags.save_allocation_stack || profiler->action_flags.track_calls) {
- write_uint32 (MONO_PROFILER_DIRECTIVE_ALLOCATIONS_HAVE_STACK);
- }
- if (profiler->action_flags.allocations_carry_id) {
- write_uint32 (MONO_PROFILER_DIRECTIVE_ALLOCATIONS_CARRY_ID);
- }
- write_uint32 (MONO_PROFILER_DIRECTIVE_LOADED_ELEMENTS_CARRY_ID);
- write_uint32 (MONO_PROFILER_DIRECTIVE_CLASSES_CARRY_ASSEMBLY_ID);
- write_uint32 (MONO_PROFILER_DIRECTIVE_METHODS_CARRY_WRAPPER_FLAG);
- }
- write_uint32 (MONO_PROFILER_DIRECTIVE_END);
-
- write_clock_data ();
- write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_DIRECTIVES);
-}
-
-#if DEBUG_HEAP_PROFILER
-#define WRITE_HEAP_SHOT_JOB_VALUE_MESSAGE(v,c) printf ("WRITE_HEAP_SHOT_JOB_VALUE: writing value %p at cursor %p\n", (v), (c))
-#else
-#define WRITE_HEAP_SHOT_JOB_VALUE_MESSAGE(v,c)
-#endif
-#define WRITE_HEAP_SHOT_JOB_VALUE(j,v) do {\
- if ((j)->cursor < (j)->end) {\
- WRITE_HEAP_SHOT_JOB_VALUE_MESSAGE ((v), ((j)->cursor));\
- *((j)->cursor) = (v);\
- (j)->cursor ++;\
- } else {\
- profiler_heap_shot_write_job_add_buffer (j, v);\
- }\
-} while (0)
-
-
-#undef GUINT_TO_POINTER
-#undef GPOINTER_TO_UINT
-#if (SIZEOF_VOID_P == 4)
-#define GUINT_TO_POINTER(u) ((void*)(guint32)(u))
-#define GPOINTER_TO_UINT(p) ((guint32)(void*)(p))
-#elif (SIZEOF_VOID_P == 8)
-#define GUINT_TO_POINTER(u) ((void*)(guint64)(u))
-#define GPOINTER_TO_UINT(p) ((guint64)(void*)(p))
-#else
-#error Bad size of void pointer
-#endif
-
-#define WRITE_HEAP_SHOT_JOB_VALUE_WITH_CODE(j,v,c) WRITE_HEAP_SHOT_JOB_VALUE (j, GUINT_TO_POINTER (GPOINTER_TO_UINT (v)|(c)))
-
-#if DEBUG_HEAP_PROFILER
-#define UPDATE_JOB_BUFFER_CURSOR_MESSAGE() printf ("profiler_heap_shot_write_block[UPDATE_JOB_BUFFER_CURSOR]: in job %p, moving to buffer %p and cursor %p\n", job, buffer, cursor)
-#else
-#define UPDATE_JOB_BUFFER_CURSOR_MESSAGE()
-#endif
-#define UPDATE_JOB_BUFFER_CURSOR() do {\
- cursor++;\
- if (cursor >= end) {\
- buffer = buffer->next;\
- if (buffer != NULL) {\
- cursor = & (buffer->buffer [0]);\
- if (buffer->next != NULL) {\
- end = & (buffer->buffer [PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE]);\
- } else {\
- end = job->cursor;\
- }\
- } else {\
- cursor = NULL;\
- }\
- }\
- UPDATE_JOB_BUFFER_CURSOR_MESSAGE ();\
-} while (0)
-
-static void
-profiler_heap_shot_write_data_block (ProfilerHeapShotWriteJob *job) {
- ProfilerHeapShotWriteBuffer *buffer;
- gpointer* cursor;
- gpointer* end;
- guint64 start_counter;
- guint64 start_time;
- guint64 end_counter;
- guint64 end_time;
-
- write_uint64 (job->start_counter);
- write_uint64 (job->start_time);
- write_uint64 (job->end_counter);
- write_uint64 (job->end_time);
- write_uint32 (job->collection);
- MONO_PROFILER_GET_CURRENT_COUNTER (start_counter);
- MONO_PROFILER_GET_CURRENT_TIME (start_time);
- write_uint64 (start_counter);
- write_uint64 (start_time);
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_data_block: start writing job %p (start %p, end %p)...\n", job, & (job->buffers->buffer [0]), job->cursor);
-#endif
- buffer = job->buffers;
- cursor = & (buffer->buffer [0]);
- if (buffer->next != NULL) {
- end = & (buffer->buffer [PROFILER_HEAP_SHOT_WRITE_BUFFER_SIZE]);
- } else {
- end = job->cursor;
- }
- if (cursor >= end) {
- cursor = NULL;
- }
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_data_block: in job %p, starting at buffer %p and cursor %p\n", job, buffer, cursor);
-#endif
- while (cursor != NULL) {
- gpointer value = *cursor;
- HeapProfilerJobValueCode code = GPOINTER_TO_UINT (value) & HEAP_CODE_MASK;
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_data_block: got value %p and code %d\n", value, code);
-#endif
-
- UPDATE_JOB_BUFFER_CURSOR ();
- if (code == HEAP_CODE_FREE_OBJECT_CLASS) {
- MonoClass *klass = GUINT_TO_POINTER (GPOINTER_TO_UINT (value) & (~ (guint64) HEAP_CODE_MASK));
- //MonoClass *klass = GUINT_TO_POINTER (GPOINTER_TO_UINT (value) % 4);
- ClassIdMappingElement *class_id;
- guint32 size;
-
- class_id = class_id_mapping_element_get (klass);
- if (class_id == NULL) {
- printf ("profiler_heap_shot_write_data_block: unknown class %p", klass);
- }
- g_assert (class_id != NULL);
- write_uint32 ((class_id->id << 2) | HEAP_CODE_FREE_OBJECT_CLASS);
-
- size = GPOINTER_TO_UINT (*cursor);
- UPDATE_JOB_BUFFER_CURSOR ();
- write_uint32 (size);
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_data_block: wrote unreachable object of class %p (id %d, size %d)\n", klass, class_id->id, size);
-#endif
- } else if (code == HEAP_CODE_OBJECT) {
- MonoObject *object = GUINT_TO_POINTER (GPOINTER_TO_UINT (value) & (~ (guint64) HEAP_CODE_MASK));
- MonoClass *klass = mono_object_get_class (object);
- ClassIdMappingElement *class_id = class_id_mapping_element_get (klass);
- guint32 size = mono_object_get_size (object);
- guint32 references = GPOINTER_TO_UINT (*cursor);
- UPDATE_JOB_BUFFER_CURSOR ();
-
- if (class_id == NULL) {
- printf ("profiler_heap_shot_write_data_block: unknown class %p", klass);
- }
- g_assert (class_id != NULL);
-
- write_uint64 (GPOINTER_TO_UINT (value));
- write_uint32 (class_id->id);
- write_uint32 (size);
- write_uint32 (references);
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_data_block: writing object %p (references %d)\n", value, references);
-#endif
-
- while (references > 0) {
- gpointer reference = *cursor;
- write_uint64 (GPOINTER_TO_UINT (reference));
- UPDATE_JOB_BUFFER_CURSOR ();
- references --;
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_data_block: inside object %p, wrote reference %p)\n", value, reference);
-#endif
- }
- } else {
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_data_block: unknown code %d in value %p\n", code, value);
-#endif
- g_assert_not_reached ();
- }
- }
- write_uint32 (0);
-
- MONO_PROFILER_GET_CURRENT_COUNTER (end_counter);
- MONO_PROFILER_GET_CURRENT_TIME (end_time);
- write_uint64 (end_counter);
- write_uint64 (end_time);
-
- write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_HEAP_DATA);
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_data_block: writing job %p done.\n", job);
-#endif
-}
-static void
-profiler_heap_shot_write_summary_block (ProfilerHeapShotWriteJob *job) {
- guint64 start_counter;
- guint64 start_time;
- guint64 end_counter;
- guint64 end_time;
- int id;
-
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_summary_block: start writing job %p...\n", job);
-#endif
- MONO_PROFILER_GET_CURRENT_COUNTER (start_counter);
- MONO_PROFILER_GET_CURRENT_TIME (start_time);
- write_uint64 (start_counter);
- write_uint64 (start_time);
-
- write_uint32 (job->collection);
-
- for (id = 0; id < job->summary.capacity; id ++) {
- if ((job->summary.per_class_data [id].reachable.instances > 0) || (job->summary.per_class_data [id].unreachable.instances > 0)) {
- write_uint32 (id);
- write_uint32 (job->summary.per_class_data [id].reachable.instances);
- write_uint32 (job->summary.per_class_data [id].reachable.bytes);
- write_uint32 (job->summary.per_class_data [id].unreachable.instances);
- write_uint32 (job->summary.per_class_data [id].unreachable.bytes);
- }
- }
- write_uint32 (0);
-
- MONO_PROFILER_GET_CURRENT_COUNTER (end_counter);
- MONO_PROFILER_GET_CURRENT_TIME (end_time);
- write_uint64 (end_counter);
- write_uint64 (end_time);
-
- write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_HEAP_SUMMARY);
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_summary_block: writing job %p done.\n", job);
-#endif
-}
-
-static void
-profiler_heap_shot_write_block (ProfilerHeapShotWriteJob *job) {
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_block: working on job %p...\n", job);
-#endif
-
- if (profiler->action_flags.collection_summary == TRUE) {
- profiler_heap_shot_write_summary_block (job);
- }
-
- if ((profiler->action_flags.unreachable_objects == TRUE) || (profiler->action_flags.heap_shot == TRUE)) {
- profiler_heap_shot_write_data_block (job);
- }
-
- profiler_heap_shot_write_job_free_buffers (job);
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_shot_write_block: work on job %p done.\n", job);
-#endif
-}
-
-static void
-write_element_load_block (LoadedElement *element, guint8 kind, gsize thread_id, gpointer item) {
- WRITE_BYTE (kind);
- write_uint64 (element->load_start_counter);
- write_uint64 (element->load_end_counter);
- write_uint64 (thread_id);
- write_uint32 (element->id);
- write_string (element->name);
- if (kind & MONO_PROFILER_LOADED_EVENT_ASSEMBLY) {
- MonoImage *image = mono_assembly_get_image ((MonoAssembly*) item);
- MonoAssemblyName aname;
- if (mono_assembly_fill_assembly_name (image, &aname)) {
- write_string (aname.name);
- write_uint32 (aname.major);
- write_uint32 (aname.minor);
- write_uint32 (aname.build);
- write_uint32 (aname.revision);
- write_string (aname.culture && *aname.culture? aname.culture: "neutral");
- write_string (aname.public_key_token [0] ? (char *)aname.public_key_token : "null");
- /* Retargetable flag */
- write_uint32 ((aname.flags & 0x00000100) ? 1 : 0);
- } else {
- write_string ("UNKNOWN");
- write_uint32 (0);
- write_uint32 (0);
- write_uint32 (0);
- write_uint32 (0);
- write_string ("neutral");
- write_string ("null");
- write_uint32 (0);
- }
- }
- write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_LOADED);
- element->load_written = TRUE;
-}
-
-static void
-write_element_unload_block (LoadedElement *element, guint8 kind, gsize thread_id) {
- WRITE_BYTE (kind);
- write_uint64 (element->unload_start_counter);
- write_uint64 (element->unload_end_counter);
- write_uint64 (thread_id);
- write_uint32 (element->id);
- write_string (element->name);
- write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_UNLOADED);
- element->unload_written = TRUE;
-}
-
-static void
-write_clock_data (void) {
- guint64 counter;
- guint64 time;
-
- MONO_PROFILER_GET_CURRENT_COUNTER (counter);
- MONO_PROFILER_GET_CURRENT_TIME (time);
-
- write_uint64 (counter);
- write_uint64 (time);
-}
-
-static void
-write_mapping_block (gsize thread_id) {
- ClassIdMappingElement *current_class;
- MethodIdMappingElement *current_method;
-
- if ((profiler->classes->unwritten == NULL) && (profiler->methods->unwritten == NULL))
- return;
-
-#if (DEBUG_MAPPING_EVENTS || DEBUG_FILE_WRITES)
- printf ("[write_mapping_block][TID %ld] START\n", thread_id);
-#endif
-
- write_clock_data ();
- write_uint64 (thread_id);
-
- for (current_class = profiler->classes->unwritten; current_class != NULL; current_class = current_class->next_unwritten) {
- MonoImage *image = mono_class_get_image (current_class->klass);
- MonoAssembly *assembly = mono_image_get_assembly (image);
- guint32 assembly_id = loaded_element_get_id (profiler->loaded_assemblies, assembly);
- write_uint32 (current_class->id);
- write_uint32 (assembly_id);
- write_string (current_class->name);
-#if (DEBUG_MAPPING_EVENTS)
- printf ("mapping CLASS (%d => %s)\n", current_class->id, current_class->name);
-#endif
- g_free (current_class->name);
- current_class->name = NULL;
- }
- write_uint32 (0);
- profiler->classes->unwritten = NULL;
-
- for (current_method = profiler->methods->unwritten; current_method != NULL; current_method = current_method->next_unwritten) {
- MonoMethod *method = current_method->method;
- MonoClass *klass = mono_method_get_class (method);
- ClassIdMappingElement *class_element = class_id_mapping_element_get (klass);
- g_assert (class_element != NULL);
- write_uint32 (current_method->id);
- write_uint32 (class_element->id);
- if (method->wrapper_type != 0) {
- write_uint32 (1);
- } else {
- write_uint32 (0);
- }
- write_string (current_method->name);
-#if (DEBUG_MAPPING_EVENTS)
- printf ("mapping METHOD ([%d]%d => %s)\n", class_element?class_element->id:1, current_method->id, current_method->name);
-#endif
- g_free (current_method->name);
- current_method->name = NULL;
- }
- write_uint32 (0);
- profiler->methods->unwritten = NULL;
-
- write_clock_data ();
- write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_MAPPING);
-
-#if (DEBUG_MAPPING_EVENTS || DEBUG_FILE_WRITES)
- printf ("[write_mapping_block][TID %ld] END\n", thread_id);
-#endif
-}
-
-typedef enum {
- MONO_PROFILER_PACKED_EVENT_CODE_METHOD_ENTER = 1,
- MONO_PROFILER_PACKED_EVENT_CODE_METHOD_EXIT_IMPLICIT = 2,
- MONO_PROFILER_PACKED_EVENT_CODE_METHOD_EXIT_EXPLICIT = 3,
- MONO_PROFILER_PACKED_EVENT_CODE_CLASS_ALLOCATION = 4,
- MONO_PROFILER_PACKED_EVENT_CODE_METHOD_EVENT = 5,
- MONO_PROFILER_PACKED_EVENT_CODE_CLASS_EVENT = 6,
- MONO_PROFILER_PACKED_EVENT_CODE_OTHER_EVENT = 7
-} MonoProfilerPackedEventCode;
-#define MONO_PROFILER_PACKED_EVENT_CODE_BITS 3
-#define MONO_PROFILER_PACKED_EVENT_DATA_BITS (8-MONO_PROFILER_PACKED_EVENT_CODE_BITS)
-#define MONO_PROFILER_PACKED_EVENT_DATA_MASK ((1<<MONO_PROFILER_PACKED_EVENT_DATA_BITS)-1)
-
-#define MONO_PROFILER_EVENT_MAKE_PACKED_CODE(result,data,base) do {\
- result = ((base)|((data & MONO_PROFILER_PACKED_EVENT_DATA_MASK) << MONO_PROFILER_PACKED_EVENT_CODE_BITS));\
- data >>= MONO_PROFILER_PACKED_EVENT_DATA_BITS;\
-} while (0)
-#define MONO_PROFILER_EVENT_MAKE_FULL_CODE(result,code,kind,base) do {\
- result = ((base)|((((kind)<<4) | (code)) << MONO_PROFILER_PACKED_EVENT_CODE_BITS));\
-} while (0)
-
-static void
-rewrite_last_written_stack (ProfilerThreadStack *stack) {
- guint8 event_code;
- int i = thread_stack_get_last_written_frame (stack);
-
- MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, MONO_PROFILER_EVENT_STACK_SECTION, 0, MONO_PROFILER_PACKED_EVENT_CODE_OTHER_EVENT);
- WRITE_BYTE (event_code);
- write_uint32 (0);
- write_uint32 (i);
-
- while (i > 0) {
- i--;
- write_uint32 (thread_stack_written_frame_at_index (stack, i));
- }
-}
-
-
-static ProfilerEventData*
-write_stack_section_event (ProfilerEventData *events, ProfilerPerThreadData *data) {
- int last_saved_frame = events->data.number;
- int saved_frames = events->value;
- guint8 event_code;
- int i;
-
- MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, MONO_PROFILER_EVENT_STACK_SECTION, 0, MONO_PROFILER_PACKED_EVENT_CODE_OTHER_EVENT);
- WRITE_BYTE (event_code);
- write_uint32 (last_saved_frame);
- write_uint32 (saved_frames);
- thread_stack_set_last_written_frame (&(data->stack), last_saved_frame + saved_frames);
- events++;
-
- for (i = 0; i < saved_frames; i++) {
- guint8 code = events->code;
- guint32 jit_flag;
- MethodIdMappingElement *method;
- guint32 frame_value;
-
- if (code == MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER) {
- jit_flag = 0;
- } else if (code == MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER) {
- jit_flag = 1;
- } else {
- g_assert_not_reached ();
- jit_flag = 0;
- }
-
- method = method_id_mapping_element_get (events->data.address);
- g_assert (method != NULL);
- frame_value = (method->id << 1) | jit_flag;
- write_uint32 (frame_value);
- thread_stack_write_frame_at_index (&(data->stack), last_saved_frame + saved_frames - (1 + i), frame_value);
- events ++;
- }
-
- return events;
-}
-
-static ProfilerEventData*
-write_event (ProfilerEventData *event, ProfilerPerThreadData *data) {
- ProfilerEventData *next = event + 1;
- gboolean write_event_value = TRUE;
- guint8 event_code;
- guint64 event_data;
- guint64 event_value;
- gboolean write_event_value_extension_1 = FALSE;
- guint64 event_value_extension_1 = 0;
- gboolean write_event_value_extension_2 = FALSE;
- guint64 event_value_extension_2 = 0;
-
- event_value = event->value;
- if (event_value == MAX_EVENT_VALUE) {
- event_value = *((guint64*)next);
- next ++;
- }
-
- if (event->data_type == MONO_PROFILER_EVENT_DATA_TYPE_METHOD) {
- MethodIdMappingElement *element = method_id_mapping_element_get (event->data.address);
- g_assert (element != NULL);
- event_data = element->id;
-
- if (event->code == MONO_PROFILER_EVENT_METHOD_CALL) {
- if (event->kind == MONO_PROFILER_EVENT_KIND_START) {
- MONO_PROFILER_EVENT_MAKE_PACKED_CODE (event_code, event_data, MONO_PROFILER_PACKED_EVENT_CODE_METHOD_ENTER);
- } else {
- MONO_PROFILER_EVENT_MAKE_PACKED_CODE (event_code, event_data, MONO_PROFILER_PACKED_EVENT_CODE_METHOD_EXIT_EXPLICIT);
- }
- } else {
- MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, event->code, event->kind, MONO_PROFILER_PACKED_EVENT_CODE_METHOD_EVENT);
- }
- } else if (event->data_type == MONO_PROFILER_EVENT_DATA_TYPE_CLASS) {
- ClassIdMappingElement *element = class_id_mapping_element_get (event->data.address);
- g_assert (element != NULL);
- event_data = element->id;
-
- if (event->code == MONO_PROFILER_EVENT_CLASS_ALLOCATION) {
- if ((! profiler->action_flags.save_allocation_caller) || (! (next->code == MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER))) {
- MONO_PROFILER_EVENT_MAKE_PACKED_CODE (event_code, event_data, MONO_PROFILER_PACKED_EVENT_CODE_CLASS_ALLOCATION);
- } else {
- MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, MONO_PROFILER_EVENT_JIT_TIME_ALLOCATION, event->kind, MONO_PROFILER_PACKED_EVENT_CODE_OTHER_EVENT);
- }
-
- if (profiler->action_flags.save_allocation_caller) {
- MonoMethod *caller_method = next->data.address;
-
- if ((next->code != MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER) && (next->code != MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER)) {
- g_assert_not_reached ();
- }
-
- if (caller_method != NULL) {
- MethodIdMappingElement *caller = method_id_mapping_element_get (caller_method);
- g_assert (caller != NULL);
- event_value_extension_1 = caller->id;
- }
-
- write_event_value_extension_1 = TRUE;
- next ++;
- }
-
- if (profiler->action_flags.allocations_carry_id) {
- event_value_extension_2 = GPOINTER_TO_UINT (next->data.address);
-
- if (next->code != MONO_PROFILER_EVENT_ALLOCATION_OBJECT_ID) {
- g_assert_not_reached ();
- }
-
- write_event_value_extension_2 = TRUE;
- next ++;
- }
- } else if (event->code == MONO_PROFILER_EVENT_CLASS_MONITOR) {
- g_assert (next->code == MONO_PROFILER_EVENT_OBJECT_MONITOR);
-
- MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, event->code, event->kind, MONO_PROFILER_PACKED_EVENT_CODE_CLASS_EVENT);
- event_value_extension_1 = next->value;
- write_event_value_extension_1 = TRUE;
- event_value_extension_2 = GPOINTER_TO_UINT (next->data.address);
- write_event_value_extension_2 = TRUE;
- next ++;
- } else {
- MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, event->code, event->kind, MONO_PROFILER_PACKED_EVENT_CODE_CLASS_EVENT);
- }
- } else {
- if (event->code == MONO_PROFILER_EVENT_STACK_SECTION) {
- return write_stack_section_event (event, data);
- } else {
- event_data = event->data.number;
- MONO_PROFILER_EVENT_MAKE_FULL_CODE (event_code, event->code, event->kind, MONO_PROFILER_PACKED_EVENT_CODE_OTHER_EVENT);
- }
- }
-
- /* Skip writing JIT events if the user did not ask for them */
- if ((event->code == MONO_PROFILER_EVENT_METHOD_JIT) && ! profiler->action_flags.jit_time) {
- return next;
- }
-
-#if (DEBUG_LOGGING_PROFILER)
- EVENT_MARK ();
- printf ("writing EVENT[%p] data_type:%d, kind:%d, code:%d (%d:%ld:%ld)\n", event,
- event->data_type, event->kind, event->code,
- event_code, event_data, event_value);
-#endif
-
- WRITE_BYTE (event_code);
- write_uint64 (event_data);
- if (write_event_value) {
- write_uint64 (event_value);
- if (write_event_value_extension_1) {
- write_uint64 (event_value_extension_1);
- }
- if (write_event_value_extension_2) {
- write_uint64 (event_value_extension_2);
- }
- }
-
- return next;
-}
-
-static void
-write_thread_data_block (ProfilerPerThreadData *data) {
- ProfilerEventData *start = data->first_unwritten_event;
- ProfilerEventData *end = data->first_unmapped_event;
-
- if (start == end)
- return;
-#if (DEBUG_FILE_WRITES)
- printf ("write_thread_data_block: preparing buffer for thread %ld\n", (guint64) data->thread_id);
-#endif
- write_clock_data ();
- write_uint64 (data->thread_id);
-
- write_uint64 (data->start_event_counter);
-
- /* If we are tracking the stack, make sure that stack sections */
- /* can be fully reconstructed even reading only one block */
- if (profiler->action_flags.track_stack) {
- rewrite_last_written_stack (&(data->stack));
- }
-
- while (start < end) {
- start = write_event (start, data);
- }
- WRITE_BYTE (0);
- data->first_unwritten_event = end;
-
- write_clock_data ();
- write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_EVENTS);
-#if (DEBUG_FILE_WRITES)
- printf ("write_thread_data_block: buffer for thread %ld written\n", (guint64) data->thread_id);
-#endif
-}
-
-static ProfilerExecutableMemoryRegionData*
-profiler_executable_memory_region_new (gpointer *start, gpointer *end, guint32 file_offset, char *file_name, guint32 id) {
- ProfilerExecutableMemoryRegionData *result = g_new (ProfilerExecutableMemoryRegionData, 1);
- result->start = start;
- result->end = end;
- result->file_offset = file_offset;
- result->file_name = g_strdup (file_name);
- result->id = id;
- result->is_new = TRUE;
-
- result->file = NULL;
- result->file_region_reference = NULL;
- result->symbols_capacity = id;
- result->symbols_count = id;
- result->symbols = NULL;
-
- return result;
-}
-
-static void
-executable_file_close (ProfilerExecutableMemoryRegionData *region);
-
-static void
-profiler_executable_memory_region_destroy (ProfilerExecutableMemoryRegionData *data) {
- if (data->file != NULL) {
- executable_file_close (data);
- data->file = NULL;
- }
- if (data->symbols != NULL) {
- g_free (data->symbols);
- data->symbols = NULL;
- }
- if (data->file_name != NULL) {
- g_free (data->file_name);
- data->file_name = NULL;
- }
- g_free (data);
-}
-
-static ProfilerExecutableMemoryRegions*
-profiler_executable_memory_regions_new (int next_id, int next_unmanaged_function_id) {
- ProfilerExecutableMemoryRegions *result = g_new (ProfilerExecutableMemoryRegions, 1);
- result->regions = g_new0 (ProfilerExecutableMemoryRegionData*, 32);
- result->regions_capacity = 32;
- result->regions_count = 0;
- result->next_id = next_id;
- result->next_unmanaged_function_id = next_unmanaged_function_id;
- return result;
-}
-
-static void
-profiler_executable_memory_regions_destroy (ProfilerExecutableMemoryRegions *regions) {
- int i;
-
- for (i = 0; i < regions->regions_count; i++) {
- profiler_executable_memory_region_destroy (regions->regions [i]);
- }
- g_free (regions->regions);
- g_free (regions);
-}
-
-static ProfilerExecutableMemoryRegionData*
-find_address_region (ProfilerExecutableMemoryRegions *regions, gpointer address) {
- int low_index = 0;
- int high_index = regions->regions_count;
- int middle_index = 0;
- ProfilerExecutableMemoryRegionData *middle_region = regions->regions [0];
-
- if ((regions->regions_count == 0) || (regions->regions [low_index]->start > address) || (regions->regions [high_index - 1]->end < address)) {
- return NULL;
- }
-
- //printf ("find_address_region: Looking for address %p in %d regions (from %p to %p)\n", address, regions->regions_count, regions->regions [low_index]->start, regions->regions [high_index - 1]->end);
-
- while (low_index != high_index) {
- middle_index = low_index + ((high_index - low_index) / 2);
- middle_region = regions->regions [middle_index];
-
- //printf ("find_address_region: Looking for address %p, considering index %d[%p-%p] (%d-%d)\n", address, middle_index, middle_region->start, middle_region->end, low_index, high_index);
-
- if (middle_region->start > address) {
- if (middle_index > 0) {
- high_index = middle_index;
- } else {
- return NULL;
- }
- } else if (middle_region->end < address) {
- if (middle_index < regions->regions_count - 1) {
- low_index = middle_index + 1;
- } else {
- return NULL;
- }
- } else {
- return middle_region;
- }
- }
-
- if ((middle_region == NULL) || (middle_region->start > address) || (middle_region->end < address)) {
- return NULL;
- } else {
- return middle_region;
- }
-}
-
-static void
-append_region (ProfilerExecutableMemoryRegions *regions, gpointer *start, gpointer *end, guint32 file_offset, char *file_name) {
- if (regions->regions_count >= regions->regions_capacity) {
- ProfilerExecutableMemoryRegionData **new_regions = g_new0 (ProfilerExecutableMemoryRegionData*, regions->regions_capacity * 2);
- memcpy (new_regions, regions->regions, regions->regions_capacity * sizeof (ProfilerExecutableMemoryRegionData*));
- g_free (regions->regions);
- regions->regions = new_regions;
- regions->regions_capacity = regions->regions_capacity * 2;
- }
- regions->regions [regions->regions_count] = profiler_executable_memory_region_new (start, end, file_offset, file_name, regions->next_id);
- regions->regions_count ++;
- regions->next_id ++;
-}
-
-static gboolean
-regions_are_equivalent (ProfilerExecutableMemoryRegionData *region1, ProfilerExecutableMemoryRegionData *region2) {
- if ((region1->start == region2->start) &&
- (region1->end == region2->end) &&
- (region1->file_offset == region2->file_offset) &&
- ! strcmp (region1->file_name, region2->file_name)) {
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-static int
-compare_regions (const void *a1, const void *a2) {
- ProfilerExecutableMemoryRegionData *r1 = * (ProfilerExecutableMemoryRegionData**) a1;
- ProfilerExecutableMemoryRegionData *r2 = * (ProfilerExecutableMemoryRegionData**) a2;
- return (r1->start < r2->start)? -1 : ((r1->start > r2->start)? 1 : 0);
-}
-
-static void
-restore_old_regions (ProfilerExecutableMemoryRegions *old_regions, ProfilerExecutableMemoryRegions *new_regions) {
- int old_i;
- int new_i;
-
- for (new_i = 0; new_i < new_regions->regions_count; new_i++) {
- ProfilerExecutableMemoryRegionData *new_region = new_regions->regions [new_i];
- for (old_i = 0; old_i < old_regions->regions_count; old_i++) {
- ProfilerExecutableMemoryRegionData *old_region = old_regions->regions [old_i];
- if ( regions_are_equivalent (old_region, new_region)) {
- new_regions->regions [new_i] = old_region;
- old_regions->regions [old_i] = new_region;
-
- // FIXME (sanity check)
- g_assert (new_region->is_new && ! old_region->is_new);
- }
- }
- }
-}
-
-static void
-sort_regions (ProfilerExecutableMemoryRegions *regions) {
- if (regions->regions_count > 1) {
- int i;
-
- qsort (regions->regions, regions->regions_count, sizeof (ProfilerExecutableMemoryRegionData *), compare_regions);
-
- i = 1;
- while (i < regions->regions_count) {
- ProfilerExecutableMemoryRegionData *current_region = regions->regions [i];
- ProfilerExecutableMemoryRegionData *previous_region = regions->regions [i - 1];
-
- if (regions_are_equivalent (previous_region, current_region)) {
- int j;
-
- if (! current_region->is_new) {
- profiler_executable_memory_region_destroy (previous_region);
- regions->regions [i - 1] = current_region;
- } else {
- profiler_executable_memory_region_destroy (current_region);
- }
-
- for (j = i + 1; j < regions->regions_count; j++) {
- regions->regions [j - 1] = regions->regions [j];
- }
-
- regions->regions_count --;
- } else {
- i++;
- }
- }
- }
-}
-
-static void
-fix_region_references (ProfilerExecutableMemoryRegions *regions) {
- int i;
- for (i = 0; i < regions->regions_count; i++) {
- ProfilerExecutableMemoryRegionData *region = regions->regions [i];
- if (region->file_region_reference != NULL) {
- region->file_region_reference->region = region;
- }
- }
-}
-
-static void
-executable_file_add_region_reference (ProfilerExecutableFile *file, ProfilerExecutableMemoryRegionData *region) {
- guint8 *section_headers = file->data + file->header->e_shoff;
- int section_index;
-
- for (section_index = 1; section_index < file->header->e_shnum; section_index ++) {
- ElfSection *section_header = (ElfSection*) (section_headers + (file->header->e_shentsize * section_index));
-
- if ((section_header->sh_addr != 0) && (section_header->sh_flags & ELF_SHF_EXECINSTR) &&
- (region->file_offset <= section_header->sh_offset) && (region->file_offset + (((guint8*)region->end)-((guint8*)region->start)) >= (section_header->sh_offset + section_header->sh_size))) {
- ProfilerExecutableFileSectionRegion *section_region = & (file->section_regions [section_index]);
- section_region->region = region;
- section_region->section_address = (gpointer) section_header->sh_addr;
- section_region->section_offset = section_header->sh_offset;
- region->file_region_reference = section_region;
- }
- }
-}
-
-static gboolean check_elf_header (ElfHeader* header) {
- guint16 test = 0x0102;
-
- if ((header->e_ident [EI_MAG0] != 0x7f) || (header->e_ident [EI_MAG1] != 'E') ||
- (header->e_ident [EI_MAG2] != 'L') || (header->e_ident [EI_MAG3] != 'F')) {
- return FALSE;
- }
-
- if (sizeof (gsize) == 4) {
- if (header->e_ident [EI_CLASS] != ELF_CLASS_32) {
- g_warning ("Class is not ELF_CLASS_32 with gsize size %d", (int) sizeof (gsize));
- return FALSE;
- }
- } else if (sizeof (gsize) == 8) {
- if (header->e_ident [EI_CLASS] != ELF_CLASS_64) {
- g_warning ("Class is not ELF_CLASS_64 with gsize size %d", (int) sizeof (gsize));
- return FALSE;
- }
- } else {
- g_warning ("Absurd gsize size %d", (int) sizeof (gsize));
- return FALSE;
- }
-
- if ((*(guint8*)(&test)) == 0x01) {
- if (header->e_ident [EI_DATA] != ELF_DATA_MSB) {
- g_warning ("Data is not ELF_DATA_MSB with first test byte 0x01");
- return FALSE;
- }
- } else if ((*(guint8*)(&test)) == 0x02) {
- if (header->e_ident [EI_DATA] != ELF_DATA_LSB) {
- g_warning ("Data is not ELF_DATA_LSB with first test byte 0x02");
- return FALSE;
- }
- } else {
- g_warning ("Absurd test byte value");
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean check_elf_file (int fd) {
- void *header = malloc (sizeof (ElfHeader));
- ssize_t read_result = read (fd, header, sizeof (ElfHeader));
- gboolean result;
-
- if (read_result != sizeof (ElfHeader)) {
- result = FALSE;
- } else {
- result = check_elf_header ((ElfHeader*) header);
- }
-
- free (header);
- return result;
-}
-
-static ProfilerExecutableFile*
-executable_file_open (ProfilerExecutableMemoryRegionData *region) {
- ProfilerExecutableFiles *files = & (profiler->executable_files);
- ProfilerExecutableFile *file = region->file;
-
- if (file == NULL) {
- file = (ProfilerExecutableFile*) g_hash_table_lookup (files->table, region->file_name);
-
- if (file == NULL) {
- struct stat stat_buffer;
- int symtab_index = 0;
- int strtab_index = 0;
- int dynsym_index = 0;
- int dynstr_index = 0;
- ElfHeader *header;
- guint8 *section_headers;
- int section_index;
- int strings_index;
-
- file = g_new0 (ProfilerExecutableFile, 1);
- region->file = file;
- g_hash_table_insert (files->table, region->file_name, file);
- file->reference_count ++;
- file->next_new_file = files->new_files;
- files->new_files = file;
-
- file->fd = open (region->file_name, O_RDONLY);
- if (file->fd == -1) {
- //g_warning ("Cannot open file '%s': '%s'", region->file_name, strerror (errno));
- return file;
- } else {
- if (fstat (file->fd, &stat_buffer) != 0) {
- //g_warning ("Cannot stat file '%s': '%s'", region->file_name, strerror (errno));
- return file;
- } else if (! check_elf_file (file->fd)) {
- return file;
- } else {
- size_t region_length = ((guint8*)region->end) - ((guint8*)region->start);
- file->length = stat_buffer.st_size;
-
- if (file->length == region_length) {
- file->data = region->start;
- close (file->fd);
- file->fd = -1;
- } else {
- file->data = mmap (NULL, file->length, PROT_READ, MAP_PRIVATE, file->fd, 0);
-
- if (file->data == MAP_FAILED) {
- close (file->fd);
- //g_warning ("Cannot map file '%s': '%s'", region->file_name, strerror (errno));
- file->data = NULL;
- return file;
- }
- }
- }
- }
-
- /* OK, this is a usable elf file, and we mmapped it... */
- header = (ElfHeader*) file->data;
- file->header = header;
- section_headers = file->data + file->header->e_shoff;
- file->main_string_table = ((const char*) file->data) + (((ElfSection*) (section_headers + (header->e_shentsize * header->e_shstrndx)))->sh_offset);
-
- for (section_index = 0; section_index < header->e_shnum; section_index ++) {
- ElfSection *section_header = (ElfSection*) (section_headers + (header->e_shentsize * section_index));
-
- if (section_header->sh_type == ELF_SHT_SYMTAB) {
- symtab_index = section_index;
- } else if (section_header->sh_type == ELF_SHT_DYNSYM) {
- dynsym_index = section_index;
- } else if (section_header->sh_type == ELF_SHT_STRTAB) {
- if (! strcmp (file->main_string_table + section_header->sh_name, ".strtab")) {
- strtab_index = section_index;
- } else if (! strcmp (file->main_string_table + section_header->sh_name, ".dynstr")) {
- dynstr_index = section_index;
- }
- }
- }
-
- if ((symtab_index != 0) && (strtab_index != 0)) {
- section_index = symtab_index;
- strings_index = strtab_index;
- } else if ((dynsym_index != 0) && (dynstr_index != 0)) {
- section_index = dynsym_index;
- strings_index = dynstr_index;
- } else {
- section_index = 0;
- strings_index = 0;
- }
-
- if (section_index != 0) {
- ElfSection *section_header = (ElfSection*) (section_headers + (header->e_shentsize * section_index));
- file->symbol_size = section_header->sh_entsize;
- file->symbols_count = (guint32) (section_header->sh_size / section_header->sh_entsize);
- file->symbols_start = file->data + section_header->sh_offset;
- file->symbols_string_table = ((const char*) file->data) + (((ElfSection*) (section_headers + (header->e_shentsize * strings_index)))->sh_offset);
- }
-
- file->section_regions = g_new0 (ProfilerExecutableFileSectionRegion, file->header->e_shnum);
- } else {
- region->file = file;
- file->reference_count ++;
- }
- }
-
- if (file->header != NULL) {
- executable_file_add_region_reference (file, region);
- }
-
- return file;
-}
-
-static void
-executable_file_free (ProfilerExecutableFile* file) {
- if (file->fd != -1) {
- if (close (file->fd) != 0) {
- g_warning ("Cannot close file: '%s'", strerror (errno));
- }
- if (file->data != NULL) {
- if (munmap (file->data, file->length) != 0) {
- g_warning ("Cannot unmap file: '%s'", strerror (errno));
- }
- }
- }
- if (file->section_regions != NULL) {
- g_free (file->section_regions);
- file->section_regions = NULL;
- }
- g_free (file);
-}
-
-static void
-executable_file_close (ProfilerExecutableMemoryRegionData *region) {
- region->file->reference_count --;
-
- if ((region->file_region_reference != NULL) && (region->file_region_reference->region == region)) {
- region->file_region_reference->region = NULL;
- region->file_region_reference->section_address = 0;
- region->file_region_reference->section_offset = 0;
- }
-
- if (region->file->reference_count <= 0) {
- ProfilerExecutableFiles *files = & (profiler->executable_files);
- g_hash_table_remove (files->table, region->file_name);
- executable_file_free (region->file);
- region->file = NULL;
- }
-}
-
-static void
-executable_file_count_symbols (ProfilerExecutableFile *file) {
- int symbol_index;
-
- for (symbol_index = 0; symbol_index < file->symbols_count; symbol_index ++) {
- ElfSymbol *symbol = (ElfSymbol*) (file->symbols_start + (symbol_index * file->symbol_size));
-
- if ((ELF_ST_TYPE (symbol->st_info) == ELF_STT_FUNC) &&
- (symbol->st_shndx > 0) &&
- (symbol->st_shndx < file->header->e_shnum)) {
- int symbol_section_index = symbol->st_shndx;
- ProfilerExecutableMemoryRegionData *region = file->section_regions [symbol_section_index].region;
- if ((region != NULL) && (region->symbols == NULL)) {
- region->symbols_count ++;
- }
- }
- }
-}
-
-static void
-executable_memory_regions_prepare_symbol_tables (ProfilerExecutableMemoryRegions *regions) {
- int i;
- for (i = 0; i < regions->regions_count; i++) {
- ProfilerExecutableMemoryRegionData *region = regions->regions [i];
- if ((region->symbols_count > 0) && (region->symbols == NULL)) {
- region->symbols = g_new (ProfilerUnmanagedSymbol, region->symbols_count);
- region->symbols_capacity = region->symbols_count;
- region->symbols_count = 0;
- }
- }
-}
-
-static const char*
-executable_region_symbol_get_name (ProfilerExecutableMemoryRegionData *region, ProfilerUnmanagedSymbol *symbol) {
- ElfSymbol *elf_symbol = (ElfSymbol*) (region->file->symbols_start + (symbol->index * region->file->symbol_size));
- return region->file->symbols_string_table + elf_symbol->st_name;
-}
-
-static void
-executable_file_build_symbol_tables (ProfilerExecutableFile *file) {
- int symbol_index;
-
- for (symbol_index = 0; symbol_index < file->symbols_count; symbol_index ++) {
- ElfSymbol *symbol = (ElfSymbol*) (file->symbols_start + (symbol_index * file->symbol_size));
-
- if ((ELF_ST_TYPE (symbol->st_info) == ELF_STT_FUNC) &&
- (symbol->st_shndx > 0) &&
- (symbol->st_shndx < file->header->e_shnum)) {
- int symbol_section_index = symbol->st_shndx;
- ProfilerExecutableFileSectionRegion *section_region = & (file->section_regions [symbol_section_index]);
- ProfilerExecutableMemoryRegionData *region = section_region->region;
-
- if (region != NULL) {
- ProfilerUnmanagedSymbol *new_symbol = & (region->symbols [region->symbols_count]);
- region->symbols_count ++;
-
- new_symbol->id = 0;
- new_symbol->index = symbol_index;
- new_symbol->size = symbol->st_size;
- new_symbol->offset = (((guint8*) symbol->st_value) - section_region->section_address) - (region->file_offset - section_region->section_offset);
- }
- }
- }
-}
-
-static int
-compare_region_symbols (const void *p1, const void *p2) {
- const ProfilerUnmanagedSymbol *s1 = p1;
- const ProfilerUnmanagedSymbol *s2 = p2;
- return (s1->offset < s2->offset)? -1 : ((s1->offset > s2->offset)? 1 : 0);
-}
-
-static void
-executable_memory_regions_sort_symbol_tables (ProfilerExecutableMemoryRegions *regions) {
- int i;
- for (i = 0; i < regions->regions_count; i++) {
- ProfilerExecutableMemoryRegionData *region = regions->regions [i];
- if ((region->is_new) && (region->symbols != NULL)) {
- qsort (region->symbols, region->symbols_count, sizeof (ProfilerUnmanagedSymbol), compare_region_symbols);
- }
- }
-}
-
-static void
-build_symbol_tables (ProfilerExecutableMemoryRegions *regions, ProfilerExecutableFiles *files) {
- int i;
- ProfilerExecutableFile *file;
-
- for (i = 0; i < regions->regions_count; i++) {
- ProfilerExecutableMemoryRegionData *region = regions->regions [i];
- if ((region->is_new) && (region->file == NULL)) {
- executable_file_open (region);
- }
- }
-
- for (file = files->new_files; file != NULL; file = file->next_new_file) {
- executable_file_count_symbols (file);
- }
-
- executable_memory_regions_prepare_symbol_tables (regions);
-
- for (file = files->new_files; file != NULL; file = file->next_new_file) {
- executable_file_build_symbol_tables (file);
- }
-
- executable_memory_regions_sort_symbol_tables (regions);
-
- file = files->new_files;
- while (file != NULL) {
- ProfilerExecutableFile *next_file = file->next_new_file;
- file->next_new_file = NULL;
- file = next_file;
- }
- files->new_files = NULL;
-}
-
-static ProfilerUnmanagedSymbol*
-executable_memory_region_find_symbol (ProfilerExecutableMemoryRegionData *region, guint32 offset) {
- if (region->symbols_count > 0) {
- ProfilerUnmanagedSymbol *low = region->symbols;
- ProfilerUnmanagedSymbol *high = region->symbols + (region->symbols_count - 1);
- int step = region->symbols_count >> 1;
- ProfilerUnmanagedSymbol *current = region->symbols + step;
-
- do {
- step = (high - low) >> 1;
-
- if (offset < current->offset) {
- high = current;
- current = high - step;
- } else if (offset >= current->offset) {
- if (offset >= (current->offset + current->size)) {
- low = current;
- current = low + step;
- } else {
- return current;
- }
- }
- } while (step > 0);
-
- if ((offset >= current->offset) && (offset < (current->offset + current->size))) {
- return current;
- } else {
- return NULL;
- }
- } else {
- return NULL;
- }
-}
-
-//FIXME: make also Win32 and BSD variants
-#define MAPS_BUFFER_SIZE 4096
-#define MAPS_FILENAME_SIZE 2048
-
-static gboolean
-update_regions_buffer (int fd, char *buffer) {
- ssize_t result = read (fd, buffer, MAPS_BUFFER_SIZE);
-
- if (result == MAPS_BUFFER_SIZE) {
- return TRUE;
- } else if (result >= 0) {
- *(buffer + result) = 0;
- return FALSE;
- } else {
- *buffer = 0;
- return FALSE;
- }
-}
-
-#define GOTO_NEXT_CHAR(c,b,fd) do {\
- (c)++;\
- if (((c) - (b) >= MAPS_BUFFER_SIZE) || ((*(c) == 0) && ((c) != (b)))) {\
- update_regions_buffer ((fd), (b));\
- (c) = (b);\
- }\
-} while (0);
-
-static int hex_digit_value (char c) {
- if ((c >= '0') && (c <= '9')) {
- return c - '0';
- } else if ((c >= 'a') && (c <= 'f')) {
- return c - 'a' + 10;
- } else if ((c >= 'A') && (c <= 'F')) {
- return c - 'A' + 10;
- } else {
- return 0;
- }
-}
-
-/*
- * Start address
- * -
- * End address
- * (space)
- * Permissions
- * Offset
- * (space)
- * Device
- * (space)
- * Inode
- * (space)
- * File
- * \n
- */
-typedef enum {
- MAP_LINE_PARSER_STATE_INVALID,
- MAP_LINE_PARSER_STATE_START_ADDRESS,
- MAP_LINE_PARSER_STATE_END_ADDRESS,
- MAP_LINE_PARSER_STATE_PERMISSIONS,
- MAP_LINE_PARSER_STATE_OFFSET,
- MAP_LINE_PARSER_STATE_DEVICE,
- MAP_LINE_PARSER_STATE_INODE,
- MAP_LINE_PARSER_STATE_BLANK_BEFORE_FILENAME,
- MAP_LINE_PARSER_STATE_FILENAME,
- MAP_LINE_PARSER_STATE_DONE
-} MapLineParserState;
-
-const char *map_line_parser_state [] = {
- "INVALID",
- "START_ADDRESS",
- "END_ADDRESS",
- "PERMISSIONS",
- "OFFSET",
- "DEVICE",
- "INODE",
- "BLANK_BEFORE_FILENAME",
- "FILENAME",
- "DONE"
-};
-
-static char*
-parse_map_line (ProfilerExecutableMemoryRegions *regions, int fd, char *buffer, char *filename, char *current) {
- MapLineParserState state = MAP_LINE_PARSER_STATE_START_ADDRESS;
- gsize start_address = 0;
- gsize end_address = 0;
- guint32 offset = 0;
- int filename_index = 0;
- gboolean is_executable = FALSE;
- gboolean done = FALSE;
-
- char c = *current;
-
- while (1) {
- switch (state) {
- case MAP_LINE_PARSER_STATE_START_ADDRESS:
- if (isxdigit (c)) {
- start_address <<= 4;
- start_address |= hex_digit_value (c);
- } else if (c == '-') {
- state = MAP_LINE_PARSER_STATE_END_ADDRESS;
- } else {
- state = MAP_LINE_PARSER_STATE_INVALID;
- }
- break;
- case MAP_LINE_PARSER_STATE_END_ADDRESS:
- if (isxdigit (c)) {
- end_address <<= 4;
- end_address |= hex_digit_value (c);
- } else if (isblank (c)) {
- state = MAP_LINE_PARSER_STATE_PERMISSIONS;
- } else {
- state = MAP_LINE_PARSER_STATE_INVALID;
- }
- break;
- case MAP_LINE_PARSER_STATE_PERMISSIONS:
- if (c == 'x') {
- is_executable = TRUE;
- } else if (isblank (c)) {
- state = MAP_LINE_PARSER_STATE_OFFSET;
- } else if ((c != '-') && ! isalpha (c)) {
- state = MAP_LINE_PARSER_STATE_INVALID;
- }
- break;
- case MAP_LINE_PARSER_STATE_OFFSET:
- if (isxdigit (c)) {
- offset <<= 4;
- offset |= hex_digit_value (c);
- } else if (isblank (c)) {
- state = MAP_LINE_PARSER_STATE_DEVICE;
- } else {
- state = MAP_LINE_PARSER_STATE_INVALID;
- }
- break;
- case MAP_LINE_PARSER_STATE_DEVICE:
- if (isblank (c)) {
- state = MAP_LINE_PARSER_STATE_INODE;
- } else if ((c != ':') && ! isxdigit (c)) {
- state = MAP_LINE_PARSER_STATE_INVALID;
- }
- break;
- case MAP_LINE_PARSER_STATE_INODE:
- if (isblank (c)) {
- state = MAP_LINE_PARSER_STATE_BLANK_BEFORE_FILENAME;
- } else if (! isdigit (c)) {
- state = MAP_LINE_PARSER_STATE_INVALID;
- }
- break;
- case MAP_LINE_PARSER_STATE_BLANK_BEFORE_FILENAME:
- if ((c == '/') || (c == '[')) {
- state = MAP_LINE_PARSER_STATE_FILENAME;
- filename [filename_index] = *current;
- filename_index ++;
- } else if (! isblank (c)) {
- state = MAP_LINE_PARSER_STATE_INVALID;
- }
- break;
- case MAP_LINE_PARSER_STATE_FILENAME:
- if (filename_index < MAPS_FILENAME_SIZE) {
- if (c == '\n') {
- state = MAP_LINE_PARSER_STATE_DONE;
- done = TRUE;
- filename [filename_index] = 0;
- } else {
- filename [filename_index] = *current;
- filename_index ++;
- }
- } else {
- filename [filename_index] = 0;
- g_warning ("ELF filename too long: \"%s\"...\n", filename);
- }
- break;
- case MAP_LINE_PARSER_STATE_DONE:
- if (done && is_executable) {
- filename [filename_index] = 0;
- append_region (regions, (gpointer) start_address, (gpointer) end_address, offset, filename);
- }
- return current;
- case MAP_LINE_PARSER_STATE_INVALID:
- if (c == '\n') {
- state = MAP_LINE_PARSER_STATE_DONE;
- }
- break;
- }
-
- if (c == 0) {
- return NULL;
- } else if (c == '\n') {
- state = MAP_LINE_PARSER_STATE_DONE;
- }
-
- GOTO_NEXT_CHAR(current, buffer, fd);
- c = *current;
- }
-}
-
-static gboolean
-scan_process_regions (ProfilerExecutableMemoryRegions *regions) {
- char *buffer;
- char *filename;
- char *current;
- int fd;
-
- fd = open ("/proc/self/maps", O_RDONLY);
- if (fd == -1) {
- return FALSE;
- }
-
- buffer = malloc (MAPS_BUFFER_SIZE);
- filename = malloc (MAPS_FILENAME_SIZE);
- update_regions_buffer (fd, buffer);
- current = buffer;
- while (current != NULL) {
- current = parse_map_line (regions, fd, buffer, filename, current);
- }
-
- free (buffer);
- free (filename);
-
- close (fd);
- return TRUE;
-}
-//End of Linux code
-
-typedef enum {
- MONO_PROFILER_STATISTICAL_CODE_END = 0,
- MONO_PROFILER_STATISTICAL_CODE_METHOD = 1,
- MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_ID = 2,
- MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_NEW_ID = 3,
- MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_OFFSET_IN_REGION = 4,
- MONO_PROFILER_STATISTICAL_CODE_CALL_CHAIN = 5,
- MONO_PROFILER_STATISTICAL_CODE_REGIONS = 7
-} MonoProfilerStatisticalCode;
-
-static void
-refresh_memory_regions (void) {
- ProfilerExecutableMemoryRegions *old_regions = profiler->executable_regions;
- ProfilerExecutableMemoryRegions *new_regions = profiler_executable_memory_regions_new (old_regions->next_id, old_regions->next_unmanaged_function_id);
- int i;
-
- LOG_WRITER_THREAD ("Refreshing memory regions...");
- scan_process_regions (new_regions);
- sort_regions (new_regions);
- restore_old_regions (old_regions, new_regions);
- fix_region_references (new_regions);
- LOG_WRITER_THREAD ("Refreshed memory regions.");
-
- LOG_WRITER_THREAD ("Building symbol tables...");
- build_symbol_tables (new_regions, & (profiler->executable_files));
-#if 0
- printf ("Symbol tables done!\n");
- printf ("Region summary...\n");
- for (i = 0; i < new_regions->regions_count; i++) {
- ProfilerExecutableMemoryRegionData *region = new_regions->regions [i];
- printf ("Region %d[%d][NEW:%d] (%p-%p) at %d in file %s\n", i, region->id, region->is_new,
- region->start, region->end, region->file_offset, region->file_name);
- }
- printf ("New symbol tables dump...\n");
- for (i = 0; i < new_regions->regions_count; i++) {
- ProfilerExecutableMemoryRegionData *region = new_regions->regions [i];
-
- if (region->is_new) {
- int symbol_index;
-
- printf ("Region %d[%d][NEW:%d] (%p-%p) at %d in file %s\n", i, region->id, region->is_new,
- region->start, region->end, region->file_offset, region->file_name);
- for (symbol_index = 0; symbol_index < region->symbols_count; symbol_index ++) {
- ProfilerUnmanagedSymbol *symbol = & (region->symbols [symbol_index]);
- printf (" [%d] Symbol %s (offset %d, size %d)\n", symbol_index,
- executable_region_symbol_get_name (region, symbol),
- symbol->offset, symbol->size);
- }
- }
- }
-#endif
- LOG_WRITER_THREAD ("Built symbol tables.");
-
- // This marks the region "sub-block"
- write_uint32 (MONO_PROFILER_STATISTICAL_CODE_REGIONS);
-
- // First write the "removed" regions
- for (i = 0; i < old_regions->regions_count; i++) {
- ProfilerExecutableMemoryRegionData *region = old_regions->regions [i];
- if (! region->is_new) {
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[refresh_memory_regions] Invalidated region %d\n", region->id);
-#endif
- write_uint32 (region->id);
- }
- }
- write_uint32 (0);
-
- // Then write the new ones
- for (i = 0; i < new_regions->regions_count; i++) {
- ProfilerExecutableMemoryRegionData *region = new_regions->regions [i];
- if (region->is_new) {
- region->is_new = FALSE;
-
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[refresh_memory_regions] Wrote region %d (%p-%p[%d] '%s')\n", region->id, region->start, region->end, region->file_offset, region->file_name);
-#endif
- write_uint32 (region->id);
- write_uint64 (GPOINTER_TO_UINT (region->start));
- write_uint32 (GPOINTER_TO_UINT (region->end) - GPOINTER_TO_UINT (region->start));
- write_uint32 (region->file_offset);
- write_string (region->file_name);
- }
- }
- write_uint32 (0);
-
- // Finally, free the old ones, and replace them
- profiler_executable_memory_regions_destroy (old_regions);
- profiler->executable_regions = new_regions;
-}
-
-static gboolean
-write_statistical_hit (gpointer address, gboolean regions_refreshed) {
- ProfilerCodeBuffer *code_buffer = profiler_code_buffer_from_address (profiler, address);
-
- if ((code_buffer != NULL) && (code_buffer->info.type == MONO_PROFILER_CODE_BUFFER_METHOD)) {
- MonoMethod *method = code_buffer->info.data.method;
- MethodIdMappingElement *element = method_id_mapping_element_get (method);
-
- if (element != NULL) {
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[write_statistical_hit] Wrote method %d\n", element->id);
-#endif
- write_uint32 ((element->id << 3) | MONO_PROFILER_STATISTICAL_CODE_METHOD);
- } else {
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[write_statistical_hit] Wrote unknown method %p\n", method);
-#endif
- write_uint32 (MONO_PROFILER_STATISTICAL_CODE_METHOD);
- }
- } else {
- ProfilerExecutableMemoryRegionData *region = find_address_region (profiler->executable_regions, address);
-
- if (region == NULL && ! regions_refreshed) {
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[write_statistical_hit] Cannot find region for address %p, refreshing...\n", address);
-#endif
- refresh_memory_regions ();
- regions_refreshed = TRUE;
- region = find_address_region (profiler->executable_regions, address);
- }
-
- if (region != NULL) {
- guint32 offset = ((guint8*)address) - ((guint8*)region->start);
- ProfilerUnmanagedSymbol *symbol = executable_memory_region_find_symbol (region, offset);
-
- if (symbol != NULL) {
- if (symbol->id > 0) {
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[write_statistical_hit] Wrote unmanaged symbol %d\n", symbol->id);
-#endif
- write_uint32 ((symbol->id << 3) | MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_ID);
- } else {
- ProfilerExecutableMemoryRegions *regions = profiler->executable_regions;
- const char *symbol_name = executable_region_symbol_get_name (region, symbol);
- symbol->id = regions->next_unmanaged_function_id;
- regions->next_unmanaged_function_id ++;
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[write_statistical_hit] Wrote new unmanaged symbol in region %d[%d]\n", region->id, offset);
-#endif
- write_uint32 ((region->id << 3) | MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_NEW_ID);
- write_uint32 (symbol->id);
- write_string (symbol_name);
- }
- } else {
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[write_statistical_hit] Wrote unknown unmanaged hit in region %d[%d] (address %p)\n", region->id, offset, address);
-#endif
- write_uint32 ((region->id << 3) | MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_OFFSET_IN_REGION);
- write_uint32 (offset);
- }
- } else {
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[write_statistical_hit] Wrote unknown unmanaged hit %p\n", address);
-#endif
- write_uint32 (MONO_PROFILER_STATISTICAL_CODE_UNMANAGED_FUNCTION_OFFSET_IN_REGION);
- write_uint64 (GPOINTER_TO_UINT (address));
- }
- }
-
- return regions_refreshed;
-}
-
-static void
-flush_all_mappings (void);
-
-static void
-write_statistical_data_block (ProfilerStatisticalData *data) {
- int start_index = data->first_unwritten_index;
- int end_index = data->next_free_index;
- gboolean regions_refreshed = FALSE;
- int call_chain_depth = profiler->statistical_call_chain_depth;
- int index;
-
- if (end_index > data->end_index)
- end_index = data->end_index;
-
- if (start_index == end_index)
- return;
-
- data->first_unwritten_index = end_index;
-
- write_clock_data ();
-
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[write_statistical_data_block] Starting loop at index %d\n", start_index);
-#endif
-
- for (index = start_index; index < end_index; index ++) {
- int base_index = index * (call_chain_depth + 1);
- ProfilerStatisticalHit hit = data->hits [base_index];
- int callers_count;
-
- regions_refreshed = write_statistical_hit (hit.address, regions_refreshed);
- base_index ++;
-
- for (callers_count = 0; callers_count < call_chain_depth; callers_count ++) {
- hit = data->hits [base_index + callers_count];
- if (hit.address == NULL) {
- break;
- }
- }
-
- if (callers_count > 0) {
- write_uint32 ((callers_count << 3) | MONO_PROFILER_STATISTICAL_CODE_CALL_CHAIN);
-
- for (callers_count = 0; callers_count < call_chain_depth; callers_count ++) {
- hit = data->hits [base_index + callers_count];
- if (hit.address != NULL) {
- regions_refreshed = write_statistical_hit (hit.address, regions_refreshed);
- } else {
- break;
- }
- }
- }
- }
- write_uint32 (MONO_PROFILER_STATISTICAL_CODE_END);
-
-#if DEBUG_STATISTICAL_PROFILER
- printf ("[write_statistical_data_block] Ending loop at index %d\n", end_index);
-#endif
- write_clock_data ();
-
- write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_STATISTICAL);
-}
-
-static void
-write_intro_block (void) {
- write_uint32 (1);
- write_string ("mono");
- write_uint32 (profiler->flags);
- write_uint64 (profiler->start_counter);
- write_uint64 (profiler->start_time);
- write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_INTRO);
-}
-
-static void
-write_end_block (void) {
- write_uint32 (1);
- write_uint64 (profiler->end_counter);
- write_uint64 (profiler->end_time);
- write_current_block (MONO_PROFILER_FILE_BLOCK_KIND_END);
-}
-
-static void
-update_mapping (ProfilerPerThreadData *data) {
- ProfilerEventData *start = data->first_unmapped_event;
- ProfilerEventData *end = data->next_free_event;
- data->first_unmapped_event = end;
-
-#if (DEBUG_LOGGING_PROFILER)
- printf ("[update_mapping][TID %ld] START\n", data->thread_id);
-#endif
- while (start < end) {
-#if DEBUG_LOGGING_PROFILER
- printf ("Examining event %p[TID %ld] looking for a new mapping...\n", start, data->thread_id);
-#endif
- if (start->data_type == MONO_PROFILER_EVENT_DATA_TYPE_CLASS) {
- ClassIdMappingElement *element = class_id_mapping_element_get (start->data.address);
- if (element == NULL) {
- MonoClass *klass = start->data.address;
- class_id_mapping_element_new (klass);
- }
- } else if (start->data_type == MONO_PROFILER_EVENT_DATA_TYPE_METHOD) {
- MethodIdMappingElement *element = method_id_mapping_element_get (start->data.address);
- if (element == NULL) {
- MonoMethod *method = start->data.address;
- if (method != NULL) {
- method_id_mapping_element_new (method);
- }
- }
- }
-
- if (start->value == MAX_EVENT_VALUE) {
- start ++;
- }
- start ++;
- }
-#if (DEBUG_LOGGING_PROFILER)
- printf ("[update_mapping][TID %ld] END\n", data->thread_id);
-#endif
-}
-
-static void
-flush_all_mappings (void) {
- ProfilerPerThreadData *data;
-
- for (data = profiler->per_thread_data; data != NULL; data = data->next) {
- update_mapping (data);
- }
- for (data = profiler->per_thread_data; data != NULL; data = data->next) {
- write_mapping_block (data->thread_id);
- }
-}
-
-static void
-flush_full_event_data_buffer (ProfilerPerThreadData *data) {
- LOCK_PROFILER ();
-
- // We flush all mappings because some id definitions could come
- // from other threads
- flush_all_mappings ();
- g_assert (data->first_unmapped_event >= data->next_free_event);
-
- write_thread_data_block (data);
-
- data->next_free_event = data->events;
- data->next_unreserved_event = data->events;
- data->first_unwritten_event = data->events;
- data->first_unmapped_event = data->events;
- MONO_PROFILER_GET_CURRENT_COUNTER (data->start_event_counter);
- data->last_event_counter = data->start_event_counter;
-
- UNLOCK_PROFILER ();
-}
-
-/* The ">=" operator is intentional, to leave one spare slot for "extended values" */
-#define RESERVE_EVENTS(d,e,count) do {\
- if ((d)->next_unreserved_event >= ((d)->end_event - (count))) {\
- flush_full_event_data_buffer (d);\
- }\
- (e) = (d)->next_unreserved_event;\
- (d)->next_unreserved_event += (count);\
-} while (0)
-#define GET_NEXT_FREE_EVENT(d,e) RESERVE_EVENTS ((d),(e),1)
-#define COMMIT_RESERVED_EVENTS(d) do {\
- data->next_free_event = data->next_unreserved_event;\
-} while (0)
-
-static void
-flush_everything (void) {
- ProfilerPerThreadData *data;
-
- flush_all_mappings ();
- for (data = profiler->per_thread_data; data != NULL; data = data->next) {
- write_thread_data_block (data);
- }
- write_statistical_data_block (profiler->statistical_data);
-}
-
-#define RESULT_TO_LOAD_CODE(r) (((r)==MONO_PROFILE_OK)?MONO_PROFILER_LOADED_EVENT_SUCCESS:MONO_PROFILER_LOADED_EVENT_FAILURE)
-static void
-appdomain_start_load (MonoProfiler *profiler, MonoDomain *domain) {
- LOCK_PROFILER ();
- loaded_element_load_start (profiler->loaded_appdomains, domain);
- UNLOCK_PROFILER ();
-}
-
-static void
-appdomain_end_load (MonoProfiler *profiler, MonoDomain *domain, int result) {
- char *name;
- LoadedElement *element;
-
- name = g_strdup_printf ("%d", mono_domain_get_id (domain));
- LOCK_PROFILER ();
- element = loaded_element_load_end (profiler->loaded_appdomains, domain, name);
- write_element_load_block (element, MONO_PROFILER_LOADED_EVENT_APPDOMAIN | RESULT_TO_LOAD_CODE (result), CURRENT_THREAD_ID (), domain);
- UNLOCK_PROFILER ();
-}
-
-static void
-appdomain_start_unload (MonoProfiler *profiler, MonoDomain *domain) {
- LOCK_PROFILER ();
- loaded_element_unload_start (profiler->loaded_appdomains, domain);
- flush_everything ();
- UNLOCK_PROFILER ();
-}
-
-static void
-appdomain_end_unload (MonoProfiler *profiler, MonoDomain *domain) {
- LoadedElement *element;
-
- LOCK_PROFILER ();
- element = loaded_element_unload_end (profiler->loaded_appdomains, domain);
- write_element_unload_block (element, MONO_PROFILER_LOADED_EVENT_APPDOMAIN, CURRENT_THREAD_ID ());
- UNLOCK_PROFILER ();
-}
-
-static void
-module_start_load (MonoProfiler *profiler, MonoImage *module) {
- LOCK_PROFILER ();
- loaded_element_load_start (profiler->loaded_modules, module);
- UNLOCK_PROFILER ();
-}
-
-static void
-module_end_load (MonoProfiler *profiler, MonoImage *module, int result) {
- char *name;
- MonoAssemblyName aname;
- LoadedElement *element;
-
- if (mono_assembly_fill_assembly_name (module, &aname)) {
- name = mono_stringify_assembly_name (&aname);
- } else {
- name = g_strdup_printf ("Dynamic module \"%p\"", module);
- }
- LOCK_PROFILER ();
- element = loaded_element_load_end (profiler->loaded_modules, module, name);
- write_element_load_block (element, MONO_PROFILER_LOADED_EVENT_MODULE | RESULT_TO_LOAD_CODE (result), CURRENT_THREAD_ID (), module);
- UNLOCK_PROFILER ();
-}
-
-static void
-module_start_unload (MonoProfiler *profiler, MonoImage *module) {
- LOCK_PROFILER ();
- loaded_element_unload_start (profiler->loaded_modules, module);
- flush_everything ();
- UNLOCK_PROFILER ();
-}
-
-static void
-module_end_unload (MonoProfiler *profiler, MonoImage *module) {
- LoadedElement *element;
-
- LOCK_PROFILER ();
- element = loaded_element_unload_end (profiler->loaded_modules, module);
- write_element_unload_block (element, MONO_PROFILER_LOADED_EVENT_MODULE, CURRENT_THREAD_ID ());
- UNLOCK_PROFILER ();
-}
-
-static void
-assembly_start_load (MonoProfiler *profiler, MonoAssembly *assembly) {
- LOCK_PROFILER ();
- loaded_element_load_start (profiler->loaded_assemblies, assembly);
- UNLOCK_PROFILER ();
-}
-
-static void
-assembly_end_load (MonoProfiler *profiler, MonoAssembly *assembly, int result) {
- char *name;
- MonoAssemblyName aname;
- LoadedElement *element;
-
- if (mono_assembly_fill_assembly_name (mono_assembly_get_image (assembly), &aname)) {
- name = mono_stringify_assembly_name (&aname);
- } else {
- name = g_strdup_printf ("Dynamic assembly \"%p\"", assembly);
- }
- LOCK_PROFILER ();
- element = loaded_element_load_end (profiler->loaded_assemblies, assembly, name);
- write_element_load_block (element, MONO_PROFILER_LOADED_EVENT_ASSEMBLY | RESULT_TO_LOAD_CODE (result), CURRENT_THREAD_ID (), assembly);
- UNLOCK_PROFILER ();
-}
-
-static void
-assembly_start_unload (MonoProfiler *profiler, MonoAssembly *assembly) {
- LOCK_PROFILER ();
- loaded_element_unload_start (profiler->loaded_assemblies, assembly);
- flush_everything ();
- UNLOCK_PROFILER ();
-}
-static void
-assembly_end_unload (MonoProfiler *profiler, MonoAssembly *assembly) {
- LoadedElement *element;
-
- LOCK_PROFILER ();
- element = loaded_element_unload_end (profiler->loaded_assemblies, assembly);
- write_element_unload_block (element, MONO_PROFILER_LOADED_EVENT_ASSEMBLY, CURRENT_THREAD_ID ());
- UNLOCK_PROFILER ();
-}
-
-#if (DEBUG_LOGGING_PROFILER)
-static const char*
-class_event_code_to_string (MonoProfilerClassEvents code) {
- switch (code) {
- case MONO_PROFILER_EVENT_CLASS_LOAD: return "LOAD";
- case MONO_PROFILER_EVENT_CLASS_UNLOAD: return "UNLOAD";
- case MONO_PROFILER_EVENT_CLASS_ALLOCATION: return "ALLOCATION";
- case MONO_PROFILER_EVENT_CLASS_EXCEPTION: return "EXCEPTION";
- default: g_assert_not_reached (); return "";
- }
-}
-static const char*
-method_event_code_to_string (MonoProfilerMethodEvents code) {
- switch (code) {
- case MONO_PROFILER_EVENT_METHOD_CALL: return "CALL";
- case MONO_PROFILER_EVENT_METHOD_JIT: return "JIT";
- case MONO_PROFILER_EVENT_METHOD_FREED: return "FREED";
- case MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER: return "ALLOCATION_CALLER";
- case MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER: return "ALLOCATION_JIT_TIME_CALLER";
- case MONO_PROFILER_EVENT_ALLOCATION_OBJECT_ID: return "ALLOCATION_OBJECT_ID";
- default: g_assert_not_reached (); return "";
- }
-}
-static const char*
-number_event_code_to_string (MonoProfilerEvents code) {
- switch (code) {
- case MONO_PROFILER_EVENT_THREAD: return "THREAD";
- case MONO_PROFILER_EVENT_GC_COLLECTION: return "GC_COLLECTION";
- case MONO_PROFILER_EVENT_GC_MARK: return "GC_MARK";
- case MONO_PROFILER_EVENT_GC_SWEEP: return "GC_SWEEP";
- case MONO_PROFILER_EVENT_GC_RESIZE: return "GC_RESIZE";
- case MONO_PROFILER_EVENT_GC_STOP_WORLD: return "GC_STOP_WORLD";
- case MONO_PROFILER_EVENT_GC_START_WORLD: return "GC_START_WORLD";
- case MONO_PROFILER_EVENT_JIT_TIME_ALLOCATION: return "JIT_TIME_ALLOCATION";
- case MONO_PROFILER_EVENT_STACK_SECTION: return "STACK_SECTION";
- case MONO_PROFILER_EVENT_ALLOCATION_OBJECT_ID: return "ALLOCATION_OBJECT_ID";
- default: g_assert_not_reached (); return "";
- }
-}
-static const char*
-event_result_to_string (MonoProfilerEventResult code) {
- switch (code) {
- case MONO_PROFILER_EVENT_RESULT_SUCCESS: return "SUCCESS";
- case MONO_PROFILER_EVENT_RESULT_FAILURE: return "FAILURE";
- default: g_assert_not_reached (); return "";
- }
-}
-static const char*
-event_kind_to_string (MonoProfilerEventKind code) {
- switch (code) {
- case MONO_PROFILER_EVENT_KIND_START: return "START";
- case MONO_PROFILER_EVENT_KIND_END: return "END";
- default: g_assert_not_reached (); return "";
- }
-}
-static void
-print_event_data (ProfilerPerThreadData *data, ProfilerEventData *event, guint64 value) {
- if (event->data_type == MONO_PROFILER_EVENT_DATA_TYPE_CLASS) {
- printf ("STORE EVENT [TID %ld][EVENT %ld] CLASS[%p] %s:%s:%s[%d-%d-%d] %ld (%s.%s)\n",
- data->thread_id,
- event - data->events,
- event->data.address,
- class_event_code_to_string (event->code & ~MONO_PROFILER_EVENT_RESULT_MASK),
- event_result_to_string (event->code & MONO_PROFILER_EVENT_RESULT_MASK),
- event_kind_to_string (event->kind),
- event->data_type,
- event->kind,
- event->code,
- value,
- mono_class_get_namespace ((MonoClass*) event->data.address),
- mono_class_get_name ((MonoClass*) event->data.address));
- } else if (event->data_type == MONO_PROFILER_EVENT_DATA_TYPE_METHOD) {
- printf ("STORE EVENT [TID %ld][EVENT %ld] METHOD[%p] %s:%s:%s[%d-%d-%d] %ld (%s.%s:%s (?))\n",
- data->thread_id,
- event - data->events,
- event->data.address,
- method_event_code_to_string (event->code & ~MONO_PROFILER_EVENT_RESULT_MASK),
- event_result_to_string (event->code & MONO_PROFILER_EVENT_RESULT_MASK),
- event_kind_to_string (event->kind),
- event->data_type,
- event->kind,
- event->code,
- value,
- (event->data.address != NULL) ? mono_class_get_namespace (mono_method_get_class ((MonoMethod*) event->data.address)) : "<NULL>",
- (event->data.address != NULL) ? mono_class_get_name (mono_method_get_class ((MonoMethod*) event->data.address)) : "<NULL>",
- (event->data.address != NULL) ? mono_method_get_name ((MonoMethod*) event->data.address) : "<NULL>");
- } else {
- printf ("STORE EVENT [TID %ld][EVENT %ld] NUMBER[%ld] %s:%s[%d-%d-%d] %ld\n",
- data->thread_id,
- event - data->events,
- (guint64) event->data.number,
- number_event_code_to_string (event->code),
- event_kind_to_string (event->kind),
- event->data_type,
- event->kind,
- event->code,
- value);
- }
-}
-#define LOG_EVENT(data,ev,val) print_event_data ((data),(ev),(val))
-#else
-#define LOG_EVENT(data,ev,val)
-#endif
-
-#define RESULT_TO_EVENT_CODE(r) (((r)==MONO_PROFILE_OK)?MONO_PROFILER_EVENT_RESULT_SUCCESS:MONO_PROFILER_EVENT_RESULT_FAILURE)
-
-#define STORE_EVENT_ITEM_COUNTER(event,p,i,dt,c,k) do {\
- guint64 counter;\
- guint64 delta;\
- MONO_PROFILER_GET_CURRENT_COUNTER (counter);\
- (event)->data.address = (i);\
- (event)->data_type = (dt);\
- (event)->code = (c);\
- (event)->kind = (k);\
- delta = counter - data->last_event_counter;\
- if (delta < MAX_EVENT_VALUE) {\
- (event)->value = delta;\
- } else {\
- ProfilerEventData *extension = data->next_unreserved_event;\
- data->next_unreserved_event ++;\
- (event)->value = MAX_EVENT_VALUE;\
- *(guint64*)extension = delta;\
- }\
- data->last_event_counter = counter;\
- LOG_EVENT (data, (event), delta);\
-} while (0);
-#define STORE_EVENT_ITEM_VALUE(event,p,i,dt,c,k,v) do {\
- (event)->data.address = (i);\
- (event)->data_type = (dt);\
- (event)->code = (c);\
- (event)->kind = (k);\
- if ((v) < MAX_EVENT_VALUE) {\
- (event)->value = (v);\
- } else {\
- ProfilerEventData *extension = data->next_unreserved_event;\
- data->next_unreserved_event ++;\
- (event)->value = MAX_EVENT_VALUE;\
- *(guint64*)extension = (v);\
- }\
- LOG_EVENT (data, (event), (v));\
-}while (0);
-#define STORE_EVENT_NUMBER_COUNTER(event,p,n,dt,c,k) do {\
- guint64 counter;\
- guint64 delta;\
- MONO_PROFILER_GET_CURRENT_COUNTER (counter);\
- (event)->data.number = (n);\
- (event)->data_type = (dt);\
- (event)->code = (c);\
- (event)->kind = (k);\
- delta = counter - data->last_event_counter;\
- if (delta < MAX_EVENT_VALUE) {\
- (event)->value = delta;\
- } else {\
- ProfilerEventData *extension = data->next_unreserved_event;\
- data->next_unreserved_event ++;\
- (event)->value = MAX_EVENT_VALUE;\
- *(guint64*)extension = delta;\
- }\
- data->last_event_counter = counter;\
- LOG_EVENT (data, (event), delta);\
-}while (0);
-#define STORE_EVENT_NUMBER_VALUE(event,p,n,dt,c,k,v) do {\
- (event)->data.number = (n);\
- (event)->data_type = (dt);\
- (event)->code = (c);\
- (event)->kind = (k);\
- if ((v) < MAX_EVENT_VALUE) {\
- (event)->value = (v);\
- } else {\
- ProfilerEventData *extension = data->next_unreserved_event;\
- data->next_unreserved_event ++;\
- (event)->value = MAX_EVENT_VALUE;\
- *(guint64*)extension = (v);\
- }\
- LOG_EVENT (data, (event), (v));\
-}while (0);
-#define INCREMENT_EVENT(event) do {\
- if ((event)->value != MAX_EVENT_VALUE) {\
- (event) ++;\
- } else {\
- (event) += 2;\
- }\
-}while (0);
-
-static void
-class_start_load (MonoProfiler *profiler, MonoClass *klass) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_ITEM_COUNTER (event, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_LOAD, MONO_PROFILER_EVENT_KIND_START);
- COMMIT_RESERVED_EVENTS (data);
-}
-static void
-class_end_load (MonoProfiler *profiler, MonoClass *klass, int result) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_ITEM_COUNTER (event, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_LOAD | RESULT_TO_EVENT_CODE (result), MONO_PROFILER_EVENT_KIND_END);
- COMMIT_RESERVED_EVENTS (data);
-}
-static void
-class_start_unload (MonoProfiler *profiler, MonoClass *klass) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_ITEM_COUNTER (event, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_UNLOAD, MONO_PROFILER_EVENT_KIND_START);
- COMMIT_RESERVED_EVENTS (data);
-}
-static void
-class_end_unload (MonoProfiler *profiler, MonoClass *klass) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_ITEM_COUNTER (event, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_UNLOAD, MONO_PROFILER_EVENT_KIND_END);
- COMMIT_RESERVED_EVENTS (data);
-}
-
-static void
-method_start_jit (MonoProfiler *profiler, MonoMethod *method) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- thread_stack_push_jitted_safely (&(data->stack), method, TRUE);
- STORE_EVENT_ITEM_COUNTER (event, profiler, method, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_JIT, MONO_PROFILER_EVENT_KIND_START);
- COMMIT_RESERVED_EVENTS (data);
-}
-static void
-method_end_jit (MonoProfiler *profiler, MonoMethod *method, int result) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_ITEM_COUNTER (event, profiler, method, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_JIT | RESULT_TO_EVENT_CODE (result), MONO_PROFILER_EVENT_KIND_END);
- thread_stack_pop (&(data->stack));
- COMMIT_RESERVED_EVENTS (data);
-}
-
-#if (HAS_OPROFILE)
-static void
-method_jit_result (MonoProfiler *prof, MonoMethod *method, MonoJitInfo* jinfo, int result) {
- if (profiler->action_flags.oprofile && (result == MONO_PROFILE_OK)) {
- MonoClass *klass = mono_method_get_class (method);
- char *signature = mono_signature_get_desc (mono_method_signature (method), TRUE);
- char *name = g_strdup_printf ("%s.%s:%s (%s)", mono_class_get_namespace (klass), mono_class_get_name (klass), mono_method_get_name (method), signature);
- gpointer code_start = mono_jit_info_get_code_start (jinfo);
- int code_size = mono_jit_info_get_code_size (jinfo);
-
- if (op_write_native_code (name, code_start, code_size)) {
- g_warning ("Problem calling op_write_native_code\n");
- }
-
- g_free (signature);
- g_free (name);
- }
-}
-#endif
-
-
-static void
-method_enter (MonoProfiler *profiler, MonoMethod *method) {
- ProfilerPerThreadData *data;
-
- CHECK_PROFILER_ENABLED ();
- GET_PROFILER_THREAD_DATA (data);
- if (profiler->action_flags.track_calls) {
- ProfilerEventData *event;
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_ITEM_COUNTER (event, profiler, method, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_CALL, MONO_PROFILER_EVENT_KIND_START);
- COMMIT_RESERVED_EVENTS (data);
- }
- if (profiler->action_flags.track_stack) {
- thread_stack_push_safely (&(data->stack), method);
- }
-}
-static void
-method_leave (MonoProfiler *profiler, MonoMethod *method) {
- ProfilerPerThreadData *data;
-
- CHECK_PROFILER_ENABLED ();
- GET_PROFILER_THREAD_DATA (data);
- if (profiler->action_flags.track_calls) {
- ProfilerEventData *event;
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_ITEM_COUNTER (event, profiler, method, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_CALL, MONO_PROFILER_EVENT_KIND_END);
- COMMIT_RESERVED_EVENTS (data);
- }
- if (profiler->action_flags.track_stack) {
- thread_stack_pop (&(data->stack));
- }
-}
-
-static void
-method_free (MonoProfiler *profiler, MonoMethod *method) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_ITEM_COUNTER (event, profiler, method, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_FREED, 0);
- COMMIT_RESERVED_EVENTS (data);
-}
-
-static void
-thread_start (MonoProfiler *profiler, uintptr_t tid) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_NUMBER_COUNTER (event, profiler, tid, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_THREAD, MONO_PROFILER_EVENT_KIND_START);
- COMMIT_RESERVED_EVENTS (data);
-}
-static void
-thread_end (MonoProfiler *profiler, uintptr_t tid) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_NUMBER_COUNTER (event, profiler, tid, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_THREAD, MONO_PROFILER_EVENT_KIND_END);
- COMMIT_RESERVED_EVENTS (data);
-}
-
-static ProfilerEventData*
-save_stack_delta (MonoProfiler *profiler, ProfilerPerThreadData *data, ProfilerEventData *events, int unsaved_frames) {
- int i;
-
- /* In this loop it is safe to simply increment "events" because MAX_EVENT_VALUE cannot be reached. */
- STORE_EVENT_NUMBER_VALUE (events, profiler, data->stack.last_saved_top, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_STACK_SECTION, 0, unsaved_frames);
- events++;
- for (i = 0; i < unsaved_frames; i++) {
- if (! thread_stack_index_from_top_is_jitted (&(data->stack), i)) {
- STORE_EVENT_ITEM_VALUE (events, profiler, thread_stack_index_from_top (&(data->stack), i), MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER, 0, 0);
- } else {
- STORE_EVENT_ITEM_VALUE (events, profiler, thread_stack_index_from_top (&(data->stack), i), MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER, 0, 0);
- }
- events ++;
- }
-
- data->stack.last_saved_top = data->stack.top;
-
- return events;
-}
-
-static void
-object_allocated (MonoProfiler *profiler, MonoObject *obj, MonoClass *klass) {
- ProfilerPerThreadData *data;
- ProfilerEventData *events;
- int unsaved_frames;
- int event_slot_count;
-
- GET_PROFILER_THREAD_DATA (data);
- event_slot_count = 1;
- if (profiler->action_flags.save_allocation_caller) {
- event_slot_count ++;
- }
- if (profiler->action_flags.allocations_carry_id) {
- event_slot_count ++;
- }
- if (profiler->action_flags.save_allocation_stack) {
- unsaved_frames = thread_stack_count_unsaved_frames (&(data->stack));
- event_slot_count += (unsaved_frames + 1);
- } else {
- unsaved_frames = 0;
- }
- RESERVE_EVENTS (data, events, event_slot_count);
-
- if (profiler->action_flags.save_allocation_stack) {
- events = save_stack_delta (profiler, data, events, unsaved_frames);
- }
-
- STORE_EVENT_ITEM_VALUE (events, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_ALLOCATION, 0, (guint64) mono_object_get_size (obj));
- if (profiler->action_flags.unreachable_objects || profiler->action_flags.heap_shot || profiler->action_flags.collection_summary) {
- STORE_ALLOCATED_OBJECT (data, obj);
- }
-
- if (profiler->action_flags.save_allocation_caller) {
- MonoMethod *caller = thread_stack_top (&(data->stack));
- gboolean caller_is_jitted = thread_stack_top_is_jitted (&(data->stack));
- int index = 1;
- /* In this loop it is safe to simply increment "events" because MAX_EVENT_VALUE cannot be reached. */
- events ++;
-
- while ((caller != NULL) && (caller->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE)) {
- caller = thread_stack_index_from_top (&(data->stack), index);
- caller_is_jitted = thread_stack_index_from_top_is_jitted (&(data->stack), index);
- index ++;
- }
- if (! caller_is_jitted) {
- STORE_EVENT_ITEM_VALUE (events, profiler, caller, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_ALLOCATION_CALLER, 0, 0);
- } else {
- STORE_EVENT_ITEM_VALUE (events, profiler, caller, MONO_PROFILER_EVENT_DATA_TYPE_METHOD, MONO_PROFILER_EVENT_METHOD_ALLOCATION_JIT_TIME_CALLER, 0, 0);
- }
- }
- if (profiler->action_flags.allocations_carry_id) {
- events ++;
- STORE_EVENT_ITEM_VALUE (events, profiler, obj, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_ALLOCATION_OBJECT_ID, 0, 0);
- }
-
- COMMIT_RESERVED_EVENTS (data);
-}
-
-static void
-monitor_event (MonoProfiler *profiler, MonoObject *obj, MonoProfilerMonitorEvent event) {
- ProfilerPerThreadData *data;
- ProfilerEventData *events;
- MonoClass *klass;
- int unsaved_frames;
- int event_slot_count;
-
- CHECK_PROFILER_ENABLED ();
-
- GET_PROFILER_THREAD_DATA (data);
- klass = mono_object_get_class (obj);
-
- unsaved_frames = thread_stack_count_unsaved_frames (&(data->stack));
- if (unsaved_frames > 0) {
- event_slot_count = unsaved_frames + 3;
- } else {
- event_slot_count = 2;
- }
-
- RESERVE_EVENTS (data, events, event_slot_count);
- if (unsaved_frames > 0) {
- events = save_stack_delta (profiler, data, events, unsaved_frames);
- }
- STORE_EVENT_ITEM_COUNTER (events, profiler, klass, MONO_PROFILER_EVENT_DATA_TYPE_CLASS, MONO_PROFILER_EVENT_CLASS_MONITOR, MONO_PROFILER_EVENT_KIND_START);
- INCREMENT_EVENT (events);
- STORE_EVENT_ITEM_VALUE (events, profiler, obj, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_OBJECT_MONITOR, 0, event);
- COMMIT_RESERVED_EVENTS (data);
-}
-
-static void
-statistical_call_chain (MonoProfiler *profiler, int call_chain_depth, guchar **ips, void *context) {
- MonoDomain *domain = mono_domain_get ();
- ProfilerStatisticalData *data;
- unsigned int index;
-
- CHECK_PROFILER_ENABLED ();
- do {
- data = profiler->statistical_data;
- index = InterlockedIncrement ((int*) &data->next_free_index);
-
- if (index <= data->end_index) {
- unsigned int base_index = (index - 1) * (profiler->statistical_call_chain_depth + 1);
- unsigned int call_chain_index = 0;
-
- //printf ("[statistical_call_chain] (%d)\n", call_chain_depth);
- while (call_chain_index < call_chain_depth) {
- ProfilerStatisticalHit *hit = & (data->hits [base_index + call_chain_index]);
- //printf ("[statistical_call_chain] [%d] = %p\n", base_index + call_chain_index, ips [call_chain_index]);
- hit->address = (gpointer) ips [call_chain_index];
- hit->domain = domain;
- call_chain_index ++;
- }
- while (call_chain_index <= profiler->statistical_call_chain_depth) {
- ProfilerStatisticalHit *hit = & (data->hits [base_index + call_chain_index]);
- //printf ("[statistical_call_chain] [%d] = NULL\n", base_index + call_chain_index);
- hit->address = NULL;
- hit->domain = NULL;
- call_chain_index ++;
- }
- } else {
- /* Check if we are the one that must swap the buffers */
- if (index == data->end_index + 1) {
- ProfilerStatisticalData *new_data;
-
- /* In the *impossible* case that the writer thread has not finished yet, */
- /* loop waiting for it and meanwhile lose all statistical events... */
- do {
- /* First, wait that it consumed the ready buffer */
- while (profiler->statistical_data_ready != NULL);
- /* Then, wait that it produced the free buffer */
- new_data = profiler->statistical_data_second_buffer;
- } while (new_data == NULL);
-
- profiler->statistical_data_ready = data;
- profiler->statistical_data = new_data;
- profiler->statistical_data_second_buffer = NULL;
- WRITER_EVENT_RAISE ();
- /* Otherwise exit from the handler and drop the event... */
- } else {
- break;
- }
-
- /* Loop again, hoping to acquire a free slot this time (otherwise the event will be dropped) */
- data = NULL;
- }
- } while (data == NULL);
-}
-
-static void
-statistical_hit (MonoProfiler *profiler, guchar *ip, void *context) {
- MonoDomain *domain = mono_domain_get ();
- ProfilerStatisticalData *data;
- unsigned int index;
-
- CHECK_PROFILER_ENABLED ();
- do {
- data = profiler->statistical_data;
- index = InterlockedIncrement ((int*) &data->next_free_index);
-
- if (index <= data->end_index) {
- ProfilerStatisticalHit *hit = & (data->hits [index - 1]);
- hit->address = (gpointer) ip;
- hit->domain = domain;
- } else {
- /* Check if we are the one that must swap the buffers */
- if (index == data->end_index + 1) {
- ProfilerStatisticalData *new_data;
-
- /* In the *impossible* case that the writer thread has not finished yet, */
- /* loop waiting for it and meanwhile lose all statistical events... */
- do {
- /* First, wait that it consumed the ready buffer */
- while (profiler->statistical_data_ready != NULL);
- /* Then, wait that it produced the free buffer */
- new_data = profiler->statistical_data_second_buffer;
- } while (new_data == NULL);
-
- profiler->statistical_data_ready = data;
- profiler->statistical_data = new_data;
- profiler->statistical_data_second_buffer = NULL;
- WRITER_EVENT_RAISE ();
- }
-
- /* Loop again, hoping to acquire a free slot this time */
- data = NULL;
- }
- } while (data == NULL);
-}
-
-static MonoProfilerEvents
-gc_event_code_from_profiler_event (MonoGCEvent event) {
- switch (event) {
- case MONO_GC_EVENT_START:
- case MONO_GC_EVENT_END:
- return MONO_PROFILER_EVENT_GC_COLLECTION;
- case MONO_GC_EVENT_MARK_START:
- case MONO_GC_EVENT_MARK_END:
- return MONO_PROFILER_EVENT_GC_MARK;
- case MONO_GC_EVENT_RECLAIM_START:
- case MONO_GC_EVENT_RECLAIM_END:
- return MONO_PROFILER_EVENT_GC_SWEEP;
- case MONO_GC_EVENT_PRE_STOP_WORLD:
- case MONO_GC_EVENT_POST_STOP_WORLD:
- return MONO_PROFILER_EVENT_GC_STOP_WORLD;
- case MONO_GC_EVENT_PRE_START_WORLD:
- case MONO_GC_EVENT_POST_START_WORLD:
- return MONO_PROFILER_EVENT_GC_START_WORLD;
- default:
- g_assert_not_reached ();
- return 0;
- }
-}
-
-static MonoProfilerEventKind
-gc_event_kind_from_profiler_event (MonoGCEvent event) {
- switch (event) {
- case MONO_GC_EVENT_START:
- case MONO_GC_EVENT_MARK_START:
- case MONO_GC_EVENT_RECLAIM_START:
- case MONO_GC_EVENT_PRE_STOP_WORLD:
- case MONO_GC_EVENT_PRE_START_WORLD:
- return MONO_PROFILER_EVENT_KIND_START;
- case MONO_GC_EVENT_END:
- case MONO_GC_EVENT_MARK_END:
- case MONO_GC_EVENT_RECLAIM_END:
- case MONO_GC_EVENT_POST_START_WORLD:
- case MONO_GC_EVENT_POST_STOP_WORLD:
- return MONO_PROFILER_EVENT_KIND_END;
- default:
- g_assert_not_reached ();
- return 0;
- }
-}
-
-static gboolean
-dump_current_heap_snapshot (void) {
- gboolean result;
-
- if (profiler->heap_shot_was_requested) {
- result = TRUE;
- } else {
- if (profiler->dump_next_heap_snapshots > 0) {
- profiler->dump_next_heap_snapshots--;
- result = TRUE;
- } else if (profiler->dump_next_heap_snapshots < 0) {
- result = TRUE;
- } else {
- result = FALSE;
- }
- }
-
- return result;
-}
-
-static void
-profiler_heap_buffers_setup (ProfilerHeapShotHeapBuffers *heap) {
- heap->buffers = g_new (ProfilerHeapShotHeapBuffer, 1);
- heap->buffers->previous = NULL;
- heap->buffers->next = NULL;
- heap->buffers->start_slot = &(heap->buffers->buffer [0]);
- heap->buffers->end_slot = &(heap->buffers->buffer [PROFILER_HEAP_SHOT_HEAP_BUFFER_SIZE]);
- heap->last = heap->buffers;
- heap->current = heap->buffers;
- heap->first_free_slot = & (heap->buffers->buffer [0]);
-}
-static void
-profiler_heap_buffers_clear (ProfilerHeapShotHeapBuffers *heap) {
- heap->buffers = NULL;
- heap->last = NULL;
- heap->current = NULL;
- heap->first_free_slot = NULL;
-}
-static void
-profiler_heap_buffers_free (ProfilerHeapShotHeapBuffers *heap) {
- ProfilerHeapShotHeapBuffer *current = heap->buffers;
- while (current != NULL) {
- ProfilerHeapShotHeapBuffer *next = current->next;
- g_free (current);
- current = next;
- }
- profiler_heap_buffers_clear (heap);
-}
-
-static int
-report_object_references (gpointer *start, ClassIdMappingElement *layout, ProfilerHeapShotWriteJob *job) {
- int reported_references = 0;
- int slot;
-
- for (slot = 0; slot < layout->data.layout.slots; slot ++) {
- gboolean slot_has_reference;
- if (layout->data.layout.slots <= CLASS_LAYOUT_PACKED_BITMAP_SIZE) {
- if (layout->data.bitmap.compact & (((guint64)1) << slot)) {
- slot_has_reference = TRUE;
- } else {
- slot_has_reference = FALSE;
- }
- } else {
- if (layout->data.bitmap.extended [slot >> 3] & (1 << (slot & 7))) {
- slot_has_reference = TRUE;
- } else {
- slot_has_reference = FALSE;
- }
- }
-
- if (slot_has_reference) {
- gpointer field = start [slot];
-
- if ((field != NULL) && mono_object_is_alive (field)) {
- reported_references ++;
- WRITE_HEAP_SHOT_JOB_VALUE (job, field);
- }
- }
- }
-
- return reported_references;
-}
-
-static void
-profiler_heap_report_object_reachable (ProfilerHeapShotWriteJob *job, MonoObject *obj) {
- if (job != NULL) {
- MonoClass *klass = mono_object_get_class (obj);
- ClassIdMappingElement *class_id = class_id_mapping_element_get (klass);
- if (class_id == NULL) {
- printf ("profiler_heap_report_object_reachable: class %p (%s.%s) has no id\n", klass, mono_class_get_namespace (klass), mono_class_get_name (klass));
- }
- g_assert (class_id != NULL);
-
- if (job->summary.capacity > 0) {
- guint32 id = class_id->id;
- g_assert (id < job->summary.capacity);
-
- job->summary.per_class_data [id].reachable.instances ++;
- job->summary.per_class_data [id].reachable.bytes += mono_object_get_size (obj);
- }
- if (profiler->action_flags.heap_shot && job->dump_heap_data) {
- int reference_counter = 0;
- gpointer *reference_counter_location;
-
- WRITE_HEAP_SHOT_JOB_VALUE_WITH_CODE (job, obj, HEAP_CODE_OBJECT);
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_report_object_reachable: reported object %p at cursor %p\n", obj, (job->cursor - 1));
-#endif
- WRITE_HEAP_SHOT_JOB_VALUE (job, NULL);
- reference_counter_location = job->cursor - 1;
-
- if (mono_class_get_rank (klass)) {
- MonoArray *array = (MonoArray *) obj;
- MonoClass *element_class = mono_class_get_element_class (klass);
- ClassIdMappingElement *element_id = class_id_mapping_element_get (element_class);
-
- g_assert (element_id != NULL);
- if (element_id->data.layout.slots == CLASS_LAYOUT_NOT_INITIALIZED) {
- class_id_mapping_element_build_layout_bitmap (element_class, element_id);
- }
- if (! mono_class_is_valuetype (element_class)) {
- int length = mono_array_length (array);
- int i;
- for (i = 0; i < length; i++) {
- MonoObject *array_element = mono_array_get (array, MonoObject*, i);
- if ((array_element != NULL) && mono_object_is_alive (array_element)) {
- reference_counter ++;
- WRITE_HEAP_SHOT_JOB_VALUE (job, array_element);
- }
- }
- } else if (element_id->data.layout.references > 0) {
- int length = mono_array_length (array);
- int array_element_size = mono_array_element_size (klass);
- int i;
- for (i = 0; i < length; i++) {
- gpointer array_element_address = mono_array_addr_with_size (array, array_element_size, i);
- reference_counter += report_object_references (array_element_address, element_id, job);
- }
- }
- } else {
- if (class_id->data.layout.slots == CLASS_LAYOUT_NOT_INITIALIZED) {
- class_id_mapping_element_build_layout_bitmap (klass, class_id);
- }
- if (class_id->data.layout.references > 0) {
- reference_counter += report_object_references ((gpointer)(((char*)obj) + sizeof (MonoObject)), class_id, job);
- }
- }
-
- *reference_counter_location = GINT_TO_POINTER (reference_counter);
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_report_object_reachable: updated reference_counter_location %p with value %d\n", reference_counter_location, reference_counter);
-#endif
- }
- }
-}
-static void
-profiler_heap_report_object_unreachable (ProfilerHeapShotWriteJob *job, MonoObject *obj) {
- if (job != NULL) {
- MonoClass *klass = mono_object_get_class (obj);
- guint32 size = mono_object_get_size (obj);
-
- if (job->summary.capacity > 0) {
- ClassIdMappingElement *class_id = class_id_mapping_element_get (klass);
- guint32 id;
-
- if (class_id == NULL) {
- printf ("profiler_heap_report_object_reachable: class %p (%s.%s) has no id\n", klass, mono_class_get_namespace (klass), mono_class_get_name (klass));
- }
- g_assert (class_id != NULL);
- id = class_id->id;
- g_assert (id < job->summary.capacity);
-
- job->summary.per_class_data [id].unreachable.instances ++;
- job->summary.per_class_data [id].unreachable.bytes += size;
- }
- if (profiler->action_flags.unreachable_objects && job->dump_heap_data) {
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_report_object_unreachable: at job %p writing klass %p\n", job, klass);
-#endif
- WRITE_HEAP_SHOT_JOB_VALUE_WITH_CODE (job, klass, HEAP_CODE_FREE_OBJECT_CLASS);
-
-#if DEBUG_HEAP_PROFILER
- printf ("profiler_heap_report_object_unreachable: at job %p writing size %p\n", job, GUINT_TO_POINTER (size));
-#endif
- WRITE_HEAP_SHOT_JOB_VALUE (job, GUINT_TO_POINTER (size));
- }
- }
-}
-
-static void
-profiler_heap_add_object (ProfilerHeapShotHeapBuffers *heap, ProfilerHeapShotWriteJob *job, MonoObject *obj) {
- if (heap->first_free_slot >= heap->current->end_slot) {
- if (heap->current->next != NULL) {
- heap->current = heap->current->next;
- } else {
- ProfilerHeapShotHeapBuffer *buffer = g_new (ProfilerHeapShotHeapBuffer, 1);
- buffer->previous = heap->last;
- buffer->next = NULL;
- buffer->start_slot = &(buffer->buffer [0]);
- buffer->end_slot = &(buffer->buffer [PROFILER_HEAP_SHOT_HEAP_BUFFER_SIZE]);
- heap->current = buffer;
- heap->last->next = buffer;
- heap->last = buffer;
- }
- heap->first_free_slot = &(heap->current->buffer [0]);
- }
-
- *(heap->first_free_slot) = obj;
- heap->first_free_slot ++;
- profiler_heap_report_object_reachable (job, obj);
-}
-
-static MonoObject*
-profiler_heap_pop_object_from_end (ProfilerHeapShotHeapBuffers *heap, ProfilerHeapShotWriteJob *job, MonoObject** current_slot) {
- while (heap->first_free_slot != current_slot) {
- MonoObject* obj;
-
- if (heap->first_free_slot > heap->current->start_slot) {
- heap->first_free_slot --;
- } else {
- heap->current = heap->current->previous;
- g_assert (heap->current != NULL);
- heap->first_free_slot = heap->current->end_slot - 1;
- }
-
- obj = *(heap->first_free_slot);
-
- if (mono_object_is_alive (obj)) {
- profiler_heap_report_object_reachable (job, obj);
- return obj;
- } else {
- profiler_heap_report_object_unreachable (job, obj);
- }
- }
- return NULL;
-}
-
-static void
-profiler_heap_scan (ProfilerHeapShotHeapBuffers *heap, ProfilerHeapShotWriteJob *job) {
- ProfilerHeapShotHeapBuffer *current_buffer = heap->buffers;
- MonoObject** current_slot = current_buffer->start_slot;
-
- while (current_slot != heap->first_free_slot) {
- MonoObject *obj = *current_slot;
- if (mono_object_is_alive (obj)) {
- profiler_heap_report_object_reachable (job, obj);
- } else {
- profiler_heap_report_object_unreachable (job, obj);
- *current_slot = profiler_heap_pop_object_from_end (heap, job, current_slot);
- }
-
- if (*current_slot != NULL) {
- current_slot ++;
-
- if (current_slot == current_buffer->end_slot) {
- current_buffer = current_buffer->next;
- g_assert (current_buffer != NULL);
- current_slot = current_buffer->start_slot;
- }
- }
- }
-}
-
-static inline gboolean
-heap_shot_write_job_should_be_created (gboolean dump_heap_data) {
- return dump_heap_data || profiler->action_flags.unreachable_objects || profiler->action_flags.collection_summary;
-}
-
-static void
-process_gc_event (MonoProfiler *profiler, gboolean do_heap_profiling, MonoGCEvent ev) {
- static gboolean dump_heap_data;
-
- switch (ev) {
- case MONO_GC_EVENT_PRE_STOP_WORLD:
- // Get the lock, so we are sure nobody is flushing events during the collection,
- // and we can update all mappings (building the class descriptors).
- // This is necessary also during lock profiling (even if do_heap_profiling is FALSE).
- LOCK_PROFILER ();
- break;
- case MONO_GC_EVENT_POST_STOP_WORLD:
- if (do_heap_profiling) {
- dump_heap_data = dump_current_heap_snapshot ();
- if (heap_shot_write_job_should_be_created (dump_heap_data)) {
- ProfilerPerThreadData *data;
- // Update all mappings, so that we have built all the class descriptors.
- flush_all_mappings ();
- // Also write all event buffers, so that allocations are recorded.
- for (data = profiler->per_thread_data; data != NULL; data = data->next) {
- write_thread_data_block (data);
- }
- }
- } else {
- dump_heap_data = FALSE;
- }
- // Release lock...
- UNLOCK_PROFILER ();
- break;
- case MONO_GC_EVENT_MARK_END: {
- if (do_heap_profiling) {
- ProfilerHeapShotWriteJob *job;
- ProfilerPerThreadData *data;
-
- if (heap_shot_write_job_should_be_created (dump_heap_data)) {
- job = profiler_heap_shot_write_job_new (profiler->heap_shot_was_requested, dump_heap_data, profiler->garbage_collection_counter);
- profiler->heap_shot_was_requested = FALSE;
- MONO_PROFILER_GET_CURRENT_COUNTER (job->start_counter);
- MONO_PROFILER_GET_CURRENT_TIME (job->start_time);
- } else {
- job = NULL;
- }
-
- profiler_heap_scan (&(profiler->heap), job);
-
- for (data = profiler->per_thread_data; data != NULL; data = data->next) {
- ProfilerHeapShotObjectBuffer *buffer;
- for (buffer = data->heap_shot_object_buffers; buffer != NULL; buffer = buffer->next) {
- MonoObject **cursor;
- for (cursor = buffer->first_unprocessed_slot; cursor < buffer->next_free_slot; cursor ++) {
- MonoObject *obj = *cursor;
-#if DEBUG_HEAP_PROFILER
- printf ("gc_event: in object buffer %p(%p-%p) cursor at %p has object %p ", buffer, &(buffer->buffer [0]), buffer->end, cursor, obj);
-#endif
- if (mono_object_is_alive (obj)) {
-#if DEBUG_HEAP_PROFILER
- printf ("(object is alive, adding to heap)\n");
-#endif
- profiler_heap_add_object (&(profiler->heap), job, obj);
- } else {
-#if DEBUG_HEAP_PROFILER
- printf ("(object is unreachable, reporting in job)\n");
-#endif
- profiler_heap_report_object_unreachable (job, obj);
- }
- }
- buffer->first_unprocessed_slot = cursor;
- }
- }
-
- if (job != NULL) {
- MONO_PROFILER_GET_CURRENT_COUNTER (job->end_counter);
- MONO_PROFILER_GET_CURRENT_TIME (job->end_time);
-
- profiler_add_heap_shot_write_job (job);
- profiler_free_heap_shot_write_jobs ();
- WRITER_EVENT_RAISE ();
- }
- }
- break;
- }
- default:
- break;
- }
-}
-
-static void
-gc_event (MonoProfiler *profiler, MonoGCEvent ev, int generation) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- gboolean do_heap_profiling = profiler->action_flags.unreachable_objects || profiler->action_flags.heap_shot || profiler->action_flags.collection_summary;
- guint32 event_value;
-
- if (ev == MONO_GC_EVENT_START) {
- profiler->garbage_collection_counter ++;
- }
-
- event_value = (profiler->garbage_collection_counter << 8) | generation;
-
- if (ev == MONO_GC_EVENT_POST_STOP_WORLD) {
- process_gc_event (profiler, do_heap_profiling, ev);
- }
-
- /* Check if the gc event should be recorded. */
- if (profiler->action_flags.report_gc_events || do_heap_profiling) {
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- STORE_EVENT_NUMBER_COUNTER (event, profiler, event_value, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, gc_event_code_from_profiler_event (ev), gc_event_kind_from_profiler_event (ev));
- COMMIT_RESERVED_EVENTS (data);
- }
-
- if (ev != MONO_GC_EVENT_POST_STOP_WORLD) {
- process_gc_event (profiler, do_heap_profiling, ev);
- }
-}
-
-static void
-gc_resize (MonoProfiler *profiler, gint64 new_size) {
- ProfilerPerThreadData *data;
- ProfilerEventData *event;
- GET_PROFILER_THREAD_DATA (data);
- GET_NEXT_FREE_EVENT (data, event);
- profiler->garbage_collection_counter ++;
- STORE_EVENT_NUMBER_VALUE (event, profiler, new_size, MONO_PROFILER_EVENT_DATA_TYPE_OTHER, MONO_PROFILER_EVENT_GC_RESIZE, 0, profiler->garbage_collection_counter);
- COMMIT_RESERVED_EVENTS (data);
-}
-
-static void
-runtime_initialized (MonoProfiler *profiler) {
- LOG_WRITER_THREAD ("runtime_initialized: initializing internal calls.\n");
- mono_add_internal_call ("Mono.Profiler.RuntimeControls::EnableProfiler", enable_profiler);
- mono_add_internal_call ("Mono.Profiler.RuntimeControls::DisableProfiler", disable_profiler);
- mono_add_internal_call ("Mono.Profiler.RuntimeControls::TakeHeapSnapshot", request_heap_snapshot);
- LOG_WRITER_THREAD ("runtime_initialized: initialized internal calls.\n");
-}
-
-
-#define MAX_COMMAND_LENGTH (1024)
-static int server_socket;
-static int command_socket;
-
-static void
-write_user_response (const char *response) {
- LOG_USER_THREAD ("write_user_response: writing response:");
- LOG_USER_THREAD (response);
- send (command_socket, response, strlen (response), 0);
-}
-
-static void
-execute_user_command (char *command) {
- char *line_feed;
-
- LOG_USER_THREAD ("execute_user_command: executing command:");
- LOG_USER_THREAD (command);
-
- /* Ignore leading and trailing '\r' */
- line_feed = strchr (command, '\r');
- if (line_feed == command) {
- command ++;
- line_feed = strchr (command, '\r');
- }
- if ((line_feed != NULL) && (* (line_feed + 1) == 0)) {
- *line_feed = 0;
- }
-
- if (strcmp (command, "enable") == 0) {
- LOG_USER_THREAD ("execute_user_command: enabling profiler");
- enable_profiler ();
- write_user_response ("DONE\n");
- } else if (strcmp (command, "disable") == 0) {
- LOG_USER_THREAD ("execute_user_command: disabling profiler");
- disable_profiler ();
- write_user_response ("DONE\n");
- } else if (strcmp (command, "heap-snapshot") == 0) {
- LOG_USER_THREAD ("execute_user_command: taking heap snapshot");
- profiler->heap_shot_was_requested = TRUE;
- WRITER_EVENT_RAISE ();
- write_user_response ("DONE\n");
- } else if (strstr (command, "heap-snapshot-counter") == 0) {
- char *equals;
- LOG_USER_THREAD ("execute_user_command: changing heap counter");
- equals = strstr (command, "=");
- if (equals != NULL) {
- equals ++;
- if (strcmp (equals, "all") == 0) {
- LOG_USER_THREAD ("execute_user_command: heap counter is \"all\"");
- profiler->garbage_collection_counter = -1;
- } else if (strcmp (equals, "none") == 0) {
- LOG_USER_THREAD ("execute_user_command: heap counter is \"none\"");
- profiler->garbage_collection_counter = 0;
- } else {
- profiler->garbage_collection_counter = atoi (equals);
- }
- write_user_response ("DONE\n");
- } else {
- write_user_response ("ERROR\n");
- }
- profiler->heap_shot_was_requested = TRUE;
- } else {
- LOG_USER_THREAD ("execute_user_command: command not recognized");
- write_user_response ("ERROR\n");
- }
-}
-
-static gboolean
-process_user_commands (void) {
- char *command_buffer = malloc (MAX_COMMAND_LENGTH);
- int command_buffer_current_index = 0;
- gboolean loop = TRUE;
- gboolean result = TRUE;
-
- while (loop) {
- int unprocessed_characters;
-
- LOG_USER_THREAD ("process_user_commands: reading from socket...");
- unprocessed_characters = recv (command_socket, command_buffer + command_buffer_current_index, MAX_COMMAND_LENGTH - command_buffer_current_index, 0);
-
- if (unprocessed_characters > 0) {
- char *command_end = NULL;
-
- LOG_USER_THREAD ("process_user_commands: received characters.");
-
- do {
- if (command_end != NULL) {
- *command_end = 0;
- execute_user_command (command_buffer);
- unprocessed_characters -= (((command_end - command_buffer) - command_buffer_current_index) + 1);
-
- if (unprocessed_characters > 0) {
- memmove (command_buffer, command_end + 1, unprocessed_characters);
- }
- command_buffer_current_index = 0;
- }
-
- command_end = memchr (command_buffer, '\n', command_buffer_current_index + unprocessed_characters);
- } while (command_end != NULL);
-
- command_buffer_current_index += unprocessed_characters;
-
- } else if (unprocessed_characters == 0) {
- LOG_USER_THREAD ("process_user_commands: received no character.");
- result = TRUE;
- loop = FALSE;
- } else {
- LOG_USER_THREAD ("process_user_commands: received error.");
- result = FALSE;
- loop = FALSE;
- }
- }
-
- free (command_buffer);
- return result;
-}
-
-static guint32
-user_thread (gpointer nothing) {
- struct sockaddr_in server_address;
-
- server_socket = -1;
- command_socket = -1;
-
- LOG_USER_THREAD ("user_thread: starting up...");
-
- server_socket = socket (AF_INET, SOCK_STREAM, 0);
- if (server_socket < 0) {
- LOG_USER_THREAD ("user_thread: error creating socket.");
- return 0;
- }
- memset (& server_address, 0, sizeof (server_address));
-
- server_address.sin_family = AF_INET;
- server_address.sin_addr.s_addr = INADDR_ANY;
- if ((profiler->command_port < 1023) || (profiler->command_port > 65535)) {
- LOG_USER_THREAD ("user_thread: invalid port number.");
- return 0;
- }
- server_address.sin_port = htons (profiler->command_port);
-
- if (bind (server_socket, (struct sockaddr *) &server_address, sizeof(server_address)) < 0) {
- LOG_USER_THREAD ("user_thread: error binding socket.");
- close (server_socket);
- return 0;
- }
-
- LOG_USER_THREAD ("user_thread: listening...\n");
- listen (server_socket, 1);
- command_socket = accept (server_socket, NULL, NULL);
- if (command_socket < 0) {
- LOG_USER_THREAD ("user_thread: error accepting socket.");
- close (server_socket);
- return 0;
- }
-
- LOG_USER_THREAD ("user_thread: processing user commands...");
- process_user_commands ();
-
- LOG_USER_THREAD ("user_thread: exiting cleanly.");
- close (server_socket);
- close (command_socket);
- return 0;
-}
-
-
-/* called at the end of the program */
-static void
-profiler_shutdown (MonoProfiler *prof)
-{
- ProfilerPerThreadData* current_thread_data;
- ProfilerPerThreadData* next_thread_data;
-
- LOG_WRITER_THREAD ("profiler_shutdown: zeroing relevant flags");
- mono_profiler_set_events (0);
- /* During shutdown searching for MonoJitInfo is not possible... */
- if (profiler->statistical_call_chain_strategy == MONO_PROFILER_CALL_CHAIN_MANAGED) {
- mono_profiler_install_statistical_call_chain (NULL, 0, MONO_PROFILER_CALL_CHAIN_NONE);
- }
- //profiler->flags = 0;
- //profiler->action_flags.unreachable_objects = FALSE;
- //profiler->action_flags.heap_shot = FALSE;
-
- LOG_WRITER_THREAD ("profiler_shutdown: asking stats thread to exit");
- profiler->terminate_writer_thread = TRUE;
- WRITER_EVENT_RAISE ();
- LOG_WRITER_THREAD ("profiler_shutdown: waiting for stats thread to exit");
- WAIT_WRITER_THREAD ();
- LOG_WRITER_THREAD ("profiler_shutdown: stats thread should be dead now");
- WRITER_EVENT_DESTROY ();
-
- LOCK_PROFILER ();
- flush_everything ();
- MONO_PROFILER_GET_CURRENT_TIME (profiler->end_time);
- MONO_PROFILER_GET_CURRENT_COUNTER (profiler->end_counter);
- write_end_block ();
- FLUSH_FILE ();
- CLOSE_FILE();
- mono_profiler_install_code_chunk_new (NULL);
- mono_profiler_install_code_chunk_destroy (NULL);
- mono_profiler_install_code_buffer_new (NULL);
- profiler_code_chunks_cleanup (& (profiler->code_chunks));
- UNLOCK_PROFILER ();
-
- g_free (profiler->file_name);
- if (profiler->file_name_suffix != NULL) {
- g_free (profiler->file_name_suffix);
- }
-
- method_id_mapping_destroy (profiler->methods);
- class_id_mapping_destroy (profiler->classes);
- g_hash_table_destroy (profiler->loaded_assemblies);
- g_hash_table_destroy (profiler->loaded_modules);
- g_hash_table_destroy (profiler->loaded_appdomains);
-
- FREE_PROFILER_THREAD_DATA ();
-
- for (current_thread_data = profiler->per_thread_data; current_thread_data != NULL; current_thread_data = next_thread_data) {
- next_thread_data = current_thread_data->next;
- profiler_per_thread_data_destroy (current_thread_data);
- }
- if (profiler->statistical_data != NULL) {
- profiler_statistical_data_destroy (profiler->statistical_data);
- }
- if (profiler->statistical_data_ready != NULL) {
- profiler_statistical_data_destroy (profiler->statistical_data_ready);
- }
- if (profiler->statistical_data_second_buffer != NULL) {
- profiler_statistical_data_destroy (profiler->statistical_data_second_buffer);
- }
- if (profiler->executable_regions != NULL) {
- profiler_executable_memory_regions_destroy (profiler->executable_regions);
- }
-
- profiler_heap_buffers_free (&(profiler->heap));
-
- profiler_free_write_buffers ();
- profiler_destroy_heap_shot_write_jobs ();
-
- DELETE_PROFILER_MUTEX ();
-
-#if (HAS_OPROFILE)
- if (profiler->action_flags.oprofile) {
- op_close_agent ();
- }
-#endif
-
- g_free (profiler);
- profiler = NULL;
-}
-
-#define FAIL_ARGUMENT_CHECK(message) do {\
- failure_message = (message);\
- goto failure_handling;\
-} while (0)
-#define FAIL_PARSING_VALUED_ARGUMENT FAIL_ARGUMENT_CHECK("cannot parse valued argument %s")
-#define FAIL_PARSING_FLAG_ARGUMENT FAIL_ARGUMENT_CHECK("cannot parse flag argument %s")
-#define CHECK_CONDITION(condition,message) do {\
- gboolean result = (condition);\
- if (result) {\
- FAIL_ARGUMENT_CHECK (message);\
- }\
-} while (0)
-#define FAIL_IF_HAS_MINUS CHECK_CONDITION(has_minus,"minus ('-') modifier not allowed for argument %s")
-#define TRUE_IF_NOT_MINUS ((!has_minus)?TRUE:FALSE)
-
-#define DEFAULT_ARGUMENTS "s"
-static void
-setup_user_options (const char *arguments) {
- gchar **arguments_array, **current_argument;
- detect_fast_timer ();
-
- profiler->file_name = NULL;
- profiler->file_name_suffix = NULL;
- profiler->per_thread_buffer_size = 10000;
- profiler->statistical_buffer_size = 10000;
- profiler->statistical_call_chain_depth = 0;
- profiler->statistical_call_chain_strategy = MONO_PROFILER_CALL_CHAIN_NATIVE;
- profiler->write_buffer_size = 1024;
- profiler->dump_next_heap_snapshots = 0;
- profiler->heap_shot_was_requested = FALSE;
- profiler->flags = MONO_PROFILE_APPDOMAIN_EVENTS|
- MONO_PROFILE_ASSEMBLY_EVENTS|
- MONO_PROFILE_MODULE_EVENTS|
- MONO_PROFILE_CLASS_EVENTS|
- MONO_PROFILE_METHOD_EVENTS|
- MONO_PROFILE_JIT_COMPILATION;
- profiler->profiler_enabled = TRUE;
-
- if (arguments == NULL) {
- arguments = DEFAULT_ARGUMENTS;
- } else if (strstr (arguments, ":")) {
- arguments = strstr (arguments, ":") + 1;
- if (arguments [0] == 0) {
- arguments = DEFAULT_ARGUMENTS;
- }
- }
-
- arguments_array = g_strsplit (arguments, ",", -1);
-
- for (current_argument = arguments_array; ((current_argument != NULL) && (current_argument [0] != 0)); current_argument ++) {
- char *argument = *current_argument;
- char *equals = strstr (argument, "=");
- const char *failure_message = NULL;
- gboolean has_plus;
- gboolean has_minus;
-
- if (*argument == '+') {
- has_plus = TRUE;
- has_minus = FALSE;
- argument ++;
- } else if (*argument == '-') {
- has_plus = FALSE;
- has_minus = TRUE;
- argument ++;
- } else {
- has_plus = FALSE;
- has_minus = FALSE;
- }
-
- if (equals != NULL) {
- int equals_position = equals - argument;
-
- if (! (strncmp (argument, "per-thread-buffer-size", equals_position) && strncmp (argument, "tbs", equals_position))) {
- int value = atoi (equals + 1);
- FAIL_IF_HAS_MINUS;
- if (value > 0) {
- profiler->per_thread_buffer_size = value;
- }
- } else if (! (strncmp (argument, "statistical", equals_position) && strncmp (argument, "stat", equals_position) && strncmp (argument, "s", equals_position))) {
- int value = atoi (equals + 1);
- FAIL_IF_HAS_MINUS;
- if (value > 0) {
- if (value > MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH) {
- value = MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH;
- }
- profiler->statistical_call_chain_depth = value;
- profiler->flags |= MONO_PROFILE_STATISTICAL;
- }
- } else if (! (strncmp (argument, "call-chain-strategy", equals_position) && strncmp (argument, "ccs", equals_position))) {
- char *parameter = equals + 1;
- FAIL_IF_HAS_MINUS;
- if (! strcmp (parameter, "native")) {
- profiler->statistical_call_chain_strategy = MONO_PROFILER_CALL_CHAIN_NATIVE;
- } else if (! strcmp (parameter, "glibc")) {
- profiler->statistical_call_chain_strategy = MONO_PROFILER_CALL_CHAIN_GLIBC;
- } else if (! strcmp (parameter, "managed")) {
- profiler->statistical_call_chain_strategy = MONO_PROFILER_CALL_CHAIN_MANAGED;
- } else {
- failure_message = "invalid call chain strategy in argument %s";
- goto failure_handling;
- }
- } else if (! (strncmp (argument, "statistical-thread-buffer-size", equals_position) && strncmp (argument, "sbs", equals_position))) {
- int value = atoi (equals + 1);
- FAIL_IF_HAS_MINUS;
- if (value > 0) {
- profiler->statistical_buffer_size = value;
- }
- } else if (! (strncmp (argument, "write-buffer-size", equals_position) && strncmp (argument, "wbs", equals_position))) {
- int value = atoi (equals + 1);
- FAIL_IF_HAS_MINUS;
- if (value > 0) {
- profiler->write_buffer_size = value;
- }
- } else if (! (strncmp (argument, "output", equals_position) && strncmp (argument, "out", equals_position) && strncmp (argument, "o", equals_position) && strncmp (argument, "O", equals_position))) {
- FAIL_IF_HAS_MINUS;
- if (strlen (equals + 1) > 0) {
- profiler->file_name = g_strdup (equals + 1);
- }
- } else if (! (strncmp (argument, "output-suffix", equals_position) && strncmp (argument, "suffix", equals_position) && strncmp (argument, "os", equals_position) && strncmp (argument, "OS", equals_position))) {
- FAIL_IF_HAS_MINUS;
- if (strlen (equals + 1) > 0) {
- profiler->file_name_suffix = g_strdup (equals + 1);
- }
- } else if (! (strncmp (argument, "heap-shot", equals_position) && strncmp (argument, "heap", equals_position) && strncmp (argument, "h", equals_position))) {
- char *parameter = equals + 1;
- if (! strcmp (parameter, "all")) {
- profiler->dump_next_heap_snapshots = -1;
- } else {
- profiler->dump_next_heap_snapshots = atoi (parameter);
- }
- FAIL_IF_HAS_MINUS;
- if (! has_plus) {
- profiler->action_flags.save_allocation_caller = TRUE;
- profiler->action_flags.save_allocation_stack = TRUE;
- profiler->action_flags.allocations_carry_id = TRUE_IF_NOT_MINUS;
- }
- profiler->action_flags.heap_shot = TRUE_IF_NOT_MINUS;
- } else if (! (strncmp (argument, "gc-dumps", equals_position) && strncmp (argument, "gc-d", equals_position) && strncmp (argument, "gcd", equals_position))) {
- FAIL_IF_HAS_MINUS;
- if (strlen (equals + 1) > 0) {
- profiler->dump_next_heap_snapshots = atoi (equals + 1);
- }
- } else if (! (strncmp (argument, "command-port", equals_position) && strncmp (argument, "cp", equals_position))) {
- FAIL_IF_HAS_MINUS;
- if (strlen (equals + 1) > 0) {
- profiler->command_port = atoi (equals + 1);
- }
- } else {
- FAIL_PARSING_VALUED_ARGUMENT;
- }
- } else {
- if (! (strcmp (argument, "jit") && strcmp (argument, "j"))) {
- profiler->action_flags.jit_time = TRUE_IF_NOT_MINUS;
- } else if (! (strcmp (argument, "allocations") && strcmp (argument, "alloc") && strcmp (argument, "a"))) {
- FAIL_IF_HAS_MINUS;
- if (! has_plus) {
- profiler->action_flags.save_allocation_caller = TRUE;
- profiler->action_flags.save_allocation_stack = TRUE;
- }
- if (! has_minus) {
- profiler->flags |= MONO_PROFILE_ALLOCATIONS;
- } else {
- profiler->flags &= ~MONO_PROFILE_ALLOCATIONS;
- }
- } else if (! (strcmp (argument, "monitor") && strcmp (argument, "locks") && strcmp (argument, "lock"))) {
- FAIL_IF_HAS_MINUS;
- profiler->action_flags.track_stack = TRUE;
- profiler->flags |= MONO_PROFILE_MONITOR_EVENTS;
- profiler->flags |= MONO_PROFILE_GC;
- } else if (! (strcmp (argument, "gc") && strcmp (argument, "g"))) {
- FAIL_IF_HAS_MINUS;
- profiler->action_flags.report_gc_events = TRUE;
- profiler->flags |= MONO_PROFILE_GC;
- } else if (! (strcmp (argument, "allocations-summary") && strcmp (argument, "as"))) {
- profiler->action_flags.collection_summary = TRUE_IF_NOT_MINUS;
- } else if (! (strcmp (argument, "heap-shot") && strcmp (argument, "heap") && strcmp (argument, "h"))) {
- FAIL_IF_HAS_MINUS;
- if (! has_plus) {
- profiler->action_flags.save_allocation_caller = TRUE;
- profiler->action_flags.save_allocation_stack = TRUE;
- profiler->action_flags.allocations_carry_id = TRUE_IF_NOT_MINUS;
- }
- profiler->action_flags.heap_shot = TRUE_IF_NOT_MINUS;
- } else if (! (strcmp (argument, "unreachable") && strcmp (argument, "free") && strcmp (argument, "f"))) {
- profiler->action_flags.unreachable_objects = TRUE_IF_NOT_MINUS;
- } else if (! (strcmp (argument, "threads") && strcmp (argument, "t"))) {
- if (! has_minus) {
- profiler->flags |= MONO_PROFILE_THREADS;
- } else {
- profiler->flags &= ~MONO_PROFILE_THREADS;
- }
- } else if (! (strcmp (argument, "enter-leave") && strcmp (argument, "calls") && strcmp (argument, "c"))) {
- profiler->action_flags.track_calls = TRUE_IF_NOT_MINUS;
- } else if (! (strcmp (argument, "statistical") && strcmp (argument, "stat") && strcmp (argument, "s"))) {
- if (! has_minus) {
- profiler->flags |= MONO_PROFILE_STATISTICAL;
- } else {
- profiler->flags &= ~MONO_PROFILE_STATISTICAL;
- }
- } else if (! (strcmp (argument, "save-allocation-caller") && strcmp (argument, "sac"))) {
- profiler->action_flags.save_allocation_caller = TRUE_IF_NOT_MINUS;
- } else if (! (strcmp (argument, "save-allocation-stack") && strcmp (argument, "sas"))) {
- profiler->action_flags.save_allocation_stack = TRUE_IF_NOT_MINUS;
- } else if (! (strcmp (argument, "allocations-carry-id") && strcmp (argument, "aci"))) {
- profiler->action_flags.allocations_carry_id = TRUE_IF_NOT_MINUS;
- } else if (! (strcmp (argument, "start-enabled") && strcmp (argument, "se"))) {
- profiler->profiler_enabled = TRUE_IF_NOT_MINUS;
- } else if (! (strcmp (argument, "start-disabled") && strcmp (argument, "sd"))) {
- profiler->profiler_enabled = ! TRUE_IF_NOT_MINUS;
- } else if (! (strcmp (argument, "force-accurate-timer") && strcmp (argument, "fac"))) {
- use_fast_timer = TRUE_IF_NOT_MINUS;
-#if (HAS_OPROFILE)
- } else if (! (strcmp (argument, "oprofile") && strcmp (argument, "oprof"))) {
- profiler->flags |= MONO_PROFILE_JIT_COMPILATION;
- profiler->action_flags.oprofile = TRUE;
- if (op_open_agent ()) {
- FAIL_ARGUMENT_CHECK ("problem calling op_open_agent");
- }
-#endif
- } else if (strcmp (argument, "logging")) {
- FAIL_PARSING_FLAG_ARGUMENT;
- }
- }
-
-failure_handling:
- if (failure_message != NULL) {
- g_warning (failure_message, argument);
- failure_message = NULL;
- }
- }
-
- g_free (arguments_array);
-
- /* Ensure that the profiler flags needed to support required action flags are active */
- if (profiler->action_flags.jit_time) {
- profiler->flags |= MONO_PROFILE_JIT_COMPILATION;
- }
- if (profiler->action_flags.save_allocation_caller || profiler->action_flags.save_allocation_stack || profiler->action_flags.allocations_carry_id) {
- profiler->flags |= MONO_PROFILE_ALLOCATIONS;
- }
- if (profiler->action_flags.collection_summary || profiler->action_flags.heap_shot || profiler->action_flags.unreachable_objects) {
- profiler->flags |= MONO_PROFILE_ALLOCATIONS;
- profiler->action_flags.report_gc_events = TRUE;
- }
- if (profiler->action_flags.track_calls) {
- profiler->flags |= MONO_PROFILE_ENTER_LEAVE;
- profiler->action_flags.jit_time = TRUE;
- }
- if (profiler->action_flags.save_allocation_caller || profiler->action_flags.save_allocation_stack) {
- profiler->action_flags.track_stack = TRUE;
- profiler->flags |= MONO_PROFILE_ENTER_LEAVE;
- }
- if (profiler->action_flags.track_stack) {
- profiler->flags |= MONO_PROFILE_ENTER_LEAVE;
- }
-
- /* Tracking call stacks is useless if we already emit all enter-exit events... */
- if (profiler->action_flags.track_calls) {
- profiler->action_flags.track_stack = FALSE;
- profiler->action_flags.save_allocation_caller = FALSE;
- profiler->action_flags.save_allocation_stack = FALSE;
- }
-
- /* Without JIT events the stat profiler will not find method IDs... */
- if (profiler->flags | MONO_PROFILE_STATISTICAL) {
- profiler->flags |= MONO_PROFILE_JIT_COMPILATION;
- }
- /* Profiling allocations without knowing which gc we are doing is not nice... */
- if (profiler->flags | MONO_PROFILE_ALLOCATIONS) {
- profiler->flags |= MONO_PROFILE_GC;
- profiler->action_flags.report_gc_events = TRUE;
- }
-
-
- if (profiler->file_name == NULL) {
- char *program_name = g_get_prgname ();
-
- if (program_name != NULL) {
- char *name_buffer = g_strdup (program_name);
- char *name_start = name_buffer;
- char *cursor;
-
- /* Jump over the last '/' */
- cursor = strrchr (name_buffer, '/');
- if (cursor == NULL) {
- cursor = name_buffer;
- } else {
- cursor ++;
- }
- name_start = cursor;
-
- /* Then jump over the last '\\' */
- cursor = strrchr (name_start, '\\');
- if (cursor == NULL) {
- cursor = name_start;
- } else {
- cursor ++;
- }
- name_start = cursor;
-
- /* Finally, find the last '.' */
- cursor = strrchr (name_start, '.');
- if (cursor != NULL) {
- *cursor = 0;
- }
-
- if (profiler->file_name_suffix == NULL) {
- profiler->file_name = g_strdup_printf ("%s.mprof", name_start);
- } else {
- profiler->file_name = g_strdup_printf ("%s-%s.mprof", name_start, profiler->file_name_suffix);
- }
- g_free (name_buffer);
- } else {
- profiler->file_name = g_strdup_printf ("%s.mprof", "profiler-log");
- }
- }
-}
-
-static guint32
-data_writer_thread (gpointer nothing) {
- for (;;) {
- ProfilerStatisticalData *statistical_data;
- gboolean done;
-
- LOG_WRITER_THREAD ("data_writer_thread: going to sleep");
- WRITER_EVENT_WAIT ();
- LOG_WRITER_THREAD ("data_writer_thread: just woke up");
-
- if (profiler->heap_shot_was_requested) {
- MonoDomain * root_domain = mono_get_root_domain ();
-
- if (root_domain != NULL) {
- MonoThread *this_thread;
- LOG_WRITER_THREAD ("data_writer_thread: attaching thread");
- this_thread = mono_thread_attach (root_domain);
- LOG_WRITER_THREAD ("data_writer_thread: starting requested collection");
- mono_gc_collect (mono_gc_max_generation ());
- LOG_WRITER_THREAD ("data_writer_thread: requested collection done");
- LOG_WRITER_THREAD ("data_writer_thread: detaching thread");
- mono_thread_detach (this_thread);
- this_thread = NULL;
- LOG_WRITER_THREAD ("data_writer_thread: collection sequence completed");
- } else {
- LOG_WRITER_THREAD ("data_writer_thread: cannot get root domain, collection sequence skipped");
- }
-
- }
-
- statistical_data = profiler->statistical_data_ready;
- done = (statistical_data == NULL) && (profiler->heap_shot_write_jobs == NULL);
-
- if (!done) {
- LOG_WRITER_THREAD ("data_writer_thread: acquiring lock and writing data");
- LOCK_PROFILER ();
-
- // This makes sure that all method ids are in place
- LOG_WRITER_THREAD ("data_writer_thread: writing mapping...");
- flush_all_mappings ();
- LOG_WRITER_THREAD ("data_writer_thread: wrote mapping");
-
- if (statistical_data != NULL) {
- LOG_WRITER_THREAD ("data_writer_thread: writing statistical data...");
- profiler->statistical_data_ready = NULL;
- write_statistical_data_block (statistical_data);
- statistical_data->next_free_index = 0;
- statistical_data->first_unwritten_index = 0;
- profiler->statistical_data_second_buffer = statistical_data;
- LOG_WRITER_THREAD ("data_writer_thread: wrote statistical data");
- }
-
- profiler_process_heap_shot_write_jobs ();
-
- UNLOCK_PROFILER ();
- LOG_WRITER_THREAD ("data_writer_thread: wrote data and released lock");
- } else {
- LOG_WRITER_THREAD ("data_writer_thread: acquiring lock and flushing buffers");
- LOCK_PROFILER ();
- LOG_WRITER_THREAD ("data_writer_thread: lock acquired, flushing buffers");
- flush_everything ();
- UNLOCK_PROFILER ();
- LOG_WRITER_THREAD ("data_writer_thread: flushed buffers and released lock");
- }
-
- if (profiler->terminate_writer_thread) {
- LOG_WRITER_THREAD ("data_writer_thread: exiting thread");
- CLEANUP_WRITER_THREAD ();
- EXIT_THREAD ();
- }
- }
- return 0;
-}
-
-void
-mono_profiler_startup (const char *desc);
-
-/* the entry point (mono_profiler_load?) */
-void
-mono_profiler_startup (const char *desc)
-{
- profiler = g_new0 (MonoProfiler, 1);
-
- setup_user_options ((desc != NULL) ? desc : DEFAULT_ARGUMENTS);
-
- INITIALIZE_PROFILER_MUTEX ();
- MONO_PROFILER_GET_CURRENT_TIME (profiler->start_time);
- MONO_PROFILER_GET_CURRENT_COUNTER (profiler->start_counter);
- profiler->last_header_counter = 0;
-
- profiler->methods = method_id_mapping_new ();
- profiler->classes = class_id_mapping_new ();
- profiler->loaded_element_next_free_id = 1;
- profiler->loaded_assemblies = g_hash_table_new_full (g_direct_hash, NULL, NULL, loaded_element_destroy);
- profiler->loaded_modules = g_hash_table_new_full (g_direct_hash, NULL, NULL, loaded_element_destroy);
- profiler->loaded_appdomains = g_hash_table_new_full (g_direct_hash, NULL, NULL, loaded_element_destroy);
-
- profiler->statistical_data = profiler_statistical_data_new (profiler);
- profiler->statistical_data_second_buffer = profiler_statistical_data_new (profiler);
-
- profiler->write_buffers = g_malloc (sizeof (ProfilerFileWriteBuffer) + PROFILER_FILE_WRITE_BUFFER_SIZE);
- profiler->write_buffers->next = NULL;
- profiler->current_write_buffer = profiler->write_buffers;
- profiler->current_write_position = 0;
- profiler->full_write_buffers = 0;
- profiler_code_chunks_initialize (& (profiler->code_chunks));
-
- profiler->executable_regions = profiler_executable_memory_regions_new (1, 1);
-
- profiler->executable_files.table = g_hash_table_new (g_str_hash, g_str_equal);
- profiler->executable_files.new_files = NULL;
-
- profiler->heap_shot_write_jobs = NULL;
- if (profiler->action_flags.unreachable_objects || profiler->action_flags.heap_shot || profiler->action_flags.collection_summary) {
- profiler_heap_buffers_setup (&(profiler->heap));
- } else {
- profiler_heap_buffers_clear (&(profiler->heap));
- }
- profiler->garbage_collection_counter = 0;
-
- WRITER_EVENT_INIT ();
- LOG_WRITER_THREAD ("mono_profiler_startup: creating writer thread");
- CREATE_WRITER_THREAD (data_writer_thread);
- LOG_WRITER_THREAD ("mono_profiler_startup: created writer thread");
- if ((profiler->command_port >= 1024) && (profiler->command_port <= 65535)) {
- LOG_USER_THREAD ("mono_profiler_startup: creating user thread");
- CREATE_USER_THREAD (user_thread);
- LOG_USER_THREAD ("mono_profiler_startup: created user thread");
- } else {
- LOG_USER_THREAD ("mono_profiler_startup: skipping user thread creation");
- }
-
- ALLOCATE_PROFILER_THREAD_DATA ();
-
- OPEN_FILE ();
-
- write_intro_block ();
- write_directives_block (TRUE);
-
- mono_profiler_install (profiler, profiler_shutdown);
-
- mono_profiler_install_appdomain (appdomain_start_load, appdomain_end_load,
- appdomain_start_unload, appdomain_end_unload);
- mono_profiler_install_assembly (assembly_start_load, assembly_end_load,
- assembly_start_unload, assembly_end_unload);
- mono_profiler_install_module (module_start_load, module_end_load,
- module_start_unload, module_end_unload);
- mono_profiler_install_class (class_start_load, class_end_load,
- class_start_unload, class_end_unload);
- mono_profiler_install_jit_compile (method_start_jit, method_end_jit);
- mono_profiler_install_enter_leave (method_enter, method_leave);
- mono_profiler_install_method_free (method_free);
- mono_profiler_install_thread (thread_start, thread_end);
- mono_profiler_install_allocation (object_allocated);
- mono_profiler_install_monitor (monitor_event);
- mono_profiler_install_statistical (statistical_hit);
- mono_profiler_install_statistical_call_chain (statistical_call_chain, profiler->statistical_call_chain_depth, profiler->statistical_call_chain_strategy);
- mono_profiler_install_gc (gc_event, gc_resize);
- mono_profiler_install_runtime_initialized (runtime_initialized);
-#if (HAS_OPROFILE)
- mono_profiler_install_jit_end (method_jit_result);
-#endif
- if (profiler->flags | MONO_PROFILE_STATISTICAL) {
- mono_profiler_install_code_chunk_new (profiler_code_chunk_new_callback);
- mono_profiler_install_code_chunk_destroy (profiler_code_chunk_destroy_callback);
- mono_profiler_install_code_buffer_new (profiler_code_buffer_new_callback);
- }
-
- mono_profiler_set_events (profiler->flags);
-}
-
return "code_buffer_monitor";
case MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE:
return "code_buffer_delegate_invoke";
+ case MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING:
+ return "code_buffer_exception_handling";
default:
return "unspecified";
}
MonoJitInfo *ji;
};
+#ifdef TLS_INIT
+#undef TLS_INIT
+#endif
+
#ifdef HOST_WIN32
#define TLS_SET(x,y) (TlsSetValue (x, y))
#define TLS_GET(t,x) ((t *) TlsGetValue (x))
#define LOG_HEADER_ID 0x4D505A01
#define LOG_VERSION_MAJOR 0
#define LOG_VERSION_MINOR 4
-#define LOG_DATA_VERSION 8
+#define LOG_DATA_VERSION 9
/*
* Changes in data versions:
* version 2: added offsets in heap walk
* version 5: added counters sampling
* version 6: added optional backtrace in sampling info
* version 8: added TYPE_RUNTIME and JIT helpers/trampolines
+ * version 9: added MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING
*/
enum {
generic-typedef.2.cs \
generic-marshalbyref.2.cs \
generic-xdomain.2.cs \
+ dynamic-generic-size.cs \
bug-431413.2.cs \
bug-459285.2.cs \
generic-virtual-invoke.2.cs \
TESTBS=$(BENCHSRC:.cs=.exe)
STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
-EXTRA_DIST=test-driver $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
+EXTRA_DIST=test-driver test-runner.cs $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
$(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
%.exe: %.il
--- /dev/null
+using System;
+using System.Threading;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Collections.Generic;
+
+namespace GenericSize
+{
+ class GenericSize
+ {
+ static int Iterations = 10000;
+ static AssemblyBuilder assembly;
+ static ModuleBuilder module;
+ static string ASSEMBLY_NAME = "MonoTests.System.Reflection.Emit.TypeBuilderTest";
+
+ static void SetUp ()
+ {
+ AssemblyName assemblyName = new AssemblyName ();
+ assemblyName.Name = ASSEMBLY_NAME;
+
+ assembly =
+ Thread.GetDomain ().DefineDynamicAssembly (assemblyName, AssemblyBuilderAccess.Run);
+
+ module = assembly.DefineDynamicModule ("module1");
+ }
+
+ static int Main()
+ {
+ SetUp ();
+
+ TypeBuilder tb = module.DefineType ("Test", TypeAttributes.Public);
+ tb.DefineGenericParameters ("T");
+ var tb_ctor = tb.DefineDefaultConstructor (MethodAttributes.Public);
+
+ var tb2 = module.DefineType ("Test2", TypeAttributes.Public);
+ var g0 = tb2.DefineGenericParameters ("T");
+
+ var mb = tb2.DefineMethod ("Foo", MethodAttributes.Public | MethodAttributes.Static, typeof (object), new Type [0]);
+
+ var il = mb.GetILGenerator();
+ il.Emit(OpCodes.Newobj, TypeBuilder.GetConstructor (tb.MakeGenericType (g0), tb_ctor));
+ il.Emit(OpCodes.Ret);
+
+ var t1 = tb.CreateType ();
+ var t2 = tb2.CreateType ();
+
+ var ginst = t2.MakeGenericType (typeof (string));
+ var method = ginst.GetMethod ("Foo", BindingFlags.Public | BindingFlags.Static);
+
+ var lst = new List<Object>();
+
+ for (int i = 0; i < GenericSize.Iterations; i++) {
+ lst.Add (method.Invoke (null, null));
+ if (i % 15 == 0)
+ GC.Collect();
+ }
+
+ return 0;
+ }
+ }
+}
return 3;
if (System.Object.ReferenceEquals(c, String.Concat(b, "a")))
return 4;
+ if (!Object.ReferenceEquals (String.Empty, ""))
+ return 5;
return 0;
}
}
mono-threads-openbsd.c \
mono-threads-android.c \
mono-threads.h \
+ mono-threads-coop.c \
+ mono-threads-coop.h \
mono-tls.h \
mono-tls.c \
linux_magic.h \
struct _MonoCodeManager {
int dynamic;
int read_only;
+ int bind_size;
CodeChunk *current;
CodeChunk *full;
CodeChunk *last;
* Creates a new code manager suitable for holding native code that can be
* used for single or small methods that need to be deallocated independently
* of other native code.
+ * BIND_SIZE is the amount of memory reserved for storing thunks. If its 0,
+ * the default size is used.
*
* Returns: the new code manager
*/
MonoCodeManager*
-mono_code_manager_new_dynamic (void)
+mono_code_manager_new_dynamic (int bind_size)
{
MonoCodeManager *cman = mono_code_manager_new ();
cman->dynamic = 1;
+ cman->bind_size = bind_size;
return cman;
}
#define BIND_ROOM 8
#endif
#if defined(TARGET_ARM64)
-#define BIND_ROOM 8
+#define BIND_ROOM 4
#endif
static CodeChunk*
-new_codechunk (CodeChunk *last, int dynamic, int size)
+new_codechunk (CodeChunk *last, int dynamic, int size, int bind_size)
{
int minsize, flags = CODE_FLAG_MMAP;
int chunk_size, bsize = 0;
}
}
#ifdef BIND_ROOM
- bsize = chunk_size / BIND_ROOM;
+ if (bind_size) {
+ bsize = bind_size;
+ } else {
+ if (dynamic)
+ /* Reserve more space since there are no other chunks we might use if this one gets full */
+ bsize = (chunk_size * 2) / BIND_ROOM;
+ else
+ bsize = chunk_size / BIND_ROOM;
+ }
if (bsize < MIN_BSIZE)
bsize = MIN_BSIZE;
bsize += MIN_ALIGN -1;
bsize &= ~ (MIN_ALIGN - 1);
if (chunk_size - size < bsize) {
chunk_size = size + bsize;
- chunk_size += pagesize - 1;
- chunk_size &= ~ (pagesize - 1);
+ if (!dynamic) {
+ chunk_size += pagesize - 1;
+ chunk_size &= ~ (pagesize - 1);
+ }
}
#endif
}
if (!cman->current) {
- cman->current = new_codechunk (cman->last, cman->dynamic, size);
+ cman->current = new_codechunk (cman->last, cman->dynamic, size, cman->bind_size);
if (!cman->current)
return NULL;
cman->last = cman->current;
cman->full = chunk;
break;
}
- chunk = new_codechunk (cman->last, cman->dynamic, size);
+ chunk = new_codechunk (cman->last, cman->dynamic, size, cman->bind_size);
if (!chunk)
return NULL;
chunk->next = cman->current;
typedef struct _MonoCodeManager MonoCodeManager;
MONO_API MonoCodeManager* mono_code_manager_new (void);
-MONO_API MonoCodeManager* mono_code_manager_new_dynamic (void);
+MONO_API MonoCodeManager* mono_code_manager_new_dynamic (int bind_size);
MONO_API void mono_code_manager_destroy (MonoCodeManager *cman);
MONO_API void mono_code_manager_invalidate (MonoCodeManager *cman);
MONO_API void mono_code_manager_set_read_only (MonoCodeManager *cman);
#include "mono-error-internals.h"
#include <mono/metadata/exception.h>
-#include <mono/metadata/object-internals.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/debug-helpers.h>
mono_error_cleanup (target_error);
return ex;
}
-
-
-/*
-Raises the exception of @error.
-Does nothing if @error has a success error code.
-Aborts in case of a double fault. This happens when it can't recover from an error caused by trying
-to construct the first exception object.
-The error object @error is cleaned up.
-*/
-void
-mono_error_raise_exception (MonoError *target_error)
-{
- MonoException *ex = mono_error_convert_to_exception (target_error);
- if (ex)
- mono_raise_exception (ex);
-}
g_free (wname);
return result;
#else
- return (MonoFileMap *)fopen (name, "rb");
+ int fd = open (name, O_RDONLY);
+ if (fd < 0)
+ return NULL;
+ return (MonoFileMap *)(size_t)fd;
#endif
}
mono_file_map_size (MonoFileMap *fmap)
{
struct stat stat_buf;
- if (fstat (fileno ((FILE*)fmap), &stat_buf) < 0)
+ if (fstat (mono_file_map_fd (fmap), &stat_buf) < 0)
return 0;
return stat_buf.st_size;
}
int
mono_file_map_fd (MonoFileMap *fmap)
{
+#ifdef WIN32
return fileno ((FILE*)fmap);
+#else
+ return (int)(size_t)fmap;
+#endif
}
int
mono_file_map_close (MonoFileMap *fmap)
{
+#ifdef WIN32
return fclose ((FILE*)fmap);
+#else
+ close (mono_file_map_fd (fmap));
+#endif
}
#if !defined (HOST_WIN32)
return NULL;
}
-/**
- * mono_process_get_name:
- * @pid: pid of the process
- * @buf: byte buffer where to store the name of the prcoess
- * @len: size of the buffer @buf
- *
- * Return the name of the process identified by @pid, storing it
- * inside @buf for a maximum of len bytes (including the terminating 0).
- */
-char*
-mono_process_get_name (gpointer pid, char *buf, int len)
-{
#if USE_SYSCTL
- int res;
+
#ifdef KERN_PROC2
- int mib [6];
- size_t data_len = sizeof (struct kinfo_proc2);
- struct kinfo_proc2 processi;
+#define KINFO_PROC struct kinfo_proc2
#else
- int mib [4];
- size_t data_len = sizeof (struct kinfo_proc);
- struct kinfo_proc processi;
-#endif /* KERN_PROC2 */
+#define KINFO_PROC struct kinfo_proc
+#endif
- memset (buf, 0, len);
+static gboolean
+sysctl_kinfo_proc (gpointer pid, KINFO_PROC* processi)
+{
+ int res;
+ size_t data_len = sizeof (KINFO_PROC);
#ifdef KERN_PROC2
+ int mib [6];
mib [0] = CTL_KERN;
mib [1] = KERN_PROC2;
mib [2] = KERN_PROC_PID;
mib [3] = GPOINTER_TO_UINT (pid);
- mib [4] = sizeof(struct kinfo_proc2);
+ mib [4] = sizeof(KINFO_PROC);
mib [5] = 400; /* XXX */
- res = sysctl (mib, 6, &processi, &data_len, NULL, 0);
-
- if (res < 0 || data_len != sizeof (struct kinfo_proc2)) {
- return buf;
- }
+ res = sysctl (mib, 6, processi, &data_len, NULL, 0);
#else
+ int mib [4];
mib [0] = CTL_KERN;
mib [1] = KERN_PROC;
mib [2] = KERN_PROC_PID;
mib [3] = GPOINTER_TO_UINT (pid);
-
- res = sysctl (mib, 4, &processi, &data_len, NULL, 0);
- if (res < 0 || data_len != sizeof (struct kinfo_proc)) {
- return buf;
- }
+
+ res = sysctl (mib, 4, processi, &data_len, NULL, 0);
#endif /* KERN_PROC2 */
- strncpy (buf, processi.kinfo_name_member, len - 1);
+
+ if (res < 0 || data_len != sizeof (KINFO_PROC))
+ return FALSE;
+
+ return TRUE;
+}
+#endif /* USE_SYSCTL */
+
+/**
+ * mono_process_get_name:
+ * @pid: pid of the process
+ * @buf: byte buffer where to store the name of the prcoess
+ * @len: size of the buffer @buf
+ *
+ * Return the name of the process identified by @pid, storing it
+ * inside @buf for a maximum of len bytes (including the terminating 0).
+ */
+char*
+mono_process_get_name (gpointer pid, char *buf, int len)
+{
+#if USE_SYSCTL
+ KINFO_PROC processi;
+
+ memset (buf, 0, len);
+
+ if (sysctl_kinfo_proc (pid, &processi))
+ strncpy (buf, processi.kinfo_name_member, len - 1);
+
return buf;
#else
char fname [128];
#endif
}
+void
+mono_process_get_times (gpointer pid, gint64 *start_time, gint64 *user_time, gint64 *kernel_time)
+{
+ if (user_time)
+ *user_time = mono_process_get_data (pid, MONO_PROCESS_USER_TIME);
+
+ if (kernel_time)
+ *kernel_time = mono_process_get_data (pid, MONO_PROCESS_SYSTEM_TIME);
+
+ if (start_time) {
+ *start_time = 0;
+
+#if USE_SYSCTL
+ {
+ KINFO_PROC processi;
+
+ if (sysctl_kinfo_proc (pid, &processi))
+ *start_time = mono_100ns_datetime_from_timeval (processi.kp_proc.p_starttime);
+ }
+#endif
+
+ if (*start_time == 0) {
+ static guint64 boot_time = 0;
+ if (!boot_time)
+ boot_time = mono_100ns_datetime () - ((guint64)mono_msec_ticks ()) * 10000;
+
+ *start_time = boot_time + mono_process_get_data (pid, MONO_PROCESS_ELAPSED);
+ }
+ }
+}
+
/*
* /proc/pid/stat format:
* pid (cmdname) S
* [0] ppid pgid sid tty_nr tty_pgrp flags min_flt cmin_flt maj_flt cmaj_flt
- * [10] utime stime cutime cstime prio nice threads 0 start_time vsize rss
+ * [10] utime stime cutime cstime prio nice threads 0 start_time vsize
* [20] rss rsslim start_code end_code start_stack esp eip pending blocked sigign
* [30] sigcatch wchan 0 0 exit_signal cpu rt_prio policy
*/
case MONO_PROCESS_FAULTS:
return get_process_stat_item (rpid, 6, TRUE, error);
case MONO_PROCESS_ELAPSED:
- return get_process_stat_item (rpid, 18, FALSE, error) / get_user_hz ();
+ return get_process_stat_time (rpid, 18, FALSE, error);
case MONO_PROCESS_PPID:
return get_process_stat_time (rpid, 0, FALSE, error);
case MONO_PROCESS_PAGED_BYTES:
if (count > 0)
return count + 1;
#endif
-#ifdef _SC_NPROCESSORS_ONLN
- count = sysconf (_SC_NPROCESSORS_ONLN);
+#ifdef _SC_NPROCESSORS_CONF
+ count = sysconf (_SC_NPROCESSORS_CONF);
if (count > 0)
return count;
#endif
gpointer* mono_process_list (int *size);
+void mono_process_get_times (gpointer pid, gint64 *start_time, gint64 *user_time, gint64 *kernel_time);
+
char* mono_process_get_name (gpointer pid, char *buf, int len);
gint64 mono_process_get_data (gpointer pid, MonoProcessData data);
--- /dev/null
+/*
+ * mono-threads.c: Coop threading
+ *
+ * Author:
+ * Rodrigo Kumpera (kumpera@gmail.com)
+ *
+ * Copyright 2015 Xamarin, Inc (http://www.xamarin.com)
+ */
+
+#include <mono/utils/mono-compiler.h>
+#include <mono/utils/mono-semaphore.h>
+#include <mono/utils/mono-threads.h>
+#include <mono/utils/mono-tls.h>
+#include <mono/utils/hazard-pointer.h>
+#include <mono/utils/mono-memory-model.h>
+#include <mono/utils/mono-mmap.h>
+#include <mono/utils/atomic.h>
+#include <mono/utils/mono-time.h>
+
+#ifdef USE_COOP_BACKEND
+
+
+void
+mono_threads_state_poll (void)
+{
+ MonoThreadInfo *info;
+
+ info = mono_thread_info_current_unchecked ();
+ if (!info)
+ return;
+ THREADS_SUSPEND_DEBUG ("FINISH SELF SUSPEND OF %p\n", mono_thread_info_get_tid (info));
+
+ /* Fast check for pending suspend requests */
+ if (!(info->thread_state & (STATE_ASYNC_SUSPEND_REQUESTED | STATE_SELF_SUSPEND_REQUESTED)))
+ return;
+
+ g_assert (mono_threads_get_runtime_callbacks ()->thread_state_init_from_sigctx (&info->thread_saved_state [SELF_SUSPEND_STATE_INDEX], NULL));
+
+ /* commit the saved state and notify others if needed */
+ switch (mono_threads_transition_state_poll (info)) {
+ case SelfSuspendResumed:
+ return;
+ case SelfSuspendWait:
+ mono_thread_info_wait_for_resume (info);
+ break;
+ case SelfSuspendNotifyAndWait:
+ mono_threads_notify_initiator_of_suspend (info);
+ mono_thread_info_wait_for_resume (info);
+ break;
+ }
+}
+
+void*
+mono_threads_prepare_blocking (void)
+{
+ MonoThreadInfo *info;
+
+ info = mono_thread_info_current_unchecked ();
+ /* If the thread is not attached, it doesn't make sense prepare for suspend. */
+ if (!info || !mono_thread_info_is_live (info)) {
+ THREADS_SUSPEND_DEBUG ("PREPARE-BLOCKING failed %p\n", mono_thread_info_get_tid (info));
+ return NULL;
+ }
+
+retry:
+ /*The JIT might not be able to save*/
+ if (!mono_threads_get_runtime_callbacks ()->thread_state_init_from_sigctx (&info->thread_saved_state [SELF_SUSPEND_STATE_INDEX], NULL)) {
+ THREADS_SUSPEND_DEBUG ("PREPARE-BLOCKING failed %p to save thread state\n", mono_thread_info_get_tid (info));
+ return NULL;
+ }
+
+ switch (mono_threads_transition_do_blocking (info)) {
+ case DoBlockingContinue:
+ break;
+ case DoBlockingPollAndRetry:
+ mono_threads_state_poll ();
+ goto retry;
+ }
+
+ return info;
+}
+
+void
+mono_threads_finish_blocking (void *cookie)
+{
+ static gboolean warned_about_bad_transition;
+ MonoThreadInfo *info = cookie;
+
+ if (!info)
+ return;
+
+ g_assert (info == mono_thread_info_current_unchecked ());
+
+ switch (mono_threads_transition_done_blocking (info)) {
+ case DoneBlockingAborted:
+ if (!warned_about_bad_transition) {
+ warned_about_bad_transition = TRUE;
+ g_warning ("[%p] Blocking call ended in running state for, this might lead to unbound GC pauses.", mono_thread_info_get_tid (info));
+ }
+ mono_threads_state_poll ();
+ break;
+ case DoneBlockingOk:
+ info->thread_saved_state [SELF_SUSPEND_STATE_INDEX].valid = FALSE;
+ break;
+ case DoneBlockingWait:
+ THREADS_SUSPEND_DEBUG ("state polling done, notifying of resume\n");
+ mono_thread_info_wait_for_resume (info);
+ break;
+ default:
+ g_error ("Unknown thread state");
+ }
+}
+
+
+void*
+mono_threads_reset_blocking_start (void)
+{
+ MonoThreadInfo *info = mono_thread_info_current_unchecked ();
+
+ /* If the thread is not attached, it doesn't make sense prepare for suspend. */
+ if (!info || !mono_thread_info_is_live (info))
+ return NULL;
+
+ switch (mono_threads_transition_abort_blocking (info)) {
+ case AbortBlockingIgnore:
+ info->thread_saved_state [SELF_SUSPEND_STATE_INDEX].valid = FALSE;
+ return NULL;
+ case AbortBlockingIgnoreAndPoll:
+ mono_threads_state_poll ();
+ return NULL;
+ case AbortBlockingOk:
+ info->thread_saved_state [SELF_SUSPEND_STATE_INDEX].valid = FALSE;
+ return info;
+ case AbortBlockingOkAndPool:
+ mono_threads_state_poll ();
+ return info;
+ default:
+ g_error ("Unknown thread state");
+ }
+}
+
+void
+mono_threads_reset_blocking_end (void *cookie)
+{
+ MonoThreadInfo *info = cookie;
+
+ if (!info)
+ return;
+
+ g_assert (info == mono_thread_info_current_unchecked ());
+ mono_threads_prepare_blocking ();
+}
+
+
+void
+mono_threads_core_abort_syscall (MonoThreadInfo *info)
+{
+ g_error ("FIXME");
+}
+
+gboolean
+mono_threads_core_begin_async_resume (MonoThreadInfo *info)
+{
+ g_error ("FIXME");
+ return FALSE;
+}
+
+gboolean
+mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
+{
+ mono_threads_add_to_pending_operation_set (info);
+ /* There's nothing else to do after we async request the thread to suspend */
+ return TRUE;
+}
+
+gboolean
+mono_threads_core_check_suspend_result (MonoThreadInfo *info)
+{
+ /* Async suspend can't async fail on coop */
+ return TRUE;
+}
+
+gboolean
+mono_threads_core_needs_abort_syscall (void)
+{
+ /*
+ Small digression.
+ Syscall abort can't be handled by the suspend machinery even though it's kind of implemented
+ in a similar way (with, like, signals).
+
+ So, having it here is wrong, it should be on mono-threads-(mach|posix|windows).
+ Ideally we would slice this in (coop|preemp) and target. Then have this file set:
+ mono-threads-mach, mono-threads-mach-preempt and mono-threads-mach-coop.
+ More files, less ifdef hell.
+ */
+ return FALSE;
+}
+
+void
+mono_threads_init_platform (void)
+{
+ //See the above for what's wrong here.
+}
+
+void
+mono_threads_platform_free (MonoThreadInfo *info)
+{
+ //See the above for what's wrong here.
+}
+
+void
+mono_threads_platform_register (MonoThreadInfo *info)
+{
+ //See the above for what's wrong here.
+}
+
+
+#endif
\ No newline at end of file
--- /dev/null
+/*
+ * mono-threads-coop.h: Cooperative suspend thread helpers
+ *
+ * Author:
+ * Rodrigo Kumpera (kumpera@gmail.com)
+ *
+ * (C) 2015 Xamarin
+ */
+
+#ifndef __MONO_THREADS_COOP_H__
+#define __MONO_THREADS_COOP_H__
+
+#include <config.h>
+
+#ifdef USE_COOP_GC
+
+/* Runtime consumable API */
+
+#define MONO_SUSPEND_CHECK() do { \
+ if (G_UNLIKELY (mono_threads_polling_required)) mono_threads_state_poll (); \
+} while (0);
+
+#define MONO_PREPARE_BLOCKING \
+{ \
+ void *__blocking_cookie = mono_threads_prepare_blocking ();
+
+#define MONO_FINISH_BLOCKING \
+ mono_threads_finish_blocking (__blocking_cookie); \
+}
+
+#define MONO_PREPARE_RESET_BLOCKING \
+{ \
+ void *__reset_cookie = mono_threads_reset_blocking_start ();
+
+#define MONO_FINISH_RESET_BLOCKING \
+ mono_threads_reset_blocking_end (__reset_cookie); \
+}
+/* Internal API */
+
+extern volatile size_t mono_threads_polling_required;
+
+void mono_threads_state_poll (void);
+void* mono_threads_prepare_blocking (void);
+void mono_threads_finish_blocking (void* cookie);
+
+void* mono_threads_reset_blocking_start (void);
+void mono_threads_reset_blocking_end (void* cookie);
+
+#else
+
+#define MONO_SUSPEND_CHECK do { } while (0);
+#define MONO_PREPARE_BLOCKING {
+#define MONO_FINISH_BLOCKING }
+#define MONO_PREPARE_RESET_BLOCKING {
+#define MONO_FINISH_RESET_BLOCKING }
+
+#endif /* USE_COOP_GC */
+
+
+#endif
start_info->handle = handle;
info = mono_thread_info_attach (&result);
+ MONO_PREPARE_BLOCKING
+
info->runtime_thread = TRUE;
info->handle = handle;
MONO_SEM_DESTROY (&info->create_suspended_sem);
}
+ MONO_FINISH_BLOCKING
/* Run the actual main function of the thread */
result = start_func (t_arg);
CloseHandle (handle);
}
-void
-mono_threads_core_interrupt (MonoThreadInfo *info)
-{
- mono_threads_core_abort_syscall (info);
-}
-
gboolean
mono_threads_core_needs_abort_syscall (void)
{
{
}
+#endif
+
+#if defined (HOST_WIN32)
+
typedef struct {
LPTHREAD_START_ROUTINE start_routine;
void *arg;
#define mono_thread_info_run_state(info) (((MonoThreadInfo*)info)->thread_state & THREAD_STATE_MASK)
/*warn at 50 ms*/
-#define SLEEP_DURATION_BEFORE_WARNING (50)
+#define SLEEP_DURATION_BEFORE_WARNING (10)
/*abort at 1 sec*/
-#define SLEEP_DURATION_BEFORE_ABORT 1000
+#define SLEEP_DURATION_BEFORE_ABORT 200
-static void
-wait_for_resume (MonoThreadInfo* info)
-{
- MONO_SEM_WAIT_UNITERRUPTIBLE (&info->resume_semaphore);
-}
+static int suspend_posts, resume_posts, waits_done, pending_ops;
void
mono_threads_notify_initiator_of_suspend (MonoThreadInfo* info)
{
- THREADS_SUSPEND_DEBUG ("[INITIATOR-NOTIFY-SUSPEND] %p\n", info);
+ THREADS_SUSPEND_DEBUG ("[INITIATOR-NOTIFY-SUSPEND] %p\n", mono_thread_info_get_tid (info));
MONO_SEM_POST (&suspend_semaphore);
+ InterlockedIncrement (&suspend_posts);
}
void
mono_threads_notify_initiator_of_resume (MonoThreadInfo* info)
{
- THREADS_SUSPEND_DEBUG ("[INITIATOR-NOTIFY-RESUME] %p\n", info);
+ THREADS_SUSPEND_DEBUG ("[INITIATOR-NOTIFY-RESUME] %p\n", mono_thread_info_get_tid (info));
MONO_SEM_POST (&suspend_semaphore);
+ InterlockedIncrement (&resume_posts);
+}
+
+static void
+resume_async_suspended (MonoThreadInfo *info)
+{
+ g_assert (mono_threads_core_begin_async_resume (info));
}
static void
resume_self_suspended (MonoThreadInfo* info)
{
- THREADS_SUSPEND_DEBUG ("begin self-resume %p\n", info);
+ THREADS_SUSPEND_DEBUG ("**BEGIN self-resume %p\n", mono_thread_info_get_tid (info));
MONO_SEM_POST (&info->resume_semaphore);
}
-static void
-resume_async_suspended (MonoThreadInfo *info)
+void
+mono_thread_info_wait_for_resume (MonoThreadInfo* info)
{
- g_assert (mono_threads_core_begin_async_resume (info));
+ THREADS_SUSPEND_DEBUG ("**WAIT self-resume %p\n", mono_thread_info_get_tid (info));
+ MONO_SEM_WAIT_UNITERRUPTIBLE (&info->resume_semaphore);
}
static void
void
mono_threads_add_to_pending_operation_set (MonoThreadInfo* info)
{
- THREADS_SUSPEND_DEBUG ("added %p to pending suspend\n", info);
+ THREADS_SUSPEND_DEBUG ("added %p to pending suspend\n", mono_thread_info_get_tid (info));
++pending_suspends;
+ InterlockedIncrement (&pending_ops);
}
void
mono_threads_begin_global_suspend (void)
{
g_assert (pending_suspends == 0);
- THREADS_SUSPEND_DEBUG ("------ BEGIN GLOBAL OP\n");
+ THREADS_SUSPEND_DEBUG ("------ BEGIN GLOBAL OP sp %d rp %d wd %d po %d\n", suspend_posts, resume_posts, waits_done, pending_ops);
}
void
mono_threads_end_global_suspend (void)
{
g_assert (pending_suspends == 0);
- THREADS_SUSPEND_DEBUG ("------ END GLOBAL OP\n");
+ THREADS_SUSPEND_DEBUG ("------ END GLOBAL OP sp %d rp %d wd %d po %d\n", suspend_posts, resume_posts, waits_done, pending_ops);
}
static void
dump_threads (void)
{
MonoThreadInfo *info;
+ MonoThreadInfo *cur = mono_thread_info_current ();
+
+ MOSTLY_ASYNC_SAFE_PRINTF ("STATE CUE CARD: (? means a positive number, usually 1 or 2)\n");
+ MOSTLY_ASYNC_SAFE_PRINTF ("\t0x0\t- starting (GOOD, unless the thread is running managed code)\n");
+ MOSTLY_ASYNC_SAFE_PRINTF ("\t0x1\t- running (BAD, unless it's the gc thread)\n");
+ MOSTLY_ASYNC_SAFE_PRINTF ("\t0x2\t- detached (GOOD, unless the thread is running managed code)\n");
+ MOSTLY_ASYNC_SAFE_PRINTF ("\t0x?03\t- async suspended (GOOD)\n");
+ MOSTLY_ASYNC_SAFE_PRINTF ("\t0x?04\t- self suspended (GOOD)\n");
+ MOSTLY_ASYNC_SAFE_PRINTF ("\t0x?05\t- async suspend requested (BAD)\n");
+ MOSTLY_ASYNC_SAFE_PRINTF ("\t0x?06\t- self suspend requested (BAD)\n");
+ MOSTLY_ASYNC_SAFE_PRINTF ("\t0x07\t- blocking (GOOD)\n");
+ MOSTLY_ASYNC_SAFE_PRINTF ("\t0x?08\t- blocking with pending suspend (GOOD)\n");
+
FOREACH_THREAD_SAFE (info) {
- THREADS_SUSPEND_DEBUG ("--thread %p id %p state %x\n", info, mono_thread_info_get_tid (info), info->thread_state);
+ MOSTLY_ASYNC_SAFE_PRINTF ("--thread %p id %p [%p] state %x %s\n", info, mono_thread_info_get_tid (info), (void*)(size_t)info->native_handle, info->thread_state, info == cur ? "GC INITIATOR" : "" );
} END_FOREACH_THREAD_SAFE
}
THREADS_SUSPEND_DEBUG ("[INITIATOR-WAIT-COUNT] %d\n", c);
for (i = 0; i < pending_suspends; ++i) {
THREADS_SUSPEND_DEBUG ("[INITIATOR-WAIT-WAITING]\n");
+ InterlockedIncrement (&waits_done);
if (!MONO_SEM_TIMEDWAIT (&suspend_semaphore, SLEEP_DURATION_BEFORE_ABORT))
continue;
mono_stopwatch_stop (&suspension_time);
dump_threads ();
- THREADS_SUSPEND_DEBUG ("WAITING for %d threads, got %d suspended\n", (int)pending_suspends, i);
- THREADS_SUSPEND_DEBUG ("cur thread is %p\n", pthread_self ());
+ MOSTLY_ASYNC_SAFE_PRINTF ("WAITING for %d threads, got %d suspended\n", (int)pending_suspends, i);
g_error ("suspend_thread suspend took %d ms, which is more than the allowed %d ms", (int)mono_stopwatch_elapsed_ms (&suspension_time), SLEEP_DURATION_BEFORE_ABORT);
}
mono_stopwatch_stop (&suspension_time);
case SelfSuspendResumed:
return;
case SelfSuspendWait:
- wait_for_resume (info);
+ mono_thread_info_wait_for_resume (info);
break;
case SelfSuspendNotifyAndWait:
mono_threads_notify_initiator_of_suspend (info);
- wait_for_resume (info);
+ mono_thread_info_wait_for_resume (info);
mono_threads_notify_initiator_of_resume (info);
break;
}
#include <mono/utils/mono-linked-list-set.h>
#include <mono/utils/mono-mutex.h>
#include <mono/utils/mono-tls.h>
+#include <mono/utils/mono-threads-coop.h>
#include <glib.h>
-
+#include <config.h>
#ifdef HOST_WIN32
#include <windows.h>
MonoThreadUnwindState* mono_thread_info_get_suspend_state (THREAD_INFO_TYPE *info);
+
+void mono_thread_info_wait_for_resume (THREAD_INFO_TYPE *info);
/* Advanced suspend API, used for suspending multiple threads as once. */
gboolean mono_thread_info_is_running (THREAD_INFO_TYPE *info);
gboolean mono_thread_info_is_live (THREAD_INFO_TYPE *info);
* Copyright (C) 2008 Novell, Inc.
*/
-#include <utils/mono-time.h>
+#include <config.h>
#include <stdlib.h>
#include <stdio.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <utils/mono-time.h>
+
+
#define MTICKS_PER_SEC 10000000
#ifdef HOST_WIN32
#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#if defined (HAVE_SYS_PARAM_H)
#include <sys/param.h>
{
struct timeval tv;
if (gettimeofday (&tv, NULL) == 0)
- return (((gint64)tv.tv_sec + EPOCH_ADJUST) * 1000000 + tv.tv_usec) * 10;
+ return mono_100ns_datetime_from_timeval (tv);
return 0;
}
+gint64
+mono_100ns_datetime_from_timeval (struct timeval tv)
+{
+ return (((gint64)tv.tv_sec + EPOCH_ADJUST) * 1000000 + tv.tv_usec) * 10;
+}
+
#endif
#include <mono/utils/mono-compiler.h>
#include <glib.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
/* Returns the number of milliseconds from boot time: this should be monotonic */
guint32 mono_msec_ticks (void);
/* Returns the number of 100ns ticks from unspecified time: this should be monotonic */
gint64 mono_100ns_ticks (void);
-/* Returns the number of 100ns ticks since 1/1/1, UTC timezone */
+/* Returns the number of 100ns ticks since 1/1/1601, UTC timezone */
gint64 mono_100ns_datetime (void);
+#ifndef HOST_WIN32
+gint64 mono_100ns_datetime_from_timeval (struct timeval tv);
+#endif
+
/* Stopwatch class for internal runtime use */
typedef struct {
gint64 start, stop;
+++ /dev/null
-Random collection of notes
-
- * What is the point of having the InlineVar argument to
- opcodes be a signed integer instead of unsigned?
-
-
-Storage
-
- The CIL metadata is a very compressed file format, even the
- sizes of blobs and strings are recorded in a compressed form.
- Still, all strings are encoded using 16-bit chars, instead of the
- more efficient UTF-8.
-
build_profiles =
if INSTALL_4_5
-build_profiles += net_4_0 net_4_5 xbuild_12 xbuild_14
+build_profiles += binary_reference_assemblies net_4_5 xbuild_12 xbuild_14
al_profile = net_4_5
endif
# Compile all assemblies with the verifier turned on. Code must be valid but not verifiable.
# TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode.
-# Skip net 4.0 assemblies because they contain metadata only
+# Skip binary_reference_assemblies because they contain metadata only
mcs-compileall: mono-wrapper etc/mono/config
save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \
for profile in $(test_profiles); do \
- if [ "net_4_0" = "$$profile" ]; then \
+ if [ "binary_reference_assemblies" = "$$profile" ]; then \
continue; \
fi; \
if [ "xbuild_12" = "$$profile" ]; then \
/*
* Bare bones profiler. Compile with:
- * gcc -shared -o mono-profiler-sample.so sample.c `pkg-config --cflags --libs mono`
- * Install the binary where the dynamic loader can find it.
+ *
+ * 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
* Then run mono with:
* mono --profile=sample your_application.exe
+ *
+ * Note if you name a profiler with more than 8 characters (eg sample6789) appears to not work
*/
struct _MonoProfiler {
# set LD_LIBRARY_PATH to ensure that libmono is found
export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
# and set MONO_PATH to ensure that mscorlib.dll can be found
-export MONO_PATH=$prefix/lib/mono/2.0
+export MONO_PATH=$prefix/lib/mono/4.5
for i in "${monolist[@]}"; do
($bindir/monodis --assembly $i | awk '
# set LD_LIBRARY_PATH to ensure that libmono is found
export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
# and set MONO_PATH to ensure that mscorlib.dll can be found
-export MONO_PATH=$prefix/lib/mono/2.0
+export MONO_PATH=$prefix/lib/mono/4.5
REQUIRES=$(
for i in "${monolist[@]}"; do
--- /dev/null
+/* @(#)e_hypot.c 1.3 95/01/18 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include <sys/cdefs.h>
+
+#include <float.h>
+#include <math.h>
+
+#include "complex.h"
+#include "math_private.h"
+
+/*-
+ * Copyright (c) 2004 Stefan Farfeleder
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+double
+creal(double complex z)
+{
+ return z;
+}
+
+double
+cimag(double complex z)
+{
+ const double_complex z1 = { .f = z };
+
+ return (IMAGPART(z1));
+}
+
+/*
+ * cabs() wrapper for hypot().
+ *
+ * Written by J.T. Conklin, <jtc@wimsey.com>
+ * Placed into the Public Domain, 1994.
+ */
+
+double
+cabs(double complex z)
+{
+ return hypot(creal(z), cimag(z));
+}
--- /dev/null
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * from: @(#)fdlibm.h 5.1 93/09/24
+ * $FreeBSD$
+ */
+
+#ifndef _MATH_PRIVATE_H_
+#define _MATH_PRIVATE_H_
+
+#include <sys/types.h>
+#include <machine/endian.h>
+
+/*
+ * The original fdlibm code used statements like:
+ * n0 = ((*(int*)&one)>>29)^1; * index of high word *
+ * ix0 = *(n0+(int*)&x); * high word of x *
+ * ix1 = *((1-n0)+(int*)&x); * low word of x *
+ * to dig two 32 bit words out of the 64 bit IEEE floating point
+ * value. That is non-ANSI, and, moreover, the gcc instruction
+ * scheduler gets it wrong. We instead use the following macros.
+ * Unlike the original code, we determine the endianness at compile
+ * time, not at run time; I don't see much benefit to selecting
+ * endianness at run time.
+ */
+
+/*
+ * A union which permits us to convert between a double and two 32 bit
+ * ints.
+ */
+
+#ifdef __arm__
+#if defined(__VFP_FP__) || defined(__ARM_EABI__)
+#define IEEE_WORD_ORDER BYTE_ORDER
+#else
+#define IEEE_WORD_ORDER BIG_ENDIAN
+#endif
+#else /* __arm__ */
+#define IEEE_WORD_ORDER BYTE_ORDER
+#endif
+
+#if IEEE_WORD_ORDER == BIG_ENDIAN
+
+typedef union
+{
+ double value;
+ struct
+ {
+ u_int32_t msw;
+ u_int32_t lsw;
+ } parts;
+ struct
+ {
+ u_int64_t w;
+ } xparts;
+} ieee_double_shape_type;
+
+#endif
+
+#if IEEE_WORD_ORDER == LITTLE_ENDIAN
+
+typedef union
+{
+ double value;
+ struct
+ {
+ u_int32_t lsw;
+ u_int32_t msw;
+ } parts;
+ struct
+ {
+ u_int64_t w;
+ } xparts;
+} ieee_double_shape_type;
+
+#endif
+
+/* Get two 32 bit ints from a double. */
+
+#define EXTRACT_WORDS(ix0,ix1,d) \
+do { \
+ ieee_double_shape_type ew_u; \
+ ew_u.value = (d); \
+ (ix0) = ew_u.parts.msw; \
+ (ix1) = ew_u.parts.lsw; \
+} while (0)
+
+/* Get a 64-bit int from a double. */
+#define EXTRACT_WORD64(ix,d) \
+do { \
+ ieee_double_shape_type ew_u; \
+ ew_u.value = (d); \
+ (ix) = ew_u.xparts.w; \
+} while (0)
+
+/* Get the more significant 32 bit int from a double. */
+
+#define GET_HIGH_WORD(i,d) \
+do { \
+ ieee_double_shape_type gh_u; \
+ gh_u.value = (d); \
+ (i) = gh_u.parts.msw; \
+} while (0)
+
+/* Get the less significant 32 bit int from a double. */
+
+#define GET_LOW_WORD(i,d) \
+do { \
+ ieee_double_shape_type gl_u; \
+ gl_u.value = (d); \
+ (i) = gl_u.parts.lsw; \
+} while (0)
+
+/* Set a double from two 32 bit ints. */
+
+#define INSERT_WORDS(d,ix0,ix1) \
+do { \
+ ieee_double_shape_type iw_u; \
+ iw_u.parts.msw = (ix0); \
+ iw_u.parts.lsw = (ix1); \
+ (d) = iw_u.value; \
+} while (0)
+
+/* Set a double from a 64-bit int. */
+#define INSERT_WORD64(d,ix) \
+do { \
+ ieee_double_shape_type iw_u; \
+ iw_u.xparts.w = (ix); \
+ (d) = iw_u.value; \
+} while (0)
+
+/* Set the more significant 32 bits of a double from an int. */
+
+#define SET_HIGH_WORD(d,v) \
+do { \
+ ieee_double_shape_type sh_u; \
+ sh_u.value = (d); \
+ sh_u.parts.msw = (v); \
+ (d) = sh_u.value; \
+} while (0)
+
+/* Set the less significant 32 bits of a double from an int. */
+
+#define SET_LOW_WORD(d,v) \
+do { \
+ ieee_double_shape_type sl_u; \
+ sl_u.value = (d); \
+ sl_u.parts.lsw = (v); \
+ (d) = sl_u.value; \
+} while (0)
+
+/*
+ * A union which permits us to convert between a float and a 32 bit
+ * int.
+ */
+
+typedef union
+{
+ float value;
+ /* FIXME: Assumes 32 bit int. */
+ unsigned int word;
+} ieee_float_shape_type;
+
+/* Get a 32 bit int from a float. */
+
+#define GET_FLOAT_WORD(i,d) \
+do { \
+ ieee_float_shape_type gf_u; \
+ gf_u.value = (d); \
+ (i) = gf_u.word; \
+} while (0)
+
+/* Set a float from a 32 bit int. */
+
+#define SET_FLOAT_WORD(d,i) \
+do { \
+ ieee_float_shape_type sf_u; \
+ sf_u.word = (i); \
+ (d) = sf_u.value; \
+} while (0)
+
+/*
+ * Get expsign and mantissa as 16 bit and 64 bit ints from an 80 bit long
+ * double.
+ */
+
+#define EXTRACT_LDBL80_WORDS(ix0,ix1,d) \
+do { \
+ union IEEEl2bits ew_u; \
+ ew_u.e = (d); \
+ (ix0) = ew_u.xbits.expsign; \
+ (ix1) = ew_u.xbits.man; \
+} while (0)
+
+/*
+ * Get expsign and mantissa as one 16 bit and two 64 bit ints from a 128 bit
+ * long double.
+ */
+
+#define EXTRACT_LDBL128_WORDS(ix0,ix1,ix2,d) \
+do { \
+ union IEEEl2bits ew_u; \
+ ew_u.e = (d); \
+ (ix0) = ew_u.xbits.expsign; \
+ (ix1) = ew_u.xbits.manh; \
+ (ix2) = ew_u.xbits.manl; \
+} while (0)
+
+/* Get expsign as a 16 bit int from a long double. */
+
+#define GET_LDBL_EXPSIGN(i,d) \
+do { \
+ union IEEEl2bits ge_u; \
+ ge_u.e = (d); \
+ (i) = ge_u.xbits.expsign; \
+} while (0)
+
+/*
+ * Set an 80 bit long double from a 16 bit int expsign and a 64 bit int
+ * mantissa.
+ */
+
+#define INSERT_LDBL80_WORDS(d,ix0,ix1) \
+do { \
+ union IEEEl2bits iw_u; \
+ iw_u.xbits.expsign = (ix0); \
+ iw_u.xbits.man = (ix1); \
+ (d) = iw_u.e; \
+} while (0)
+
+/*
+ * Set a 128 bit long double from a 16 bit int expsign and two 64 bit ints
+ * comprising the mantissa.
+ */
+
+#define INSERT_LDBL128_WORDS(d,ix0,ix1,ix2) \
+do { \
+ union IEEEl2bits iw_u; \
+ iw_u.xbits.expsign = (ix0); \
+ iw_u.xbits.manh = (ix1); \
+ iw_u.xbits.manl = (ix2); \
+ (d) = iw_u.e; \
+} while (0)
+
+/* Set expsign of a long double from a 16 bit int. */
+
+#define SET_LDBL_EXPSIGN(d,v) \
+do { \
+ union IEEEl2bits se_u; \
+ se_u.e = (d); \
+ se_u.xbits.expsign = (v); \
+ (d) = se_u.e; \
+} while (0)
+
+#ifdef __i386__
+/* Long double constants are broken on i386. */
+#define LD80C(m, ex, v) { \
+ .xbits.man = __CONCAT(m, ULL), \
+ .xbits.expsign = (0x3fff + (ex)) | ((v) < 0 ? 0x8000 : 0), \
+}
+#else
+/* The above works on non-i386 too, but we use this to check v. */
+#define LD80C(m, ex, v) { .e = (v), }
+#endif
+
+#ifdef FLT_EVAL_METHOD
+/*
+ * Attempt to get strict C99 semantics for assignment with non-C99 compilers.
+ */
+#if FLT_EVAL_METHOD == 0 || __GNUC__ == 0
+#define STRICT_ASSIGN(type, lval, rval) ((lval) = (rval))
+#else
+#define STRICT_ASSIGN(type, lval, rval) do { \
+ volatile type __lval; \
+ \
+ if (sizeof(type) >= sizeof(long double)) \
+ (lval) = (rval); \
+ else { \
+ __lval = (rval); \
+ (lval) = __lval; \
+ } \
+} while (0)
+#endif
+#endif /* FLT_EVAL_METHOD */
+
+/* Support switching the mode to FP_PE if necessary. */
+#if defined(__i386__) && !defined(NO_FPSETPREC)
+#define ENTERI() \
+ long double __retval; \
+ fp_prec_t __oprec; \
+ \
+ if ((__oprec = fpgetprec()) != FP_PE) \
+ fpsetprec(FP_PE)
+#define RETURNI(x) do { \
+ __retval = (x); \
+ if (__oprec != FP_PE) \
+ fpsetprec(__oprec); \
+ RETURNF(__retval); \
+} while (0)
+#else
+#define ENTERI(x)
+#define RETURNI(x) RETURNF(x)
+#endif
+
+/* Default return statement if hack*_t() is not used. */
+#define RETURNF(v) return (v)
+
+/*
+ * 2sum gives the same result as 2sumF without requiring |a| >= |b| or
+ * a == 0, but is slower.
+ */
+#define _2sum(a, b) do { \
+ __typeof(a) __s, __w; \
+ \
+ __w = (a) + (b); \
+ __s = __w - (a); \
+ (b) = ((a) - (__w - __s)) + ((b) - __s); \
+ (a) = __w; \
+} while (0)
+
+/*
+ * 2sumF algorithm.
+ *
+ * "Normalize" the terms in the infinite-precision expression a + b for
+ * the sum of 2 floating point values so that b is as small as possible
+ * relative to 'a'. (The resulting 'a' is the value of the expression in
+ * the same precision as 'a' and the resulting b is the rounding error.)
+ * |a| must be >= |b| or 0, b's type must be no larger than 'a's type, and
+ * exponent overflow or underflow must not occur. This uses a Theorem of
+ * Dekker (1971). See Knuth (1981) 4.2.2 Theorem C. The name "TwoSum"
+ * is apparently due to Skewchuk (1997).
+ *
+ * For this to always work, assignment of a + b to 'a' must not retain any
+ * extra precision in a + b. This is required by C standards but broken
+ * in many compilers. The brokenness cannot be worked around using
+ * STRICT_ASSIGN() like we do elsewhere, since the efficiency of this
+ * algorithm would be destroyed by non-null strict assignments. (The
+ * compilers are correct to be broken -- the efficiency of all floating
+ * point code calculations would be destroyed similarly if they forced the
+ * conversions.)
+ *
+ * Fortunately, a case that works well can usually be arranged by building
+ * any extra precision into the type of 'a' -- 'a' should have type float_t,
+ * double_t or long double. b's type should be no larger than 'a's type.
+ * Callers should use these types with scopes as large as possible, to
+ * reduce their own extra-precision and efficiciency problems. In
+ * particular, they shouldn't convert back and forth just to call here.
+ */
+#ifdef DEBUG
+#define _2sumF(a, b) do { \
+ __typeof(a) __w; \
+ volatile __typeof(a) __ia, __ib, __r, __vw; \
+ \
+ __ia = (a); \
+ __ib = (b); \
+ assert(__ia == 0 || fabsl(__ia) >= fabsl(__ib)); \
+ \
+ __w = (a) + (b); \
+ (b) = ((a) - __w) + (b); \
+ (a) = __w; \
+ \
+ /* The next 2 assertions are weak if (a) is already long double. */ \
+ assert((long double)__ia + __ib == (long double)(a) + (b)); \
+ __vw = __ia + __ib; \
+ __r = __ia - __vw; \
+ __r += __ib; \
+ assert(__vw == (a) && __r == (b)); \
+} while (0)
+#else /* !DEBUG */
+#define _2sumF(a, b) do { \
+ __typeof(a) __w; \
+ \
+ __w = (a) + (b); \
+ (b) = ((a) - __w) + (b); \
+ (a) = __w; \
+} while (0)
+#endif /* DEBUG */
+
+/*
+ * Set x += c, where x is represented in extra precision as a + b.
+ * x must be sufficiently normalized and sufficiently larger than c,
+ * and the result is then sufficiently normalized.
+ *
+ * The details of ordering are that |a| must be >= |c| (so that (a, c)
+ * can be normalized without extra work to swap 'a' with c). The details of
+ * the normalization are that b must be small relative to the normalized 'a'.
+ * Normalization of (a, c) makes the normalized c tiny relative to the
+ * normalized a, so b remains small relative to 'a' in the result. However,
+ * b need not ever be tiny relative to 'a'. For example, b might be about
+ * 2**20 times smaller than 'a' to give about 20 extra bits of precision.
+ * That is usually enough, and adding c (which by normalization is about
+ * 2**53 times smaller than a) cannot change b significantly. However,
+ * cancellation of 'a' with c in normalization of (a, c) may reduce 'a'
+ * significantly relative to b. The caller must ensure that significant
+ * cancellation doesn't occur, either by having c of the same sign as 'a',
+ * or by having |c| a few percent smaller than |a|. Pre-normalization of
+ * (a, b) may help.
+ *
+ * This is is a variant of an algorithm of Kahan (see Knuth (1981) 4.2.2
+ * exercise 19). We gain considerable efficiency by requiring the terms to
+ * be sufficiently normalized and sufficiently increasing.
+ */
+#define _3sumF(a, b, c) do { \
+ __typeof(a) __tmp; \
+ \
+ __tmp = (c); \
+ _2sumF(__tmp, (a)); \
+ (b) += (a); \
+ (a) = __tmp; \
+} while (0)
+
+/*
+ * Common routine to process the arguments to nan(), nanf(), and nanl().
+ */
+void _scan_nan(uint32_t *__words, int __num_words, const char *__s);
+
+#ifdef _COMPLEX_H
+
+/*
+ * C99 specifies that complex numbers have the same representation as
+ * an array of two elements, where the first element is the real part
+ * and the second element is the imaginary part.
+ */
+typedef union {
+ float complex f;
+ float a[2];
+} float_complex;
+typedef union {
+ double complex f;
+ double a[2];
+} double_complex;
+typedef union {
+ long double complex f;
+ long double a[2];
+} long_double_complex;
+#define REALPART(z) ((z).a[0])
+#define IMAGPART(z) ((z).a[1])
+
+/*
+ * Inline functions that can be used to construct complex values.
+ *
+ * The C99 standard intends x+I*y to be used for this, but x+I*y is
+ * currently unusable in general since gcc introduces many overflow,
+ * underflow, sign and efficiency bugs by rewriting I*y as
+ * (0.0+I)*(y+0.0*I) and laboriously computing the full complex product.
+ * In particular, I*Inf is corrupted to NaN+I*Inf, and I*-0 is corrupted
+ * to -0.0+I*0.0.
+ */
+static __inline float complex
+cpackf(float x, float y)
+{
+ float_complex z;
+
+ REALPART(z) = x;
+ IMAGPART(z) = y;
+ return (z.f);
+}
+
+static __inline double complex
+cpack(double x, double y)
+{
+ double_complex z;
+
+ REALPART(z) = x;
+ IMAGPART(z) = y;
+ return (z.f);
+}
+
+static __inline long double complex
+cpackl(long double x, long double y)
+{
+ long_double_complex z;
+
+ REALPART(z) = x;
+ IMAGPART(z) = y;
+ return (z.f);
+}
+#endif /* _COMPLEX_H */
+
+#ifdef __GNUCLIKE_ASM
+
+/* Asm versions of some functions. */
+
+#ifdef __amd64__
+static __inline int
+irint(double x)
+{
+ int n;
+
+ asm("cvtsd2si %1,%0" : "=r" (n) : "x" (x));
+ return (n);
+}
+#define HAVE_EFFICIENT_IRINT
+#endif
+
+#ifdef __i386__
+static __inline int
+irint(double x)
+{
+ int n;
+
+ asm("fistl %0" : "=m" (n) : "t" (x));
+ return (n);
+}
+#define HAVE_EFFICIENT_IRINT
+#endif
+
+#if defined(__amd64__) || defined(__i386__)
+static __inline int
+irintl(long double x)
+{
+ int n;
+
+ asm("fistl %0" : "=m" (n) : "t" (x));
+ return (n);
+}
+#define HAVE_EFFICIENT_IRINTL
+#endif
+
+#endif /* __GNUCLIKE_ASM */
+
+#ifdef DEBUG
+#if defined(__amd64__) || defined(__i386__)
+#define breakpoint() asm("int $3")
+#else
+#include <signal.h>
+
+#define breakpoint() raise(SIGTRAP)
+#endif
+#endif
+
+/* Write a pari script to test things externally. */
+#ifdef DOPRINT
+#include <stdio.h>
+
+#ifndef DOPRINT_SWIZZLE
+#define DOPRINT_SWIZZLE 0
+#endif
+
+#ifdef DOPRINT_LD80
+
+#define DOPRINT_START(xp) do { \
+ uint64_t __lx; \
+ uint16_t __hx; \
+ \
+ /* Hack to give more-problematic args. */ \
+ EXTRACT_LDBL80_WORDS(__hx, __lx, *xp); \
+ __lx ^= DOPRINT_SWIZZLE; \
+ INSERT_LDBL80_WORDS(*xp, __hx, __lx); \
+ printf("x = %.21Lg; ", (long double)*xp); \
+} while (0)
+#define DOPRINT_END1(v) \
+ printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v))
+#define DOPRINT_END2(hi, lo) \
+ printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n", \
+ (long double)(hi), (long double)(lo))
+
+#elif defined(DOPRINT_D64)
+
+#define DOPRINT_START(xp) do { \
+ uint32_t __hx, __lx; \
+ \
+ EXTRACT_WORDS(__hx, __lx, *xp); \
+ __lx ^= DOPRINT_SWIZZLE; \
+ INSERT_WORDS(*xp, __hx, __lx); \
+ printf("x = %.21Lg; ", (long double)*xp); \
+} while (0)
+#define DOPRINT_END1(v) \
+ printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v))
+#define DOPRINT_END2(hi, lo) \
+ printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n", \
+ (long double)(hi), (long double)(lo))
+
+#elif defined(DOPRINT_F32)
+
+#define DOPRINT_START(xp) do { \
+ uint32_t __hx; \
+ \
+ GET_FLOAT_WORD(__hx, *xp); \
+ __hx ^= DOPRINT_SWIZZLE; \
+ SET_FLOAT_WORD(*xp, __hx); \
+ printf("x = %.21Lg; ", (long double)*xp); \
+} while (0)
+#define DOPRINT_END1(v) \
+ printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v))
+#define DOPRINT_END2(hi, lo) \
+ printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n", \
+ (long double)(hi), (long double)(lo))
+
+#else /* !DOPRINT_LD80 && !DOPRINT_D64 (LD128 only) */
+
+#ifndef DOPRINT_SWIZZLE_HIGH
+#define DOPRINT_SWIZZLE_HIGH 0
+#endif
+
+#define DOPRINT_START(xp) do { \
+ uint64_t __lx, __llx; \
+ uint16_t __hx; \
+ \
+ EXTRACT_LDBL128_WORDS(__hx, __lx, __llx, *xp); \
+ __llx ^= DOPRINT_SWIZZLE; \
+ __lx ^= DOPRINT_SWIZZLE_HIGH; \
+ INSERT_LDBL128_WORDS(*xp, __hx, __lx, __llx); \
+ printf("x = %.36Lg; ", (long double)*xp); \
+} while (0)
+#define DOPRINT_END1(v) \
+ printf("y = %.36Lg; z = 0; show(x, y, z);\n", (long double)(v))
+#define DOPRINT_END2(hi, lo) \
+ printf("y = %.36Lg; z = %.36Lg; show(x, y, z);\n", \
+ (long double)(hi), (long double)(lo))
+
+#endif /* DOPRINT_LD80 */
+
+#else /* !DOPRINT */
+#define DOPRINT_START(xp)
+#define DOPRINT_END1(v)
+#define DOPRINT_END2(hi, lo)
+#endif /* DOPRINT */
+
+#define RETURNP(x) do { \
+ DOPRINT_END1(x); \
+ RETURNF(x); \
+} while (0)
+#define RETURNPI(x) do { \
+ DOPRINT_END1(x); \
+ RETURNI(x); \
+} while (0)
+#define RETURN2P(x, y) do { \
+ DOPRINT_END2((x), (y)); \
+ RETURNF((x) + (y)); \
+} while (0)
+#define RETURN2PI(x, y) do { \
+ DOPRINT_END2((x), (y)); \
+ RETURNI((x) + (y)); \
+} while (0)
+#ifdef STRUCT_RETURN
+#define RETURNSP(rp) do { \
+ if (!(rp)->lo_set) \
+ RETURNP((rp)->hi); \
+ RETURN2P((rp)->hi, (rp)->lo); \
+} while (0)
+#define RETURNSPI(rp) do { \
+ if (!(rp)->lo_set) \
+ RETURNPI((rp)->hi); \
+ RETURN2PI((rp)->hi, (rp)->lo); \
+} while (0)
+#endif
+#define SUM2P(x, y) ({ \
+ const __typeof (x) __x = (x); \
+ const __typeof (y) __y = (y); \
+ \
+ DOPRINT_END2(__x, __y); \
+ __x + __y; \
+})
+
+/*
+ * ieee style elementary functions
+ *
+ * We rename functions here to improve other sources' diffability
+ * against fdlibm.
+ */
+#define __ieee754_sqrt sqrt
+#define __ieee754_acos acos
+#define __ieee754_acosh acosh
+#define __ieee754_log log
+#define __ieee754_log2 log2
+#define __ieee754_atanh atanh
+#define __ieee754_asin asin
+#define __ieee754_atan2 atan2
+#define __ieee754_exp exp
+#define __ieee754_cosh cosh
+#define __ieee754_fmod fmod
+#define __ieee754_pow pow
+#define __ieee754_lgamma lgamma
+#define __ieee754_gamma gamma
+#define __ieee754_lgamma_r lgamma_r
+#define __ieee754_gamma_r gamma_r
+#define __ieee754_log10 log10
+#define __ieee754_sinh sinh
+#define __ieee754_hypot hypot
+#define __ieee754_j0 j0
+#define __ieee754_j1 j1
+#define __ieee754_y0 y0
+#define __ieee754_y1 y1
+#define __ieee754_jn jn
+#define __ieee754_yn yn
+#define __ieee754_remainder remainder
+#define __ieee754_scalb scalb
+#define __ieee754_sqrtf sqrtf
+#define __ieee754_acosf acosf
+#define __ieee754_acoshf acoshf
+#define __ieee754_logf logf
+#define __ieee754_atanhf atanhf
+#define __ieee754_asinf asinf
+#define __ieee754_atan2f atan2f
+#define __ieee754_expf expf
+#define __ieee754_coshf coshf
+#define __ieee754_fmodf fmodf
+#define __ieee754_powf powf
+#define __ieee754_lgammaf lgammaf
+#define __ieee754_gammaf gammaf
+#define __ieee754_lgammaf_r lgammaf_r
+#define __ieee754_gammaf_r gammaf_r
+#define __ieee754_log10f log10f
+#define __ieee754_log2f log2f
+#define __ieee754_sinhf sinhf
+#define __ieee754_hypotf hypotf
+#define __ieee754_j0f j0f
+#define __ieee754_j1f j1f
+#define __ieee754_y0f y0f
+#define __ieee754_y1f y1f
+#define __ieee754_jnf jnf
+#define __ieee754_ynf ynf
+#define __ieee754_remainderf remainderf
+#define __ieee754_scalbf scalbf
+
+/* fdlibm kernel function */
+int __kernel_rem_pio2(double*,double*,int,int,int);
+
+/* double precision kernel functions */
+#ifndef INLINE_REM_PIO2
+int __ieee754_rem_pio2(double,double*);
+#endif
+double __kernel_sin(double,double,int);
+double __kernel_cos(double,double);
+double __kernel_tan(double,double,int);
+double __ldexp_exp(double,int);
+#ifdef _COMPLEX_H
+double complex __ldexp_cexp(double complex,int);
+#endif
+
+/* float precision kernel functions */
+#ifndef INLINE_REM_PIO2F
+int __ieee754_rem_pio2f(float,double*);
+#endif
+#ifndef INLINE_KERNEL_SINDF
+float __kernel_sindf(double);
+#endif
+#ifndef INLINE_KERNEL_COSDF
+float __kernel_cosdf(double);
+#endif
+#ifndef INLINE_KERNEL_TANDF
+float __kernel_tandf(double,int);
+#endif
+float __ldexp_expf(float,int);
+#ifdef _COMPLEX_H
+float complex __ldexp_cexpf(float complex,int);
+#endif
+
+/* long double precision kernel functions */
+long double __kernel_sinl(long double, long double, int);
+long double __kernel_cosl(long double, long double);
+long double __kernel_tanl(long double, long double, int);
+
+#endif /* !_MATH_PRIVATE_H_ */
\ No newline at end of file
result->gchandle = gchandle;
result->compress = compress;
result->buffer = g_new (guchar, BUFFER_SIZE);
+ result->stream->next_out = result->buffer;
+ result->stream->avail_out = BUFFER_SIZE;
return result;
}
if (!stream->compress)
return 0;
- if (!is_final) {
+ if (!is_final && stream->stream->avail_in != 0) {
status = deflate (stream->stream, Z_PARTIAL_FLUSH);
if (status != Z_OK && status != Z_STREAM_END)
return status;
writer.WriteLine ("{0}: {1}", "NumberGroupSeparator", nf.NumberGroupSeparator);
Dump (writer, nf.NumberGroupSizes, "NumberGroupSizes", true);
writer.WriteLine ("{0}: {1}", "NumberNegativePattern", nf.NumberNegativePattern);
- writer.WriteLine ("{0}: {1}", "PercentDecimalDigits", nf.PercentDecimalDigits);
- writer.WriteLine ("{0}: {1}", "PercentDecimalSeparator", nf.PercentDecimalSeparator);
- writer.WriteLine ("{0}: {1}", "PercentGroupSeparator", nf.PercentGroupSeparator);
- Dump (writer, nf.PercentGroupSizes, "PercentGroupSizes", true);
writer.WriteLine ("{0}: {1}", "PercentNegativePattern", nf.PercentNegativePattern);
writer.WriteLine ("{0}: {1}", "PercentPositivePattern", nf.PercentPositivePattern);
writer.WriteLine ("{0}: {1}", "PercentSymbol", nf.PercentSymbol);
// We don't add 3 as it's for some arabic states only
switch (data.ThreeLetterISOLanguageName) {
case "amh":
- data.NumberFormatEntry.NumberDecimalDigits =
- data.NumberFormatEntry.PercentDecimalDigits = 1;
+ data.NumberFormatEntry.NumberDecimalDigits = 1;
break;
default:
- data.NumberFormatEntry.NumberDecimalDigits =
- data.NumberFormatEntry.PercentDecimalDigits = 2;
+ data.NumberFormatEntry.NumberDecimalDigits = 2;
break;
}
node = doc.SelectSingleNode ("ldml/numbers/symbols");
if (node != null) {
- el = node.SelectSingleNode ("decimal");
- if (el != null) {
- ni.NumberDecimalSeparator =
- ni.PercentDecimalSeparator = el.InnerText;
- }
-
el = node.SelectSingleNode ("plusSign");
if (el != null)
ni.PositiveSign = el.InnerText;
}
if (value != null) {
- ni.NumberGroupSeparator =
- ni.PercentGroupSeparator =
- ni.CurrencyGroupSeparator = value;
+ ni.NumberGroupSeparator = ni.CurrencyGroupSeparator = value;
}
}
public string NumberGroupSeparator = ",";
public string[] NumberGroupSizes = new string[Constants.GROUP_SIZE];
public string NumberNegativePattern;
+ /*
public int PercentDecimalDigits;
public string PercentDecimalSeparator = ",";
public string PercentGroupSeparator = ",";
public string[] PercentGroupSizes = new string[Constants.GROUP_SIZE];
+ */
public string PercentNegativePattern;
public string PercentPositivePattern;
public string PercentSymbol = "%";
builder.Append (EncodeStringIdx (CurrencyDecimalSeparator) + ", ");
builder.Append (EncodeStringIdx (CurrencyGroupSeparator) + ", ");
- builder.Append (EncodeStringIdx (PercentDecimalSeparator) + ", ");
- builder.Append (EncodeStringIdx (PercentGroupSeparator) + ", ");
builder.Append (EncodeStringIdx (NumberDecimalSeparator) + ", ");
builder.Append (EncodeStringIdx (NumberGroupSeparator) + ", ");
builder.Append (NumberNegativePattern + ", ");
builder.Append (CurrencyDecimalDigits + ", ");
- builder.Append (PercentDecimalDigits + ", ");
builder.Append (NumberDecimalDigits + ", ");
AppendGroupSizes (builder, CurrencyGroupSizes);
builder.Append (", ");
- AppendGroupSizes (builder, PercentGroupSizes);
- builder.Append (", ");
AppendGroupSizes (builder, NumberGroupSizes);
builder.Append ('}');
};
static readonly Dictionary<int, string[]> Numbers = new Dictionary<int, string[]> {
- { 0x0001, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x0002, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0003, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x0004, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x0005, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x0006, new [] { "12", "2", "1", "0", "0", ",", "." } },
- { 0x0007, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0008, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0009, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x000A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x000B, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x000C, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x000D, new [] { "2", "2", "1", "1", "1", ".", "," } },
- { 0x000E, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x000F, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0010, new [] { "9", "2", "1", "1", "1", ",", "." } },
- { 0x0011, new [] { "1", "0", "1", "1", "1", ".", "," } },
- { 0x0012, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x0013, new [] { "12", "2", "1", "0", "0", ",", "." } },
- { 0x0014, new [] { "12", "2", "1", "0", "0", ",", " " } },
- { 0x0015, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x0016, new [] { "9", "2", "1", "1", "1", ",", "." } },
- { 0x0017, new [] { "2", "2", "1", "1", "1", ".", "'" } },
- { 0x0018, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0019, new [] { "5", "1", "1", "1", "1", ",", " " } },
- { 0x001A, new [] { "8", "3", "2", "1", "1", ",", "." } },
- { 0x001B, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x001C, new [] { "5", "1", "1", "0", "0", ",", "." } },
- { 0x001D, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x001E, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x001F, new [] { "8", "3", "1", "2", "2", ",", "." } },
- { 0x0020, new [] { "3", "0", "1", "0", "0", ".", "," } },
- { 0x0021, new [] { "0", "0", "1", "0", "0", ",", "." } },
- { 0x0022, new [] { "5", "1", "1", "1", "1", ",", " " } },
- { 0x0023, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0024, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0025, new [] { "8", "3", "1", "1", "1", ".", " " } },
- { 0x0026, new [] { "9", "2", "1", "1", "1", ",", " " } },
- { 0x0027, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0028, new [] { "8", "3", "1", "1", "1", ";", " " } },
- { 0x0029, new [] { "3", "2", "3", "0", "0", "/", "," } },
- { 0x002A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x002B, new [] { "8", "3", "1", "0", "0", ".", "," } },
- { 0x002C, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x002D, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x002E, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x002F, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x0032, new [] { "2", "2", "1", "2", "2", ".", "," } },
- { 0x0034, new [] { "2", "2", "1", "2", "2", ".", "," } },
- { 0x0035, new [] { "2", "2", "1", "2", "2", ".", "," } },
- { 0x0036, new [] { "2", "2", "1", "1", "1", ".", "," } },
- { 0x0037, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0038, new [] { "12", "2", "1", "1", "1", ",", "." } },
- { 0x0039, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x003A, new [] { "1", "0", "1", "2", "2", ".", "," } },
- { 0x003B, new [] { "12", "2", "1", "2", "2", ",", " " } },
- { 0x003C, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x003E, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x003F, new [] { "1", "0", "1", "1", "1", "-", " " } },
- { 0x0040, new [] { "8", "3", "1", "1", "1", "-", " " } },
- { 0x0041, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x0042, new [] { "5", "1", "1", "1", "1", ",", " " } },
- { 0x0043, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x0044, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x0045, new [] { "12", "2", "1", "2", "2", ".", "," } },
- { 0x0046, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x0047, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x0048, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x0049, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x004A, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x004B, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x004C, new [] { "12", "2", "1", "2", "2", ".", "," } },
- { 0x004D, new [] { "12", "1", "1", "1", "1", ".", "," } },
- { 0x004E, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x004F, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x0050, new [] { "5", "1", "1", "0", "0", ",", " " } },
- { 0x0051, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x0052, new [] { "1", "0", "1", "2", "2", ".", "," } },
- { 0x0053, new [] { "5", "1", "2", "1", "1", ".", "," } },
- { 0x0054, new [] { "4", "1", "0", "0", "0", ".", "," } },
- { 0x0056, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x0057, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x005A, new [] { "3", "2", "1", "0", "0", ".", "," } },
- { 0x005B, new [] { "14", "2", "1", "0", "0", ".", "," } },
- { 0x005D, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x005E, new [] { "1", "0", "1", "1", "1", ".", "," } },
- { 0x005F, new [] { "8", "3", "3", "0", "0", ".", "," } },
- { 0x0061, new [] { "1", "0", "1", "1", "1", ".", "," } },
- { 0x0062, new [] { "12", "2", "1", "0", "0", ",", "." } },
- { 0x0063, new [] { "3", "0", "3", "4", "2", "٫", "٬" } },
- { 0x0064, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x0065, new [] { "10", "3", "1", "0", "0", ".", "," } },
- { 0x0068, new [] { "2", "2", "1", "0", "0", ".", "," } },
- { 0x006A, new [] { "2", "2", "1", "0", "0", ".", "," } },
- { 0x006B, new [] { "14", "2", "1", "2", "2", ",", "." } },
- { 0x006C, new [] { "2", "2", "1", "2", "2", ".", "," } },
- { 0x006D, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x006E, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x006F, new [] { "12", "2", "1", "0", "0", ",", "." } },
- { 0x0070, new [] { "2", "2", "1", "0", "0", ".", "," } },
- { 0x0078, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x007A, new [] { "9", "2", "1", "0", "0", ",", "." } },
- { 0x007C, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x007E, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0080, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x0081, new [] { "1", "0", "1", "2", "2", ".", "," } },
- { 0x0082, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0083, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0084, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0085, new [] { "5", "1", "1", "1", "1", ",", " " } },
- { 0x0086, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x0087, new [] { "2", "2", "1", "0", "0", ",", " " } },
- { 0x0088, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x008C, new [] { "3", "0", "3", "4", "2", ".", "," } },
- { 0x0091, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x0401, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x0402, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0403, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x0404, new [] { "1", "0", "1", "1", "1", ".", "," } },
- { 0x0405, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x0406, new [] { "12", "2", "1", "0", "0", ",", "." } },
- { 0x0407, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0408, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0409, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x040B, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x040C, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x040D, new [] { "2", "2", "1", "1", "1", ".", "," } },
- { 0x040E, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x040F, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0410, new [] { "9", "2", "1", "1", "1", ",", "." } },
- { 0x0411, new [] { "1", "0", "1", "1", "1", ".", "," } },
- { 0x0412, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x0413, new [] { "12", "2", "1", "0", "0", ",", "." } },
- { 0x0414, new [] { "12", "2", "1", "0", "0", ",", " " } },
- { 0x0415, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x0416, new [] { "9", "2", "1", "1", "1", ",", "." } },
- { 0x0417, new [] { "2", "2", "1", "1", "1", ".", "'" } },
- { 0x0418, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0419, new [] { "5", "1", "1", "1", "1", ",", " " } },
- { 0x041A, new [] { "8", "3", "2", "1", "1", ",", "." } },
- { 0x041B, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x041C, new [] { "5", "1", "1", "0", "0", ",", "." } },
- { 0x041D, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x041E, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x041F, new [] { "8", "3", "1", "2", "2", ",", "." } },
- { 0x0420, new [] { "3", "0", "1", "0", "0", ".", "," } },
- { 0x0421, new [] { "0", "0", "1", "0", "0", ",", "." } },
- { 0x0422, new [] { "5", "1", "1", "1", "1", ",", " " } },
- { 0x0423, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0424, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0425, new [] { "8", "3", "1", "1", "1", ".", " " } },
- { 0x0426, new [] { "9", "2", "1", "1", "1", ",", " " } },
- { 0x0427, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0428, new [] { "8", "3", "1", "1", "1", ";", " " } },
- { 0x0429, new [] { "3", "2", "3", "0", "0", "/", "," } },
- { 0x042A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x042B, new [] { "8", "3", "1", "0", "0", ".", "," } },
- { 0x042C, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x042D, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x042E, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x042F, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x0432, new [] { "2", "2", "1", "2", "2", ".", "," } },
- { 0x0434, new [] { "2", "2", "1", "2", "2", ".", "," } },
- { 0x0435, new [] { "2", "2", "1", "2", "2", ".", "," } },
- { 0x0436, new [] { "2", "2", "1", "1", "1", ".", "," } },
- { 0x0437, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0438, new [] { "12", "2", "1", "1", "1", ",", "." } },
- { 0x0439, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x043A, new [] { "1", "0", "1", "2", "2", ".", "," } },
- { 0x043B, new [] { "12", "2", "1", "2", "2", ",", " " } },
- { 0x043E, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x043F, new [] { "1", "0", "1", "1", "1", "-", " " } },
- { 0x0440, new [] { "8", "3", "1", "1", "1", "-", " " } },
- { 0x0441, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x0442, new [] { "5", "1", "1", "1", "1", ",", " " } },
- { 0x0443, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x0444, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x0445, new [] { "12", "2", "1", "2", "2", ".", "," } },
- { 0x0446, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x0447, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x0448, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x0449, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x044A, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x044B, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x044C, new [] { "12", "2", "1", "2", "2", ".", "," } },
- { 0x044D, new [] { "12", "1", "1", "1", "1", ".", "," } },
- { 0x044E, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x044F, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x0450, new [] { "5", "1", "1", "0", "0", ",", " " } },
- { 0x0451, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x0452, new [] { "1", "0", "1", "2", "2", ".", "," } },
- { 0x0453, new [] { "5", "1", "2", "1", "1", ".", "," } },
- { 0x0454, new [] { "4", "1", "0", "0", "0", ".", "," } },
- { 0x0456, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x0457, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x045A, new [] { "3", "2", "1", "0", "0", ".", "," } },
- { 0x045B, new [] { "14", "2", "1", "0", "0", ".", "," } },
- { 0x045D, new [] { "0", "0", "1", "1", "1", ".", "," } },
- { 0x045E, new [] { "1", "0", "1", "1", "1", ".", "," } },
- { 0x0461, new [] { "1", "0", "1", "1", "1", ".", "," } },
- { 0x0462, new [] { "12", "2", "1", "0", "0", ",", "." } },
- { 0x0463, new [] { "3", "0", "3", "4", "2", "٫", "٬" } },
- { 0x0464, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x0465, new [] { "10", "3", "1", "0", "0", ".", "," } },
- { 0x0468, new [] { "2", "2", "1", "0", "0", ".", "," } },
- { 0x046A, new [] { "2", "2", "1", "0", "0", ".", "," } },
- { 0x046B, new [] { "14", "2", "1", "2", "2", ",", "." } },
- { 0x046C, new [] { "2", "2", "1", "2", "2", ".", "," } },
- { 0x046D, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x046E, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x046F, new [] { "12", "2", "1", "0", "0", ",", "." } },
- { 0x0470, new [] { "2", "2", "1", "0", "0", ".", "," } },
- { 0x0478, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x047A, new [] { "9", "2", "1", "0", "0", ",", "." } },
- { 0x047C, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x047E, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0480, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x0481, new [] { "1", "0", "1", "2", "2", ".", "," } },
- { 0x0482, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0483, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0484, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0485, new [] { "5", "1", "1", "1", "1", ",", " " } },
- { 0x0486, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x0487, new [] { "2", "2", "1", "0", "0", ",", " " } },
- { 0x0488, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x048C, new [] { "3", "0", "3", "4", "2", ".", "," } },
- { 0x0491, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x0801, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x0804, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x0807, new [] { "2", "2", "1", "1", "1", ".", "'" } },
- { 0x0809, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x080A, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x080C, new [] { "12", "2", "1", "0", "0", ",", "." } },
- { 0x0810, new [] { "2", "2", "1", "1", "1", ".", "'" } },
- { 0x0813, new [] { "12", "2", "1", "1", "1", ",", "." } },
- { 0x0814, new [] { "12", "2", "1", "0", "0", ",", " " } },
- { 0x0816, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x081A, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x081D, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x082C, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x082E, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x083B, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x083C, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x083E, new [] { "0", "0", "1", "0", "0", ",", "." } },
- { 0x0843, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x0845, new [] { "12", "2", "1", "2", "2", ".", "," } },
- { 0x0850, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x085D, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x085F, new [] { "8", "3", "3", "0", "0", ".", "," } },
- { 0x086B, new [] { "14", "2", "1", "2", "2", ",", "." } },
- { 0x0C01, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x0C04, new [] { "0", "0", "1", "1", "1", ".", "," } },
- { 0x0C07, new [] { "9", "2", "1", "1", "1", ",", "." } },
- { 0x0C09, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x0C0A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x0C0C, new [] { "15", "3", "1", "0", "0", ",", " " } },
- { 0x0C1A, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x0C3B, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x0C6B, new [] { "12", "2", "1", "2", "2", ".", "," } },
- { 0x1001, new [] { "3", "0", "3", "0", "0", ".", "," } },
- { 0x1004, new [] { "0", "0", "1", "1", "1", ".", "," } },
- { 0x1007, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x1009, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x100A, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x100C, new [] { "2", "2", "1", "0", "0", ".", "'" } },
- { 0x101A, new [] { "8", "3", "2", "0", "0", ",", "." } },
- { 0x103B, new [] { "12", "2", "1", "2", "2", ",", " " } },
- { 0x1401, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x1404, new [] { "0", "0", "1", "1", "1", ".", "," } },
- { 0x1407, new [] { "2", "2", "1", "1", "1", ".", "'" } },
- { 0x1409, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x140A, new [] { "0", "0", "1", "0", "0", ",", "." } },
- { 0x140C, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x141A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x143B, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x1801, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x1809, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x180A, new [] { "14", "2", "1", "0", "0", ".", "," } },
- { 0x180C, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x181A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x183B, new [] { "12", "2", "1", "2", "2", ",", " " } },
- { 0x1C01, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x1C09, new [] { "2", "2", "1", "1", "1", ",", " " } },
- { 0x1C0A, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x1C1A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x1C3B, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x2001, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x2009, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x200A, new [] { "12", "2", "1", "0", "0", ",", "." } },
- { 0x201A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x203B, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x2401, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x2409, new [] { "1", "0", "1", "0", "0", ".", "," } },
- { 0x240A, new [] { "14", "2", "1", "0", "0", ",", "." } },
- { 0x241A, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x243B, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x2801, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x2809, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x280A, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x281A, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x2C01, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x2C09, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x2C0A, new [] { "2", "2", "1", "0", "0", ",", "." } },
- { 0x2C1A, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x3001, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x3009, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x300A, new [] { "14", "2", "1", "0", "0", ",", "." } },
- { 0x301A, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x3401, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x3409, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x340A, new [] { "9", "2", "1", "0", "0", ",", "." } },
- { 0x3801, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x380A, new [] { "14", "2", "1", "0", "0", ",", "." } },
- { 0x3C01, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x3C0A, new [] { "14", "2", "1", "0", "0", ",", "." } },
- { 0x4001, new [] { "3", "2", "3", "0", "0", ".", "," } },
- { 0x4009, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x400A, new [] { "14", "2", "1", "0", "0", ",", "." } },
- { 0x4409, new [] { "0", "0", "1", "1", "1", ".", "," } },
- { 0x440A, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x4809, new [] { "0", "0", "1", "1", "1", ".", "," } },
- { 0x480A, new [] { "12", "2", "1", "0", "0", ".", "," } },
- { 0x4C0A, new [] { "14", "2", "1", "0", "0", ".", "," } },
- { 0x500A, new [] { "14", "2", "1", "0", "0", ".", "," } },
- { 0x540A, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x641A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x681A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x6C1A, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x701A, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x703B, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x742C, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x743B, new [] { "8", "3", "1", "0", "0", ",", " " } },
- { 0x7804, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x7814, new [] { "12", "2", "1", "0", "0", ",", " " } },
- { 0x781A, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x782C, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x783B, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x7843, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x7850, new [] { "5", "1", "1", "0", "0", ",", " " } },
- { 0x785D, new [] { "0", "0", "1", "1", "1", ".", "," } },
- { 0x7C04, new [] { "0", "0", "1", "1", "1", ".", "," } },
- { 0x7C14, new [] { "12", "2", "1", "0", "0", ",", " " } },
- { 0x7C1A, new [] { "8", "3", "1", "1", "1", ",", "." } },
- { 0x7C28, new [] { "8", "3", "1", "1", "1", ";", " " } },
- { 0x7C2E, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x7C3B, new [] { "8", "3", "1", "0", "0", ",", "." } },
- { 0x7C43, new [] { "8", "3", "1", "1", "1", ",", " " } },
- { 0x7C50, new [] { "2", "0", "1", "1", "1", ".", "," } },
- { 0x7C5D, new [] { "0", "0", "1", "0", "0", ".", "," } },
- { 0x7C5F, new [] { "8", "3", "3", "0", "0", ".", "," } },
- { 0x7C68, new [] { "2", "2", "1", "0", "0", ".", "," } },
+ { 0x0001, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x0002, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0003, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0004, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0005, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0006, new [] { "12", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x0007, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0008, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0009, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x000A, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x000B, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x000C, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x000D, new [] { "2", "2", "1", "1", "1", ".", ",", "." } },
+ { 0x000E, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x000F, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0010, new [] { "9", "2", "1", "1", "1", ",", ".", "," } },
+ { 0x0011, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0012, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0013, new [] { "12", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x0014, new [] { "12", "2", "1", "0", "0", ",", " ", "," } },
+ { 0x0015, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0016, new [] { "9", "2", "1", "1", "1", ",", ".", "," } },
+ { 0x0017, new [] { "2", "2", "1", "1", "1", ".", " ", "." } },
+ { 0x0018, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0019, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x001A, new [] { "8", "3", "2", "1", "1", ",", ".", "," } },
+ { 0x001B, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x001C, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x001D, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x001E, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x001F, new [] { "8", "3", "1", "2", "2", ",", ".", "," } },
+ { 0x0020, new [] { "3", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0021, new [] { "0", "0", "1", "1", "1", ",", ".", "," } },
+ { 0x0022, new [] { "5", "1", "1", "1", "1", ",", " ", "," } },
+ { 0x0023, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0024, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0025, new [] { "8", "3", "1", "1", "1", ".", " ", "," } },
+ { 0x0026, new [] { "9", "2", "1", "1", "1", ",", " ", "," } },
+ { 0x0027, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0028, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0029, new [] { "3", "0", "3", "0", "0", "/", ",", "/" } },
+ { 0x002A, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x002B, new [] { "8", "3", "1", "0", "0", ".", ",", "." } },
+ { 0x002C, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x002D, new [] { "8", "3", "1", "10", "3", ",", ".", "," } },
+ { 0x002E, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x002F, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0030, new [] { "1", "0", "1", "1", "2", ",", " ", "," } },
+ { 0x0031, new [] { "1", "0", "1", "1", "2", ",", " ", "," } },
+ { 0x0032, new [] { "2", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x0034, new [] { "2", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x0035, new [] { "2", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x0036, new [] { "2", "2", "1", "1", "1", ",", " ", "," } },
+ { 0x0037, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0038, new [] { "12", "2", "1", "1", "1", ",", ".", "," } },
+ { 0x0039, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x003A, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x003B, new [] { "12", "2", "1", "2", "2", ",", " ", "," } },
+ { 0x003C, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x003E, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x003F, new [] { "1", "0", "1", "1", "1", "-", " ", "," } },
+ { 0x0040, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0041, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0042, new [] { "5", "1", "1", "1", "1", ",", " ", "," } },
+ { 0x0043, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0044, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0045, new [] { "12", "2", "1", "1", "0", ".", ",", "." } },
+ { 0x0046, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0047, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0048, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0049, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x004A, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x004B, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x004C, new [] { "12", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x004D, new [] { "12", "2", "1", "1", "1", ".", ",", "." } },
+ { 0x004E, new [] { "12", "2", "1", "0", "0", "`", ",", "." } },
+ { 0x004F, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0050, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0051, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0052, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0053, new [] { "5", "1", "2", "1", "1", ".", ",", "." } },
+ { 0x0054, new [] { "8", "3", "1", "0", "0", ".", ",", "." } },
+ { 0x0055, new [] { "9", "3", "1", "1", "1", ".", ",", "." } },
+ { 0x0056, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0057, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0059, new [] { "9", "2", "3", "0", "3", ".", ",", "." } },
+ { 0x005A, new [] { "8", "3", "1", "0", "0", ".", ",", "." } },
+ { 0x005B, new [] { "14", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x005C, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x005D, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x005E, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x005F, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0061, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0062, new [] { "12", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x0063, new [] { "3", "0", "3", "4", "2", ".", ",", "." } },
+ { 0x0064, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0065, new [] { "10", "3", "1", "0", "0", ".", ",", "." } },
+ { 0x0067, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0068, new [] { "2", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x006A, new [] { "9", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x006B, new [] { "14", "2", "1", "2", "2", ",", ".", "," } },
+ { 0x006C, new [] { "2", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x006D, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x006E, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x006F, new [] { "12", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x0070, new [] { "2", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0072, new [] { "1", "0", "1", "1", "2", ".", ",", "." } },
+ { 0x0073, new [] { "1", "1", "1", "1", "1", ".", ",", "." } },
+ { 0x0074, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0075, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0077, new [] { "1", "0", "1", "1", "2", ".", ",", "." } },
+ { 0x0078, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x007A, new [] { "9", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x007C, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x007E, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0080, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0081, new [] { "1", "0", "1", "2", "2", ".", ",", "." } },
+ { 0x0082, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0083, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0084, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0085, new [] { "5", "1", "1", "1", "1", ",", " ", "," } },
+ { 0x0086, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0087, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0088, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x008C, new [] { "3", "0", "3", "4", "2", ".", ",", "," } },
+ { 0x0091, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0092, new [] { "2", "0", "1", "2", "2", ".", ",", "." } },
+ { 0x0401, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x0402, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0403, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0404, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0405, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0406, new [] { "12", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x0407, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0408, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0409, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x040B, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x040C, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x040D, new [] { "2", "2", "1", "1", "1", ".", ",", "." } },
+ { 0x040E, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x040F, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0410, new [] { "9", "2", "1", "1", "1", ",", ".", "," } },
+ { 0x0411, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0412, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0413, new [] { "12", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x0414, new [] { "12", "2", "1", "0", "0", ",", " ", "," } },
+ { 0x0415, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0416, new [] { "9", "2", "1", "1", "1", ",", ".", "," } },
+ { 0x0417, new [] { "2", "2", "1", "1", "1", ".", " ", "." } },
+ { 0x0418, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0419, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x041A, new [] { "8", "3", "2", "1", "1", ",", ".", "," } },
+ { 0x041B, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x041C, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x041D, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x041E, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x041F, new [] { "8", "3", "1", "2", "2", ",", ".", "," } },
+ { 0x0420, new [] { "3", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0421, new [] { "0", "0", "1", "1", "1", ",", ".", "," } },
+ { 0x0422, new [] { "5", "1", "1", "1", "1", ",", " ", "," } },
+ { 0x0423, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0424, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0425, new [] { "8", "3", "1", "1", "1", ".", " ", "," } },
+ { 0x0426, new [] { "9", "2", "1", "1", "1", ",", " ", "," } },
+ { 0x0427, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0428, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0429, new [] { "3", "0", "3", "0", "0", "/", ",", "/" } },
+ { 0x042A, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x042B, new [] { "8", "3", "1", "0", "0", ".", ",", "." } },
+ { 0x042C, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x042D, new [] { "8", "3", "1", "10", "3", ",", ".", "," } },
+ { 0x042E, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x042F, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0430, new [] { "1", "0", "1", "1", "2", ",", " ", "," } },
+ { 0x0431, new [] { "1", "0", "1", "1", "2", ",", " ", "," } },
+ { 0x0432, new [] { "2", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x0434, new [] { "2", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x0435, new [] { "2", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x0436, new [] { "2", "2", "1", "1", "1", ",", " ", "," } },
+ { 0x0437, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0438, new [] { "12", "2", "1", "1", "1", ",", ".", "," } },
+ { 0x0439, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x043A, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x043B, new [] { "12", "2", "1", "2", "2", ",", " ", "," } },
+ { 0x043E, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x043F, new [] { "1", "0", "1", "1", "1", "-", " ", "," } },
+ { 0x0440, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0441, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0442, new [] { "5", "1", "1", "1", "1", ",", " ", "," } },
+ { 0x0443, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0444, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0445, new [] { "12", "2", "1", "1", "0", ".", ",", "." } },
+ { 0x0446, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0447, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0448, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0449, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x044A, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x044B, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x044C, new [] { "12", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x044D, new [] { "12", "2", "1", "1", "1", ".", ",", "." } },
+ { 0x044E, new [] { "12", "2", "1", "0", "0", "`", ",", "." } },
+ { 0x044F, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0450, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0451, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0452, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0453, new [] { "5", "1", "2", "1", "1", ".", ",", "." } },
+ { 0x0454, new [] { "8", "3", "1", "0", "0", ".", ",", "." } },
+ { 0x0455, new [] { "9", "3", "1", "1", "1", ".", ",", "." } },
+ { 0x0456, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0457, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x045A, new [] { "8", "3", "1", "0", "0", ".", ",", "." } },
+ { 0x045B, new [] { "14", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x045C, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x045D, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x045E, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0461, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0462, new [] { "12", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x0463, new [] { "3", "0", "3", "4", "2", ".", ",", "." } },
+ { 0x0464, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0465, new [] { "10", "3", "1", "0", "0", ".", ",", "." } },
+ { 0x0468, new [] { "2", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x046A, new [] { "9", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x046B, new [] { "14", "2", "1", "2", "2", ",", ".", "," } },
+ { 0x046C, new [] { "2", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x046D, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x046E, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x046F, new [] { "12", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x0470, new [] { "2", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x0472, new [] { "1", "0", "1", "1", "2", ".", ",", "." } },
+ { 0x0473, new [] { "5", "1", "0", "1", "1", ".", ",", "." } },
+ { 0x0474, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0475, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0477, new [] { "1", "0", "1", "1", "2", ".", ",", "." } },
+ { 0x0478, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x047A, new [] { "9", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x047C, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x047E, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0480, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0481, new [] { "1", "0", "1", "2", "2", ".", ",", "." } },
+ { 0x0482, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0483, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0484, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0485, new [] { "5", "1", "1", "1", "1", ",", " ", "," } },
+ { 0x0486, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0487, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0488, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x048C, new [] { "3", "0", "3", "4", "2", ".", ",", "," } },
+ { 0x0491, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x0492, new [] { "2", "0", "1", "2", "2", ".", ",", "." } },
+ { 0x0801, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x0803, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0804, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0807, new [] { "2", "2", "1", "1", "1", ".", " ", "," } },
+ { 0x0809, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x080A, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x080C, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0810, new [] { "2", "2", "1", "1", "1", ".", " ", "," } },
+ { 0x0813, new [] { "12", "2", "1", "1", "1", ",", ".", "," } },
+ { 0x0814, new [] { "12", "2", "1", "0", "0", ",", " ", "," } },
+ { 0x0816, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0818, new [] { "5", "1", "1", "1", "2", ",", ".", "," } },
+ { 0x081A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x081D, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0820, new [] { "1", "0", "1", "1", "2", ".", ",", "." } },
+ { 0x082C, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x082E, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0832, new [] { "2", "2", "1", "2", "2", ".", ",", "." } },
+ { 0x083B, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x083C, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x083E, new [] { "0", "0", "1", "0", "0", ",", ".", "," } },
+ { 0x0843, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x0845, new [] { "12", "2", "1", "1", "0", ".", ",", "." } },
+ { 0x0846, new [] { "9", "2", "2", "9", "3", ".", ",", "." } },
+ { 0x0849, new [] { "12", "2", "1", "1", "1", ".", ",", "." } },
+ { 0x0850, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0859, new [] { "9", "2", "3", "0", "3", ".", ",", "." } },
+ { 0x085D, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x085F, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0861, new [] { "1", "0", "1", "1", "2", ".", ",", "." } },
+ { 0x0867, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x086B, new [] { "12", "2", "1", "1", "1", ",", ".", "," } },
+ { 0x0873, new [] { "1", "1", "1", "1", "1", ".", ",", "." } },
+ { 0x0C01, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x0C04, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0C07, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0C09, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0C0A, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x0C0C, new [] { "15", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0C1A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x0C3B, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x0C50, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x0C6B, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x1000, new [] { "1", "0", "1", "1", "1", ",", ".", "," } },
+ { 0x1001, new [] { "3", "0", "3", "0", "0", ".", ",", "." } },
+ { 0x1004, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x1007, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x1009, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x100A, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x100C, new [] { "8", "3", "1", "1", "1", ".", " ", "," } },
+ { 0x101A, new [] { "8", "3", "2", "0", "0", ",", ".", "," } },
+ { 0x103B, new [] { "12", "2", "1", "2", "2", ",", " ", "," } },
+ { 0x105F, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x1401, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x1404, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x1407, new [] { "2", "2", "1", "1", "1", ",", ".", "," } },
+ { 0x1409, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x140A, new [] { "0", "0", "1", "1", "1", ",", ".", "," } },
+ { 0x140C, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x141A, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x143B, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x1801, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x1809, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x180A, new [] { "14", "2", "1", "1", "1", ".", ",", "." } },
+ { 0x180C, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x181A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x183B, new [] { "12", "2", "1", "2", "2", ",", " ", "," } },
+ { 0x1C01, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x1C09, new [] { "2", "2", "1", "1", "1", ",", " ", "," } },
+ { 0x1C0A, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x1C1A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x1C3B, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x2001, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x2009, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x200A, new [] { "12", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x200C, new [] { "4", "1", "1", "1", "2", ",", " ", "," } },
+ { 0x201A, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x203B, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x2401, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x2409, new [] { "1", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x240A, new [] { "1", "0", "1", "1", "1", ",", ".", "," } },
+ { 0x240C, new [] { "4", "1", "1", "1", "2", ",", " ", "," } },
+ { 0x241A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x243B, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x2801, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x2809, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x280A, new [] { "12", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x280C, new [] { "4", "1", "1", "1", "2", ",", " ", "," } },
+ { 0x281A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x2C01, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x2C09, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x2C0A, new [] { "2", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x2C0C, new [] { "4", "1", "1", "1", "2", ",", " ", "," } },
+ { 0x2C1A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x3001, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x3009, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x300A, new [] { "14", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x300C, new [] { "4", "1", "1", "1", "2", ",", " ", "," } },
+ { 0x301A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x3401, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x3409, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x340A, new [] { "9", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x340C, new [] { "4", "1", "1", "1", "2", ",", " ", "," } },
+ { 0x3801, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x380A, new [] { "9", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x380C, new [] { "4", "1", "1", "1", "2", ",", " ", "," } },
+ { 0x3C01, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x3C09, new [] { "0", "0", "1", "1", "2", ".", ",", "." } },
+ { 0x3C0A, new [] { "14", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x3C0C, new [] { "4", "1", "1", "1", "2", ",", " ", "," } },
+ { 0x4001, new [] { "3", "2", "3", "0", "0", ".", ",", "." } },
+ { 0x4009, new [] { "12", "2", "1", "1", "1", ".", ",", "." } },
+ { 0x400A, new [] { "14", "2", "1", "0", "0", ",", ".", "," } },
+ { 0x4409, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x440A, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x4809, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x480A, new [] { "12", "2", "1", "1", "1", ".", ",", "." } },
+ { 0x4C0A, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x500A, new [] { "1", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x540A, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x580A, new [] { "1", "0", "1", "1", "2", ".", ",", "." } },
+ { 0x641A, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x681A, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x6C1A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x701A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x703B, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x742C, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x743B, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x7804, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x7814, new [] { "12", "2", "1", "0", "0", ",", " ", "," } },
+ { 0x781A, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x782C, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x783B, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x7843, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x7850, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x785D, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x785F, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x7C04, new [] { "0", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x7C14, new [] { "12", "2", "1", "0", "0", ",", " ", "," } },
+ { 0x7C1A, new [] { "8", "3", "1", "1", "1", ",", ".", "," } },
+ { 0x7C28, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x7C2E, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x7C3B, new [] { "8", "3", "1", "0", "0", ",", ".", "," } },
+ { 0x7C43, new [] { "8", "3", "1", "1", "1", ",", " ", "," } },
+ { 0x7C46, new [] { "9", "2", "2", "9", "3", ".", ",", "." } },
+ { 0x7C50, new [] { "2", "0", "1", "1", "1", ".", ",", "." } },
+ { 0x7C59, new [] { "9", "2", "3", "0", "3", ".", ",", "." } },
+ { 0x7C5C, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x7C5D, new [] { "0", "0", "1", "0", "0", ".", ",", "." } },
+ { 0x7C5F, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x7C67, new [] { "8", "3", "1", "0", "0", ",", " ", "," } },
+ { 0x7C68, new [] { "2", "2", "1", "0", "0", ".", ",", "." } },
+ { 0x7C92, new [] { "2", "0", "1", "2", "2", ".", ",", "." } },
};
static readonly Dictionary<int, string> Geo = new Dictionary<int, string> {
nf.PercentPositivePattern = entry_nf[4];
nf.CurrencyDecimalSeparator = entry_nf[5];
nf.CurrencyGroupSeparator = entry_nf[6];
+ nf.NumberDecimalSeparator = entry_nf[7];
string[][] gsizes;
if (!GroupSizes.TryGetValue (lcid, out gsizes)) {
- gsizes = new[] { new[] { "3" }, new[] { "3" }, new[] { "3" } };
+ gsizes = new[] { new[] { "3" }, new[] { "3" } };
}
gsizes[0].CopyTo (nf.CurrencyGroupSizes, 0);
gsizes[1].CopyTo (nf.NumberGroupSizes, 0);
- gsizes[2].CopyTo (nf.PercentGroupSizes, 0);
}
public static void FillValues (int lcid, RegionInfoEntry ri)